|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.HitInfoFactories.DefaultHitInfoFactory
public static class HitInfoFactories.DefaultHitInfoFactory
This hit info factory creates hit information which use the reversed paint order of the view. As an exception, if a node label which is not selected would be returned as the first hit and node labels are among the types to be returned and the owning node of the label is also at the hit location, then the node is returned instead of the node label.
Constructor Summary | |
---|---|
HitInfoFactories.DefaultHitInfoFactory(Graph2DView view)
Initializes a new DefaultHitInfoFactory instance that
test the elements of the graph that is associated to the specified graph
view for hits. |
Method Summary | |
---|---|
HitInfo |
createHitInfo(double x,
double y,
int types,
boolean firstHitOnly)
Creates a hit info for a given type of graph elements at
the specified location. |
protected HitInfo |
createHitInfo(Graph2DView view,
Graph2D graph,
double x,
double y,
int elementTypes,
boolean firstHitOnly)
Creates a hit information object for a given type of graph
elements at the specified location. |
protected Graph2D |
getGraph()
Returns the graph whose elements are checked for hits in createHitInfo(double, double, int, boolean) . |
protected Graph2DView |
getView()
Returns the graph view that is associated to this factory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HitInfoFactories.DefaultHitInfoFactory(Graph2DView view)
DefaultHitInfoFactory
instance that
test the elements of the graph that is associated to the specified graph
view for hits.
view
- the Graph2DView
whose graph is checked for hits.Method Detail |
---|
public HitInfo createHitInfo(double x, double y, int types, boolean firstHitOnly)
hit info
for a given type of graph elements at
the specified location. A hit info provides information on the graph
elements at the given world coordinates.
This implementation returns a
new HitInfo(getGraph(), iterator, x, y, firstHitOnly)where the
iterator
iterates over the graph elements of the
specified types in the reversed paint order of the view.
As an exception, if a node label which is not selected would be returned as the first hit only and node ports and/or nodes are among the types to be returned and the node port associated to the label/the owning node of the label is also at the hit location, then the associated node port/the owning node is returned instead of the node label.
createHitInfo
in interface HitInfoFactory
x
- x world coordinatey
- y world coordinatetypes
- a bitwise combination of the type masks provided by
Graph2DTraversal
or Graph2DTraversal.ALL
.firstHitOnly
- if true
only the hit info only considers
the first graph element at the specified coordinates
protected HitInfo createHitInfo(Graph2DView view, Graph2D graph, double x, double y, int elementTypes, boolean firstHitOnly)
hit information object
for a given type of graph
elements at the specified location.
view
- the view whose rendering order determines the order in which
elements are checked for hits.
This implementation returns a
new HitInfo(graph, iterator, x, y, firstHitOnly)where the
iterator
iterates over the graph elements of the
specified types in the reversed paint order of the view.
Called from createHitInfo(double, double, int, boolean)
.
graph
- the graph whose elements are checked for hits.x
- the x-coordinate of the hit location.y
- the y-coordinate of the hit location.elementTypes
- determines the types of graph elements that should be
checked for hits. The elementTypes
argument is a bitwise
combination of the type masks provided by Graph2DTraversal
or
Graph2DTraversal.ALL
.firstHitOnly
- if true
only the first element at
the specified location is returned; otherwise all elements at the
specified location are returned.
protected Graph2DView getView()
Graph2DView
associated to this factory.protected Graph2D getGraph()
createHitInfo(double, double, int, boolean)
.
Graph2D
associated to the factory's graph view.
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |