com.swfm.mica.layouts
Class Mi2DMeshGraphLayout

java.lang.Object
  extended bycom.swfm.mica.core.MiPart
      extended bycom.swfm.mica.core.MiContainer
          extended bycom.swfm.mica.layouts.MiLayout
              extended bycom.swfm.mica.layouts.MiManipulatableLayout
                  extended bycom.swfm.mica.layouts.Mi2DMeshGraphLayout
All Implemented Interfaces:
MiiActionHandler, MiiActionTypes, MiiAttributeTypes, MiiCopyable, MiiDragAndDropParticipant, MiiEventTypes, MiiLayout, MiiManipulatableLayout, MiiNames, MiiOrientablePart, MiiPropertyTypes, MiiTypes

public class Mi2DMeshGraphLayout
extends MiManipulatableLayout

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

Field Summary
                 
Constructor Summary
Mi2DMeshGraphLayout()
          Constructs a new instance of Mi2DMeshGraphLayout.
 
Method Summary
 MiParts addNewColumnAt(int colNum)
           
 MiParts addNewRowAt(int rowNum)
           
 void calcMinimumSize(MiSize size)
          Gets the minimum size of this MiPart.
 void cycleOrientation()
          Changes to the next supported orientation.
 void deleteColumn(int colNum)
           
 void deleteNode(int index)
          Deletes the node at the given index.
 void deleteRow(int rowNum)
           
 void formatTarget(java.lang.String connectionType)
          Remove all of the connections and create a random network of connections of the nodes in the target.
 int getOrientation()
          Gets the orientation.
 MiParts insertNeighboringNode(MiPart node, int index, int relativeLocation)
          Inserts the given node at the given relative location to the node at the given index.
 boolean isOrientationFixed()
          Gets whether the orientation can be changed.
 void setOrientation(int orientation)
          Sets the orientation.
 
Methods inherited from class com.swfm.mica.layouts.MiManipulatableLayout
appendNeighboringNode, appendNode, attachManipulatorToTarget, calcPreferredSize, copy, deepCopy, formatEmptyTarget, getDefaultSelectionGraphics, getEdge, getEdgeConnectionType, getLayoutContainerPartRelations, getLayoutElementsBasedOnAverageElementSize, getLayoutElementsBasedOnSizeOfElementRadii, getLayoutManipulator, getMinimumNumberOfTargetNodes, getNeighboringNode, getNode, getNodeBounds, getNodes, getNodesInTarget, getNumberOfEdges, getNumberOfNodes, getPreferredEdgeLength, getPropertyDescriptions, getPropertyValue, getPrototypeEdge, getPrototypePlaceHolder, getSupportedImportFormats, insertNode, insertNode, makeEdge, makeLayoutManipulator, makePlaceHolder, processAction, removeNode, setDefaultSelectionGraphics, setEdgeConnectionType, setLayoutContainerPartRelations, setLayoutElementsBasedOnAverageElementSize, setLayoutElementsBasedOnSizeOfElementRadii, setLayoutManipulator, setMinimumNumberOfTargetNodes, setPreferredEdgeLength, setPropertyValue, setPrototypeEdge, setPrototypePlaceHolder, setTarget, stripTargetOfConnections
 
Methods inherited from class com.swfm.mica.layouts.MiLayout
determinesPreferredAndMinimumSizes, getAlleyHSpacing, getAlleyMargins, getAlleyVSpacing, getCellMargins, getCellMargins, getElementHJustification, getElementHSizing, getElementVJustification, getElementVSizing, getInsetMargins, getInsetMargins, getLastElementJustification, getTarget, getUniqueElementIndex, getUniqueElementSizing, isEnabled, isIndependantOfTargetPosition, isScalingOfPartsWhenBoundsChangesHandledDuringLayout, layoutParts, makeCopy, setAlleyHSpacing, setAlleySpacing, setAlleyVSpacing, setCellMargins, setCellMargins, setElementHJustification, setElementHSizing, setElementJustification, setElementSizing, setElementVJustification, setElementVSizing, setEnabled, setInsetMargins, setInsetMargins, setLastElementJustification, setScalingOfPartsWhenBoundsChangesHandledDuringLayout, setUniqueElementIndex, setUniqueElementSizing, toString
 
Methods inherited from class com.swfm.mica.core.MiContainer
appendPart, containsPart, doImport, getIndexOfPart, getIntersectionWithLine, getKeepConnectionsBelowNodes, getNumberOfParts, getPart, getPart, hasEventHandlers, hasValidCachedEventHandlerInfo, insertPart, invalidateCachedEventHandlerInfo, isContainerOf, isContainerOf, isContainerOfWithAttachments, pick, pickDeepListContents, pickObject, removeAllParts, removePart, removePart, setKeepConnectionsBelowNodes, setPart, translate
 
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, appendPoint, appendPoint, applyCustomLookAndFeel, containsItem, containsOpaqueRectangles, copy, deleteAllConnections, deleteAllParts, deleteSelf, dispatchAction, dispatchAction, dispatchAction, dispatchActionRequest, dispatchActionRequest, dispatchActionRequest, dispatchEvent, doExport, 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, getInnerBounds, getInnerBounds, getInvalidAreaNotificationsEnabled, getInvalidLayoutNotificationsEnabled, getItem, getItem, getKeyFocusTraversalGroup, getLayout, 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, getNumberOfPoints, getNumberOfResources, getOutgoingInvalidLayoutNotificationsEnabled, getPoint, getPoint, getPointEntryAngle, getPointExitAngle, getPointX, getPointY, getPreferredSize, getPrototypeManipulator, getRelativeLocation, getResource, getResourceName, getRootWindow, getRotation, getSelectionGraphics, getShadowColor, getShadowDirection, getShadowLength, getShadowRenderer, getShadowShape, getShadowStyle, getSize, getSnapPointManager, getStatusHelp, getSupportedExportFormats, getThisOrPartHasInvalidArea, getToolHintHelp, getTotalNumberOfPartsCreated, getTransform, getTransparency, getValidatingLayout, getVisibilityAnimator, getWhiteColor, getWidth, getWriteMode, getXmax, getXmin, getXorColor, getYmax, getYmin, hasAttachment, hasAttribute, hasEnterKeyFocus, hasEventHandler, hasFixedAspectRatio, hasFixedHeight, hasFixedWidth, hasKeyboardFocus, hasMouseFocus, hasOverriddenMinimumSize, hasOverriddenPreferredSize, hasProperty, hasTotallyInvalidArea, hasValidLayout, insertActionHandler, insertActionHandler, insertActionHandler, insertConnection, insertContainer, insertEventHandler, insertItem, insertPoint, insertPoint, invalidateArea, invalidateArea, invalidateLayout, isAcceptingEnterKeyFocus, isAcceptingKeyboardFocus, isAcceptingMouseFocus, isAcceptingTabKeys, isActionDispatchingEnabled, isConnectable, isConnectedTo, 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, makeImageFromArea, makeManipulator, optimizedInvalidateArea, optimizedInvalidateDrawBoundsArea, overrideAttributes, overrideEventHandlingDisabledByContainer, packLayout, pickDeepList, preRenderToDoubleBuffer, refreshBounds, refreshLookAndFeel, refreshLookAndFeel, removeActionHandler, removeActionHandler, removeActionHandlers, removeAllActionHandlers, removeAllAttachments, removeAllConnections, removeAllEventHandlers, removeAllItems, removeAllManipulators, removeAttachment, removeAttachment, removeCommandHandler, removeCommandHandler, removeConnection, removeConnection, removeContainer, removeContainer, removeEventHandler, removeFromAllContainers, removeItem, removeItem, removePoint, 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, setNumberOfPoints, setOutgoingInvalidLayoutNotificationsEnabled, setPickable, setPickableWhenTransparent, setPoint, 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, translatePoint, validateLayout, validatePropertyValue, waitUntilRedrawn
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.swfm.mica.layouts.MiiLayout
determinesPreferredAndMinimumSizes, getMinimumSize, getPreferredSize, getTarget, invalidateLayout, isEnabled, isIndependantOfTargetPosition, layoutParts, setEnabled
 
Methods inherited from interface com.swfm.mica.core.MiiCopyable
makeCopy
 

Constructor Detail

Mi2DMeshGraphLayout

public Mi2DMeshGraphLayout()
Constructs a new instance of Mi2DMeshGraphLayout.

Method Detail

isOrientationFixed

public boolean isOrientationFixed()
Gets whether the orientation can be changed.

Specified by:
isOrientationFixed in interface MiiOrientablePart
Overrides:
isOrientationFixed in class MiManipulatableLayout
Returns:
true if the orientation cannot be changed

setOrientation

public void setOrientation(int orientation)
Sets the orientation. Typically the valid values are: Mi_HORIZONTAL Mi_VERTICAL However, the implementation is free to define it's own, custom orientations.

Specified by:
setOrientation in interface MiiOrientablePart
Overrides:
setOrientation in class MiManipulatableLayout
Parameters:
orientation - the orientation

getOrientation

public int getOrientation()
Gets the orientation. Typically the valid values are: Mi_HORIZONTAL Mi_VERTICAL However, the implementation is free to define it's own, custom orientations.

Specified by:
getOrientation in interface MiiOrientablePart
Overrides:
getOrientation in class MiManipulatableLayout
Returns:
the orientation

cycleOrientation

public void cycleOrientation()
Changes to the next supported orientation.

Specified by:
cycleOrientation in interface MiiOrientablePart
Overrides:
cycleOrientation in class MiManipulatableLayout

insertNeighboringNode

public MiParts insertNeighboringNode(MiPart node,
                                     int index,
                                     int relativeLocation)
Description copied from class: MiManipulatableLayout
Inserts the given node at the given relative location to the node at the given index. Valid relative locations are: Mi_ABOVE Mi_BELOW Mi_TO_RIGHT Mi_TO_LEFT Mi_TOP Mi_BOTTOM Mi_FAR_RIGHT Mi_FAR_LEFT

Specified by:
insertNeighboringNode in interface MiiManipulatableLayout
Overrides:
insertNeighboringNode in class MiManipulatableLayout
Parameters:
node - the node to insert
index - the index of the node that the given node will be inserted relative to (-1 indicates that this should append the given node after the last node)
relativeLocation - the relative location of the insertion point
Returns:
the list of nodes that were inserted (the given node and any placeholders that may have to be added).

deleteNode

public void deleteNode(int index)
Deletes the node at the given index. If the node is not a MiPlaceHolder then it is replaced by one. In any case the node is deleted. In order to preserve the topology a whole row is deleted (as opposed to a whole column)

Specified by:
deleteNode in interface MiiManipulatableLayout
Overrides:
deleteNode in class MiManipulatableLayout
Parameters:
index - the index of the node to delete

addNewRowAt

public MiParts addNewRowAt(int rowNum)

addNewColumnAt

public MiParts addNewColumnAt(int colNum)

deleteRow

public void deleteRow(int rowNum)

deleteColumn

public void deleteColumn(int colNum)

calcMinimumSize

public void calcMinimumSize(MiSize size)
Gets the minimum size of this MiPart.

Overrides:
calcMinimumSize in class MiContainer
Parameters:
size - the (returned) minimum size
See Also:
MiPart.getMinimumSize(com.swfm.mica.core.MiSize)

formatTarget

public void formatTarget(java.lang.String connectionType)
Remove all of the connections and create a random network of connections of the nodes in the target.

Specified by:
formatTarget in class MiManipulatableLayout
Parameters:
connectionType - the type of connection that defines the graph