public class IlvInappropriateLinkException extends IlvInappropriateGraphException
The exception can be thrown, for instance, by a layout algorithm that
needs to reshape a link when the link class is not appropriate. With
an IlvGrapher
, the following link classes are not
appropriate for the layout algorithms that need to insert intermediate
points in order to give a polyline or orthogonal shape to the link:
IlvLinkImage
(the base class),IlvOneLinkImage
,IlvDoubleLinkImage
,IlvOneSplineLinkImage
,IlvDoubleSplineLinkImage
.IlvPolylineLinkImage
or IlvSplineLinkImage
can be used instead.
For layout algorithms that need to give the link a straight-line shape, the following link classes are not appropriate:
The classesIlvLinkImage
or IlvPolylineLinkImage
can be used instead.
The exception can also be thrown by a layout algorithm that needs to
move the connection point of a link but the link connector is not
appropriate for this operation. More specifically, the exception is
thrown when a link connector that is not an instance of IlvFreeLinkConnector
(or a subclass) is
used.
You can catch this exception and call the method IlvGraphLayoutUtil.EnsureAppropriateLinks(IlvInappropriateLinkException)
in order to replace the inappropriate links and/or link connectors
with new links.
IlvGraphLayout.performLayout()
,
IlvGraphLayoutUtil.EnsureAppropriateLinks(IlvInappropriateLinkException)
,
IlvGrapherAdapter.reshapeLink(java.lang.Object, ilog.views.IlvPoint, ilog.views.IlvPoint[], int, int, ilog.views.IlvPoint, boolean)
,
IlvGraphLayoutReport.EXCEPTION_DURING_LAYOUT
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
CANNOT_MOVE_CONNECTION_POINT
The type of the exception when the connection point of a link cannot
be moved.
|
static int |
CANNOT_MOVE_PINNED_CONNECTION_POINT
The type of the exception when the connection point of a link cannot
be moved because it is a pinned connection point.
|
static int |
CANNOT_RESHAPE_INTERGRAPH_LINK_TO_POLYLINE
The type of the exception when intermediate points cannot be added to
an intergraph link.
|
static int |
CANNOT_RESHAPE_INTERGRAPH_LINK_TO_STRAIGHT
The type of the exception when intermediate points cannot be removed
from an intergraph link.
|
static int |
CANNOT_RESHAPE_TO_POLYLINE
The type of the exception when intermediate points cannot be added to
a normal link.
|
static int |
CANNOT_RESHAPE_TO_STRAIGHT
The type of the exception when intermediate points cannot be removed
from a normal link.
|
Constructor and Description |
---|
IlvInappropriateLinkException(IlvGraphModel graphModel,
IlvGraphLayout layout,
int type)
Creates a new
IlvInappropriateLinkException . |
IlvInappropriateLinkException(IlvGraphModel graphModel,
IlvGraphLayout layout,
String message,
int type)
Creates a new
IlvInappropriateLinkException . |
Modifier and Type | Method and Description |
---|---|
int |
getType()
Returns the type of the exception.
|
getGraphLayout, getGraphModel, setGraphLayout
getNext, setNext
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public static final int CANNOT_RESHAPE_TO_STRAIGHT
IlvGrapher
, this type of exception means that a normal
link of type IlvOneLinkImage
or IlvDoubleLinkImage
(or subclasses) is used with a
layout that needs to remove the intermediate points. This type is
not used for intergraph links.public static final int CANNOT_RESHAPE_TO_POLYLINE
IlvGrapher
,
this type of exception means that a normal link of type IlvLinkImage
(base class only), IlvOneLinkImage
, or IlvDoubleLinkImage
(or subclasses) is used with a
layout that needs to add intermediate points. This type is not used
for intergraph links.public static final int CANNOT_RESHAPE_INTERGRAPH_LINK_TO_STRAIGHT
IlvGrapher
, this type of exception means that an
intergraph link of type IlvOneLinkImage
or IlvDoubleLinkImage
(or subclasses) is
used with a layout that needs to remove the intermediate points.public static final int CANNOT_RESHAPE_INTERGRAPH_LINK_TO_POLYLINE
IlvGrapher
, this type of exception means that an
intergraph link of type IlvLinkImage
(base class
only), IlvOneLinkImage
, or IlvDoubleLinkImage
(or subclasses) is used with a
layout that needs to add intermediate points.public static final int CANNOT_MOVE_CONNECTION_POINT
IlvGrapher
, this
type of exception means that a link connector (see IlvLinkConnector
) that is not of type IlvFreeLinkConnector
is attached to the
origin and/or destination node of a link.
To ensure backward compatibility with JViews 5.5, this type is also
set whenever the type CANNOT_MOVE_PINNED_CONNECTION_POINT
is
set.
public static final int CANNOT_MOVE_PINNED_CONNECTION_POINT
IlvGrapher
, this type of exception means that a
pin link connector (see IlvPinLinkConnector
) is attached to the
origin and/or destination node of a link but the layout cannot handle
pin link connectors properly. (Note that Hierarchical layout and the
Link layouts can handle pin link connectors and will not set this
type).public IlvInappropriateLinkException(IlvGraphModel graphModel, IlvGraphLayout layout, String message, int type)
IlvInappropriateLinkException
. You do not
need to call this constructor directly. If appropriate, the exception
is created by internal methods of JViews.graphModel
- The graph model for which the exception was raised.
Must not be null
.layout
- The layout instance that generated the exception, or
null
if the exception was raised by direct calls of
methods of IlvGraphModel
.message
- The message of the exception.type
- The type of the exception. See getType()
.public IlvInappropriateLinkException(IlvGraphModel graphModel, IlvGraphLayout layout, int type)
IlvInappropriateLinkException
. You do not
need to call this constructor directly. If appropriate, the exception
is created by internal methods of JViews.graphModel
- The graph model for which the exception was raised.
Must not be null
.layout
- The layout instance that generated the exception, or
null
if the exception was raised by direct calls of
methods of IlvGraphModel
.type
- The type of the exception. See getType()
.public final int getType()
CANNOT_RESHAPE_TO_STRAIGHT
, CANNOT_RESHAPE_TO_POLYLINE
,
CANNOT_RESHAPE_INTERGRAPH_LINK_TO_STRAIGHT
, CANNOT_RESHAPE_INTERGRAPH_LINK_TO_POLYLINE
, CANNOT_MOVE_CONNECTION_POINT
, and CANNOT_MOVE_PINNED_CONNECTION_POINT
. To check the type, you can do
the following:
if ((ex.getType() & IlvInappropriateLinkException.CANNOT_RESHAPE_TO_STRAIGHT) > 0) ...The easiest way to handle this exception is to use the utility method
IlvGraphLayoutUtil.EnsureAppropriateLinks(IlvInappropriateLinkException)
.CANNOT_RESHAPE_TO_STRAIGHT
,
CANNOT_RESHAPE_TO_POLYLINE
,
CANNOT_RESHAPE_INTERGRAPH_LINK_TO_STRAIGHT
,
CANNOT_RESHAPE_INTERGRAPH_LINK_TO_POLYLINE
,
CANNOT_MOVE_CONNECTION_POINT
,
CANNOT_MOVE_PINNED_CONNECTION_POINT
,
IlvGrapherAdapter.reshapeLink(java.lang.Object, ilog.views.IlvPoint, ilog.views.IlvPoint[], int, int, ilog.views.IlvPoint, boolean)
,
IlvGraphLayoutUtil.EnsureAppropriateLinks(IlvInappropriateLinkException)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.