public class IltGrapherAdapter extends IlvGrapherAdapter
IltGrapherAdapter
is the bridge between a graph layout and an
IltCompositeGrapher
.
An instance of this class is automatically provided with every
IltCompositeGrapher
and refers to the objects contained
in its proxy layer.
All layouts attached to an instance of this class must be set
to coordinates mode IlvGraphLayout.VIEW_COORDINATES
.
This is done automatically if you use the methods
IltCompositeGrapher.setNodeLayout(ilog.views.graphlayout.IlvGraphLayout)
,
IltCompositeGrapher.setLinkLayout(ilog.views.graphlayout.IlvGraphLayout)
,
IltCompositeGrapher.performLayoutOnce(ilog.views.graphlayout.IlvGraphLayout)
,
IltCompositeGrapher.performLayoutOnce(ilog.views.graphlayout.IlvGraphLayout, java.lang.Runnable)
.
IltCompositeGrapher.getGraphModel()
,
IltcCompositeManager.getProxyLayer()
Modifier and Type | Field and Description |
---|---|
protected boolean |
usingZoomPolicy
For nice link behavior with mixed zoom.
|
Constructor and Description |
---|
IltGrapherAdapter(IltcCompositeGrapher grapher)
Creates a new adapter for the given
IltCompositeGrapher . |
Modifier and Type | Method and Description |
---|---|
protected void |
afterAttach(IlvGraphLayout layout)
Notifies the graph model that it has been attached to a layout.
|
protected void |
afterDetach(IlvGraphLayout layout)
Notifies the graph model that it has been detached from a layout.
|
IlvRect |
boundingBox(Object node)
Returns the bounding box of a node or a link.
|
protected IlvGraphModel |
createGraphModel(Object subgraph)
Creates a new
IlvGrapherAdapter for a subgraph. |
void |
dispose()
Disposes of this
IlvGraphModel and releases any
resources that it is using. |
IlvTransformer |
getReferenceTransformer()
Returns the transformer taken into account.
|
boolean |
hasMoveableConnectionPoint(Object link,
boolean origin)
Returns
true if the connection point of link
on the origin or destination node can be moved by a call to
reshapeLink . |
boolean |
isUsingZoomPolicy()
Returns
true if the getReferenceTransformer
method uses the zoom policy. |
void |
moveNode(Object node,
double x,
double y,
boolean redraw)
Changes the position of the specified node.
|
void |
reshapeLink(Object link,
IlvPoint fromPoint,
IlvPoint[] points,
int startIndex,
int length,
IlvPoint toPoint,
boolean redraw)
Like the method in the superclass IlvGrapherAdapter.
|
void |
setUsingZoomPolicy(boolean useZoomPolicy)
Specifies whether the
getReferenceTransformer
method uses the zoom policy. |
addLayer, afterAnimationStep, afterLayout, beforeAnimationStep, beforeLayout, getAnimationRedrawMode, getCoordinatesMode, getFilter, getFrom, getGrapher, getInterGraphLinks, getInterGraphLinksCount, getLayers, getLayersCount, getLayoutPropertyPrefix, getLinkComparator, getLinkPointAt, getLinkPoints, getLinkPointsCount, getLinks, getLinksCount, getLinksFrom, getLinksFromCount, getLinksTo, getLinksToCount, getLinkWidth, getNeighbors, getNodeComparator, getNodes, getNodesAndLinks, getOpposite, getParentModel, getPreferredLayoutPropertyPrefix, getProperty, getProperty, getReferenceView, getSubgraphs, getSubgraphsCount, getTo, getTransformer, hasPinnedConnectionPoint, isConstantModeManagerFrameAutoMargin, isFullLayerNotification, isInterGraphLink, isLayerAdded, isLayoutNeeded, isLink, isLinkBetween, isNode, isReshapeableLink, isSubgraph, loadParametersFromNamedProperties, loadParametersFromNamedProperties, loadParametersFromNamedProperties, loadPreferredLayoutsFromNamedProperties, prepareGrapher, prepareViewForAnimation, redrawAfterLayout, removeAllLayers, removeLayer, removeParametersFromNamedProperties, removeParametersFromNamedProperties, removeParametersFromNamedProperties, restoreAndDisableViewCoordinates, saveAndEnableViewCoordinates, saveParametersToNamedProperties, saveParametersToNamedProperties, savePreferredLayoutsToNamedProperties, setAnimationRedrawMode, setConstantModeManagerFrameAutoMargin, setCoordinatesMode, setFilter, setFullLayerNotification, setLinkComparator, setNodeComparator, setPreferredLayoutPropertyPrefix, setProperty, setProperty, setReferenceTransformer, setReferenceView, toString
addGraphModelListener, adjustmentEnd, boundingBox, fireGraphModelEvent, fireGraphModelEvent, geometryChanged, getGraphModel, getInstanceId, getLayout, getLayouts, getLinks, getLinksCount, getNodeDegree, getNodesCount, getOriginatingLayout, getRootModel, isConnectionPointCheckEnabled, isInternalGraphModelChecking, isLinkCheckEnabled, move, performLayout, performLayout, removeGraphModelListener, setConnectionPointCheckEnabled, setInternalGraphModelChecking, setLinkCheckEnabled, structureChanged
protected boolean usingZoomPolicy
public IltGrapherAdapter(IltcCompositeGrapher grapher)
IltCompositeGrapher
.IltCompositeGrapher.getGraphModel()
public void dispose()
IlvGraphModel
and releases any
resources that it is using. An IlvGraphModel
object
cannot be used after the dispose
method has been called.
If there are any layouts still attached, they get automatically
detached from the graph model.
The method recursively disposes of this graph model and all its
graph model children (if any).dispose
in class IlvGraphModel
IlvGraphLayout.detach()
protected void afterAttach(IlvGraphLayout layout)
IlvGraphModel
IlvGraphLayout.attach(IlvGraphModel)
.
The default implementation does nothing. If necessary, you can override this method in order to perform some operations.
afterAttach
in class IlvGraphModel
layout
- The layout instance to which the model has been attached.IlvGraphModel.afterDetach(ilog.views.graphlayout.IlvGraphLayout)
,
IlvGraphLayout.attach(IlvGraphModel)
protected void afterDetach(IlvGraphLayout layout)
IlvGraphModel
IlvGraphLayout.detach()
.
The default implementation does nothing. If necessary, you can override this method in order to perform some operations.
afterDetach
in class IlvGraphModel
layout
- The layout instance from which the model has been
detached.IlvGraphModel.afterAttach(ilog.views.graphlayout.IlvGraphLayout)
,
IlvGraphLayout.detach()
public void moveNode(Object node, double x, double y, boolean redraw)
IlvGrapherAdapter
x
and
y
coordinates correspond to the top-left corner of the
rectangle that defines the node (see also the method IlvGrapherAdapter.boundingBox(java.lang.Object)
).moveNode
in class IlvGrapherAdapter
node
- The node.x
- The new x-position.y
- The new y-position.redraw
- If true
, the node is redrawn.public void reshapeLink(Object link, IlvPoint fromPoint, IlvPoint[] points, int startIndex, int length, IlvPoint toPoint, boolean redraw)
reshapeLink
in class IlvGrapherAdapter
link
- The link to be reshaped.fromPoint
- The connection point of the link on the origin node. If
null
, the connection point is not moved.points
- The intermediate points of the link (ordered from origin
node to destination node). If null
, all the
intermediate points of the link are removed.startIndex
- The start position in the array of points.length
- The number of intermediate points.toPoint
- The connection point of the link on the destination node.
If null
, the connection point is not moved.redraw
- If true
, the link is redrawn.IlvGraphLayoutUtil.EnsureAppropriateLinkTypes(IlvGraphLayout, boolean)
,
IlvGraphLayoutUtil.EnsureAppropriateLinkConnectors(IlvGraphLayout, boolean)
,
IlvGraphLayoutUtil.EnsureAppropriateLinks(IlvGraphLayout, boolean)
,
IlvGraphModel.setLinkCheckEnabled(boolean)
,
IlvGraphModel.setConnectionPointCheckEnabled(boolean)
public boolean hasMoveableConnectionPoint(Object link, boolean origin)
true
if the connection point of link
on the origin or destination node can be moved by a call to
reshapeLink
. Returns false
if such
a call may fail to set the connection point to the argument
passed to reshapeLink
.
Overridden in order to accept the IltLinkConnectors.
hasMoveableConnectionPoint
in class IlvGrapherAdapter
link
- The link.origin
- Set to true
if the connection point is on the
origin and false
otherwise.IlvGrapherAdapter.reshapeLink(Object, IlvPoint, IlvPoint[], int, int, IlvPoint, boolean)
,
IlvGraphModel.isConnectionPointCheckEnabled()
protected IlvGraphModel createGraphModel(Object subgraph)
IlvGrapherAdapter
IlvGrapherAdapter
for a subgraph. The
method can be called on any instance of an
IlvGrapherAdapter
.createGraphModel
in class IlvGrapherAdapter
subgraph
- A subgraph. It must be an instance of
IlvGrapher
.public IlvRect boundingBox(Object node)
IlvGrapherAdapter
IlvGraphic.boundingBox(IlvTransformer)
in a way that
depends on the current coordinate mode option (see IlvGrapherAdapter.setCoordinatesMode(int)
):
IlvGraphLayout.MANAGER_COORDINATES
: returns the bounding
box of the graphic object in the coordinate space of the manager,
that is, it calls IlvGraphic.boundingBox(IlvTransformer)
with a null
argument.IlvGraphLayout.VIEW_COORDINATES
: returns the bounding box
of the graphic object in the coordinate space of the view, that is,
it calls IlvGraphic.boundingBox(IlvTransformer)
with the
reference transformer as an argument (see IlvGrapherAdapter.getReferenceTransformer()
).IlvGraphLayout.INVERSE_VIEW_COORDINATES
: returns the
bounding box of the graphic object in the coordinate space of the
view after applying the inverse transformation to the rectangle
(using the reference transformer).boundingBox
in class IlvGrapherAdapter
node
- The node or link.public boolean isUsingZoomPolicy()
true
if the getReferenceTransformer
method uses the zoom policy.public void setUsingZoomPolicy(boolean useZoomPolicy)
getReferenceTransformer
method uses the zoom policy.public IlvTransformer getReferenceTransformer()
isUsingZoomPolicy()
returns true
, this uses
the zoom transformer of the zoom policy of the top level grapher.
Otherwise, it uses the settings specified through
setReferenceTransformer
and setReferenceView
,
as described in the class IlvGrapherAdapter
.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.