com.swfm.mica.core
Class MiMultiPointShape

java.lang.Object
  extended bycom.swfm.mica.core.MiPart
      extended bycom.swfm.mica.core.MiMultiPointShape
All Implemented Interfaces:
MiiActionTypes, MiiAttributeTypes, MiiDragAndDropParticipant, MiiEventTypes, MiiNames, MiiPropertyTypes, MiiTypes
Direct Known Subclasses:
Mi3PointArc, MiLine, MiPolygon, MiPolyPoint, MiTriangle

public abstract class MiMultiPointShape
extends MiPart

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
                 
Constructor Summary
MiMultiPointShape()
           
 
Method Summary
 void appendPoint(double x, double y)
          Append another point to the points that define the shape of this MiPart.
 void appendPoints(double[] xPts, double[] yPts, int numPoints)
           
 void copy(MiPart source)
          Copy the state of this MiPart into the target MiPart.
 boolean getMaintainOrthogonality()
          Gets whether the points in this shape should remain in their horizontal and vertical positionings.
 int getNumberOfPoints()
          Gets the number of points that define the shape of this MiPart.
 MiPoint getPoint(int pointNum)
          Gets the location of the point with the given number.
 void getPoint(int pointNum, MiPoint point)
          Gets the location of the point with the given number.
 double getPointEntryAngle(int pointNumber)
          Get the angle of the shape as it enters the point with the given number.
 double getPointExitAngle(int pointNumber)
          Get the angle of the shape as it exits the point with the given number.
 double getPointX(int pointNum)
          Gets the location of the point with the given number.
 double getPointY(int pointNum)
          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.
 void insertPoint(double x, double y, int pointNum)
          Insert another point to the points that define the shape of this MiPart.
 boolean isHorizontal()
           
 boolean isVertical()
           
 MiiManipulator makeManipulator()
          Makes a manipulator for this MiPart.
 void removePoint(int pointNum)
          Remove the point with the given number.
 void setMaintainOrthogonality(boolean flag)
          Specifies whether the points in this shape should remain in their horizontal and vertical positionings.
 void setNumberOfPoints(int number)
           
 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.
 java.lang.String toString()
          Returns information about this MiPart.
 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, deleteSelf, 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, 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, getDrawBounds, 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, getPreferredSize, getPrototypeManipulator, getRelativeLocation, getResource, getResourceName, getRootWindow, getRotation, getSelectionGraphics, getShadowColor, getShadowDirection, getShadowLength, getShadowRenderer, getShadowShape, 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, isValidConnectionDestination, isValidConnectionSource, isVisible, layoutParts, makeImageFromArea, makeLayoutManipulator, optimizedInvalidateArea, optimizedInvalidateDrawBoundsArea, overrideAttributes, overrideEventHandlingDisabledByContainer, packLayout, pick, 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, removeSelf, replaceDrawBounds, replaceSelf, 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, setConnectionPointManager, 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, 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, translate, validateLayout, validatePropertyValue, waitUntilRedrawn
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MiMultiPointShape

public MiMultiPointShape()
Method Detail

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.

Overrides:
getNumberOfPoints in class MiPart
Returns:
the number of points

setNumberOfPoints

public void setNumberOfPoints(int number)
Overrides:
setNumberOfPoints in class MiPart

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.

Overrides:
setPoint in class MiPart
Parameters:
pointNum - the number of the point
x - the new x coordinate of the point
y - the new y coordinate of the point

translatePoint

public void translatePoint(int pointNum,
                           double tx,
                           double ty)
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 point
tx - the new x translation of the point
ty - the new y translation of the point

getPoint

public MiPoint getPoint(int pointNum)
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.

Overrides:
getPoint in class MiPart
Parameters:
pointNum - the number of the point
Returns:
the coordinates of the point

getPointX

public double getPointX(int pointNum)
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.

Overrides:
getPointX in class MiPart
Parameters:
pointNum - the number of the point
Returns:
the X coordinate of the point

getPointY

public double getPointY(int pointNum)
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.

Overrides:
getPointY in class MiPart
Parameters:
pointNum - the number of the point
Returns:
the Y coordinate of the point

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.

Overrides:
getPoint in class MiPart
Parameters:
pointNum - the number of the point
point - the (returned) coordinates 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 appended
y - the y coord of the point to be appended

insertPoint

public void insertPoint(double x,
                        double y,
                        int pointNum)
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 appended
y - the y coord of the point to be appended
pointNum - the index of the point to insert this new point before

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

getPointExitAngle

public double getPointExitAngle(int pointNumber)
Get the angle of the shape as it exits the point with the given number. Points are numbered from 0.

Overrides:
getPointExitAngle in class MiPart
Returns:
the angle in radians

getPointEntryAngle

public double getPointEntryAngle(int pointNumber)
Get the angle of the shape as it enters the point with the given number. Points are numbered from 0. Mi_LAST_POINT_NUMBER is also a valid point number.

Overrides:
getPointEntryAngle in class MiPart
Returns:
the angle in radians

appendPoints

public void appendPoints(double[] xPts,
                         double[] yPts,
                         int numPoints)

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

isVertical

public boolean isVertical()

isHorizontal

public boolean isHorizontal()

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 MiBoundsManipulator class.

Overrides:
makeManipulator in class MiPart
Returns:
the manipulator

copy

public void copy(MiPart source)
Copy the state of this MiPart into the target MiPart.

Overrides:
copy in class MiPart
Parameters:
source - the part to copy
See Also:
MiPart.copy()

toString

public java.lang.String toString()
Returns information about this MiPart.

Overrides:
toString in class MiPart
Returns:
textual information (class name + unique numerical id + name)

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 property
value - 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