public class IlvConstraintGraphic extends IlvLinkImage
Modifier and Type | Field and Description |
---|---|
static int |
BOUNDING_BOX_CONNECTION
Indicates whether the link points should be computed from the bounding boxes of the
associated activity graphics.
|
static double |
DEFAULT_HORIZONTAL_EXTREMITY_SEGMENT_LENGTH
Defines the default length of fixed horizontal segments of the link in view pixels.
|
static double |
DEFAULT_VERTICAL_EXTREMITY_SEGMENT_LENGTH
Defines the default length of fixed vertical segments of the link.
|
static int |
TIME_INTERVAL_CONNECTION
Indicates whether the link points should be computed from the time intervals of the
associated activities.
|
Constructor and Description |
---|
IlvConstraintGraphic()
Creates an
IlvConstraintGraphic . |
IlvConstraintGraphic(IlvActivityGraphic from,
IlvActivityGraphic to,
IlvConstraint constraint)
Creates an
IlvConstraintGraphic . |
Modifier and Type | Method and Description |
---|---|
boolean |
allowsPointInsertion()
Indicates whether insertion of intermediate points is allowed.
|
boolean |
allowsPointRemoval()
Indicates whether removal of intermediate points is allowed.
|
IlvGraphic |
copy()
Copies the object.
|
void |
draw(Graphics dst,
IlvTransformer t)
Overrides the
draw method so that if one of the associated nodes is not
visible then this function will not draw the link. |
double |
getArrowSize()
Returns the size of the arrow in view coordinates.
|
protected double |
getArrowSize(double lineWidth,
IlvTransformer t)
Returns the size of the arrow for the corresponding
IlvTransformer and
lineWidth . |
void |
getConnectionPoints(IlvPoint src,
IlvPoint dst,
IlvTransformer t)
Computes the origin and destination points to draw the link.
|
int |
getConnectionType()
Returns the link connection type.
|
IlvConstraint |
getConstraint()
Returns the associated
constraint of the graphic. |
int |
getEndCap()
Returns the decoration applied at the end of the polyline.
|
IlvGanttSheet |
getGanttSheet()
Returns the Gantt sheet to which the constraint graphic belongs.
|
double |
getHorizontalExtremitySegmentLength()
Returns the length of fixed horizontal segments of the link in view pixels.
|
int |
getLineJoin()
Returns the decoration applied when two segments are joined.
|
IlvPoint[] |
getLinkPoints(IlvTransformer t)
Returns the points that define the shape of the link.
|
IlvPoint |
getPointAt(int index,
IlvTransformer t)
Returns the point at a specified index.
|
int |
getPointsCardinal()
Returns the number of editable points.
|
JPopupMenu |
getPopupMenu(IlvPoint p,
IlvTransformer t,
IlvManagerView view,
IlvPopupMenuManager popupManager)
Returns the Swing pop-up menu to display when the pop-up menu is triggered while the
mouse pointer is at a specified location inside the constraint graphic object.
|
String |
getToolTipText(IlvPoint p,
IlvTransformer t)
Returns the tooltip text to display when the mouse pointer is at a specified
location inside the constraint graphic.
|
boolean |
isVisible()
Returns
true if the link is visible. |
IlvSelection |
makeSelection()
Creates a selection object for the constraint graphic.
|
void |
setArrowSize(double arrowSize)
Sets the size of the arrow in view coordinates.
|
void |
setConnectionType(int type)
Sets the link connection type.
|
void |
setConstraint(IlvConstraint constraint)
Sets the associated
constraint of the graphic. |
void |
setHorizontalExtremitySegmentLength(double length)
Sets the length of fixed horizontal segments of the link in view pixels.
|
boolean |
zoomable()
Returns
true if the object is zoomable, and false
otherwise. |
allowsPointMove, applyTransform, arrowBBox, arrowContains, boundingBox, contains, drawArrow, finalize, getConnectionReferencePoint, getForeground, getFrom, getFromBoundingBox, getFromTransformer, getLineStyle, getLineWidth, getLineWidth, getLinkConnectorConnectionPoint, getLinkPoints, getLocalTransformerOf, getMaximumLineWidth, getOpposite, getTo, getToBoundingBox, getToTransformer, getVisibleFrom, getVisibleTo, insertPoint, isOriented, isPersistent, isSpline, movePoint, pointsInBBox, removePoint, setEndCap, setForeground, setFrom, setIntermediateLinkPoints, setLineJoin, setLineStyle, setLineWidth, setLinkPoints, setMaximumLineWidth, setOriented, setTo, write
addActionListener, addNamedPropertyListener, allViewsRemoved, baseTextDirectionChanged, blinkingStateOn, boundingBox, callDraw, componentOrientationChanged, getAndAssociateObjectInteractor, getBaseTextDirection, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getComponentOrientation, getDefaultInteractor, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenuName, getProperty, getResolvedBaseTextDirection, getToolTipBaseTextDirection, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getULocale, getZOrderIndex, hasProperty, inside, intersects, invalidateBBoxCache, invalidateBidiCache, isBaseTextDirectionSensitive, isComponentOrientationSensitive, isDataFlavorSupported, isEditable, isInApplyToObject, isLocaleSensitive, isMovable, isSelectable, 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 static final double DEFAULT_HORIZONTAL_EXTREMITY_SEGMENT_LENGTH
getHorizontalExtremitySegmentLength()
,
setHorizontalExtremitySegmentLength(double)
,
Constant Field Valuespublic static final double DEFAULT_VERTICAL_EXTREMITY_SEGMENT_LENGTH
public static final int TIME_INTERVAL_CONNECTION
public static final int BOUNDING_BOX_CONNECTION
public IlvConstraintGraphic()
IlvConstraintGraphic
. A constraint graphic that is created
with this constructor can only be used to replace an existing constraint graphic
in the Gantt sheet.public IlvConstraintGraphic(IlvActivityGraphic from, IlvActivityGraphic to, IlvConstraint constraint)
IlvConstraintGraphic
.from
- The activity graphic
from which the link
starts.to
- The activity graphic
to which the link
points.constraint
- Defines the type of the link.public IlvConstraint getConstraint()
constraint
of the graphic.public void setConstraint(IlvConstraint constraint)
constraint
of the graphic.constraint
- The constraint.public IlvGanttSheet getGanttSheet()
null
if the graphic is not contained in a
sheet.public double getHorizontalExtremitySegmentLength()
setHorizontalExtremitySegmentLength(double)
public void setHorizontalExtremitySegmentLength(double length)
getHorizontalExtremitySegmentLength()
public void getConnectionPoints(IlvPoint src, IlvPoint dst, IlvTransformer t)
getConnectionPoints
in class IlvLinkImage
src
- A point to store the origin.dst
- A point to store the destination.t
- The transformer used to draw the link.IlvLinkConnector.getConnectionPoint(ilog.views.IlvLinkImage, boolean, ilog.views.IlvTransformer)
public int getPointsCardinal()
getPointsCardinal
in interface IlvPolyPointsInterface
getPointsCardinal
in class IlvLinkImage
public IlvPoint getPointAt(int index, IlvTransformer t)
index
are 0 or
1 because the object defines a polypoint of 2 points even if the method
getLinkPoints
returns more than 2 points. This is because only the
extremity points are to be edited.getPointAt
in interface IlvPolyPointsInterface
getPointAt
in class IlvLinkImage
index
- The index of the point.t
- The transformer through which the object is drawn.public IlvPoint[] getLinkPoints(IlvTransformer t)
This method calls the getConnectionPoints
member function to compute the
points. It may return 2, 4, or 6 points depending on the position of the two
connected activity graphics.
getLinkPoints
in class IlvLinkImage
public void draw(Graphics dst, IlvTransformer t)
draw
method so that if one of the associated nodes is not
visible then this function will not draw the link.draw
in class IlvLinkImage
dst
- The destination Graphics.t
- The transformation used to draw the object.IlvGraphic.callDraw(Graphics,IlvTransformer)
,
IlvGraphic.boundingBox(IlvTransformer)
,
IlvGraphic.zoomable()
,
IlvGraphic
public boolean allowsPointInsertion()
false
.allowsPointInsertion
in interface IlvPolyPointsInterface
allowsPointInsertion
in class IlvLinkImage
true
if the insertion of intermediate points is
allowed and false
otherwise.IlvLinkImage.insertPoint(int, double, double, ilog.views.IlvTransformer)
public boolean allowsPointRemoval()
false
.allowsPointRemoval
in interface IlvPolyPointsInterface
allowsPointRemoval
in class IlvLinkImage
true
if the removal of intermediate points is
allowed and false
otherwise.IlvLinkImage.removePoint(int, ilog.views.IlvTransformer)
public boolean isVisible()
true
if the link is visible. The link is considered not visible
if one of the associated nodes is not visible.isVisible
in class IlvGraphic
true
if this graphic object is visible.IlvGraphic.setVisible(boolean)
,
IlvGraphic.setSelectable(boolean)
,
IlvGraphic.setMovable(boolean)
,
IlvGraphic.setEditable(boolean)
public boolean zoomable()
true
if the object is zoomable, and false
otherwise. Constraint links are non-zoomable and this method always returns
false
.zoomable
in class IlvLinkImage
IlvGraphic.zoomable()
,
IlvLinkConnector.zoomable()
protected double getArrowSize(double lineWidth, IlvTransformer t)
IlvTransformer
and
lineWidth
. This implementation calls getArrowSize()
. If you
have set a size by calling the setArrowSize(double)
method, then that size is
returned. Otherwise, a value proportional to the horizontalExtremitySegmentLength
: horizontalExtremitySegmentLength/3
is
returned. Since this method returns a size that is not proportional to the
transformer zoom factor, the zoomable()
method returns false
.getArrowSize
in class IlvLinkImage
lineWidth
- The line width in manager coordinates used to draw the object. This
implementation ignores this parameter.t
- The transformer used to draw the object. This implementation ignores
this parameter.t
and lineWidth
.IlvLinkImage.getLineWidth()
public double getArrowSize()
setArrowSize(double)
method, then that size is returned. Otherwise, this
implementation returns a value proportional to the horizontalExtremitySegmentLength
:
horizontalExtremitySegmentLength/3
.getArrowSize(double,IlvTransformer)
public void setArrowSize(double arrowSize)
horizontalExtremitySegmentLength
: horizontalExtremitySegmentLength/3
.arrowSize
- The arrow size in view coordinates.getArrowSize()
public int getConnectionType()
TIME_INTERVAL_CONNECTION
.TIME_INTERVAL_CONNECTION
if the link points are computed from the
time intervals of the associated activities or BOUNDING_BOX_CONNECTION
if the link points are computed from the bounding
boxes of the associated activity graphics.setConnectionType(int)
public void setConnectionType(int type)
type
- The connection type. The value must be either TIME_INTERVAL_CONNECTION
, to indicate that the link points are computed
from the time intervals of the associated activities, or BOUNDING_BOX_CONNECTION
, to indicate that the link points are computed
from the bounding boxes of the associated activity graphics.getConnectionType()
public int getEndCap()
getEndCap
in class IlvLinkImage
IlvStroke
,
IlvLinkImage.setEndCap(int)
public int getLineJoin()
getLineJoin
in class IlvLinkImage
IlvStroke
,
IlvLinkImage.setLineJoin(int)
public IlvSelection makeSelection()
IlvLinkImageSelection
.makeSelection
in class IlvLinkImage
IlvLinkImageSelection
public String getToolTipText(IlvPoint p, IlvTransformer t)
IlvGraphic.setToolTipText(String)
method, then that string is returned.
Otherwise, this method returns a default HTML string that contains the type of the
constraint, the name of the constraint's "from" activity, and the name of the
constraint's "to" activity on separate lines.getToolTipText
in class IlvGraphic
p
- The location of the mouse (in view coordinates).t
- The transformer of the manager view in which the tooltip is about to be
displayed.p
for transformation
t
, or null
if no tooltip should be displayed.IlvGraphic
,
IlvGraphic.getToolTipText()
,
IlvGraphic.setToolTipText(String)
public JPopupMenu getPopupMenu(IlvPoint p, IlvTransformer t, IlvManagerView view, IlvPopupMenuManager popupManager)
This method can return null
to turn off the pop-up menu for the
constraint graphic object.
Note that you must enable the pop-up menu mechanism for the manager view by calling
the method IlvGanttSheet.setPopupMenusEnabled(boolean)
.
getPopupMenu
in class IlvGraphic
p
- The location of the mouse (in view coordinates).t
- The transformer that converts the coordinate system of this
object (the manager coordinates) into the coordinate system of
the manager view in which the tooltip is about to be displayed
(the view coordinates).view
- The manager view that triggered the pop-up menu.popupManager
- The pop-up menu manager.null
.IlvGraphic
,
IlvPopupMenuManager.registerView(ilog.views.IlvManagerView)
,
IlvGraphic.getPopupMenu()
public IlvGraphic copy()
IlvConstraintGraphic
cannot be copied
with the copy
method. This method returns null
.copy
in class IlvLinkImage
IlvGraphic
instance.IlvGraphic
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.