public class IlvGrapher extends IlvManager
IlvGrapher
is a subclass of IlvManager
that uses
graphic objects in the form of nodes and links to represent dynamic
interconnected information. Application areas include network management,
database visualization and knowledge engineering, circuit block diagrams,
workflow and process diagrams, organizational charts.
A grapher is composed of nodes and links. A node is an instance of
IlvGraphic
or one of its subclasses; any graphic object can be used
as a grapher node. A link is an instance of IlvLinkImage
or one of
its subclasses. Links are the visual representation of connections between
nodes.
To add a node to a grapher, call
addNode
. Links are added by
calling addLink
.
When a node is removed from a grapher, all the links connected to this node
are removed.
A new link is connected to the default connection point of each node it is attached to. When the location of a node changes, the connection points of the links are recomputed automatically. For more information about connection points, see Connection Points.
The following code example shows how to connect two nodes in a grapher with a link:
IlvGraphic node1, node2; IlvGrapher grapher = new IlvGrapher(); IlvLinkImage link; // Create new ellipse node and add it to the grapher. node1 = new IlvEllipse(new IlvRect(30,10,50,50), true, false); grapher.addNode(node1,false); // Add a new rectangular node to the grapher. node2 = new IlvRectangle(new IlvRect(220,80,50,50), false, true); grapher.addNode(node2, 2, true); // Link the two nodes and add them to a grapher. link = new IlvLinkImage(node1, node2, true); grapher.addLink(link,false); // Add the manager to different views. IlvManagerView view = new IlvManagerView(grapher); view.setBackground(Color.WHITE); JFrame frame = new JFrame("IlvLinkImage"); frame.setLayout(new BorderLayout(2, 2)); frame.getContentPane().add(view); frame.setSize(320,200); frame.setVisible(true);
The following image shows the grapher created between in the code example:
By default, nodes and links visibility is controlled independently.
You can switch on or off the visibility of the nodes and links that compose
a branch of a grapher by calling
setVisibleBranch(IlvGraphic, int, boolean, boolean)
.
For more information, see
Visibility.
A grapher embedded inside another manager or grapher, is called a
nested grapher. Like top level graphers, a nested grapher can be
displayed in several different views
simultaneously.
A nested grapher has two different representations:
Using nested graphers you can create applications that define graphs
containing subgraphs, with links crossing the graph boundaries. Links that
cross graph boundaries are called intergraph links. Call
getInterGraphLinks()
to retrieve the intergraph
links stored in this grapher with an origin or destination node in another
grapher. Call getExternalInterGraphLinks
to retrieve the
intergraph links stored in another grapher whose origin or destination node
is stored in this grapher.
IlvGrapher
is a subclass of IlvManager
and
inherits all the manager mechanisms for handling user events and
supplying interactive behavior. For more information, see
Handling Events and
Setting Interactive User Information./
IlvLinkImage
,
IlvLinkConnector
,
Serialized FormHH_BLUR, HH_BRIGHTEN, HH_CUSTOM, HH_GRAYSCALE, HH_INVERT_COLORS, HH_NONE, HH_SHARPEN
Constructor and Description |
---|
IlvGrapher()
Creates a new
IlvGrapher . |
IlvGrapher(IlvGrapher origin)
Creates a new
IlvGrapher by copying the
specified one. |
IlvGrapher(IlvInputStream stream)
Reads the grapher from an
IlvInputStream . |
IlvGrapher(int numlayers)
Creates a new
IlvGrapher with a specified number of layers. |
IlvGrapher(int numlayers,
int maxInList)
Creates a new
IlvGrapher . |
Modifier and Type | Method and Description |
---|---|
static void |
addInterGraphLink(IlvLinkImage link,
boolean redraw)
Adds an intergraph link.
|
void |
addLink(IlvLinkImage obj,
boolean redraw)
Adds a link to this grapher.
|
void |
addLink(IlvLinkImage obj,
int layer,
boolean redraw)
Adds a link to this grapher in a specified layer.
|
void |
addNode(IlvGraphic obj,
boolean redraw)
Adds a node to the grapher.
|
void |
addNode(IlvGraphic obj,
int layer,
boolean redraw)
Adds a node to the grapher in the specified layer.
|
void |
addObject(IlvGraphic obj,
int layer,
boolean redraw)
Adds the specified graphic object in the manager.
|
protected void |
afterTransformDependentObjs(HashSet objs,
boolean redraw,
boolean ifneeded)
|
protected void |
afterTransformObj(IlvGraphic obj,
boolean redraw,
boolean ifneeded,
boolean parent,
boolean fireEvent)
|
protected void |
beforeTransformDependentObjs(HashSet objs,
boolean redraw,
boolean ifneeded)
|
protected void |
beforeTransformObj(IlvGraphic obj,
boolean redraw,
boolean ifneeded,
boolean parent)
|
IlvGraphic |
copy()
Creates a new
IlvGrapher by copying this
grapher. |
protected HashSet |
getBoundingBoxDependentObjects(IlvGraphic obj,
boolean includeExternals)
Returns the dependent objects of this object.
|
IlvGraphicEnumeration |
getExternalInterGraphLinks()
Returns the intergraph links whose origin or destination node is stored
in this grapher.
|
int |
getExternalInterGraphLinksCount()
Returns the number of intergraph links whose origin or destination node is
stored in this grapher.
|
IlvGraphicEnumeration |
getFromNeighbors(IlvGraphic node)
Returns an enumeration of all nodes (
IlvGraphic )
that are the "from neighbors" of node . |
IlvGraphicEnumeration |
getInterGraphLinks()
Returns the intergraph links stored
in this grapher.
|
int |
getInterGraphLinksCount()
Returns the number of intergraph links stored
in this grapher.
|
IlvGraphicEnumeration |
getLinks(IlvGraphic node)
Returns an enumeration of all the links going from/to a node.
|
int |
getLinksCount(IlvGraphic node)
Returns the number of links going from/to a node.
|
IlvGraphicEnumeration |
getLinksFrom(IlvGraphic node)
Returns an enumeration of all the links originating from a node.
|
int |
getLinksFromCount(IlvGraphic node)
Returns the number of links originating from a node.
|
int |
getLinksInsertionLayer()
Returns the index of the layer where links are inserted when
addLink(IlvLinkImage, boolean) is called. |
IlvGraphicEnumeration |
getLinksTo(IlvGraphic node)
Returns an enumeration of all the links going to a node.
|
int |
getLinksToCount(IlvGraphic node)
Returns the number of links going to a node.
|
IlvGraphicEnumeration |
getLinksVisibleFrom(IlvGraphic node)
Returns an enumeration of all the links that have the input node as
visible origin node.
|
int |
getLinksVisibleFromCount(IlvGraphic node)
Returns the number of links that have the input node as
visible origin node.
|
IlvGraphicEnumeration |
getLinksVisibleTo(IlvGraphic node)
Returns an enumeration of all the links that have the input node as
visible destination node.
|
int |
getLinksVisibleToCount(IlvGraphic node)
Returns an enumeration of all the links that have the input node as
visible destination node.
|
static IlvGrapher |
getLowestCommonGrapher(IlvGraphic obja,
IlvGraphic objb)
Returns the lowest common grapher of two graphic objects or
null if the two objects do not have a common
ancestor. |
IlvGraphicEnumeration |
getNeighbors(IlvGraphic node)
Returns an enumeration of all nodes (
IlvGraphic )
that are the "neighbors" of node . |
IlvGraphicEnumeration |
getSelectedMovingObjects(boolean[] flags)
Returns the selected objects that should be moved by the select interactor.
|
IlvGraphicEnumeration |
getToNeighbors(IlvGraphic node)
Returns an enumeration of all nodes (
IlvGraphic )
that are the "to neighbors" of node . |
IlvGraphicEnumeration |
getTreeExternalInterGraphLinks()
Returns an enumeration of the nesting tree external intergraph links
for this grapher.
|
int |
getTreeExternalInterGraphLinksCount()
Returns the number of nesting tree external intergraph links
for this grapher.
|
boolean |
isCrossingAwareLinksFrozen()
Returns whether all crossing aware links of this manager are frozen.
|
boolean |
isInterGraphLink(IlvGraphic obj)
Returns
true if the object is a link contained
in this IlvGrapher and if the link is an intergraph link. |
boolean |
isLink(IlvGraphic obj)
Returns
true if the object is a link contained
in this IlvGrapher . |
boolean |
isLinkBetween(IlvGraphic node1,
IlvGraphic node2)
Tests whether a link exists between two nodes.
|
boolean |
isMarked(IlvGraphic obj)
Returns
true if the object is marked. |
boolean |
isNode(IlvGraphic obj)
Returns
true if the object is a node contained
in this IlvGrapher . |
boolean |
isNodeOrLink(IlvGraphic obj)
Returns
true if the object is a node or a link. |
void |
makeNode(IlvGraphic obj)
Allows a graphic object to become a node of the grapher.
|
protected IlvObjectProperty |
makeObjectProperty(IlvGraphic obj)
Creates the object property for the input object.
|
boolean |
nodeHasSons(IlvGraphic node)
Returns
true if there are links from
the specified node to other nodes. |
void |
readPrefix(IlvInputStream stream,
boolean isSubManager)
Reads properties of the manager.
|
void |
readSuffix(IlvInputStream stream,
boolean isSubManager)
Reads properties of the manager.
|
void |
removeLink(IlvLinkImage link,
boolean redraw)
Removes a link from the grapher.
|
void |
removeNode(IlvGraphic node,
boolean redraw)
Removes a node from the grapher.
|
void |
removeObject(IlvGraphic obj,
boolean redraw)
Removes an object from the grapher.
|
void |
replaceObject(IlvGraphic oldObject,
IlvGraphic newObject,
boolean redraw)
This method overrides the
replaceObject method of
IlvManager to take node and link
properties into account. |
void |
setCrossingAwareLinksFrozen(boolean flag)
Marks that all crossing aware links of this manager are frozen.
|
void |
setLayer(IlvGraphic obj,
int newLayer,
boolean redraw)
Changes the layer of a graphic object.
|
void |
setLinksInsertionLayer(int layer)
Sets the index of the layer where links are inserted when
addLink(IlvLinkImage, boolean) is called. |
void |
setMarked(IlvGraphic obj,
boolean value)
Marks or unmarks an object.
|
void |
setVisibleBranch(IlvGraphic node,
boolean visible,
boolean origin)
Shows or hides a branch that originates from or has as destination the input
node . |
void |
setVisibleBranch(IlvGraphic node,
int level,
boolean visible,
boolean origin)
Shows or hides a branch that originates from or has as destination the input
node , starting at level levels away
from node . |
void |
setVisibleBranch(IlvGraphic node,
int startLevel,
int endLevel,
boolean visible,
boolean origin,
boolean includeIntergraphLinks,
boolean includeTreeExtIntergraphLinks)
Shows or hides a branch that originates from or has as destination
the input
node , starting at startLevel levels
away from node until at endLevel levels away. |
void |
unmakeNode(IlvGraphic obj)
Allows a graphic object that was added as a node to become a
regular object.
|
void |
write(IlvOutputStream stream)
Stores the contents of the manager to an
IlvOutputStream . |
void |
writePrefix(IlvOutputStream stream,
boolean isSubManager)
Writes properties of the manager.
|
void |
writeSuffix(IlvOutputStream stream,
boolean isSubManager)
Writes properties of the manager.
|
abortReDraws, addAccelerator, addGraphicBagHierarchyListener, addLayer, addLayer, addManagerContentChangedListener, addManagerExpansionListener, addManagerLayerListener, addManagerSelectionListener, addManagerTreeContentChangedListener, addManagerTreeSelectionListener, addManagerViewsHierarchyListener, addManagerViewsListener, addObject, afterInvalidateRegion, afterTransform, allowMoving, applyToObject, applyToObjects, applyToObjects, applyToObjects, applyToObjects, applyTransform, baseTextDirectionChanged, beforeInvalidateRegion, beforeTransform, blinkingReDraw, boundingBox, check, componentOrientationChanged, computeBBox, computeBBox, contains, containsFrame, contentsChanged, copySelection, createInputStream, createManagerLayer, createOutputStream, deleteAll, deleteAll, deleteSelections, deleteSelections, deSelectAll, deSelectAll, deSelectAll, dispatchToObjects, draw, draw, duplicateSelections, duplicateSelections, enableGraphicBagHierarchyEventForwarding, enableManagerViewsHierarchyEventForwarding, fireGraphicBagHierarchyEvent, fireManagerViewsHierarchyEvent, getAccelerators, getAllObjects, getAllObjects, getAllSelectableObjects, getCardinal, getCardinal, getCardinal, getCollapsedGraphic, getCollapseExpandObject, getComponentOrientation, getDrawingTransformer, getFileName, getFrame, getHoverHighlightingImageOperation, getHoverHighlightingMode, getInsertionLayer, getIntersectionWithOutline, getLayer, getLayer, getLayerName, getLayersCount, getManagerLayer, getManagerLayer, getManagerLayer, getManagers, getManagers, getManagersCount, getManagersCount, getObject, getObject, getObject, getObject, getObjectInteractor, getObjectName, getObjectProperty, getObjects, getObjects, getObjects, getOptimizedLayerThreshold, getParent, getProperty, getSelectableObject, getSelectedObjects, getSelectedObjects, getSelectedObjects, getSelectedObjectsCount, getSelectedObjectsCount, getSelectedObjectsCount, getSelection, getSelection, getSelection, getSelectionFactory, getSelections, getSizeLimitToDrawSubmanagerContents, getStoredComponentOrientation, getStoredULocale, getStreamFactory, getTopLevelTransformer, getTransformer, getTreeLock, getULocale, getUserData, getViews, handleAccelerators, hasProperty, init, initReDraws, invalidateRegion, invalidateRegion, invalidateRegion, isAutoLabelForCollapsedGraphic, isBaseTextDirectionSensitive, isCollapsed, isCollapsible, isComponentOrientationSensitive, isContentsAdjusting, isDebugBoundingBoxes, isEditable, isInsertionAdjusting, isInvalidating, isKeepingAspectRatio, isLocaleSensitive, isManaged, isMovable, isSelectable, isSelectable, isSelected, isSelectionAdjusting, isSelectionInvariantSubManagerBounds, isVisible, isVisible, isVisible, isVisible, localeChanged, lostOwnership, map, map, mapInside, mapInside, mapIntersects, mapIntersects, moveObject, moveResize, needsDrawSubmanagerContents, needsGraphicBagHierarchyEvent, needsManagerViewsHierarchyEvent, objectIsSelectable, objectRemoved, pasteSelection, print, processEvent, processEvent, processHoverHighlightingEvent, processHoverHighlightingEvent, read, read, read, reDraw, reDrawObj, reDrawRegion, reDrawViews, removeAccelerator, removeGraphicBagHierarchyListener, removeLayer, removeManagerContentChangedListener, removeManagerExpansionListener, removeManagerLayerListener, removeManagerSelectionListener, removeManagerTreeContentChangedListener, removeManagerTreeSelectionListener, removeManagerViewsHierarchyListener, removeManagerViewsListener, removeProperty, replaceProperty, reshapeObject, selectAll, selectAll, selectAll, selectionChanged, setAccelerators, setAutoLabelForCollapsedGraphic, setBaseTextDirection, setCollapsed, setCollapsedGraphic, setComponentOrientation, setComponentOrientation, setContentsAdjusting, setContentsAdjusting, setDebugBoundingBoxes, setDebugBoundingBoxesGlobal, setEditable, setFileName, setFrame, setGraphicBag, setHoverHighlightingImageOperation, setHoverHighlightingMode, setInsertionAdjusting, setInsertionLayer, setKeepingAspectRatio, setLayerName, setMovable, setNameImpl, setNumberOfLayer, setObjectInteractor, setObjectName, setOptimizedLayerThreshold, setProperty, setSelectable, setSelectable, setSelected, setSelected, setSelectionAdjusting, setSelectionEventSource, setSelectionFactory, setSelectionInvariantSubManagerBounds, setSizeLimitToDrawSubmanagerContents, setStreamFactory, setTransformer, setULocale, setULocale, setUserData, setVisible, setVisible, setVisible, shortCut, swapLayers, translateObjects, translateSelections, viewAdded, viewRemoved, write, write, write, write, writeIt, zoomable
calcResolvedBaseTextDirection, getBaseTextDirection, getResolvedBaseTextDirection, invalidateBidiCache, setBaseTextDirection, setBaseTextDirectionDuringConstruction
addActionListener, addNamedPropertyListener, allViewsRemoved, blinkingStateOn, boundingBox, callDraw, getAndAssociateObjectInteractor, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getDefaultInteractor, getGraphicBag, GetGraphicObject, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getToolTipBaseTextDirection, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getZOrderIndex, inside, intersects, invalidateBBoxCache, isDataFlavorSupported, isEditable, isInApplyToObject, isMovable, isPersistent, isSelectable, isVisible, makeSelection, move, move, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, resize, rotate, scale, setBackground, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setForeground, setInApplyToObject, setMovable, setName, setNamedProperty, setObjectInteractor, setPopupMenu, setPopupMenuName, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemoved
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getGraphicBag
public IlvGrapher()
IlvGrapher
.
By default the grapher has 2 layers.public IlvGrapher(int numlayers)
IlvGrapher
with a specified number of layers.numlayers
- The number of layers.public IlvGrapher(int numlayers, int maxInList)
IlvGrapher
.numlayers
- The number of layers.maxInList
- The number of objects before using the quadtree.public IlvGrapher(IlvInputStream stream) throws IOException, IlvReadFileException
IlvInputStream
.
You should not call this method directly. To read
an IVL formatted file, use the setFileName
or
read
methods of the superclass. This method is used
only to read a grapher used as a graphic object inside another
manager.IOException
IlvReadFileException
public IlvGrapher(IlvGrapher origin)
IlvGrapher
by copying the
specified one.origin
- The grapher to copy.copy()
public IlvGraphic copy()
IlvGrapher
by copying this
grapher.copy
in class IlvManager
IlvGrapher
instance.IlvGraphic
public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.
You should not call this method directly.
This method is public for implementation purposes.write
in interface IlvPersistentObject
write
in class IlvManager
stream
- The output stream to write this graphic object to.IOException
- thrown when an exception occurs during
the write operation for this object.public void writePrefix(IlvOutputStream stream, boolean isSubManager) throws IOException
writePrefix
in class IlvManager
IOException
public void writeSuffix(IlvOutputStream stream, boolean isSubManager) throws IOException
writeSuffix
in class IlvManager
IOException
public void readPrefix(IlvInputStream stream, boolean isSubManager) throws IOException, IlvReadFileException
readPrefix
in class IlvManager
IOException
IlvReadFileException
public void readSuffix(IlvInputStream stream, boolean isSubManager) throws IOException, IlvReadFileException
readSuffix
in class IlvManager
IOException
IlvReadFileException
public void addObject(IlvGraphic obj, int layer, boolean redraw)
ManagerContentChangedEvent
event.addObject
in class IlvManager
obj
- The object to be added.layer
- The layer where the object should be inserted. Note that if
the manager does not have a layer that corresponds to this index, the manager
automatically increases the number of layers by calling setNumberOfLayer
.redraw
- If true
, the object is redrawn.IlvManager.addObject(ilog.views.IlvGraphic, boolean)
,
removeObject(ilog.views.IlvGraphic, boolean)
,
IlvManager.setNumberOfLayer(int)
,
setLayer(IlvGraphic, int, boolean)
public void addNode(IlvGraphic obj, boolean redraw)
obj
- The node.redraw
- If true
, the object is drawn.addNode(ilog.views.IlvGraphic, int, boolean)
,
removeNode(ilog.views.IlvGraphic, boolean)
,
IlvManager.getInsertionLayer()
,
setLayer(IlvGraphic, int, boolean)
public void addNode(IlvGraphic obj, int layer, boolean redraw)
obj
- The node.layer
- The index of the layer where the node is to be added.redraw
- If true
, the object is drawn.addNode(ilog.views.IlvGraphic, boolean)
,
removeNode(ilog.views.IlvGraphic, boolean)
,
setLayer(IlvGraphic, int, boolean)
public void addLink(IlvLinkImage obj, boolean redraw)
Note: Before adding a link, the origin and
destination nodes for the link must already exist. These nodes
must be contained either in this IlvGrapher
instance or one of its subgraphs. They must have been added using the
addNode(ilog.views.IlvGraphic, boolean)
method.
obj
- The link.redraw
- If true
, the object is drawn.getLinksInsertionLayer()
,
addLink(ilog.views.IlvLinkImage, int, boolean)
,
removeLink(ilog.views.IlvLinkImage, boolean)
,
addInterGraphLink(ilog.views.IlvLinkImage, boolean)
,
setLayer(IlvGraphic, int, boolean)
public void addLink(IlvLinkImage obj, int layer, boolean redraw)
Note: Before adding a link, the origin and
destination nodes for the link must already exist. These nodes
must be contained either in this IlvGrapher
instance or one of its subgraphs. They must have been added using the
addNode(ilog.views.IlvGraphic, boolean)
method.
obj
- The link.layer
- The index of the layer where the node is added.redraw
- If true
, the object is drawn.addLink(ilog.views.IlvLinkImage, boolean)
,
removeLink(ilog.views.IlvLinkImage, boolean)
,
addInterGraphLink(ilog.views.IlvLinkImage, boolean)
,
setLayer(IlvGraphic, int, boolean)
public final IlvGraphicEnumeration getExternalInterGraphLinks()
addInterGraphLink(ilog.views.IlvLinkImage, boolean)
,
getExternalInterGraphLinksCount()
public final int getExternalInterGraphLinksCount()
getExternalInterGraphLinks()
public final IlvGraphicEnumeration getTreeExternalInterGraphLinks()
Each link in the enumeration has one node inside and one node outside the grapher nesting tree. That is, the inside node is in this grapher or in a subgrapher nested within this grapher, and the outside node is neither in this grapher nor any nested subgraphers. The link is not stored in this grapher.
addInterGraphLink(ilog.views.IlvLinkImage, boolean)
,
getTreeExternalInterGraphLinksCount()
public final int getTreeExternalInterGraphLinksCount()
Each link counted has one node inside and one node outside the grapher nesting tree. That is, the inside node is in this grapher or in a subgrapher nested within this grapher, and the outside node is neither in this grapher nor any nested subgraphers. The link is not stored in this grapher.
addInterGraphLink(ilog.views.IlvLinkImage, boolean)
,
getTreeExternalInterGraphLinks()
public final IlvGraphicEnumeration getInterGraphLinks()
getInterGraphLinksCount()
,
isInterGraphLink(ilog.views.IlvGraphic)
,
addInterGraphLink(ilog.views.IlvLinkImage, boolean)
public final int getInterGraphLinksCount()
getInterGraphLinks()
,
isInterGraphLink(ilog.views.IlvGraphic)
,
addInterGraphLink(ilog.views.IlvLinkImage, boolean)
public static void addInterGraphLink(IlvLinkImage link, boolean redraw)
link
- The link to add.redraw
- If true
, the link will be drawn.getLowestCommonGrapher(ilog.views.IlvGraphic, ilog.views.IlvGraphic)
,
getExternalInterGraphLinks()
,
addLink(ilog.views.IlvLinkImage, boolean)
,
isInterGraphLink(ilog.views.IlvGraphic)
public static IlvGrapher getLowestCommonGrapher(IlvGraphic obja, IlvGraphic objb)
null
if the two objects do not have a common
ancestor.obja
- The first graphic object.objb
- The second graphic object.IlvManager.getParent()
public void removeObject(IlvGraphic obj, boolean redraw)
removeNode
if the object
is a node and removeLink
if the object is a link.
The specified object must have been previously added by
addObject
, addNode
, or addLink
;
otherwise, an exception is thrown.
When an object is removed, the grapher fires a
ManagerContentChangedEvent
event.
Note: It is not allowed to remove graphic objects while
browsing the enumeration returned by the methods IlvManager.getObjects()
,
IlvManager.getObjects(int)
, getLinksFrom(ilog.views.IlvGraphic)
, getLinksTo(ilog.views.IlvGraphic)
,
getLinks(ilog.views.IlvGraphic)
, and getNeighbors(ilog.views.IlvGraphic)
.
removeObject
in interface IlvGraphicBag
removeObject
in class IlvManager
obj
- The graphic object to remove.redraw
- If true
, the area where the object was located
is redrawn.removeNode(ilog.views.IlvGraphic, boolean)
,
removeLink(ilog.views.IlvLinkImage, boolean)
,
setLayer(IlvGraphic, int, boolean)
public void removeLink(IlvLinkImage link, boolean redraw)
Note: It is not allowed to remove links while
browsing the enumeration returned by the methods IlvManager.getObjects()
,
IlvManager.getObjects(int)
, getLinksFrom(ilog.views.IlvGraphic)
, getLinksTo(ilog.views.IlvGraphic)
, and
getLinks(ilog.views.IlvGraphic)
.
link
- The link to remove.redraw
- If true
, the area where the link was
located is redrawnaddLink(ilog.views.IlvLinkImage, boolean)
,
addLink(ilog.views.IlvLinkImage, int, boolean)
,
setLayer(IlvGraphic, int, boolean)
public void removeNode(IlvGraphic node, boolean redraw)
Note: It is not allowed to remove graphic objects while
browsing the enumeration returned by the methods IlvManager.getObjects()
,
IlvManager.getObjects(int)
, and getNeighbors(ilog.views.IlvGraphic)
.
node
- The node to remove.redraw
- If true
, the area where the node was
located is redrawn.addNode(ilog.views.IlvGraphic, int, boolean)
,
addNode(ilog.views.IlvGraphic, boolean)
,
setLayer(IlvGraphic, int, boolean)
public final int getLinksInsertionLayer()
addLink(IlvLinkImage, boolean)
is called.
If setLinksInsertionLayer(int)
has never been called or was set to
-1
, this method returns the same value as
IlvManager.getInsertionLayer()
.setLinksInsertionLayer(int)
,
addLink(ilog.views.IlvLinkImage,boolean)
,
IlvManager.setInsertionLayer(int)
public final void setLinksInsertionLayer(int layer)
addLink(IlvLinkImage, boolean)
is called.
If layer
is set to -1
, the result of
IlvManager.getInsertionLayer()
is used when inserting links.layer
- The insertion layer.getLinksInsertionLayer()
,
addLink(ilog.views.IlvLinkImage,boolean)
,
IlvManager.getInsertionLayer()
public void setLayer(IlvGraphic obj, int newLayer, boolean redraw)
ManagerContentChangedEvent
event.
Using this method, the nodes keep their IlvLinkConnector
.
(if any), and the links keep their origin and destination nodes.
Note that it is not allowed to change the layer of graphic objects
while browsing the enumeration returned by IlvManager.getObjects()
or IlvManager.getObjects(int)
.
setLayer
in class IlvManager
obj
- The graphic object.newLayer
- The index of the new layer. This layer must exist;
otherwise, an IllegalArgumentException
is thrown.redraw
- If true
, the object is redrawn.IlvManager.getLayer(ilog.views.IlvGraphic)
,
IlvManager.getManagerLayer(ilog.views.IlvGraphic)
public void replaceObject(IlvGraphic oldObject, IlvGraphic newObject, boolean redraw)
replaceObject
method of
IlvManager
to take node and link
properties into account.
The replaced node will keep the IlvLinkConnector
of the
previous node.
The replaced link will keep the origin and destination nodes
of the previous link.replaceObject
in class IlvManager
oldObject
- The old object.newObject
- The new object.redraw
- If true
, the objects are redrawn.public final IlvGraphicEnumeration getLinksFrom(IlvGraphic node)
node
- The node.getLinksFromCount(ilog.views.IlvGraphic)
,
getLinksTo(ilog.views.IlvGraphic)
public final int getLinksFromCount(IlvGraphic node)
node
- The node.getLinksFrom(ilog.views.IlvGraphic)
public final IlvGraphicEnumeration getLinksTo(IlvGraphic node)
null
if there are no links.node
- The node.getLinksToCount(ilog.views.IlvGraphic)
,
getLinksFrom(ilog.views.IlvGraphic)
public final int getLinksToCount(IlvGraphic node)
node
- The node.getLinksTo(ilog.views.IlvGraphic)
public final IlvGraphicEnumeration getLinks(IlvGraphic node)
node
- The node.getLinksCount(ilog.views.IlvGraphic)
,
getLinksTo(ilog.views.IlvGraphic)
,
getLinksFrom(ilog.views.IlvGraphic)
public final int getLinksCount(IlvGraphic node)
node
- The node.getLinks(ilog.views.IlvGraphic)
,
getLinksToCount(ilog.views.IlvGraphic)
,
getLinksFromCount(ilog.views.IlvGraphic)
public final IlvGraphicEnumeration getNeighbors(IlvGraphic node)
IlvGraphic
)
that are the "neighbors" of node
. That is, the nodes
that have a common link (IlvLinkImage
) with
node
.
Note: The same "neighbor" node will be returned
by the method nextElement
an equal number of times to
the number of links between node
and this neighbor.
public final IlvGraphicEnumeration getFromNeighbors(IlvGraphic node)
IlvGraphic
)
that are the "from neighbors" of node
. That is, the nodes
that have a common link (IlvLinkImage
) with
node
, where node
is the origin of the link.
Note: The same "neighbor" node is returned
by the method nextElement
an equal number of times to
the number of links between node
and this neighbor that has
the appropriate orientation.
getNeighbors(IlvGraphic)
,
getToNeighbors(IlvGraphic)
public final IlvGraphicEnumeration getToNeighbors(IlvGraphic node)
IlvGraphic
)
that are the "to neighbors" of node
. That is, the nodes
that have a common link (IlvLinkImage
) with
node
, where node
is the destination of the link.
Note: The same "neighbor" node is returned
by the method nextElement
an equal number of times to
the number of links between node
and this neighbor that has
the appropriate orientation.
getNeighbors(IlvGraphic)
,
getFromNeighbors(IlvGraphic)
public final IlvGraphicEnumeration getLinksVisibleFrom(IlvGraphic node)
link.getVisibleFrom() == node
.
Some links on the screen appear to be connected to the input origin node when the input node is a collapsed grapher. In reality, the connection is not to the collapsed grapher but to a node currently invisible nested inside the collapsed grapher. Hence, this method returns all links that are really connected to the origin node, and additionally all links that appear visually connected to this origin node if it is a collapsed grapher.
To be precise: this method returns all non-intergraph links starting from the input origin node. Furthermore it returns all intergraph links starting from the input origin node that don't go beyond the border of any collapsed grapher. Furthermore, if the input node is a collapsed grapher, it returns all tree external intergraph links of the collapsed grapher that don't go beyond the border of any other collapsed grapher. Going beyond the border of a collapsed grapher means that the node is recursively nested in subgraphers, one of these subgraphers is collapsed and the destination node of the link is not nested inside, hence outside the collapsed grapher.
node
- The origin node.getLinksVisibleFromCount(ilog.views.IlvGraphic)
,
getLinksFrom(ilog.views.IlvGraphic)
,
isInterGraphLink(ilog.views.IlvGraphic)
,
getTreeExternalInterGraphLinks()
,
IlvLinkImage.getVisibleFrom()
public final int getLinksVisibleFromCount(IlvGraphic node)
link.getVisibleFrom() == node
.
node
- The origin node.getLinksVisibleFrom(ilog.views.IlvGraphic)
,
IlvLinkImage.getVisibleFrom()
public final IlvGraphicEnumeration getLinksVisibleTo(IlvGraphic node)
link.getVisibleTo() == node
.
Some links on the screen appear to be connected to the input destination node when the input node is a collapsed grapher. In reality, the connection is not to the collapsed grapher but to a node currently invisible nested inside the collapsed grapher. Hence, this method returns all links that are really connected to the destination node, and additionally all links that appear visually connected to this destination node if it is a collapsed grapher.
To be precise: this method returns all non-intergraph links ending at the input destination node. Furthermore it returns all intergraph links ending at the input destination node that don't go beyond the border of any collapsed grapher. Furthermore, if the input node is a collapsed grapher, it returns all tree external intergraph links of the collapsed grapher that don't go beyond the border of any other collapsed grapher. Going beyond the border of a collapsed grapher means that the node is recursively nested in subgraphers, one of these subgraphers is collapsed and the origin node of the link is not nested inside, hence outside the collapsed grapher.
node
- The destination node.getLinksVisibleToCount(ilog.views.IlvGraphic)
,
getLinksTo(ilog.views.IlvGraphic)
,
isInterGraphLink(ilog.views.IlvGraphic)
,
getTreeExternalInterGraphLinks()
,
IlvLinkImage.getVisibleTo()
public final int getLinksVisibleToCount(IlvGraphic node)
link.getVisibleTo() == node
.
node
- The destination node.getLinksVisibleTo(ilog.views.IlvGraphic)
,
IlvLinkImage.getVisibleTo()
public final boolean isNode(IlvGraphic obj)
true
if the object is a node contained
in this IlvGrapher
.obj
- The graphic object to test.isLink(ilog.views.IlvGraphic)
,
isNodeOrLink(ilog.views.IlvGraphic)
public final boolean isLink(IlvGraphic obj)
true
if the object is a link contained
in this IlvGrapher
.obj
- The graphic object to test.isInterGraphLink(ilog.views.IlvGraphic)
,
isNode(ilog.views.IlvGraphic)
,
isNodeOrLink(ilog.views.IlvGraphic)
public final boolean isNodeOrLink(IlvGraphic obj)
true
if the object is a node or a link.obj
- The graphic object to test.isNode(ilog.views.IlvGraphic)
,
isLink(ilog.views.IlvGraphic)
public final boolean isInterGraphLink(IlvGraphic obj)
true
if the object is a link contained
in this IlvGrapher
and if the link is an intergraph link.
A link is an intergraph link if the origin or destination node is not in
this grapher.obj
- The graphic object to test.isLink(ilog.views.IlvGraphic)
,
isNode(ilog.views.IlvGraphic)
,
isNodeOrLink(ilog.views.IlvGraphic)
,
addInterGraphLink(ilog.views.IlvLinkImage, boolean)
,
getInterGraphLinks()
,
getInterGraphLinksCount()
public final void setMarked(IlvGraphic obj, boolean value)
obj
- The object.value
- Set to true
to mark the object,
false
otherwise.isMarked(ilog.views.IlvGraphic)
public final boolean isMarked(IlvGraphic obj)
true
if the object is marked.obj
- The object.setMarked(ilog.views.IlvGraphic, boolean)
protected IlvObjectProperty makeObjectProperty(IlvGraphic obj)
makeObjectProperty
in class IlvManager
protected HashSet getBoundingBoxDependentObjects(IlvGraphic obj, boolean includeExternals)
The default implementation returns the links that may move when the input object is a moving node.
obj
- The object that changes its bounding box.includeExternals
- If true
and the input object is
a grapher, include the external intergraph links to the depending
objects.null
if there are no
dependent objects.protected void beforeTransformObj(IlvGraphic obj, boolean redraw, boolean ifneeded, boolean parent)
IlvManager.beforeTransform(ilog.views.IlvGraphic, boolean, boolean, boolean)
.
This method is part of JViews internals. You should
not use it.beforeTransformObj
in class IlvManager
protected void afterTransformObj(IlvGraphic obj, boolean redraw, boolean ifneeded, boolean parent, boolean fireEvent)
IlvManager.afterTransform(ilog.views.IlvGraphic, boolean, boolean, boolean, boolean)
.
This method is part of JViews internals. You should
not use it.afterTransformObj
in class IlvManager
protected void beforeTransformDependentObjs(HashSet objs, boolean redraw, boolean ifneeded)
IlvManager.afterTransform(ilog.views.IlvGraphic, boolean, boolean, boolean, boolean)
.
This method is part of JViews internals. You should
not use it.protected void afterTransformDependentObjs(HashSet objs, boolean redraw, boolean ifneeded)
IlvManager.afterTransform(ilog.views.IlvGraphic, boolean, boolean, boolean, boolean)
.
This method is part of JViews internals. You should
not use it.public final boolean nodeHasSons(IlvGraphic node)
true
if there are links from
the specified node to other nodes.node
- The graphic object to test.public final boolean isLinkBetween(IlvGraphic node1, IlvGraphic node2)
node1
- The first node.node2
- The second node.public void makeNode(IlvGraphic obj)
addObject
method, this object is not considered
as a node of the grapher and it cannot have links. After calling
this method, the object will be considered as a node.obj
- The graphic object.unmakeNode(ilog.views.IlvGraphic)
public void unmakeNode(IlvGraphic obj)
makeNode(ilog.views.IlvGraphic)
.
If the specified graphic object has been added to the grapher
using the addNode
method, this object is considered
as a node of the grapher. After calling this method, the object will
no longer be considered as a node. You can call this method
only if the object has no incident links.obj
- The graphic object.makeNode(ilog.views.IlvGraphic)
public IlvGraphicEnumeration getSelectedMovingObjects(boolean[] flags)
getSelectedMovingObjects
in class IlvManager
flags
- The flags of the select interactor that control what should be
moved. If flag[0]
is true
, the
links are moved if both end nodes are selected.IlvSelectInteractor.getSelectedMovingObjects(ilog.views.IlvManager)
public void setCrossingAwareLinksFrozen(boolean flag)
public boolean isCrossingAwareLinksFrozen()
true
, trying to reshape these links has no
effect anymore.
This method is part of JViews internals. You should
not use it.public void setVisibleBranch(IlvGraphic node, boolean visible, boolean origin)
node
.
The argument node
must be a node stored in this grapher.
If the argument origin
is true
, it shows or hides the
branch that originates from node
. Otherwise, it shows or hides
the branch that has node
as destination.
The method calls
setVisibleBranch(IlvGraphic, int, boolean, boolean)
passing
0
as the level
argument.
setVisibleBranch(IlvGraphic, int, boolean, boolean)
public void setVisibleBranch(IlvGraphic node, int level, boolean visible, boolean origin)
node
, starting at level
levels away
from node
.
The argument node
must be a node stored in this grapher.
If the argument origin
is true
, it shows or hides
the branch originating from node
. Otherwise, it shows or hides
the branch that has node
as destination.
setVisibleBranch(IlvGraphic, boolean, boolean)
public void setVisibleBranch(IlvGraphic node, int startLevel, int endLevel, boolean visible, boolean origin, boolean includeIntergraphLinks, boolean includeTreeExtIntergraphLinks)
node
, starting at startLevel
levels
away from node
until at endLevel
levels away.
The argument node
must be a node stored in this grapher
or any of its subgraphers. This node has level 0, and all nodes directly
reachable by one link from this node have level 1, and so on.
It shows or hides the nodes between startLevel
and
endLevel
(exclusive, that is, specifying start level 2 and
end level 5 shows or hides the nodes and links at level 3 and 4).
If the endLevel
is negative, it is ignored, that is,
it hides all of the branch starting at startLevel
.
If the argument origin
is true
, it shows or hides
the branch originating from node
. Otherwise, it shows or hides
the branch that has node
as destination.
At a node, we have normal links and intergraph links.
If the node is a subgrapher, links may end directly at the node, or
at a node nested inside the subgrapher. The latter are called the
tree external intergraph links.
If includeIntergraphLinks
is false and
includeTreeExtIntergraphLinks
is false, it calculates the
branch by taking only normal links into account.
If includeIntergraphLinks
is false but
includeTreeExtIntergraphLinks
is true, it calculates the
branch by taking the tree external intergraph links at subgraphers
into account, and if a node belongs to the branch that is not directly
contained in this grapher, it takes the ancestor node which is directly
contained in this grapher into account. This is particular suitable
if that ancestor is a collapsed subgrapher, because the tree external
intergraph links end visually directly at the collapsed subgrapher.
If includeIntergraphLinks
is true and
includeTreeExtIntergraphLinks
is false, it calculates the
branch by taking normal links and intergraph links into account, that
end directly at the nodes.
If includeIntergraphLinks
is true and
includeTreeExtIntergraphLinks
is true, it calculates the
branch by taking normal links and intergraph links into account, including
those tree external intergraph links that end inside subgraphers.
node
- The start node of the branch. This node does not change its
visibility.startLevel
- The start level of the branch.endLevel
- The end level of the branch. If negative, it is treated
as no end level.visible
- Whether to set the branch visible or invisible.origin
- Whether to calculate the branch starting at the node or
ending at the node.includeIntergraphLinks
- Whether to include intergraph links when
calculating the branch.includeTreeExtIntergraphLinks
- Whether to include tree external
intergraph links at subgraphers when calculating the branch.setVisibleBranch(IlvGraphic, boolean, boolean)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.