|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.graph.basic.BasicLayoutTarget
public class BasicLayoutTarget
The basic set of information necessary to layout a graph: a mapping the graph data structure to aspects of its visual representation, a viewport to layout in, and some manipulation routines including pick, place, and route. This is an implementation for the Diva canvas, other layout target implementations can "port" the layout algorithms to other display implementations.
Red |
Field Summary | |
---|---|
private GraphController |
_controller
The graph controller that this is performing layout on. |
private double |
_layoutPercentage
The percentage of the screen that should be used for layout; default value is .8. |
Constructor Summary | |
---|---|
BasicLayoutTarget(GraphController controller)
Construct a new layout target that operates in the given pane. |
Method Summary | |
---|---|
java.awt.geom.Rectangle2D |
getBounds(java.lang.Object node)
Return the bounds of the figure associated with the given node in the target's view. |
GraphController |
getController()
Return the graph controller. |
protected GraphicsPane |
getGraphicsPane()
Return the pane of this display. |
GraphModel |
getGraphModel()
Return the graph model that we are operating on. |
double |
getLayoutPercentage()
Return the percentage of the pane that is used for layout. |
protected java.lang.Object |
getRootGraph()
Return the root graph of this display. |
java.awt.geom.Rectangle2D |
getViewport(java.lang.Object composite)
Return the viewport of the given graph as a rectangle in logical coordinates. |
java.lang.Object |
getVisualObject(java.lang.Object object)
Return the visual object of the given graph object. |
java.util.Iterator |
intersectingEdges(java.awt.geom.Rectangle2D r)
Return an iterator over the node or edge figures which intersect the given rectangle. |
java.util.Iterator |
intersectingNodes(java.awt.geom.Rectangle2D r)
Return an iterator over the nodes which intersect the given rectangle in the top-level graph. |
boolean |
isEdgeVisible(java.lang.Object edge)
Return whether or not the given edge is actually visible in the view. |
boolean |
isNodeVisible(java.lang.Object node)
Return whether or not the given node is actually visible in the view. |
void |
route(java.lang.Object edge)
Route absolutely the figure associated with the given edge in the target's view. |
void |
setLayoutPercentage(double d)
Set the percentage of the pane that should be used for layout. |
void |
translate(java.lang.Object node,
double dx,
double dy)
Translate the figure associated with the given node in the target's view by the given delta. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private GraphController _controller
private double _layoutPercentage
Constructor Detail |
---|
public BasicLayoutTarget(GraphController controller)
Method Detail |
---|
public java.awt.geom.Rectangle2D getBounds(java.lang.Object node)
getBounds
in interface LayoutTarget
public GraphController getController()
public GraphModel getGraphModel()
getGraphModel
in interface LayoutTarget
public double getLayoutPercentage()
setLayoutPercentage(double)
protected GraphicsPane getGraphicsPane()
protected java.lang.Object getRootGraph()
public java.awt.geom.Rectangle2D getViewport(java.lang.Object composite)
getViewport
in interface LayoutTarget
public java.lang.Object getVisualObject(java.lang.Object object)
getVisualObject
in interface LayoutTarget
public boolean isNodeVisible(java.lang.Object node)
isNodeVisible
in interface LayoutTarget
public boolean isEdgeVisible(java.lang.Object edge)
isEdgeVisible
in interface LayoutTarget
public java.util.Iterator intersectingNodes(java.awt.geom.Rectangle2D r)
intersectingNodes
in interface LayoutTarget
public java.util.Iterator intersectingEdges(java.awt.geom.Rectangle2D r)
intersectingEdges
in interface LayoutTarget
public void route(java.lang.Object edge)
route
in interface LayoutTarget
public void setLayoutPercentage(double d)
getViewport(Object)
public void translate(java.lang.Object node, double dx, double dy)
translate
in interface LayoutTarget
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |