com.swfm.mica.core
Class MiConnection
java.lang.Object
com.swfm.mica.core.MiPart
com.swfm.mica.core.MiConnection
- All Implemented Interfaces:
- MiiActionHandler, MiiActionTypes, MiiAttributeTypes, MiiDragAndDropParticipant, MiiEventTypes, MiiNames, MiiPropertyTypes, MiiTypes
- Direct Known Subclasses:
- MiPlaceHolderConnection
- public class MiConnection
- extends MiPart
- implements MiiActionHandler
This class represents any and all connections in Mica. Connections are
usually represented by a line (or lines), possibly connected at one or
both ends to another graphics part. This connection will automatically
update itself when any part it is connected to moves, changes size, or
is deleted.
The ends of a connection connect (source or destination) to a MiPart
and a particular connection point of that MiPart. Some connection points
are simple locations (such as Mi_CENTER_LOCATION, which is the default)
and some are special locations managed by the MiConnectionPointManager
of the MiPart.
- Version:
- %I% %G%
- Author:
- Michael L. Davis
|
Constructor Summary |
MiConnection()
Constructs a new MiConnection of type: null. |
MiConnection(MiPart src,
int srcConnPt,
MiPart dest,
int destConnPt)
Constructs a new MiConnection of type: null between the
given source and destination parts at the given connection
points. |
MiConnection(MiPart src,
MiPart dest)
Constructs a new MiConnection of type: null between the
given source and destination part center points. |
|
Method Summary |
void |
appendPoint(double x,
double y)
Append another point to the points that define the
shape of this MiPart. |
void |
copy(MiPart obj)
Copies the given MiPart. |
void |
deleteSelf()
Removes this MiPart from all of it's containers, parts
and connections after doing the same to all of this
MiPart's parts. |
boolean |
getAllowMultipleConnectionsBetweenSameNodesAndConnPts()
|
boolean |
getAllowSameSourceAndDestination()
|
boolean |
getAllowSameSourceAndDestinationPosition()
|
MiBounds |
getBounds(MiBounds b)
Gets the outer bounds of this MiPart. |
boolean |
getConnectionsMustBeConnectedAtBothEnds()
|
MiPart |
getDestination()
Gets the destination of this connection. |
int |
getDestinationConnPt()
Gets the location within the destination to connect to. |
MiBounds |
getDrawBounds(MiBounds b)
Get the draw bounds of this MiPart. |
boolean |
getEndPointsMayBeInDifferentEditors()
Gets whether that the source and destination parts may
be in different editors (with different transforms). |
MiPart |
getGraphics()
Gets the part that is to represent the graphics of this
connection (the default is MiLine). |
boolean |
getMaintainOrthogonality()
Gets whether the points in this shape should remain
in their horizontal and vertical positionings. |
boolean |
getMoveAllPointsWhenConnectedToJustOneMovingNode()
|
int |
getNumberOfPoints()
Gets the number of points that define the shape of
this MiPart. |
MiPart |
getOther(MiPart one)
Gets the end point at the otehr side from the given end
point (i.e. |
void |
getPoint(int pointNum,
MiPoint point)
Gets the location of the point with the given number. |
MiPropertyDescriptions |
getPropertyDescriptions()
Gets the descriptions of all of the properties. |
java.lang.String |
getPropertyValue(java.lang.String name)
Gets the textual value of the property with the given
name. |
MiPart |
getShadowShape()
Gets the shape of any shadow. |
MiPart |
getSource()
Gets the source of this connection. |
int |
getSourceConnPt()
Gets the location within the source to connect to. |
boolean |
getTruncateLineAtEndPointPartBoundries()
Gets whether that the graphics depicting this connection
(typically a MiLine) should be truncated at the boundries
of the soruce and destination parts. |
java.lang.String |
getType()
Gets the type of this connection. |
void |
insertPoint(double x,
double y,
int index)
Insert another point to the points that define the
shape of this MiPart. |
boolean |
isTranslatable()
|
boolean |
isType(java.lang.String t)
Gets whether this connection is of the given type. |
boolean |
isValidConnectionDestination(MiConnectionOperation connectOp)
Gets whether this connection is a valid destination of the
given connection. |
boolean |
isValidConnectionSource(MiConnectionOperation connectOp)
Gets whether this connection is a valid source of the
given connection. |
MiiManipulator |
makeManipulator()
Makes a manipulator for this MiPart. |
void |
nodeGeometryChanged(MiPart node)
Called by the end point MiParts when they have moved
or been resized so that this connection can reposition
iself if necessary. |
boolean |
pick(MiBounds area)
Gets whether the given area intersects the bounds of
this MiPart. |
boolean |
processAction(MiiAction action)
Processes the given action. |
void |
reCalcBounds(MiBounds b)
Realculates the outer bounds of this MiPart. |
void |
refreshEndPoints()
Updates the points(s) of this connection's graphics. |
void |
removeConnectionTo(MiPart obj)
|
void |
removePoint(int pointNum)
Remove the point with the given number. |
void |
removeSelf()
Removes this MiPart from all of it's containers and
detaches this MiPart from all of it's connections, who
are also detached from their endpoints and from their
containers. |
void |
render(MiRenderer renderer)
Draws this connection. |
void |
replaceSelf(MiPart other)
Replaces this MiPart with the given MiPart. |
void |
setAllowMultipleConnectionsBetweenSameNodesAndConnPts(boolean flag)
Allows connections duplicating others, ignore differences in paths
Responsibility of manipulators to check this and enforce this
True by default |
void |
setAllowSameSourceAndDestination(boolean flag)
|
void |
setAllowSameSourceAndDestinationPosition(boolean flag)
Allows zero length connections and 'closed loop' connections. |
void |
setConnectionPointManager(MiConnectionPointManager m)
Sets the MiConnectionPointManager of this MiPart. |
void |
setConnectionsMustBeConnectedAtBothEnds(boolean flag)
|
void |
setDestination(MiPart dest)
Sets the part that this connection is going to. |
void |
setDestinationConnPt(int pt)
Sets the location within the destination to connect to. |
void |
setEndPointsMayBeInDifferentEditors(boolean flag)
Sets whether that the source and destination parts may
be in different editors (with different transforms). |
void |
setGraphics(MiPart g)
Sets the part that is to represent the graphics of this
connection (the default is MiLine). |
void |
setIsTranslatable(boolean flag)
|
void |
setIsValidConnectionDestination(boolean flag)
|
void |
setIsValidConnectionSource(boolean flag)
|
void |
setMaintainOrthogonality(boolean flag)
Specifies whether the points in this shape should remain
in their horizontal and vertical positionings. |
void |
setMoveAllPointsWhenConnectedToJustOneMovingNode(boolean flag)
|
void |
setPoint(int pointNum,
double x,
double y)
Sets the location of the point with the given number. |
void |
setPropertyValue(java.lang.String name,
java.lang.String value)
Sets the property with the given name to the given value. |
void |
setSource(MiPart src)
Sets the part that this connection is coming from. |
void |
setSourceConnPt(int pt)
Sets the location within the source to connect to. |
void |
setTruncateLineAtEndPointPartBoundries(boolean flag)
Sets whether that the graphics depicting this connection
(typically a MiLine) should be truncated at the boundries
of the soruce and destination parts. |
void |
setType(java.lang.String t)
Sets the type of this connection. |
java.lang.String |
toString()
Returns information about this MiConnection. |
void |
translate(double x,
double y)
Translates the bounds of this MiPart by the given x
and y distances. |
void |
translatePart(double x,
double y)
|
void |
translatePoint(int pointNum,
double tx,
double ty)
Moves the location of the point with the given number. |
| Methods inherited from class com.swfm.mica.core.MiPart |
_reCalcBounds, _render, _replaceBounds, _setContainer, _setDrawManager, _setValidatingLayout, appendActionHandler, appendActionHandler, appendActionHandler, appendActionHandler, appendActionHandler, appendAttachment, appendAttachment, appendCommandHandler, appendCommandHandler, appendCommandHandler, appendConnection, appendContainer, appendEventHandler, appendItem, appendPart, appendPoint, applyCustomLookAndFeel, calcMinimumSize, calcPreferredSize, containsItem, containsOpaqueRectangles, containsPart, copy, deepCopy, deleteAllConnections, deleteAllParts, dispatchAction, dispatchAction, dispatchAction, dispatchActionRequest, dispatchActionRequest, dispatchActionRequest, dispatchEvent, doExport, doImport, draw, drawNow, drawNow, flip, flip, freeAccessLock, get1DShapeStrokeBackgroundColor, get1DShapeStrokesFilled, getAccessLock, getActionHandler, getActionsGenerated, getActionsLocallyGenerated, getActionsRequestedFromParts, getAfterRenderer, getAlphaCompositeRenderMode, getAnnotationPointManager, getAssociatedParts, getAttachment, getAttachment, getAttachmentMargins, getAttachments, getAttributeLockMask, getAttributePublicMask, getAttributes, getAttributeValue, getBackgroundColor, getBackgroundImage, getBackgroundRenderer, getBackgroundTile, getBalloonHelp, getBeforeRenderer, getBlackColor, getBorderHiliteColor, getBorderHiliteWidth, getBorderLook, getBorderRenderer, getBounds, getCenter, getCenter, getCenterOfRotation, getCenterX, getCenterY, getColor, getConnection, getConnectionPointManager, getContainer, getContainerRequestedActions, getContainingEditor, getContainingWindow, getContextCursor, getContextMenu, getContextMenu, getControlPointManager, getCustomLookAndFeels, getCustomLookAndFeels, getDarkColor, getDeepConnection, getDeepConnection, getDeepConnections, getDeeplyInvalidateAreas, getDefaultAttributes, getDialogHelp, getDoubleBuffer, getDragAndDropBehavior, getDrawManager, getEventHandler, getEventHandler, getEventHandlerWithClass, getEventHandlingDisabledByContainer, getEventHandlingEnabled, getFlipped, getFont, getFontHorizontalJustification, getFontPointSize, getFontVerticalJustification, getHasBorderHilite, getHasShadow, getHeight, getID, getIncomingInvalidLayoutNotificationsEnabled, getIndexOfItem, getIndexOfPart, getInnerBounds, getInnerBounds, getIntersectionWithLine, getInvalidAreaNotificationsEnabled, getInvalidLayoutNotificationsEnabled, getItem, getItem, getKeyFocusTraversalGroup, getLayout, getLayoutManipulator, getLightColor, getLineEndSize, getLineEndsRenderer, getLineEndsSizeFnOfLineWidth, getLineEndStyle, getLineStartSize, getLineStartStyle, getLineStyle, getLineWidth, getLocallyRequestedEventTypes, getManipulator, getMargins, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumPickAreaSize, getMinimumSize, getMinimumWidth, getName, getNumberOfActionHandlers, getNumberOfAttachments, getNumberOfConnections, getNumberOfContainers, getNumberOfDeepConnections, getNumberOfEventHandlers, getNumberOfItems, getNumberOfParts, getNumberOfResources, getOutgoingInvalidLayoutNotificationsEnabled, getPart, getPart, getPoint, getPointEntryAngle, getPointExitAngle, getPointX, getPointY, getPreferredSize, getPrototypeManipulator, getRelativeLocation, getResource, getResourceName, getRootWindow, getRotation, getSelectionGraphics, getShadowColor, getShadowDirection, getShadowLength, getShadowRenderer, getShadowStyle, getSize, getSnapPointManager, getStatusHelp, getSupportedExportFormats, getSupportedImportFormats, getThisOrPartHasInvalidArea, getToolHintHelp, getTotalNumberOfPartsCreated, getTransform, getTransparency, getValidatingLayout, getVisibilityAnimator, getWhiteColor, getWidth, getWriteMode, getXmax, getXmin, getXorColor, getYmax, getYmin, hasAttachment, hasAttribute, hasEnterKeyFocus, hasEventHandler, hasEventHandlers, hasFixedAspectRatio, hasFixedHeight, hasFixedWidth, hasKeyboardFocus, hasMouseFocus, hasOverriddenMinimumSize, hasOverriddenPreferredSize, hasProperty, hasTotallyInvalidArea, hasValidCachedEventHandlerInfo, hasValidLayout, insertActionHandler, insertActionHandler, insertActionHandler, insertConnection, insertContainer, insertEventHandler, insertItem, insertPart, insertPoint, invalidateArea, invalidateArea, invalidateLayout, isAcceptingEnterKeyFocus, isAcceptingKeyboardFocus, isAcceptingMouseFocus, isAcceptingTabKeys, isActionDispatchingEnabled, isConnectable, isConnectedTo, isContainerOf, isContainerOf, isContainerOfWithAttachments, isCopyable, isCopyableAsPartOfCopyable, isDeletable, isDoubleBuffered, isDragAndDropSource, isDragAndDropTarget, isFilled, isFontBold, isFontItalic, isFontUnderlined, isHidden, isMovable, isOpaqueRectangle, isPickable, isPickableWhenTransparent, isPrintable, isSavable, isSelectable, isSelected, isSensitive, isShowing, isSnappable, isUngroupable, isVisible, layoutParts, makeImageFromArea, makeLayoutManipulator, optimizedInvalidateArea, optimizedInvalidateDrawBoundsArea, overrideAttributes, overrideEventHandlingDisabledByContainer, packLayout, pickDeepList, pickDeepListContents, pickObject, preRenderToDoubleBuffer, refreshBounds, refreshLookAndFeel, refreshLookAndFeel, removeActionHandler, removeActionHandler, removeActionHandlers, removeAllActionHandlers, removeAllAttachments, removeAllConnections, removeAllEventHandlers, removeAllItems, removeAllManipulators, removeAllParts, removeAttachment, removeAttachment, removeCommandHandler, removeCommandHandler, removeConnection, removeConnection, removeContainer, removeContainer, removeEventHandler, removeFromAllContainers, removeItem, removeItem, removePart, removePart, removeResource, replaceDrawBounds, requestEnterKeyFocus, requestKeyboardFocus, rotate, rotate, rotateTo, scale, scale, scale, select, set1DShapeStrokeBackgroundColor, set1DShapeStrokesFilled, setAcceptingEnterKeyFocus, setAcceptingKeyboardFocus, setAcceptingMouseFocus, setAcceptingTabKeys, setActionDispatchingEnabled, setAfterRenderer, setAlphaCompositeRenderMode, setAnnotationPointManager, setAttachmentDrawnAfter, setAttachmentMargins, setAttachmentsVisibility, setAttributeLockMask, setAttributePublicMask, setAttributes, setAttributeValue, setAttributeValue, setAttributeValue, setAttributeValue, setAttributeValue, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundRenderer, setBackgroundTile, setBalloonHelp, setBalloonHelpMessage, setBeforeRenderer, setBlackColor, setBorderHiliteColor, setBorderHiliteWidth, setBorderLook, setBorderRenderer, setBounds, setBounds, setCenter, setCenter, setCenterX, setCenterY, setColor, setColor, setConnectable, setContextCursor, setContextMenu, setControlPointManager, setCopyable, setCopyableAsPartOfCopyable, setCustomLookAndFeels, setCustomLookAndFeels, setDarkColor, setDeeplyInvalidateAreas, setDefaultAttributes, setDeletable, setDialogHelp, setDialogHelpMessage, setDoubleBuffer, setDoubleBuffered, setDragAndDropBehavior, setEventHandlingEnabled, setFilled, setFixedAspectRatio, setFixedHeight, setFixedWidth, setFont, setFontBold, setFontHorizontalJustification, setFontItalic, setFontPointSize, setFontUnderlined, setFontVerticalJustification, setHasBorderHilite, setHasShadow, setHeight, setHidden, setIncomingInvalidLayoutNotificationsEnabled, setInvalidAreaNotificationsEnabled, setInvalidLayoutNotificationsEnabled, setIsDragAndDropSource, setIsDragAndDropTarget, setIsOpaqueRectangle, setItem, setKeyFocusTraversalGroup, setLayout, setLightColor, setLineEndSize, setLineEndSizeFnOfLineWidth, setLineEndsRenderer, setLineEndStyle, setLineStartSize, setLineStartStyle, setLineStyle, setLineWidth, setMargins, setMaximumHeight, setMaximumWidth, setMinimumHeight, setMinimumPickAreaSize, setMinimumSize, setMinimumWidth, setMouseFocus, setMovable, setName, setNumberOfPoints, setOutgoingInvalidLayoutNotificationsEnabled, setPart, setPickable, setPickableWhenTransparent, setPoint, setPreferredSize, setPrintable, setPropertyValues, setPrototypeManipulator, setResource, setSavable, setSelectable, setSelectionGraphics, setSensitive, setShadowColor, setShadowDirection, setShadowLength, setShadowRenderer, setShadowStyle, setSize, setSize, setSnappable, setSnapPointManager, setStatusHelp, setStatusHelpMessage, setSupportedImportFormats, setToolHintHelp, setToolHintMessage, setTransparency, setTransparency, setUngroupable, setVisibilityAnimator, setVisible, setWhiteColor, setWidth, setWriteMode, setXmax, setXmin, setXorColor, setYmax, setYmin, supportsImportOfSpecificInstance, translate, validateLayout, validatePropertyValue, waitUntilRedrawn |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MiConnection
public MiConnection()
- Constructs a new MiConnection of type: null.
MiConnection
public MiConnection(MiPart src,
MiPart dest)
- Constructs a new MiConnection of type: null between the
given source and destination part center points.
- Parameters:
src - the connection sourcedest - the connection destination
MiConnection
public MiConnection(MiPart src,
int srcConnPt,
MiPart dest,
int destConnPt)
- Constructs a new MiConnection of type: null between the
given source and destination parts at the given connection
points.
- Parameters:
src - the connection sourcesrcConnPt - the source connection point to usedest - the connection destinationdestConnPt - the source connection point to use
setSource
public void setSource(MiPart src)
- Sets the part that this connection is coming from.
- Parameters:
src - the source part or null
setDestination
public void setDestination(MiPart dest)
- Sets the part that this connection is going to.
- Parameters:
dest - the destination part or null
removeConnectionTo
public void removeConnectionTo(MiPart obj)
isType
public boolean isType(java.lang.String t)
- Gets whether this connection is of the given type.
- Parameters:
t - the type to compare to or null
- Returns:
- true if this connection is of type: t
setType
public void setType(java.lang.String t)
- Sets the type of this connection.
- Parameters:
t - the type or null
getType
public java.lang.String getType()
- Gets the type of this connection.
- Returns:
- the type or null
getSource
public MiPart getSource()
- Gets the source of this connection.
- Returns:
- the source or null
getDestination
public MiPart getDestination()
- Gets the destination of this connection.
- Returns:
- the destination or null
setIsTranslatable
public void setIsTranslatable(boolean flag)
isTranslatable
public boolean isTranslatable()
setSourceConnPt
public void setSourceConnPt(int pt)
- Sets the location within the source to connect to. Valid
connection points:
Mi_CENTER_LOCATION (the default)
Mi_LEFT_LOCATION
Mi_RIGHT_LOCATION
Mi_BOTTOM_LOCATION
Mi_TOP_LOCATION
Mi_LOWER_LEFT_LOCATION
Mi_LOWER_RIGHT_LOCATION
Mi_UPPER_LEFT_LOCATION
Mi_UPPER_RIGHT_LOCATION
Mi_OUTSIDE_LEFT_LOCATION
Mi_OUTSIDE_RIGHT_LOCATION
Mi_OUTSIDE_BOTTOM_LOCATION
Mi_OUTSIDE_TOP_LOCATION
Mi_WNW_LOCATION
Mi_WSW_LOCATION
Mi_ENE_LOCATION
Mi_ESE_LOCATION
Mi_NWN_LOCATION
Mi_NEN_LOCATION
Mi_SWS_LOCATION
Mi_SES_LOCATION
Mi_SURROUND_LOCATION
Mi_DEFAULT_LOCATION
The special location, Mi_DEFAULT_LOCATION, Specifies that
this connection is to look at the connection manager of
the source to see what to connect to, which may actually
be to a part within the source part.
- Parameters:
pt - the connection pt
getSourceConnPt
public int getSourceConnPt()
- Gets the location within the source to connect to.
- Returns:
- the connection pt
- See Also:
setSourceConnPt(int)
setDestinationConnPt
public void setDestinationConnPt(int pt)
- Sets the location within the destination to connect to. Valid
connection points:
Mi_CENTER_LOCATION (the default)
Mi_LEFT_LOCATION
Mi_RIGHT_LOCATION
Mi_BOTTOM_LOCATION
Mi_TOP_LOCATION
Mi_LOWER_LEFT_LOCATION
Mi_LOWER_RIGHT_LOCATION
Mi_UPPER_LEFT_LOCATION
Mi_UPPER_RIGHT_LOCATION
Mi_OUTSIDE_LEFT_LOCATION
Mi_OUTSIDE_RIGHT_LOCATION
Mi_OUTSIDE_BOTTOM_LOCATION
Mi_OUTSIDE_TOP_LOCATION
Mi_WNW_LOCATION
Mi_WSW_LOCATION
Mi_ENE_LOCATION
Mi_ESE_LOCATION
Mi_NWN_LOCATION
Mi_NEN_LOCATION
Mi_SWS_LOCATION
Mi_SES_LOCATION
Mi_SURROUND_LOCATION
Mi_DEFAULT_LOCATION
The special location, Mi_DEFAULT_LOCATION, Specifies that
this connection is to look at the connection manager of
the destination to see what to connect to, which may actually
be to a part within the destination part.
- Parameters:
pt - the connection pt
getDestinationConnPt
public int getDestinationConnPt()
- Gets the location within the destination to connect to.
- Returns:
- the connection pt
- See Also:
setDestinationConnPt(int)
setGraphics
public void setGraphics(MiPart g)
- Sets the part that is to represent the graphics of this
connection (the default is MiLine).
- Parameters:
g - the part to draw between the source
and destination parts
getGraphics
public MiPart getGraphics()
- Gets the part that is to represent the graphics of this
connection (the default is MiLine).
- Returns:
- the part to draw between the source
and destination parts
setEndPointsMayBeInDifferentEditors
public void setEndPointsMayBeInDifferentEditors(boolean flag)
- Sets whether that the source and destination parts may
be in different editors (with different transforms).
- Parameters:
flag - true if in different editors
getEndPointsMayBeInDifferentEditors
public boolean getEndPointsMayBeInDifferentEditors()
- Gets whether that the source and destination parts may
be in different editors (with different transforms).
setTruncateLineAtEndPointPartBoundries
public void setTruncateLineAtEndPointPartBoundries(boolean flag)
- Sets whether that the graphics depicting this connection
(typically a MiLine) should be truncated at the boundries
of the soruce and destination parts. Alternatives are
to just draw the connection on top of the part or to
call MiContainer#setKeepConnectionsBelowNodes(true) on
the container of the end points and this connection.
- Parameters:
flag - true if to truncate
getTruncateLineAtEndPointPartBoundries
public boolean getTruncateLineAtEndPointPartBoundries()
- Gets whether that the graphics depicting this connection
(typically a MiLine) should be truncated at the boundries
of the soruce and destination parts.
- Returns:
- true if to truncate
- See Also:
setTruncateLineAtEndPointPartBoundries(boolean)
setIsValidConnectionSource
public void setIsValidConnectionSource(boolean flag)
isValidConnectionSource
public boolean isValidConnectionSource(MiConnectionOperation connectOp)
- Gets whether this connection is a valid source of the
given connection. By default this returns false to prevent
connection connecting to other connections.
- Overrides:
isValidConnectionSource in class MiPart
- Parameters:
connectOp - the connection operation
- Returns:
- true if valid
setIsValidConnectionDestination
public void setIsValidConnectionDestination(boolean flag)
setMaintainOrthogonality
public void setMaintainOrthogonality(boolean flag)
- Specifies whether the points in this shape should remain
in their horizontal and vertical positionings. This will
translate the neighbors of a translated point to maintain
orthogonality.
- Parameters:
flag - true if translatePoint will maintain
orthogonality
getMaintainOrthogonality
public boolean getMaintainOrthogonality()
- Gets whether the points in this shape should remain
in their horizontal and vertical positionings. This will
translate the neighbors of a translated point to maintain
orthogonality.
- Returns:
- true if translatePoint will maintain
orthogonality
isValidConnectionDestination
public boolean isValidConnectionDestination(MiConnectionOperation connectOp)
- Gets whether this connection is a valid destination of the
given connection. By default this returns false to prevent
connection connecting to other connections.
- Overrides:
isValidConnectionDestination in class MiPart
- Parameters:
connectOp - the connection operation
- Returns:
- true if valid
setConnectionPointManager
public void setConnectionPointManager(MiConnectionPointManager m)
- Description copied from class:
MiPart
- Sets the MiConnectionPointManager of this MiPart. This
manager allows customization of the location of the
points this MiPart's connections can attach to.
- Overrides:
setConnectionPointManager in class MiPart
- Parameters:
m - the connection point manager or
null
setConnectionsMustBeConnectedAtBothEnds
public void setConnectionsMustBeConnectedAtBothEnds(boolean flag)
getConnectionsMustBeConnectedAtBothEnds
public boolean getConnectionsMustBeConnectedAtBothEnds()
setAllowMultipleConnectionsBetweenSameNodesAndConnPts
public void setAllowMultipleConnectionsBetweenSameNodesAndConnPts(boolean flag)
- Allows connections duplicating others, ignore differences in paths
Responsibility of manipulators to check this and enforce this
True by default
getAllowMultipleConnectionsBetweenSameNodesAndConnPts
public boolean getAllowMultipleConnectionsBetweenSameNodesAndConnPts()
setAllowSameSourceAndDestination
public void setAllowSameSourceAndDestination(boolean flag)
getAllowSameSourceAndDestination
public boolean getAllowSameSourceAndDestination()
setAllowSameSourceAndDestinationPosition
public void setAllowSameSourceAndDestinationPosition(boolean flag)
- Allows zero length connections and 'closed loop' connections.
Responsibility of manipulators to check this and enforce this
True by default
getAllowSameSourceAndDestinationPosition
public boolean getAllowSameSourceAndDestinationPosition()
setMoveAllPointsWhenConnectedToJustOneMovingNode
public void setMoveAllPointsWhenConnectedToJustOneMovingNode(boolean flag)
getMoveAllPointsWhenConnectedToJustOneMovingNode
public boolean getMoveAllPointsWhenConnectedToJustOneMovingNode()
getOther
public MiPart getOther(MiPart one)
- Gets the end point at the otehr side from the given end
point (i.e. source or destination point).
- Parameters:
one - either the source or destination
- Returns:
- the other end point
setPropertyValue
public void setPropertyValue(java.lang.String name,
java.lang.String value)
- Sets the property with the given name to the given value.
- Overrides:
setPropertyValue in class MiPart
- Parameters:
name - the name of an propertyvalue - the value of the property
getPropertyValue
public java.lang.String getPropertyValue(java.lang.String name)
- Gets the textual value of the property with the given
name. If the value is null then
MiiTypes.Mi_NULL_VALUE_NAME is returned.
- Overrides:
getPropertyValue in class MiPart
- Parameters:
name - the name of a property
- Returns:
- the string value of the property
getPropertyDescriptions
public MiPropertyDescriptions getPropertyDescriptions()
- Gets the descriptions of all of the properties. These
can be used to see if an property is different from the
default value or if a proposed value is valid or to get
a list of all of the valid values of a property.
- Overrides:
getPropertyDescriptions in class MiPart
- Returns:
- the list of property descriptions
deleteSelf
public void deleteSelf()
- Removes this MiPart from all of it's containers, parts
and connections after doing the same to all of this
MiPart's parts. A Mi_DELETE_ACTION is generated and
dispatched to this MiPart immediately before it is
deleted.
- Overrides:
deleteSelf in class MiPart
removeSelf
public void removeSelf()
- Removes this MiPart from all of it's containers and
detaches this MiPart from all of it's connections, who
are also detached from their endpoints and from their
containers.
- Overrides:
removeSelf in class MiPart
replaceSelf
public void replaceSelf(MiPart other)
- Replaces this MiPart with the given MiPart. This
includes putting the given part in the same location,
at the same index in all of it's containers, and to take
it's place in all of it's connections. A Mi_REPLACE_ACTION
is generated and dispatched to this MiPart (not the
given part).
- Overrides:
replaceSelf in class MiPart
- Parameters:
other - the part that will replace this one
render
public void render(MiRenderer renderer)
- Draws this connection.
- Parameters:
renderer - the renderer to use for drawing
pick
public boolean pick(MiBounds area)
- Gets whether the given area intersects the bounds of
this MiPart.
- Overrides:
pick in class MiPart
- Parameters:
area - the area
- Returns:
- true if the given area overlaps
the bounds of this MiPart.
processAction
public boolean processAction(MiiAction action)
- Processes the given action.
- Specified by:
processAction in interface MiiActionHandler
- Parameters:
action - the action to process
- Returns:
- true if it is OK to send
action to the next action handler
false if it is NOT OK to send
action to the next action handler
nodeGeometryChanged
public void nodeGeometryChanged(MiPart node)
- Called by the end point MiParts when they have moved
or been resized so that this connection can reposition
iself if necessary.
- Parameters:
node - the end point part that changed
refreshEndPoints
public void refreshEndPoints()
- Updates the points(s) of this connection's graphics.
This is usually required to be called externally, but
should not be harmful except to performance.
getBounds
public MiBounds getBounds(MiBounds b)
- Gets the outer bounds of this MiPart. Override this,
if desired, as it implements the core functionality.
- Overrides:
getBounds in class MiPart
- Parameters:
b - the (returned) outer bounds
- Returns:
- the outer bounds
getDrawBounds
public MiBounds getDrawBounds(MiBounds b)
- Get the draw bounds of this MiPart. The draw bounds is
the outer bounds plus the bounds of any shadows,
attachments, and margins.
- Overrides:
getDrawBounds in class MiPart
- Parameters:
b - the (returned) draw bounds
- Returns:
- the draw bounds
reCalcBounds
public void reCalcBounds(MiBounds b)
- Realculates the outer bounds of this MiPart. Override
this, if desired, as it implements the core
functionality. The default implementation just returns
the outer bounds.
- Parameters:
b - the (returned) outer bounds
getShadowShape
public MiPart getShadowShape()
- Gets the shape of any shadow. Used by the shadow
renderers. This method returns MiiShadowRenderer.noShadowShape
because when the shape associated with this is rendered
_it_ will draw the shadow.
- Overrides:
getShadowShape in class MiPart
- Returns:
- the shape
makeManipulator
public MiiManipulator makeManipulator()
- Makes a manipulator for this MiPart. Override this,
if desired, as it implements the core functionality.
The default behavior is to return an instance of the
MiConnectionPointManipulator class.
- Overrides:
makeManipulator in class MiPart
- Returns:
- the manipulator
getNumberOfPoints
public int getNumberOfPoints()
- Gets the number of points that define the shape of
this MiPart. The default is 2, the lower left and upper
right corners.
This is here for the use of MiMultiPointManipulator.
- Overrides:
getNumberOfPoints in class MiPart
- Returns:
- the number of points
setPoint
public void setPoint(int pointNum,
double x,
double y)
- Sets the location of the point with the given number.
Points are numbered from 0. Mi_LAST_POINT_NUMBER is
also a valid point number.
This is here for the use of MiMultiPointManipulator.
- Overrides:
setPoint in class MiPart
- Parameters:
pointNum - the number of the pointx - the new x coordinate of the pointy - the new y coordinate of the point
translatePoint
public void translatePoint(int pointNum,
double tx,
double ty)
- Description copied from class:
MiPart
- Moves the location of the point with the given number.
Points are numbered from 0. Mi_LAST_POINT_NUMBER is
also a valid point number.
- Overrides:
translatePoint in class MiPart
- Parameters:
pointNum - the number of the pointtx - the new x translation of the pointty - the new y translation of the point
appendPoint
public void appendPoint(double x,
double y)
- Append another point to the points that define the
shape of this MiPart. Override this, if desired, as it
implements the core functionality.
- Overrides:
appendPoint in class MiPart
- Parameters:
x - the x coord of the point to be appendedy - the y coord of the point to be appended
removePoint
public void removePoint(int pointNum)
- Remove the point with the given number.
Points are numbered from 0. Mi_LAST_POINT_NUMBER is
also a valid point number.
- Overrides:
removePoint in class MiPart
- Parameters:
pointNum - the number of the point
insertPoint
public void insertPoint(double x,
double y,
int index)
- Insert another point to the points that define the
shape of this MiPart. Override this, if desired, as it
implements the core functionality.
- Overrides:
insertPoint in class MiPart
- Parameters:
x - the x coord of the point to be appendedy - the y coord of the point to be appendedindex - the index of the point to insert
this new point before
getPoint
public void getPoint(int pointNum,
MiPoint point)
- Gets the location of the point with the given number.
Points are numbered from 0. Mi_LAST_POINT_NUMBER is
also a valid point number.
This is here for the use of MiMultiPointManipulator.
- Overrides:
getPoint in class MiPart
- Parameters:
pointNum - the number of the pointpoint - the (returned) coordinates of the
point
translatePart
public void translatePart(double x,
double y)
- Parameters:
x - the x translationy - the y translation
translate
public void translate(double x,
double y)
- Description copied from class:
MiPart
- Translates the bounds of this MiPart by the given x
and y distances. Any parts of this MiPart are also
translated in kind. Override this, if desired, as it
implements the core functionality.
- Overrides:
translate in class MiPart
- Parameters:
x - the x distance to translatey - the y distance to translate
toString
public java.lang.String toString()
- Returns information about this MiConnection.
- Overrides:
toString in class MiPart
- Returns:
- textual information (class name +
unique numerical id + name
+ source[connPt] + dest[connPt])
copy
public void copy(MiPart obj)
- Copies the given MiPart. This MiPart will have the same
attributes, bounds, resources, attachments, layouts,
action handlers, and event handlers as the given MiPart.
- Overrides:
copy in class MiPart
- Parameters:
obj - the part to copy- See Also:
MiPart.copy(),