public class IlvHyperEdge extends IlvGraphic
IlvHyperEdge
is the base class of the graphic objects
that represent the connection of multiple nodes in an
IlvHyperGrapher
.
A hyperedge is similar to IlvLinkImage
. A link image
has only a single source node and a single target node, while
a hyperedge has multiple source nodes and multiple target nodes.
Typically, the target nodes are indicated by arrowheads drawn at the
end of the hyperedge branches that point to the target nodes.
The source nodes are also called origin nodes (see getFrom()
).
The target nodes are also called destination nodes (see getTo()
).
A hyperedge can have the same node multiple times as source node
or as target node. To distinguish the different occurrences, the class
IlvHyperEdgeEnd
is used, which represents the unique ends of
a hyperedge at a node.
Different to IlvLinkImage
, it is possible to add or remove
source nodes and target nodes while the hyperedge is inside a hypergrapher.
See addFrom(ilog.views.IlvGraphic)
and addTo(ilog.views.IlvGraphic)
.
When the hyperedge is removed from the hypergrapher, the hyperedge remembers
the old end nodes. When a node is removed from the hypergrapher, the
hyperedge looses the connection to the node but remains in the hypergrapher.
If the hyperedge has no end nodes at all anymore, the hyperedge is not
drawn and its location is at the origin of the coordinate system. This is
usually not a useful situation. Therefore it is recommended that you remove
the hyperedge when removing its last end node.
This class draws a star like shape of straight lines between the connection
points on the origin and destination nodes. Subclasses can be used for
more complex graphical representations.
By default, the connection points are in the center of the nodes.
They can be explicitly set by moveConnectionPoint(ilog.views.hypergraph.IlvHyperEdgeEnd, double, double, ilog.views.IlvTransformer)
.
Subclasses of the class IlvHyperEdgeConnector
can be used to
restrict the connection points, e.g., to use fixed pin points.
IlvHyperGrapher
,
IlvHyperEdgeEnd
,
Serialized FormConstructor and Description |
---|
IlvHyperEdge()
Creates a new hyperedge.
|
IlvHyperEdge(IlvGraphicVector from,
IlvGraphicVector to)
Creates a new hyperedge.
|
IlvHyperEdge(IlvHyperEdge source)
Creates an
IlvHyperEdge by copying an existing one. |
IlvHyperEdge(IlvInputStream stream)
Reads the object from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
protected void |
actOnAdjustmentEnd()
Reacts on adjustment end.
|
protected Paint |
adaptPaint(Shape shape,
Paint paint)
Returns a new
Paint object that will fit the shape parameter
according to the initial paint parameter. |
IlvHyperEdgeEnd |
addFrom(IlvGraphic node)
Adds an origin node to the edge.
|
IlvHyperEdgeEnd |
addTo(IlvGraphic node)
Adds a destination node to the edge.
|
protected void |
afterAddEnd(IlvHyperEdgeEnd end,
boolean fromSide)
Called after the hyperedge end point is added to the edge.
|
void |
afterDo(IlvOrderedCompoundEdit undo)
This method must be called if undo support is needed for a specific
operation.
|
void |
applyTransform(IlvTransformer t)
Applies a transformation to the shape of the edge.
|
protected IlvRect |
arrowBBox(IlvPoint from,
IlvPoint to,
IlvTransformer t)
Computes the bounding rectangle of the arrow when the edge is oriented.
|
IlvOrderedCompoundEdit |
beforeDo(String undoPresentationName)
This method must be called if undo support is needed for a specific
operation.
|
protected void |
beforeRemoveEnd(IlvHyperEdgeEnd end,
boolean fromSide)
Called before the hyperedge end point is removed from the edge.
|
IlvRect |
boundingBox(IlvTransformer t)
Returns the bounding rectangle of the object.
|
protected IlvRect |
calcBoundingBox(IlvTransformer t)
Calculates the bounding rectangle of the object.
|
protected void |
clearBoundingBoxCache()
Clears the bounding box cache.
|
boolean |
contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
Tests if a point lies within the outline of the edge.
|
IlvGraphic |
copy()
Copies the object.
|
HashMap<IlvHyperEdgeEnd,IlvHyperEdgeEnd> |
copyShapeFrom(IlvHyperEdge source)
Copies all the ends from the input source edge.
|
protected IlvHyperEdgeEnd |
createEnd(IlvGraphic node,
boolean origin)
Creates a hyperedge end point.
|
boolean |
deleteSelection(boolean redraw)
Deletes the selection in the inner of the hyperedge.
|
void |
draw(Graphics dst,
IlvTransformer t)
Draws the hyperedge.
|
protected void |
drawArrow(Graphics dst,
IlvPoint from,
IlvPoint to,
IlvTransformer t)
Draws the arrow of the hyperedge if the edge is oriented.
|
protected void |
finalize()
Does the necessary operation when the
object is garbage collected.
|
protected Paint |
getAdaptedStrokePaint(IlvTransformer t)
Returns the stroke paint adapted to the input transformer.
|
protected double |
getArrowSize(double lineWidth,
IlvTransformer t)
Returns the size of the arrow for the corresponding
IlvTransformer and lineWidth . |
int |
getBoundingBoxCacheSize()
Returns the size of the bounding box cache of this hyperedge.
|
IlvPoint |
getCenter(IlvTransformer t)
Returns the bary center point of the hyperedge.
|
IlvHyperEdgeEnd |
getClosestEnd(double x,
double y,
IlvTransformer t)
Returns the end closest to the input point.
|
IlvRect |
getEndNodeBoundingBox(IlvGraphic node,
IlvTransformer t)
Returns the bounding box of the input node which is supposed to
be an end node of this hyperedge.
|
IlvGraphicEnumeration |
getFrom()
Returns the origin nodes.
|
IlvGraphic[] |
getFromArray()
Returns the origin nodes in an array.
|
IlvPoint[] |
getFromConnectionPoints(IlvTransformer t)
Returns all origin connection points of the hyperedge.
|
int |
getFromCount()
Returns the number of origin nodes.
|
Iterator<IlvHyperEdgeEnd> |
getFromEnds()
Returns the origin ends.
|
IlvHyperEdgeEnd[] |
getFromEndsArray()
Returns all origin ends in an array.
|
IlvHyperEdgeEnd[] |
getFromEndsArray(IlvGraphic node)
Returns all origin ends incident to the input node.
|
int |
getFromEndsCount()
Returns the number of origin ends.
|
float[] |
getLineStyle()
Returns the array representing the lengths of the dash segments.
|
double |
getLineWidth()
Returns the line width of the object.
|
double |
getLineWidth(IlvTransformer t)
Returns the line width that is
actually displayed when the object is drawn
with the specified transformer.
|
double |
getMaximumLineWidth()
Returns the maximum line width of the edge.
|
Paint |
getStrokePaint()
Returns the stroke paint of the object.
|
IlvGraphicEnumeration |
getTo()
Returns the destination nodes.
|
IlvGraphic[] |
getToArray()
Returns the destination nodes in an array.
|
IlvPoint[] |
getToConnectionPoints(IlvTransformer t)
Returns all destination connection points of the hyperedge.
|
int |
getToCount()
Returns the number of destination nodes.
|
Iterator<IlvHyperEdgeEnd> |
getToEnds()
Returns the destination ends.
|
IlvHyperEdgeEnd[] |
getToEndsArray()
Returns all destination ends in an array.
|
IlvHyperEdgeEnd[] |
getToEndsArray(IlvGraphic node)
Returns all destination ends incident to the input node.
|
int |
getToEndsCount()
Returns the number of destination ends.
|
IlvPoint[] |
getUnclippedSegmentPoints(IlvHyperEdgeEnd end,
IlvTransformer t)
Returns the end points of the segment that ends at the input hyperedge
end.
|
IlvGraphic |
getVisibleEndNode(IlvGraphic node)
Returns the graphic object visible on the screen if the
edge is an intergraph hyperedge and the input node is collapsed
in a subgrapher.
|
boolean |
isFromEnd(IlvHyperEdgeEnd end)
Returns whether the input hyperedge end belongs to the origin ends
of this hyperedge.
|
boolean |
isInterGraphHyperEdge()
Returns whether the hyperedge is an intergraph hyperedge.
|
boolean |
isPaintAbsolute()
Returns
true if the stroke paint is not adapted to the
current shape. |
boolean |
isToEnd(IlvHyperEdgeEnd end)
Returns whether the input hyperedge end belongs to the destination ends
of this hyperedge.
|
boolean |
isVisibleFrom(IlvGraphic node)
Returns true if the input node is a visible origin node of this
hyperedge.
|
boolean |
isVisibleTo(IlvGraphic node)
Returns true if the input node is a visible destination node of this
hyperedge.
|
IlvSelection |
makeSelection()
Creates a selection object for this object.
|
void |
moveConnectionPoint(IlvHyperEdgeEnd end,
double x,
double y,
IlvTransformer t)
Move the connection point of the hyperedge at the end point.
|
protected void |
readEnds(IlvInputStream stream)
Reads the information about the hyperedge ends.
|
void |
removeFrom(IlvGraphic node)
Removes an origin node from the edge.
|
void |
removeFrom(IlvHyperEdgeEnd end)
Removes an origin end from the edge.
|
void |
removeTo(IlvGraphic node)
Removes a destination node from the edge.
|
void |
removeTo(IlvHyperEdgeEnd end)
Removes an destination end from the edge.
|
void |
setBoundingBoxCacheSize(int size)
Sets the size of the bounding box cache of this hyperedge.
|
void |
setForeground(Color c)
Changes the color of the object.
|
void |
setFrom(IlvGraphicVector from)
Changes the origins of the edge.
|
void |
setLineStyle(float[] lineStyle)
Changes the array representing the lengths of the dash segments.
|
void |
setLineWidth(double lineWidth)
Changes the line width of the object.
|
void |
setMaximumLineWidth(double maximumLineWidth)
Changes the maximum line width of the edge.
|
void |
setPaintAbsolute(boolean set)
Sets whether the stroke paint is not adapted to the current shape.
|
void |
setStrokePaint(Paint p)
Changes the stroke paint of the object.
|
void |
setTo(IlvGraphicVector to)
Changes the destinations of the edge.
|
protected void |
shortenForArrowDraw(IlvPoint[] pts,
double arrowSize)
Shorten the line between
pts[0] and pts[1]
by the size of the arrow. |
void |
write(IlvOutputStream stream)
Writes the object to an
IlvOutputStream . |
protected void |
writeEnds(IlvOutputStream stream)
Writes the information about the hyperedge ends.
|
boolean |
zoomable()
Returns
true if the object is zoomable, and
false otherwise. |
addActionListener, addNamedPropertyListener, allViewsRemoved, baseTextDirectionChanged, blinkingStateOn, boundingBox, callDraw, componentOrientationChanged, getAndAssociateObjectInteractor, getBaseTextDirection, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getComponentOrientation, getDefaultInteractor, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getResolvedBaseTextDirection, getToolTipBaseTextDirection, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getULocale, getZOrderIndex, hasProperty, inside, intersects, invalidateBBoxCache, invalidateBidiCache, isBaseTextDirectionSensitive, isComponentOrientationSensitive, isDataFlavorSupported, isEditable, isInApplyToObject, isLocaleSensitive, isMovable, isPersistent, isSelectable, isVisible, localeChanged, move, move, moveResize, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setBaseTextDirection, setBaseTextDirectionDuringConstruction, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemoved
public IlvHyperEdge()
public IlvHyperEdge(IlvGraphicVector from, IlvGraphicVector to)
from
- The origin nodes.to
- The destination nodes.public IlvHyperEdge(IlvHyperEdge source)
IlvHyperEdge
by copying an existing one.source
- The origin of the copy.public IlvHyperEdge(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if the format is not correct.protected void readEnds(IlvInputStream stream) throws IlvReadFileException
stream
- The input stream.IlvReadFileException
- if the format is not correct.public void setBoundingBoxCacheSize(int size)
boundingBox(IlvTransformer)
.
The optimal size of the bounding box cache is one more than the number
of views that display the edge. If the bounding box cache is smaller
or larger, it is no harm except that the performance decreases or
some memory is wasted.
The default size is 3, which is suitable for the most typical application that displays this hyperedge in one main view and in one overview.
getBoundingBoxCacheSize()
public int getBoundingBoxCacheSize()
setBoundingBoxCacheSize(int)
public IlvGraphic copy()
IlvHyperEdge
cannot be copied with the
copy
method.
This method returns null
.copy
in class IlvGraphic
IlvGraphic
instance.IlvGraphic
public final IlvGraphicEnumeration getFrom()
getTo()
public final IlvGraphicEnumeration getTo()
getFrom()
public final IlvGraphic[] getFromArray()
getToArray()
public final IlvGraphic[] getToArray()
getFromArray()
public final int getFromCount()
getFromArray()
.
This may be different from the number of origin ends obtained by
getFromEndsCount()
, if the hyperedge ends multiple times at
some nodes.getToCount()
,
getFromEndsCount()
public final int getToCount()
getToArray()
.
This may be different from the number of destination ends obtained by
getToEndsCount()
, if the hyperedge ends multiple times at
some nodes.getFromCount()
,
getToEndsCount()
public final Iterator<IlvHyperEdgeEnd> getFromEnds()
The returned iterator does not support the Iterator.remove()
operation.
Use removeFrom(ilog.views.IlvGraphic)
to remove a hyped edge end.
IlvHyperEdgeEnd
.public final Iterator<IlvHyperEdgeEnd> getToEnds()
The returned iterator does not support the Iterator.remove()
operation.
Use removeTo(ilog.views.IlvGraphic)
to remove a hyped edge end.
IlvHyperEdgeEnd
.public IlvHyperEdgeEnd[] getFromEndsArray()
getToEndsArray()
public IlvHyperEdgeEnd[] getToEndsArray()
getFromEndsArray()
public IlvHyperEdgeEnd[] getFromEndsArray(IlvGraphic node)
getToEndsArray(IlvGraphic)
public IlvHyperEdgeEnd[] getToEndsArray(IlvGraphic node)
getFromEndsArray(IlvGraphic)
public final int getFromEndsCount()
getFromEndsArray()
.getFromCount()
,
getToEndsCount()
public final int getToEndsCount()
getToEndsArray()
.getToCount()
,
getFromEndsCount()
public final boolean isFromEnd(IlvHyperEdgeEnd end)
public final boolean isToEnd(IlvHyperEdgeEnd end)
public HashMap<IlvHyperEdgeEnd,IlvHyperEdgeEnd> copyShapeFrom(IlvHyperEdge source)
If both edges are currently in different graphers,
then this edge must be removed from its grapher before calling this
method. Otherwise, if this edge can remain inside its grapher, this
must be done inside an applyToObject session of the edge
(see IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
).
source
- The source hyperedgepublic void setFrom(IlvGraphicVector from)
If the edge is inside a grapher, this must be done inside an
applyToObject session (see IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
).
If the edge is inside a grapher, all nodes of the input vector must also
be inside a grapher.
However, you should not use this method while iterating over the
hyperedge of the grapher via IlvHyperGrapher.getHyperEdges()
,
IlvHyperGrapher.getInterGraphHyperEdges()
, or
IlvHyperGrapher.getExternalInterGraphHyperEdges()
.
setTo(ilog.views.IlvGraphicVector)
public void setTo(IlvGraphicVector to)
If the edge is inside a grapher, this must be done inside an
applyToObject session (see IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
).
If the edge is inside a grapher, all nodes of the input vector must also
be inside a grapher.
However, you should not use this method while iterating over the
hyperedge of the grapher via IlvHyperGrapher.getHyperEdges()
,
IlvHyperGrapher.getInterGraphHyperEdges()
, or
IlvHyperGrapher.getExternalInterGraphHyperEdges()
.
setFrom(ilog.views.IlvGraphicVector)
public IlvHyperEdgeEnd addFrom(IlvGraphic node)
If the edge is inside a grapher, this must be done inside an
applyToObject session (see IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
).
If the edge is inside a grapher, the node must also be inside a grapher.
However, you should not use this method while iterating over the
hyperedge of the grapher via IlvHyperGrapher.getHyperEdges()
,
IlvHyperGrapher.getInterGraphHyperEdges()
, or
IlvHyperGrapher.getExternalInterGraphHyperEdges()
.
node
- The origin nodeaddTo(ilog.views.IlvGraphic)
,
removeFrom(ilog.views.IlvGraphic)
public IlvHyperEdgeEnd addTo(IlvGraphic node)
If the edge is inside a grapher, this must be done inside an
applyToObject session (see IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
).
If the edge is inside a grapher, the node must also be inside a grapher.
However, you should not use this method while iterating over the
hyperedge of the grapher via IlvHyperGrapher.getHyperEdges()
,
IlvHyperGrapher.getInterGraphHyperEdges()
, or
IlvHyperGrapher.getExternalInterGraphHyperEdges()
.
node
- The destination nodeaddFrom(ilog.views.IlvGraphic)
,
removeTo(ilog.views.IlvGraphic)
public final void removeFrom(IlvGraphic node)
If the edge is inside a grapher, this must be done inside an
applyToObject session (see IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
).
However, you should not use this method while iterating over the
hyperedge of the grapher via IlvHyperGrapher.getHyperEdges()
,
IlvHyperGrapher.getInterGraphHyperEdges()
, or
IlvHyperGrapher.getExternalInterGraphHyperEdges()
.
Furthermore you should not use this method while iterating over
the origin nodes of the edge via getFrom()
or getFromEnds()
.
However it is safe to iterate over the origin node array obtained
by getFromArray()
when using this method.
public final void removeTo(IlvGraphic node)
If the edge is inside a grapher, this must be done inside an
applyToObject session (see IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
).
However, you should not use this method while iterating over the
hyperedge of the grapher via IlvHyperGrapher.getHyperEdges()
,
IlvHyperGrapher.getInterGraphHyperEdges()
, or
IlvHyperGrapher.getExternalInterGraphHyperEdges()
.
Furthermore, you should not use this method while iterating over the
destination nodes of the edge via getTo()
or getToEnds()
.
However it is safe to iterate over the destination node array obtained
by getToArray()
when using this method.
public final void removeFrom(IlvHyperEdgeEnd end)
If the edge is inside a grapher, this must be done inside an
applyToObject session (see IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
).
However, you should not use this method while iterating over the
hyperedge of the grapher via IlvHyperGrapher.getHyperEdges()
,
IlvHyperGrapher.getInterGraphHyperEdges()
, or
IlvHyperGrapher.getExternalInterGraphHyperEdges()
.
Furthermore you should not use this method while iterating over
the origin nodes of the edge via getFrom()
or getFromEnds()
.
However it is safe to iterate over the origin end array obtained
by getFromEndsArray()
when using this method.
public final void removeTo(IlvHyperEdgeEnd end)
If the edge is inside a grapher, this must be done inside an
applyToObject session (see IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
).
However, you should not use this method while iterating over the
hyperedge of the grapher via IlvHyperGrapher.getHyperEdges()
,
IlvHyperGrapher.getInterGraphHyperEdges()
, or
IlvHyperGrapher.getExternalInterGraphHyperEdges()
.
Furthermore you should not use this method while iterating over
destination nodes of the edge via getTo()
or getToEnds()
.
However it is safe to iterate over the destination end array obtained
by getToEndsArray()
when using this method.
protected IlvHyperEdgeEnd createEnd(IlvGraphic node, boolean origin)
IlvDefaultHyperEdgeEnd
.
This method can be overridden if a different type is needed.node
- The end node that is connected to the hyperedge by the new
end point.origin
- Whether the new end will be an origin end point
or a destination end point.protected void afterAddEnd(IlvHyperEdgeEnd end, boolean fromSide)
end
- The hyperedge end.fromSide
- Whether the hyperedge end is origin or destination.protected void beforeRemoveEnd(IlvHyperEdgeEnd end, boolean fromSide)
end
- The hyperedge end.fromSide
- Whether the hyperedge end is origin or destination.public final boolean isInterGraphHyperEdge()
This method returns a meaningful result if this hyperedge was already added to a hypergrapher. Otherwise, this method works only if all end nodes of the edge are already added to their grapher. If a new end node is added or removed later, or an end node is inserted into a different grapher, it may happen that a regular edge becomes an intergraph edge or vice versa.
public final IlvPoint[] getFromConnectionPoints(IlvTransformer t)
t
- The transformer that is used to draw the edge.public final IlvPoint[] getToConnectionPoints(IlvTransformer t)
t
- The transformer that is used to draw the edge.public void moveConnectionPoint(IlvHyperEdgeEnd end, double x, double y, IlvTransformer t)
IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
).end
- The end of the hyperedge.x
- The new x coordinate (in view coordinate system).y
- The new y coordinate (in view coordinate system).t
- The transformer that is used to draw the hyperedge.public IlvHyperEdgeEnd getClosestEnd(double x, double y, IlvTransformer t)
x
- The x coordinate.y
- The y coordinate.t
- The transformer to draw the edge.null
if there are no
ends.public boolean deleteSelection(boolean redraw)
true
if successful, and false
if there
was no inner selection to be deleted.public IlvPoint getCenter(IlvTransformer t)
getCenter
in class IlvGraphic
t
- The transformer that is used to draw the edge.IlvGraphic
public final IlvRect getEndNodeBoundingBox(IlvGraphic node, IlvTransformer t)
public final IlvGraphic getVisibleEndNode(IlvGraphic node)
node
- An origin or destination node of the edge.getEndNodeBoundingBox(ilog.views.IlvGraphic, ilog.views.IlvTransformer)
,
getFrom()
,
getTo()
,
isVisibleFrom(ilog.views.IlvGraphic)
,
isVisibleTo(ilog.views.IlvGraphic)
public boolean isVisibleFrom(IlvGraphic node)
getVisibleEndNode(originNode) == node
.
If the edge is not an intergraph hyperedge, each origin node of the hyperedge is a "visible from node". If the edge is an intergraph hyperedge, the topmost collapsed graphers that contain origin nodes of the hyperedge but do not contain the entire hyperedge are "visible from nodes".
node
- An node to be tested.getVisibleEndNode(ilog.views.IlvGraphic)
public boolean isVisibleTo(IlvGraphic node)
getVisibleEndNode(destinationNode) == node
.
If the edge is not an intergraph hyperedge, each destination node of the hyperedge is a "visible to node". If the edge is an intergraph hyperedge, the topmost collapsed graphers that contain destination nodes of the hyperedge but do not contain the entire hyperedge are "visible to nodes".
node
- An node to be tested.getVisibleEndNode(ilog.views.IlvGraphic)
protected void drawArrow(Graphics dst, IlvPoint from, IlvPoint to, IlvTransformer t)
from
and to
. The head of
the arrow is on point to
.
Note that the points are already transformed by the transformer.protected double getArrowSize(double lineWidth, IlvTransformer t)
IlvTransformer
and lineWidth
.
By redefining this method the subclass can change the size of the arrow
which by default is proportional to the edge line width and the transformer
zoom factor.
If this method returns a size that is not anymore proportional to the
transformer zoom factor, this may change the zoomability of this object
and the zoomable()
method may also have to return something
different.lineWidth
- the actual line width used to drawn the object in
manager coordinates.t
- the transformer used to draw the object.getLineWidth()
protected IlvRect arrowBBox(IlvPoint from, IlvPoint to, IlvTransformer t)
from
and to
. The head of
the arrow is on point to
.
Note that the points are already transformed by the transformer.public void draw(Graphics dst, IlvTransformer t)
draw
in class IlvGraphic
dst
- The destination Graphics.t
- The transformation used to draw the object.IlvGraphic.callDraw(Graphics,IlvTransformer)
,
IlvGraphic.boundingBox(IlvTransformer)
,
IlvGraphic.zoomable()
,
IlvGraphic
protected void shortenForArrowDraw(IlvPoint[] pts, double arrowSize)
pts[0]
and pts[1]
by the size of the arrow.public IlvPoint[] getUnclippedSegmentPoints(IlvHyperEdgeEnd end, IlvTransformer t)
IlvHyperEdgeClippingConnector
to calculate the clipping point.end
- The hyperedge end.t
- The transformer used to draw the hyperedge.public IlvRect boundingBox(IlvTransformer t)
calcBoundingBox(ilog.views.IlvTransformer)
if necessary.boundingBox
in class IlvGraphic
t
- The transformer used to draw the object.IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer)
,
IlvGraphic.zoomable()
,
IlvGraphic
protected IlvRect calcBoundingBox(IlvTransformer t)
boundingBox(ilog.views.IlvTransformer)
).t
- The transformer used to draw the object.protected void clearBoundingBoxCache()
boundingBox(ilog.views.IlvTransformer)
.public void applyTransform(IlvTransformer t)
applyTransform
in class IlvGraphic
t
- The transformation to be applied.IlvGraphic
public boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
contains
in class IlvGraphic
p
- The point to be tested.tp
- The point p
transformed by the transformer
t
.t
- The transformation that was applied to the object when it
was drawn.true
if the point lies inside this graphic object.IlvGraphic
public boolean zoomable()
true
if the object is zoomable, and
false
otherwise.
Note that the edge is zoomable if the origin nodes, the destination nodes,
and the edge connectors eventually used to control its connection
points are zoomable.zoomable
in class IlvGraphic
IlvGraphic.zoomable()
,
IlvHyperEdgeConnector.zoomable()
public void setForeground(Color c)
setForeground
in class IlvGraphic
c
- The new color.setStrokePaint(java.awt.Paint)
public void setStrokePaint(Paint p)
p
- The new paint.getStrokePaint()
public Paint getStrokePaint()
setStrokePaint(java.awt.Paint)
protected Paint getAdaptedStrokePaint(IlvTransformer t)
t
- The transformer used to draw the object.protected Paint adaptPaint(Shape shape, Paint paint)
Paint
object that will fit the shape parameter
according to the initial paint parameter.
This method is called only if isPaintAbsolute()
returns
false.
By default, it deals with GradientPaint
and
TexturePaint
instances to adapt them correctly because they
do not automatically fit the shape of the object on which they are drawn.
You can override this method to manage your own Paint
subclasses if they do not take the shape of the object into account. You
will generally call the superclass method for GradientPaint
and TexturePaint
instances.
Other Paint
objects such as
ilog.views.java2d.IlvLinearGradient
automatically take into
account the shape of the object and thus are not modified by this method.shape
- The shape parameter that the returned Paint
should fit.paint
- The initial Paint
object.isPaintAbsolute()
public boolean isPaintAbsolute()
true
if the stroke paint is not adapted to the
current shape. This is only important if the paint is a
TexturePaint
or GradientPaint
that is
defined in global coordinates.
If false
, the TexturePaint
or
GradientPaint
will be adapted to the bounding rectangle
of the object. The default value is false
.
The parameter does not affect automatically adjusted Paint
such as ilog.views.java2d.IlvLinearGradientPaint
.public void setPaintAbsolute(boolean set)
false
, the TexturePaint
or
GradientPaint
will be adapted to the bounding rectangle
of the object.public double getLineWidth()
setLineWidth(double)
public double getLineWidth(IlvTransformer t)
t
- The transformer used to draw the object.setLineWidth(double)
public void setLineWidth(double lineWidth)
IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
).lineWidth
- The new line width.getLineWidth()
public double getMaximumLineWidth()
setMaximumLineWidth(double)
public void setMaximumLineWidth(double maximumLineWidth)
IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
).maximumLineWidth
- The maximum line width, or 0 to indicate no limit.getMaximumLineWidth()
public float[] getLineStyle()
setLineStyle(float[])
public void setLineStyle(float[] lineStyle)
IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
).lineStyle
- The new line style.getLineStyle()
public IlvSelection makeSelection()
IlvHyperEdgeSelection
.makeSelection
in class IlvGraphic
IlvHyperEdgeSelection
protected void actOnAdjustmentEnd()
public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.
You should not
call this method directly; instead, you should use the write
methods of the manager.write
in interface IlvPersistentObject
write
in class IlvGraphic
stream
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.protected void writeEnds(IlvOutputStream stream) throws IOException
stream
- The output stream.IOException
protected void finalize() throws Throwable
public IlvOrderedCompoundEdit beforeDo(String undoPresentationName)
The following example illustrates the typical use case:
IlvOrderedCompoundEdit edit = hyperedge.beforeDo("Hyperedge Edition"); ... do any changes on the hyperedge ... hyperedge.afterDo(edit); // now add the edit to the undo manager so that the user can request // undoing the operation undoManager.addEdit(edit);
public void afterDo(IlvOrderedCompoundEdit undo)
undo
- The undoable edit returned by beforeDo(java.lang.String)
.beforeDo(java.lang.String)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.