|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvGraphic
ilog.views.IlvManager
ilog.views.IlvGrapher
ilog.views.hypergraph.IlvHyperGrapher
public class IlvHyperGrapher
IlvHyperGrapher is a grapher that displays nodes and hyperedges.
Nodes can be any type of graphic objects. Normal edges of type
IlvLinkImage are supported. Additionally, hyperedges of
of type IlvHyperEdge are supported.
A graphic object will become a node of a graph if it is added in
the hypergrapher using the addNode method.
A link of type IlvLinkImage must be added using
the addLink method.
A hyperedge must be added using the addHyperEdge
method.
When removing a node from the hypergrapher, all the links that come from
and go to this node will be removed, and all hyperedges that come from
and go to this node will loose the node as end point. The hyperedges
remain in the grapher as long as they have the desired minimum number of
end points (see getMinHyperEdgeEndCount()), otherwise they are
automatically removed when their end node is removed.
When changing the location of a node, the connection points of the
hyperedges will be recomputed automatically.
IlvHyperEdge,
Serialized Form| Field Summary |
|---|
| Fields inherited from class ilog.views.IlvManager |
|---|
HH_BLUR, HH_BRIGHTEN, HH_CUSTOM, HH_GRAYSCALE, HH_INVERT_COLORS, HH_NONE, HH_SHARPEN |
| Constructor Summary | |
|---|---|
IlvHyperGrapher()
Creates a new IlvHyperGrapher. |
|
IlvHyperGrapher(IlvHyperGrapher origin)
Creates a new IlvHyperGrapher by copying the
specified one. |
|
IlvHyperGrapher(IlvInputStream stream)
Reads the hypergrapher from an IlvInputStream. |
|
IlvHyperGrapher(int numlayers)
Creates a new IlvHyperGrapher with a specified number of
layers. |
|
IlvHyperGrapher(int numlayers,
int maxInList)
Creates a new IlvHyperGrapher. |
|
| Method Summary | |
|---|---|
void |
addHyperEdge(IlvHyperEdge obj,
boolean redraw)
Adds a hyperedge to this hypergrapher. |
void |
addHyperEdge(IlvHyperEdge obj,
int layer,
boolean redraw)
Adds a hyperedge to this hypergrapher in a specified layer. |
static void |
addInterGraphHyperEdge(IlvHyperEdge edge,
boolean redraw)
Adds an intergraph hyperedge. |
static void |
addInterGraphHyperEdge(IlvHyperEdge edge,
int layer,
boolean redraw)
Adds an intergraph hyperedge. |
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 hypergrapher. |
protected void |
afterHyperEdgeEndsChanged(Iterator hyperedges)
This method is eventually called after the ends of some hyperedges that belong to this grapher have changed. |
protected boolean |
afterInvalidateRegion(IlvGraphic object,
IlvRect objectBBox,
IlvManagerView view,
IlvTransformer t,
Object info)
Returns true if the region of the object must be invalidated. |
protected void |
afterTransformDependentObjs(HashSet objs,
boolean redraw,
boolean ifneeded)
Called from IlvManager.afterTransform(ilog.views.IlvGraphic, boolean, boolean, boolean, boolean). |
protected void |
afterTransformObj(IlvGraphic obj,
boolean redraw,
boolean ifneeded,
boolean parent,
boolean fireEvent)
Called from IlvManager.afterTransform(ilog.views.IlvGraphic, boolean, boolean, boolean, boolean). |
boolean |
allowMoving(IlvGraphic obj)
Returns true if the object can be moved with
the selection interactor (IlvSelectInteractor). |
protected Object |
beforeInvalidateRegion(IlvGraphic object,
IlvManagerView view,
IlvTransformer t)
Calculates the info necessary to decide whether the region of the object must be invalidated. |
protected void |
beforeTransformDependentObjs(HashSet objs,
boolean redraw,
boolean ifneeded)
Called from IlvManager.afterTransform(ilog.views.IlvGraphic, boolean, boolean, boolean, boolean). |
protected void |
beforeTransformObj(IlvGraphic obj,
boolean redraw,
boolean ifneeded,
boolean parent)
Called from IlvManager.beforeTransform(ilog.views.IlvGraphic, boolean, boolean, boolean). |
IlvGraphic |
copy()
Creates a new IlvHyperGrapher by copying this
hypergrapher. |
void |
copySelection()
Copies the selected graphic objects to the clipboard. |
void |
deleteSelections(boolean traverse,
boolean redraw)
Removes the selected objects. |
void |
disconnectHyperEdge(IlvGraphic node,
IlvHyperEdge edge,
boolean fromSide,
boolean toSide,
boolean redraw)
Disconnects the input hyperedge from the input node. |
void |
disconnectHyperEdgesFrom(IlvGraphic node,
boolean redraw)
Disconnects all outgoing hyperedges from the input node. |
void |
disconnectHyperEdgesTo(IlvGraphic node,
boolean redraw)
Disconnects all incoming hyperedges from the input node. |
void |
duplicateSelections(int dx,
int dy)
Duplicates the selected objects. |
protected HashSet |
getBoundingBoxDependentObjects(IlvGraphic obj,
boolean includeExternals)
Returns the dependent objects of this object. |
IlvGraphicEnumeration |
getExternalInterGraphHyperEdges()
Returns the intergraph hyperedges that have any end node stored in this hypergrapher. |
int |
getExternalInterGraphHyperEdgesCount()
Returns the number of intergraph hyperedges that have any end node stored in this hypergrapher. |
Iterator |
getHyperEdgeEndsFrom(IlvGraphic node)
Returns an the ends of hyperedges that have the input node as source. |
int |
getHyperEdgeEndsFromCount(IlvGraphic node)
Returns the number of ends of hyperedges that have the input node as source. |
Iterator |
getHyperEdgeEndsTo(IlvGraphic node)
Returns an the ends of hyperedges that have the input node as target. |
int |
getHyperEdgeEndsToCount(IlvGraphic node)
Returns the number of ends of hyperedges that have the input node as target. |
IlvGraphicEnumeration |
getHyperEdges()
Returns the regular hyperedges stored in this hypergrapher. |
int |
getHyperEdgesCount()
Returns the number of regular hyperedges stored in this hypergrapher. |
IlvGraphicEnumeration |
getHyperEdgesFrom(IlvGraphic node)
Returns an enumeration of all the hyperedges that have the input node as source. |
int |
getHyperEdgesFromCount(IlvGraphic node)
Returns the number of hyperedges that have the input node as source. |
IlvGraphicEnumeration |
getHyperEdgesTo(IlvGraphic node)
Returns an enumeration of all the hyperedges that have the input node as target. |
int |
getHyperEdgesToCount(IlvGraphic node)
Returns the number of hyperedges that have the input node as target. |
IlvGraphicEnumeration |
getHyperEdgesVisibleFrom(IlvGraphic node)
Returns an enumeration of all the hyperedges that have the input node as visible origin node. |
int |
getHyperEdgesVisibleFromCount(IlvGraphic node)
Returns the number of hyperedges that have the input node as visible origin node. |
IlvGraphicEnumeration |
getHyperEdgesVisibleTo(IlvGraphic node)
Returns an enumeration of all the hyperedges that have the input node as visible destination node. |
int |
getHyperEdgesVisibleToCount(IlvGraphic node)
Returns the number of hyperedges that have the input node as visible destination node. |
IlvGraphicEnumeration |
getHyperGraphFromNeighbors(IlvGraphic node)
Returns an enumeration of all nodes ( IlvGraphic)
that are the hyperedge "from neighbors" of node. |
IlvGraphicEnumeration |
getHyperGraphNeighbors(IlvGraphic node)
Returns an enumeration of all nodes ( IlvGraphic)
that are the hyperedge "neighbors" of node. |
IlvGraphicEnumeration |
getHyperGraphToNeighbors(IlvGraphic node)
Returns an enumeration of all nodes ( IlvGraphic)
that are the hyperedge "to neighbors" of node. |
IlvGraphicEnumeration |
getInterGraphHyperEdges()
Returns the intergraph hyperedges stored in this hypergrapher. |
int |
getInterGraphHyperEdgesCount()
Returns the number of intergraph hyperedges stored in this hypergrapher. |
static IlvHyperGrapher |
getLowestCommonHyperGrapher(IlvHyperEdge obj)
Returns the lowest common grapher of all end nodes of the hyperedge. |
static IlvHyperGrapher |
getLowestCommonHyperGrapher(Iterator iter)
Returns the lowest common hyper grapher of a set of nodes. |
int |
getMinHyperEdgeEndCount()
Returns the minimum number of end point a hyperedge should have. |
IlvGraphicEnumeration |
getSelectedMovingObjects(boolean[] flags)
Returns the selected objects that should be moved by the select interactor |
IlvGraphicEnumeration |
getTreeExternalInterGraphHyperEdges()
Returns an enumeration of the nesting tree external intergraph hyperegdes for this grapher. |
int |
getTreeExternalInterGraphHyperEdgesCount()
Returns the number of nesting tree external intergraph hyperedges for this grapher. |
boolean |
isHyperEdge(IlvGraphic obj)
Returns true if the object is a hyperedge contained
in this IlvGrapher. |
boolean |
isWaitingForAdjustmentEnd(IlvHyperEdge edge)
Returns true if the hyperedge is registered as waiting
for adjustment end notification. |
protected IlvObjectProperty |
makeObjectProperty(IlvGraphic obj)
Creates the object property for the input object. |
protected void |
objectRemoved(IlvGraphic obj)
This method is called when an object is removed from the manager. |
IlvGraphicEnumeration |
pasteSelection(IlvPoint p,
boolean select)
Pastes the graphic objects saved in the clipboard into the manager. |
boolean |
read(InputStream stream)
Reads an ILOG JViews formatted file in the manager. |
void |
registerWaitingForAdjustmentEnd(IlvHyperEdge edge)
Registers that a hyperedge is waiting for adjustment end notification. |
void |
removeHyperEdge(IlvHyperEdge edge,
boolean redraw)
Removes a hyperedge from the grapher. |
void |
removeHyperEdgesFrom(IlvGraphic node,
boolean redraw)
Remove all hyperedges that are incident to the input source node. |
void |
removeHyperEdgesTo(IlvGraphic node,
boolean redraw)
Remove all hyperedges that are incident to the input target node. |
void |
removeNode(IlvGraphic node,
boolean redraw)
Removes a node from the grapher. |
void |
removeObject(IlvGraphic obj,
boolean redraw)
Removes an object from the hypergrapher. |
void |
replaceObject(IlvGraphic oldObject,
IlvGraphic newObject,
boolean redraw)
This method overrides the replaceObject method of
IlvGrapher to take hyperedge properties into account. |
void |
setContentsAdjusting(boolean set)
Tells the manager that it is the beginning or the end of a major modification of its contents. |
void |
setLayer(IlvGraphic obj,
int newLayer,
boolean redraw)
Changes the layer of a graphic object. |
void |
setMinHyperEdgeEndCount(int count)
Sets the minimum number of end point a hyperedge should have. |
void |
setSelected(IlvGraphic obj,
boolean select,
boolean redraw)
Selects or deselects the specified graphic object. |
void |
setSelected(IlvGraphic obj,
IlvPoint p,
IlvManagerView view)
Selects or the specified graphic object. |
void |
translateObjects(IlvGraphicEnumeration enumeration,
float dx,
float dy,
IlvTransformer t)
Translates the input objects that must belong to this manager. |
void |
unmakeNode(IlvGraphic obj)
Allows a graphic object that was added as a node to become a regular object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ilog.views.IlvGraphicBag |
|---|
getGraphicBag |
| Constructor Detail |
|---|
public IlvHyperGrapher()
IlvHyperGrapher.
By default the hypergrapher has 2 layers.
public IlvHyperGrapher(int numlayers)
IlvHyperGrapher with a specified number of
layers.
numlayers - The number of layers.
public IlvHyperGrapher(int numlayers,
int maxInList)
IlvHyperGrapher.
numlayers - The number of layers.maxInList - The number of objects before using the quadtree.
public IlvHyperGrapher(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 hypergrapher used as a graphic object inside another
grapher.
IOException
IlvReadFileExceptionpublic IlvHyperGrapher(IlvHyperGrapher origin)
IlvHyperGrapher by copying the
specified one.
origin - The hypergrapher to copy.copy()| Method Detail |
|---|
public IlvGraphic copy()
IlvHyperGrapher by copying this
hypergrapher.
copy in class IlvGrapherIlvGrapher instance.IlvGraphic
public void addObject(IlvGraphic obj,
int layer,
boolean redraw)
ManagerContentChangedEvent event.
addObject in class IlvGrapherobj - The object to be added.layer - The layer where the object should be inserted. Note that if
the hypergrapher does not have a layer that corresponds to this index, the
hypergrapher 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)
public void addNode(IlvGraphic obj,
int layer,
boolean redraw)
addNode in class IlvGrapherobj - The node.layer - The index of the layer where the node is to be added.redraw - If true, the object is drawn.removeNode(ilog.views.IlvGraphic, boolean),
IlvGrapher.addNode(ilog.views.IlvGraphic, boolean),
IlvManager.setNumberOfLayer(int)public void unmakeNode(IlvGraphic obj)
IlvGrapher.makeNode(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 and no incident hyperedges.
unmakeNode in class IlvGrapherobj - The graphic object.IlvGrapher.makeNode(IlvGraphic)
public void addHyperEdge(IlvHyperEdge obj,
boolean redraw)
Note that the origin and destination nodes of the edge must be already
added using the method addNode(ilog.views.IlvGraphic, int, boolean), and they must be contained
either in this IlvHyperGrapher, or in subhypergraphs of it.
The hyperedge must have the minimal number of ends (see
getMinHyperEdgeEndCount()). It is not possible to add a hyperedge
that has no end node at all.
obj - The hyperedge.redraw - If true, the object is drawn.IlvGrapher.getLinksInsertionLayer(),
addHyperEdge(IlvHyperEdge, int, boolean),
removeHyperEdge(ilog.views.hypergraph.IlvHyperEdge, boolean),
addInterGraphHyperEdge(ilog.views.hypergraph.IlvHyperEdge, boolean)
public void addHyperEdge(IlvHyperEdge obj,
int layer,
boolean redraw)
Note that the origin and destination nodes of the edge must be already
added using the method addNode(ilog.views.IlvGraphic, int, boolean), and they must be contained
either in this IlvGrapher, or in subhypergraphs of it.
The hyperedge must have the minimal number of ends (see
getMinHyperEdgeEndCount()). It is not possible to add a hyperedge
that has no end node at all.
obj - The hyperedge.layer - The index of the layer where the hyperedge is added.redraw - If true, the object is drawn.addHyperEdge(IlvHyperEdge, boolean),
removeHyperEdge(ilog.views.hypergraph.IlvHyperEdge, boolean),
addInterGraphHyperEdge(ilog.views.hypergraph.IlvHyperEdge, boolean)
public static void addInterGraphHyperEdge(IlvHyperEdge edge,
boolean redraw)
The hyperedge must have the minimal number of ends specified for the
grapher where it is added (see getMinHyperEdgeEndCount()). It is
not possible to add a hyperedge that has no end node at all.
edge - The edge to add.redraw - If true, the edge will be drawn.getLowestCommonHyperGrapher(ilog.views.hypergraph.IlvHyperEdge),
getInterGraphHyperEdges(),
getExternalInterGraphHyperEdges(),
addHyperEdge(ilog.views.hypergraph.IlvHyperEdge, boolean),
IlvHyperEdge.isInterGraphHyperEdge()
public static void addInterGraphHyperEdge(IlvHyperEdge edge,
int layer,
boolean redraw)
The hyperedge must have the minimal number of ends specified for the
grapher where it is added (see getMinHyperEdgeEndCount()). It is
not possible to add a hyperedge that has no end node at all.
edge - The edge to add.layer - The index of the layer where the hyperedge is added.redraw - If true, the edge will be drawn.getLowestCommonHyperGrapher(ilog.views.hypergraph.IlvHyperEdge),
getInterGraphHyperEdges(),
getExternalInterGraphHyperEdges(),
addHyperEdge(ilog.views.hypergraph.IlvHyperEdge, boolean)public static IlvHyperGrapher getLowestCommonHyperGrapher(IlvHyperEdge obj)
null if the end nodes have no common ancestor
that is a hypergrapher.
obj - The hyperedge.public static IlvHyperGrapher getLowestCommonHyperGrapher(Iterator iter)
null if the nodes have no common ancestor
that is a hypergrapher.
iter - The iterator over the nodes.protected IlvObjectProperty makeObjectProperty(IlvGraphic obj)
makeObjectProperty in class IlvGrapher
public void removeObject(IlvGraphic obj,
boolean redraw)
removeNode if the object
is a node, removeLink if the object is a regular edge,
and removeHyperEdge if the object is a hyperedge.
Note that it is not allowed to remove graphic objects while
browsing the enumeration returned by the methods IlvManager.getObjects(),
IlvManager.getObjects(int), IlvManager.getObjects(boolean),
IlvManager.getSelections(), IlvManager.getSelectedObjects(),
IlvManager.getSelectedObjects(boolean),
IlvManager.getManagers(), IlvManager.getManagers(int),
IlvGrapher.getLinksFrom(ilog.views.IlvGraphic), IlvGrapher.getLinksTo(ilog.views.IlvGraphic),
IlvGrapher.getLinks(ilog.views.IlvGraphic), IlvGrapher.getNeighbors(ilog.views.IlvGraphic), IlvGrapher.getInterGraphLinks(),
IlvGrapher.getExternalInterGraphLinks(),
getHyperEdgesFrom(ilog.views.IlvGraphic), getHyperEdgesTo(ilog.views.IlvGraphic),
getHyperEdges(), getInterGraphHyperEdges(),
getExternalInterGraphHyperEdges(),
IlvHyperEdge.getFromEnds() and
IlvHyperEdge.getToEnds().
removeObject in interface IlvGraphicBagremoveObject in class IlvGrapherobj - The graphic object to remove.redraw - If true, the area where the object was located
is redrawn.removeNode(ilog.views.IlvGraphic, boolean),
IlvGrapher.removeLink(IlvLinkImage, boolean)
public void removeNode(IlvGraphic node,
boolean redraw)
getMinHyperEdgeEndCount().
If the node is a hypergrapher, all intergraph hyperedges that go outside the node loose the ends that are inside the node.
Note that it is not allowed to remove graphic objects while
browsing the enumeration returned by the certain methods.
See removeObject() for the list of forbidden methods.
removeNode in class IlvGraphernode - The node to remove.redraw - If true, the area where the node was
located is redrawn.addNode(ilog.views.IlvGraphic, int, boolean),
IlvGrapher.addNode(ilog.views.IlvGraphic, boolean)
public void removeHyperEdge(IlvHyperEdge edge,
boolean redraw)
Note that it is not allowed to remove graphic objects while
browsing the enumeration returned by the certain methods.
See removeObject() for the list of forbidden methods.
edge - The hyperedge to remove.redraw - If true, the area where the hyperedge was
located is redrawn.addHyperEdge(IlvHyperEdge, int, boolean),
addHyperEdge(IlvHyperEdge, boolean)protected void objectRemoved(IlvGraphic obj)
objectRemoved in class IlvManagerobj - The graphic object.
public void removeHyperEdgesFrom(IlvGraphic node,
boolean redraw)
node - The origin node.redraw - If true, the area where the hyperedges were
located is redrawn.removeHyperEdgesTo(ilog.views.IlvGraphic, boolean)
public void removeHyperEdgesTo(IlvGraphic node,
boolean redraw)
node - The destination node.redraw - If true, the area where the hyperedges were
located is redrawn.removeHyperEdgesFrom(ilog.views.IlvGraphic, boolean)public final boolean isHyperEdge(IlvGraphic obj)
true if the object is a hyperedge contained
in this IlvGrapher.
obj - The graphic object to test.
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 IlvGrapher
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 IlvGrapher
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.
beforeTransformDependentObjs in class IlvGrapher
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.
afterTransformDependentObjs in class IlvGrapher
public void replaceObject(IlvGraphic oldObject,
IlvGraphic newObject,
boolean redraw)
replaceObject method of
IlvGrapher to take hyperedge properties into account.
The replaced hyperedge will have the same ends at the original hyperedge.
replaceObject in class IlvGrapheroldObject - The old object.newObject - The new object.redraw - If true, the objects are redrawn.
public void setSelected(IlvGraphic obj,
boolean select,
boolean redraw)
IlvSelection.
If a selection factory is installed on the manager
(see setSelectionFactory), this
factory is responsible for creating the selection object. Otherwise,
the method makeSelection
of the class IlvGraphic is called.
ManagerSelectionChangedEvent event
by calling the method selectionChanged.
setSelected in class IlvManagerobj - The graphic object to select or deselect.select - If true the object will be selected,
and deselected otherwise.redraw - If true, the object is redrawn (or its region
is invalidated,
if we are in an initRedraws/reDrawViews session).IlvManager.isSelected(ilog.views.IlvGraphic),
IlvManager.getSelection(ilog.views.IlvPoint, ilog.views.IlvManagerView),
IlvManager.selectAll(boolean),
IlvManager.selectAll(boolean,boolean),
IlvManager.deSelectAll(boolean),
IlvManager.deSelectAll(int, boolean),
IlvManager.selectAll(IlvManagerView,boolean),
IlvManager.getSelectedObjects(),
IlvManager.getSelectedObjectsCount(),
IlvManager.getSelections(),