|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graph.view.VisualOperations
Class VisualOperations provides utility methods that draw and
transform a graph. There is functionality to fit any group of
VisualGraphObject instances into a destination rectangle or to
center their bounding rectangle around a given pivot point. The Barycenter
computation is included in this class as well. All methods in this class are static.
| Method Summary | |
static void |
applyScale(VisualGraphView visualgraphview,
double sx,
double sy)
Applies a scaling transform to the given VisualGraphView
instance. |
static void |
applyTransformToCenterOfComposite(Composite composite,
Transform2D xform)
Applies the given transformation on the center of a Composite object.
|
static void |
autospaceAroundVisualNode(VisualGraph visualgraph,
VisualNode visualnode)
Frees space around the given VisualNode by adjusting the
positions of all intersecting nodes and all other nodes relatively. |
static void |
autospaceHorizontalAroundVisualNode(VisualGraph visualgraph,
VisualNode visualnode)
Makes space around the given VisualNode by adjusting the
positions of all intersecting nodes and all other nodes relatively. |
static void |
autospaceVerticalAroundVisualNode(VisualGraph visualgraph,
VisualNode visualnode)
Makes space around the given VisualNode by adjusting the
positions of all intersecting nodes and all other nodes relatively. |
static Vector2 |
barycenter(java.util.List visualobjects)
Computes the barycenter of the specified VisualObjects. |
static Transform2D |
center(java.util.Iterator visualobjects,
double centerX,
double centerY)
Centers the graph around the given point (centerX, centerY). |
static void |
centerGraph(VisualGraphView visualgraphview,
java.util.Collection objects)
Centers the given objects in the VisualGraphView. |
static Boundary |
computeBoundingBox(java.util.Collection visualgraphobjects)
Computes a bounding of the given list of VisualGraphObjects. |
static Boundary |
computeBoundingBox(CompositeHierarchy hierarchy)
Computes a bounding of the current selection which is stored in a CompositeHierarchy.
|
static java.awt.Rectangle |
computeBounds(java.util.Iterator visualobjects)
Computes the bounding rectangle of the VisualGraphObject
instances accessible via the given Iterator. |
static StableHashMap |
computeDeepestSelection(VisualGraphView visualgraphview)
Compute the deepest selection by considering the hierarchy of nested subgraphs and not just the toplevel-view. |
static java.util.Collection |
computeInboundCollectionRecursively(VisualGraphView visualgraphview,
VisualNode visualnode)
Iterate over all ports and return the incoming edges. |
static int |
computeIncount(VisualNode visualnode)
Iterate over all ports and count the incoming edges. |
static java.util.ArrayList |
computeIncountList(VisualNode visualnode)
Iterate over all ports and list the incoming edges. |
static int |
computeIncountRecursively(VisualGraphView visualgraphview,
VisualNode visualnode)
Iterate over all ports and count the incoming edges. |
static int |
computeIndegree(VisualGraph visualgraph,
VisualNode visualnode)
Iterate over all ports and count the incoming edges that are connected. |
static java.util.Collection |
computeOutboundCollectionRecursively(VisualGraphView visualgraphview,
VisualNode visualnode)
Iterate over all ports and return the outgoing edges. |
static int |
computeOutcount(VisualNode visualnode)
Iterate over all ports and count the outgoing edges. |
static java.util.ArrayList |
computeOutcountList(VisualNode visualnode)
Iterate over all ports and list the outgoing edges. |
static int |
computeOutcountRecursively(VisualGraphView visualgraphview,
VisualNode visualnode)
Iterate over all ports and count the outgoing edges. |
static int |
computeOutdegree(VisualGraph visualgraph,
VisualNode visualnode)
Iterate over all ports and count the outgoing edges that are connected. |
static Transform2D |
computeTransformFromVisualSubgraph(VisualGraphView visualgraphview,
VisualSubgraph visualsubgraph)
Computes the Transform2D that transforms coordinates
from the given VisualSubgraph
to the top-level CompositeView.
|
static Transform2D |
computeTransformToVisualSubgraph(VisualGraphView visualgraphview,
VisualSubgraph visualsubgraph)
Computes the Transform2D that transforms coordinates
from the top-level CompositeView to the
given VisualSubgraph.
|
static Boundary |
computeVisibleRegion(CompositeView compositeview)
Computes the visible region of the given CompositeView. |
static java.util.HashMap |
computeVisualEdge2VisualSubgraphMap(VisualGraphView vsg)
This method will compute a map with visualedges as keys and the visualsubgraphs they are part of as values. |
static java.util.HashMap |
computeVisualNode2VisualSubgraphMap(VisualGraphView vsg)
This method will compute a map with VisualNode objects as
keys and the VisualSubgraphs they are part of as values.
|
static void |
convertCoordinates(Boundary boundary,
Transform2D transform)
Converts the given boundary by the given transformation. |
static void |
convertCoordinates(CompositeLine compositeline,
Transform2D transform)
Converts all the coordinates of the given CompositeLine
by the given transformation. |
static void |
convertCoordinates(Composite composite,
Transform2D transform)
Converts the boundary of the given Composite
by the given transformation. |
static void |
convertCoordinates(Coordinate[] coordinates,
Transform2D transform)
Converts all the coordinates of the given array by the given transformation. |
static void |
convertCoordinates(VisualEdge visualedge,
Transform2D transform)
Converts all the coordinates of the given VisualEdge
by the given transformation. |
static void |
fancyVisualTree(VisualGraph visualgraph,
java.lang.String geometry,
java.lang.String style)
Makes a fancy visualgraph if its a tree. |
static double[] |
findBoundsVisualGraphOrSelection(VisualGraphView visualgraphview)
Helper to find the bounds of either the entire VisualGraphView or of the selection. |
static java.util.Iterator |
findIntersections(VisualGraphObject subject,
java.util.Iterator visualobjects)
Finds all those VisualGraphObject objects that intersect the
given VisualGraphObject. |
static Transform2D |
fit(java.util.Collection visualobjects,
java.awt.Rectangle region)
Computes a transform that fits the VisualObjects into the
given region. |
static void |
flip(BaseCompositeIterator iterator,
double sx,
double sy,
double x0,
double y0,
double x1,
double y1)
Flips the given visualobjects with the given sx and sy scaling factors. |
static void |
flip(java.util.Iterator iterator,
double sx,
double sy,
double x0,
double y0,
double x1,
double y1)
Flips the given VisualObjects with the given
sx and sy scaling factors. |
static java.util.Collection |
getDeepSelection(VisualGraphView visualgraphview)
Compute the deepest selection by considering the hierarchy of nested subgraphs and not just the toplevel-view. |
static Transform2D |
goodfit(java.util.Collection visualobjects,
java.awt.Rectangle region)
Computes a transform that fits the visualobjects into the given region. |
static boolean |
intersectionTest(Coordinate[] coords,
Boundary boundary)
Returns true if there is an intersection between the bounds
and the multi segment line. |
static boolean |
intersectionTest(Coordinate[] coords,
BoundingBox bbox)
|
static void |
makeOrthogonalHorizontalLine(VisualGraphView visualgraphview,
VisualEdge visualedge)
Turns the given VisualEdge objects into an horizontal
orthogonal line. |
static void |
makeOrthogonalHorizontalLines(VisualGraphView visualgraphview,
java.util.Iterator visualedges)
Makes all the given VisualEdge objects to horizontal
orthogonal lines. |
static void |
makeOrthogonalVerticalLine(VisualGraphView visualgraphview,
VisualEdge visualedge)
Turns the given VisualEdges into an vertical orthogonal
line. |
static void |
makeOrthogonalVerticalLines(VisualGraphView visualgraphview,
java.util.Iterator visualedges)
Turns all given VisualEdges to vertical orthogonal lines. |
static void |
makeStraightLine(VisualEdge visualedge)
Turns the given VisualEdge into a straight line by
deleting additional points. |
static void |
makeStraightLines(java.util.Iterator visualedges)
Transforms all given VisualEdge to straight lines by
deleting additional points. |
static double |
maximumDistance(java.util.List visualobjects)
Computes the maximum distance that occurs between any two of the given VisualObjects. |
static double |
minimumDistance(java.util.List visualobjects)
Computes the minimum distance that occurs between any two of the given VisualObjects. |
static void |
recursiveSelection(VisualGraphView visualgraphview,
boolean selected)
Deprecated. make use of CompositeViewOperations.recursiveSelection(CompositeView, boolean)
instead. |
static void |
rotate(BaseCompositeIterator iterator,
double angle,
double x0,
double y0,
double x1,
double y1)
Rotates the given visualobjects with the given angle. |
static void |
rotate(java.util.Iterator iterator,
double angle,
double x0,
double y0,
double x1,
double y1)
Rotates the given visualobjects with the given angle. |
static void |
translate(java.util.Iterator visualobjects,
Transform2D transform)
Translate the specified visualobjects. |
static void |
translateViewportAccordingToBoundary(CompositeView compositeview,
Boundary boundary)
This method will set the viewport of the given CompositeView, so that the given boundary is visible. |
static void |
translateViewportAccordingToBoundary(CompositeView compositeview,
Boundary boundary,
boolean validatePosition)
This method will set the viewport of the given CompositeView, so that the given boundary is visible. |
static void |
translateViewportAccordingToBoundary(CompositeView compositeview,
Boundary boundary,
boolean validatePosition,
boolean updateView)
This method will set the viewport of the given CompositeView, so that the given boundary is visible. |
static void |
translateViewportAccordingToComposite(CompositeView compositeview,
Composite composite)
This method does the same as method translateViewportAccordingToBoundary(com.tensegrity.composite.CompositeView, com.tensegrity.graphics.Boundary),
but is a convenience wrapper that operates on composites directly. |
static void |
translateViewportAccordingToGraph(VisualGraphView visualgraphview)
This method set the viewport of the VisualGraphView given
by visualgraphview so that the graph is centered within
the viewport. |
static void |
translateViewportAroundCenter(CompositeView compositeview,
double cx,
double cy)
This method will set the viewport so that it is centered around the given coordinates. |
static void |
translateViewportAroundCenter(VisualGraphView vgv,
double cx,
double cy)
This method will set the viewport so that it is centered around the given coordinates. |
static double |
validateZoom(double scale)
Validates a scale value for a CompositeView and returns a scale value that lies withing the valid range. |
static void |
xSortedVGOs(java.util.List list)
Sorts the given list containing VisualGraphObjects inplace
based on their x-center. |
static void |
ySortedVGOs(java.util.List list)
Sorts the given list containing VisualGraphObjects inplace
based on their y-center. |
static void |
zoomToFit(VisualGraphView visualgraphview)
Zooms the VisualGraphView so that it fits the view. |
static void |
zoomToFit(VisualGraphView visualgraphview,
Boundary insets)
Zooms the VisualGraphView so that it fits the view. |
static void |
zoomToFit(VisualGraphView visualgraphview,
Boundary insets,
double maxZoom)
Zooms the VisualGraphView so that it fits the view. |
static void |
zoomToFit(VisualGraphView visualgraphview,
java.util.Collection visualobjects)
Zooms the VisualGraphView so that the given object fit into
the view. |
static void |
zoomToFit(VisualGraphView visualgraphview,
java.util.Collection visualobjects,
Boundary insets)
Zooms the VisualGraphView so that the given object fit into
the view. |
static void |
zoomToFit(VisualGraphView visualgraphview,
java.util.Collection visualobjects,
Boundary insets,
double maxZoom)
Zooms the VisualGraphView so that the given object fit into
the view. |
static void |
zoomToFit(VisualGraphView visualgraphview,
java.util.Collection visualobjects,
Boundary insets,
double maxZoom,
boolean noZoomIn)
Zooms the VisualGraphView so that the given object fit into
the view. |
static void |
zoomToFit(VisualGraphView visualgraphview,
java.awt.Rectangle bounds,
Boundary insets)
Zooms the VisualGraphView so that the given object fit into
the view. |
static void |
zoomToFit(VisualGraphView visualgraphview,
java.awt.Rectangle bounds,
Boundary insets,
double maxZoom,
boolean noZoomIn)
Zooms the VisualGraphView so that the given object fit into
the view. |
static void |
zoomToFitNoMagnification(VisualGraphView visualgraphview)
Zooms the VisualGraphView so that it fits the view. |
static void |
zoomToFitProportional(VisualGraphView visualgraphview,
Boundary destBoundary)
Zooms the VisualGraphView so that it fits the view. |
static void |
zoomToFitProportional(VisualGraphView visualgraphview,
java.util.Collection visualobjects,
Boundary destBoundary)
Zooms the VisualGraphView so that the given object fit into
the view. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final int computeIncount(VisualNode visualnode)
visualnode - the VisualNode to investigate.
VisualNode.
public static final int computeIndegree(VisualGraph visualgraph,
VisualNode visualnode)
visualgraph - the VisualGraph the
VisualNode is in.visualnode - the VisualNode to investigate.
VisualNode.public static final java.util.ArrayList computeIncountList(VisualNode visualnode)
visualnode - the VisualNode to investigate.
VisualEdge objects that are incoming.public static final int computeOutcount(VisualNode visualnode)
visualnode - the VisualNode to investigate.
VisualNode.
public static final int computeOutdegree(VisualGraph visualgraph,
VisualNode visualnode)
visualgraph - the VisualGraph the
VisualNode is in.visualnode - the VisualNode to investigate.
VisualNode.public static final java.util.ArrayList computeOutcountList(VisualNode visualnode)
visualnode - the VisualNode to investigate.
VisualEdge objects that are outgoing.
public static final int computeIncountRecursively(VisualGraphView visualgraphview,
VisualNode visualnode)
visualgraphview - the toplevel view.visualnode - the visualnode to investigate.
public static final int computeOutcountRecursively(VisualGraphView visualgraphview,
VisualNode visualnode)
visualgraphview - the top level view.visualnode - the VisualNode to investigate.
VisualNode.
public static final java.util.Collection computeInboundCollectionRecursively(VisualGraphView visualgraphview,
VisualNode visualnode)
visualgraphview - the toplevel view.visualnode - the visualnode to investigate.
public static final java.util.Collection computeOutboundCollectionRecursively(VisualGraphView visualgraphview,
VisualNode visualnode)
visualgraphview - the toplevel view.visualnode - the visualnode to investigate.
public static final void flip(java.util.Iterator iterator,
double sx,
double sy,
double x0,
double y0,
double x1,
double y1)
VisualObjects with the given
sx and sy scaling factors.
iterator - the iterator of the VisualObjects to flip.sx - the x scaling factor for the flip.sy - the x scaling factor for the flip.x0 - the left coordinate of the flip bounding box.y0 - the top coordinate of the flip bounding box.x1 - the right coordinate of the flip bounding box.y1 - the bottom coordinate of the flip bounding box.
public static final void flip(BaseCompositeIterator iterator,
double sx,
double sy,
double x0,
double y0,
double x1,
double y1)
iterator - the iterator of the visualobjects to flip.sx - the x scaling factor for the flip.sy - the x scaling factor for the flip.x0 - the left coordinate of the flip bounding box.y0 - the top coordinate of the flip bounding box.x1 - the right coordinate of the flip bounding box.y1 - the bottom coordinate of the flip bounding box.
public static final void rotate(java.util.Iterator iterator,
double angle,
double x0,
double y0,
double x1,
double y1)
iterator - the iterator of the visualobjects to flip.angle - the angle to rotate around in degrees.x0 - the left coordinate of the flip bounding box.y0 - the top coordinate of the flip bounding box.x1 - the right coordinate of the flip bounding box.y1 - the bottom coordinate of the flip bounding box.
public static final void rotate(BaseCompositeIterator iterator,
double angle,
double x0,
double y0,
double x1,
double y1)
iterator - the iterator of the visualobjects to flip.angle - the angle to rotate around in degrees.x0 - the left coordinate of the flip bounding box.y0 - the top coordinate of the flip bounding box.x1 - the right coordinate of the flip bounding box.y1 - the bottom coordinate of the flip bounding box.
public static final Transform2D goodfit(java.util.Collection visualobjects,
java.awt.Rectangle region)
visualobjects - list of visualgraphobjects to modify.region - rectangular region to fit the visualobjects into.
public static final void translate(java.util.Iterator visualobjects,
Transform2D transform)
visualobjects - list of visualgraphobjects to modify.transform - the transform to apply to the visualgraphobjects.
public static final Transform2D center(java.util.Iterator visualobjects,
double centerX,
double centerY)
visualobjects - iterator of visualgraphobjects to modify.centerX - the x coordinate of the center point.centerY - the y coordinate of the center point.
public static final Transform2D fit(java.util.Collection visualobjects,
java.awt.Rectangle region)
VisualObjects into the
given region.
visualobjects - list of VisualObjects to modify.region - rectangular region to fit the VisualObjects
into.
VisualObjects in
the desired way.public static final java.awt.Rectangle computeBounds(java.util.Iterator visualobjects)
VisualGraphObject
instances accessible via the given Iterator.
visualobjects - an Iterator linking to VisualObjects.
VisualObjects.public static final Vector2 barycenter(java.util.List visualobjects)
VisualObjects.
visualobjects - list of VisualObjects to scan.
VisualObjects.public static final double minimumDistance(java.util.List visualobjects)
VisualObjects.
visualobjects - list of VisualObjects to scan.
public static final double maximumDistance(java.util.List visualobjects)
VisualObjects.
visualobjects - list of VisualObjects to scan.
public static final void fancyVisualTree(VisualGraph visualgraph,
java.lang.String geometry,
java.lang.String style)
visualgraph - the VisualGraph to make fancy.geometry - the geometry to use.style - the geometry to use.public static final Boundary computeVisibleRegion(CompositeView compositeview)
CompositeView.
compositeview - the CompositeView to investigate.
CompositeView.
public static final void translateViewportAccordingToComposite(CompositeView compositeview,
Composite composite)
translateViewportAccordingToBoundary(com.tensegrity.composite.CompositeView, com.tensegrity.graphics.Boundary),
but is a convenience wrapper that operates on composites directly.
compositeview - the CompositeView to operate in.composite - the composite to make visible.translateViewportAccordingToBoundary(CompositeView, Boundary)public static final void translateViewportAccordingToGraph(VisualGraphView visualgraphview)
VisualGraphView given
by visualgraphview so that the graph is centered within
the viewport. Doing so the current scale of the
VisualGraphView is also taken into account.
visualgraphview - the VisualGraphView whos viewport
should be translated
public static final void translateViewportAccordingToBoundary(CompositeView compositeview,
Boundary boundary)
CompositeView, so that the given boundary is visible. The
viewport is translated so that the boundary is centered in the viewport.
This is not always possible. For example, if the boundary is placed too
close to one of the borders of the CompositeView, then the view is
centered as much as possible. If the boundary of the composite
is located directly in a corner of the CompositeView, then
no centering is possible at all.
If the given boundary is visible already, then no viewport translation is
applied either.
compositeview - the CompositeView to adjust.boundary - the boundary to make visible.
public static final void translateViewportAccordingToBoundary(CompositeView compositeview,
Boundary boundary,
boolean validatePosition)
CompositeView, so that the given boundary is visible. The
viewport is translated so that the boundary is centered in the viewport.
This is not always possible. For example, if the boundary is placed too
close to one of the borders of the composite view, then the view is
centered as much as possible. If the boundary of the composite
is located directly in a corner of the CompositeView, then
no centering is possible at all.
If the given boundary is visible already, then no viewport translation is
applied either.
compositeview - the CompositeView to adjust.boundary - the boundary to make visible.validatePosition - If true, the viewport will be validated,
so it will not be positioned in an empty
area of the graph.
public static final void translateViewportAccordingToBoundary(CompositeView compositeview,
Boundary boundary,
boolean validatePosition,
boolean updateView)
CompositeView, so that the given boundary is visible. The
viewport is translated so that the boundary is centered in the viewport.
This is not always possible. For example, if the boundary is placed too
close to one of the borders of the composite view, then the view is
centered as much as possible. If the boundary of the composite
is located directly in a corner of the CompositeView, then
no centering is possible at all.
If the given boundary is visible already, then no viewport translation is
applied either.
compositeview - the CompositeView to adjust.boundary - the boundary to make visible.validatePosition - If true, the viewport will be validated,
so it will not be positioned in an empty
area of the graph.updateView - If true, the view will updated.
public static final void translateViewportAroundCenter(CompositeView compositeview,
double cx,
double cy)
compositeview - the composite view to act in.cx - the x coordinate of the center of the viewport.cy - the y coordinate of the center of the viewport.
public static final void translateViewportAroundCenter(VisualGraphView vgv,
double cx,
double cy)
vgv - the VisualGraphView to act in.cx - the x coordinate of the center of the viewport.cy - the y coordinate of the center of the viewport.
public static final void applyTransformToCenterOfComposite(Composite composite,
Transform2D xform)
Composite object.
Typically the transformation is a scaling or rotation operation.
The bounding box of the composite is adjusted as well.
composite - the Composite to transform.xform - the transform to apply.
public static final java.util.Iterator findIntersections(VisualGraphObject subject,
java.util.Iterator visualobjects)
VisualGraphObject objects that intersect the
given VisualGraphObject.
subject - the VisualGraphObject to make scan against
all others.visualobjects - the list of VisualGraphObject that are
compared with the subject object.
public static final void autospaceAroundVisualNode(VisualGraph visualgraph,
VisualNode visualnode)
VisualNode by adjusting the
positions of all intersecting nodes and all other nodes relatively. If no
other nodes are intersected by the given VisualNode this
method will not make any changes to the given VisualGraph.
visualgraph - the VisualGraph to operate in.visualnode - the VisualNode that is subject of the
operation.autospaceHorizontalAroundVisualNode(VisualGraph, VisualNode),
autospaceVerticalAroundVisualNode(VisualGraph, VisualNode)
public static final void autospaceHorizontalAroundVisualNode(VisualGraph visualgraph,
VisualNode visualnode)
VisualNode by adjusting the
positions of all intersecting nodes and all other nodes relatively. If no
other nodes are intersected by the given VisualNode this
method will not make any changes to the VisualGraph.
This method makes horizontal space only.
visualgraph - the VisualGraph to operate in.visualnode - the VisualNode that is subject of the operation.
public static final void autospaceVerticalAroundVisualNode(VisualGraph visualgraph,
VisualNode visualnode)
VisualNode by adjusting the
positions of all intersecting nodes and all other nodes relatively. If no
other nodes are intersected by the given VisualNode this
method will not make any changes to the VisualGraph.
This method makes vertical space only.
visualgraph - the VisualGraph to operate in.visualnode - the VisualNode that is subject of the
operation.
public static final void centerGraph(VisualGraphView visualgraphview,
java.util.Collection objects)
VisualGraphView.
visualgraphview - the VisualGraphView to act in.objects - a collection of the object to center.public static final void makeStraightLines(java.util.Iterator visualedges)
VisualEdge to straight lines by
deleting additional points. If a VisualEdge is a straight
line already, nothing will happen to the VisualEdge.
visualedges - an iterator over all the VisualEdges
that should be made to straight lines.public static final void makeStraightLine(VisualEdge visualedge)
VisualEdge into a straight line by
deleting additional points. If a VisualEdge is a straight
line already, nothing will happen to the VisualEdge.
visualedge - the VisualEdge to be turned to a straight
line.
public static final void makeOrthogonalVerticalLines(VisualGraphView visualgraphview,
java.util.Iterator visualedges)
VisualEdges to vertical orthogonal lines.
visualgraphview - the top level container.visualedges - an iterator over all the VisualEdges
that should be converted.
public static final void makeOrthogonalVerticalLine(VisualGraphView visualgraphview,
VisualEdge visualedge)
VisualEdges into an vertical orthogonal
line.
visualgraphview - the top level container.visualedge - the VisualEdge that should be converted.
public static final void makeOrthogonalHorizontalLines(VisualGraphView visualgraphview,
java.util.Iterator visualedges)
VisualEdge objects to horizontal
orthogonal lines.
visualgraphview - the top level container.visualedges - an iterator over all the VisualEdges
to be converted.
public static final void makeOrthogonalHorizontalLine(VisualGraphView visualgraphview,
VisualEdge visualedge)
VisualEdge objects into an horizontal
orthogonal line.
visualgraphview - the top level container.visualedge - the VisualEdge that should be converted.public static final void zoomToFitNoMagnification(VisualGraphView visualgraphview)
VisualGraphView so that it fits the view.
visualgraphview - the VisualGraphView to fit.
public static final void zoomToFitProportional(VisualGraphView visualgraphview,
Boundary destBoundary)
VisualGraphView so that it fits the view.
visualgraphview - the VisualGraphView to fit.destBoundary - the bounds to fit into the view.
public static final void zoomToFitProportional(VisualGraphView visualgraphview,
java.util.Collection visualobjects,
Boundary destBoundary)
VisualGraphView so that the given object fit into
the view.
visualgraphview - the VisualGraphView to fit.visualobjects - the VisualObjects to fit into the view.destBoundary - the destination boundary.public static final void zoomToFit(VisualGraphView visualgraphview)
VisualGraphView so that it fits the view.
visualgraphview - the VisualGraphView to fit.
public static final void zoomToFit(VisualGraphView visualgraphview,
Boundary insets)
VisualGraphView so that it fits the view.
visualgraphview - the VisualGraphView to fit.insets - Insets to create a border around the elements. Can be null.
public static final void zoomToFit(VisualGraphView visualgraphview,
Boundary insets,
double maxZoom)
VisualGraphView so that it fits the view.
visualgraphview - the VisualGraphView to fit.insets - Insets to create a border around the elements. Can be null.maxZoom - Do not zoom larger than this value
public static final void zoomToFit(VisualGraphView visualgraphview,
java.util.Collection visualobjects)
VisualGraphView so that the given object fit into
the view.
visualgraphview - the VisualGraphView to fit.visualobjects - the VisualObjects to fit into the view.
public static final void zoomToFit(VisualGraphView visualgraphview,
java.util.Collection visualobjects,
Boundary insets)
VisualGraphView so that the given object fit into
the view.
visualgraphview - the VisualGraphView to fit.visualobjects - the VisualObjects to fit into the view.insets - Insets to create a border around the elements. Can be null.
public static final void zoomToFit(VisualGraphView visualgraphview,
java.util.Collection visualobjects,
Boundary insets,
double maxZoom)
VisualGraphView so that the given object fit into
the view.
visualgraphview - the VisualGraphView to fit.visualobjects - the VisualObjects to fit into the view.insets - Insets to create a border around the elements. Can be null.maxZoom - Do not zoom larger than this value
public static void zoomToFit(VisualGraphView visualgraphview,
java.util.Collection visualobjects,
Boundary insets,
double maxZoom,
boolean noZoomIn)
VisualGraphView so that the given object fit into
the view.
visualgraphview - the VisualGraphView to fit.visualobjects - the VisualObjects to fit into the view.insets - Insets to create a border around the elements. Can be null.maxZoom - Do not zoom larger than this valuenoZoomIn - true, to avoid zooming in
public static final void zoomToFit(VisualGraphView visualgraphview,
java.awt.Rectangle bounds,
Boundary insets)
VisualGraphView so that the given object fit into
the view.
visualgraphview - the VisualGraphView to fit.bounds - the rectangle to fit into the view.insets - Insets to create a border around the elements. Can be null.
public static final void zoomToFit(VisualGraphView visualgraphview,
java.awt.Rectangle bounds,
Boundary insets,
double maxZoom,
boolean noZoomIn)
VisualGraphView so that the given object fit into
the view.
visualgraphview - the VisualGraphView to fit.bounds - the rectangle to fit into the view.insets - Insets to create a border around the elements. Can be null.maxZoom - Do not zoom larger than this valuenoZoomIn - true, to avoid zooming in
public static final Transform2D computeTransformToVisualSubgraph(VisualGraphView visualgraphview,
VisualSubgraph visualsubgraph)
Transform2D that transforms coordinates
from the top-level CompositeView to the
given VisualSubgraph.
Please note that the
CompositeHierarchy
and
CompositeHierarchyUtilities
are a more generic and most often better way of computing such
transforms.
visualgraphview - the top level VisualGraphView.visualsubgraph - the VisualSubgraph to look for.
Transform2D that converts coordinates
to the specified VisualSubgraph.
public static final Transform2D computeTransformFromVisualSubgraph(VisualGraphView visualgraphview,
VisualSubgraph visualsubgraph)
Transform2D that transforms coordinates
from the given VisualSubgraph
to the top-level CompositeView.
Please note that the
CompositeHierarchy
and
CompositeHierarchyUtilities
are a more generic and most often better way of computing such
transforms.
visualgraphview - the top level VisualGraphView.visualsubgraph - the VisualSubgraph to look for.
Transform2D that converts coordinates
from the specified VisualSubgraph.public static final java.util.HashMap computeVisualNode2VisualSubgraphMap(VisualGraphView vsg)
VisualNode objects as
keys and the VisualSubgraphs they are part of as values.
Some entries in the map have null values, in this case the corresponding
VisualNode objects are part of the
VisualGraphView itself.
vsg - the VisualGraphView to perform the search in.
VisualNodes to VisualSubgraph.public static final java.util.HashMap computeVisualEdge2VisualSubgraphMap(VisualGraphView vsg)
vsg - the visualgraphview to perform the search in.
public static final StableHashMap computeDeepestSelection(VisualGraphView visualgraphview)
visualgraphview - the VisualGraphView to start the
search in.
HashMap with the hierarchypublic static final java.util.Collection getDeepSelection(VisualGraphView visualgraphview)
visualgraphview - the VisualGraphView to start the
search in.
public static final void convertCoordinates(Composite composite,
Transform2D transform)
Composite
by the given transformation.
composite - the Composite whose boundary should be
transformed.transform - the Transform2D that describes the boundary
change.
public static final void convertCoordinates(VisualEdge visualedge,
Transform2D transform)
VisualEdge
by the given transformation.
visualedge - the VisualEdge whose coordinates should
be transformed.transform - the Transform2D that describes the coordinate
change.
public static final void convertCoordinates(Coordinate[] coordinates,
Transform2D transform)
coordinates - the array of coordinates to convert.transform - the Transform2D that describes the coordinate
change.
public static final void convertCoordinates(CompositeLine compositeline,
Transform2D transform)
CompositeLine
by the given transformation.
compositeline - the CompositeLine whose coordinates should
be transformed.transform - the Transform2D that describes the coordinate
change.
public static final void convertCoordinates(Boundary boundary,
Transform2D transform)
boundary - the Boundary to be transformed.transform - the Transform2D to apply.
public static final boolean intersectionTest(Coordinate[] coords,
Boundary boundary)
true if there is an intersection between the bounds
and the multi segment line.
coords - line segments coordinates.boundary - the boundary to test for intersection.
true if there is an intersection.
public static final boolean intersectionTest(Coordinate[] coords,
BoundingBox bbox)
public static final Boundary computeBoundingBox(CompositeHierarchy hierarchy)
CompositeHierarchy.
The coordinates of the returned bounding box are given in units of the
coordinate system of the
CompositeView the selection is within.
hierarchy - the selection
public static final Boundary computeBoundingBox(java.util.Collection visualgraphobjects)
VisualGraphObjects.
visualgraphobjects - a collection of VisualGraphObjects.
VisualGraphObject
objects.
public static final void recursiveSelection(VisualGraphView visualgraphview,
boolean selected)
CompositeViewOperations.recursiveSelection(CompositeView, boolean)
instead.
VisualGraphObjects that are contained
in the specified VisualGraphView to the desired
selection-state.
VisualGraphObjects that are nested in embedded
VisualSubgraphs are processed as well.
visualgraphview - the VisualGraphView to process.selected - the selection state to apply to all
contained VisualGraphObjects.public static final void xSortedVGOs(java.util.List list)
VisualGraphObjects inplace
based on their x-center.
list - the list of VisualGraphObjects to sort inplace.public static final void ySortedVGOs(java.util.List list)
VisualGraphObjects inplace
based on their y-center.
list - the list of VisualGraphObjects to sort inplace.
public static void applyScale(VisualGraphView visualgraphview,
double sx,
double sy)
VisualGraphView
instance.
visualgraphview - the VisualGraphView to scale.sx - scale in x direction.sy - scale in y direction.public static double[] findBoundsVisualGraphOrSelection(VisualGraphView visualgraphview)
VisualGraphView or of the selection.
visualgraphview - the VisualGraphView to investigate.
public static double validateZoom(double scale)
scale - The scale that should be validated
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||