public class ShapePickSupport extends java.lang.Object implements PickSupport
Modifier and Type | Field and Description |
---|---|
protected HasGraphLayout |
hasGraphLayout |
protected HasShapeFunctions |
hasShapeFunctions |
protected LayoutTransformer |
layoutTransformer |
protected float |
pickSize |
Constructor and Description |
---|
ShapePickSupport()
Create an instance.
|
ShapePickSupport(float pickSize) |
ShapePickSupport(HasGraphLayout hasGraphLayout,
LayoutTransformer layoutTransformer,
HasShapeFunctions hasShapeFunctions,
float pickSize)
Create an instance.
|
Modifier and Type | Method and Description |
---|---|
Edge |
getEdge(double x,
double y)
return an edge whose shape intersects the 'pickArea' footprint of the passed
x,y, coordinates.
|
LayoutTransformer |
getLayoutTransformer() |
Vertex |
getVertex(double x,
double y)
Iterates over Vertices, checking to see if x,y is contained in the
Vertex's Shape.
|
void |
setHasGraphLayout(HasGraphLayout hasGraphLayout)
called by a HasLayout impl (like VisualizationViewer) when this
PickSupport impl is
added to it.
|
void |
setHasShapes(HasShapeFunctions hasShapes) |
void |
setLayout(Layout layout)
ShapePickSupport gets its layout from its VisualizationViewer, so this
method currently does nothing. |
void |
setLayoutTransformer(LayoutTransformer layoutTransformer)
When this PickSupport is set on a VisualizationViewer,
the VisualizationViewer calls this method to pass its
layout transformer in
|
protected HasGraphLayout hasGraphLayout
protected HasShapeFunctions hasShapeFunctions
protected float pickSize
protected LayoutTransformer layoutTransformer
public ShapePickSupport(HasGraphLayout hasGraphLayout, LayoutTransformer layoutTransformer, HasShapeFunctions hasShapeFunctions, float pickSize)
hasGraphLayout
- source of the current layout.hasShapeFunctions
- source of Vertex and Edge shapes.pickSize
- how large to make the pick footprint for line edgespublic ShapePickSupport(float pickSize)
public ShapePickSupport()
public void setHasGraphLayout(HasGraphLayout hasGraphLayout)
setHasGraphLayout
in interface PickSupport
public void setHasShapes(HasShapeFunctions hasShapes)
hasShapes
- The hasShapes to set.public LayoutTransformer getLayoutTransformer()
public void setLayoutTransformer(LayoutTransformer layoutTransformer)
layoutTransformer
- The layoutTransformer to set.public Vertex getVertex(double x, double y)
getVertex
in interface GraphElementAccessor
GraphElementAccessor.getVertex(double, double)
public Edge getEdge(double x, double y)
getEdge
in interface GraphElementAccessor
public void setLayout(Layout layout)
ShapePickSupport
gets its layout from its VisualizationViewer, so this
method currently does nothing.setLayout
in interface GraphElementAccessor
GraphElementAccessor.setLayout(edu.uci.ics.jung.visualization.Layout)