com.swfm.mica.core
Class MiAttachments

java.lang.Object
  extended bycom.swfm.mica.core.MiPart
      extended bycom.swfm.mica.core.MiContainer
          extended bycom.swfm.mica.core.MiAttachments
All Implemented Interfaces:
MiiActionTypes, MiiAttributeTypes, MiiDragAndDropParticipant, MiiEventTypes, MiiNames, MiiPropertyTypes, MiiTypes

public class MiAttachments
extends MiContainer

Note, this clased sparingly, as the master MiPart's should API should be used to add and remove things from an MiAttachments.

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

Field Summary
                 
Constructor Summary
MiAttachments()
           
MiAttachments(MiPart obj)
           
 
Method Summary
 void appendAttachment(MiPart obj, int location, java.lang.String tag, MiMargins margins)
          Append the given part to the attachments of this MiPart.
 void appendAttachment(MiPart obj, int location, java.lang.String tag, MiMargins margins, boolean drawAfter)
           
 MiPart deepCopy()
          Makes and returns a copy of this container and all of it's parts.
 void drawAfter(MiRenderer renderer)
           
 void drawBefore(MiRenderer renderer)
           
 MiPart getAttachment(java.lang.String tag)
          Get this MiPart's attachment with the given tag.
 MiMargins getAttachmentMargins(java.lang.String tag)
          Get this MiPart's attachment's margins with the given tag.
 MiPart getContainer(int index)
          Gets the container at the given index.
 int getNumberOfContainers()
          Gets the number of containers of this MiPart.
 boolean hasAttachment(MiPart obj)
          Gets whether this MiPart has the given attachment.
 void invalidateArea()
          Invalidates the entire area (drawBounds) of this MiPart.
 void invalidateArea(MiBounds area)
          Invalidates the given area of this MiPart if invalid area notifications are enabled.
 void invalidateCachedEventHandlerInfo()
          Invalidates the cached information about the event handlers assigned to this MiPart and it's containers.
 void invalidateLayout()
          Specifies that this MiPart has an invalid layout if incoming invalid layout notifications are enabled.
 void invalidateLayouts()
           
 boolean isBeforePart(MiPart obj)
           
 void layoutParts()
          Call any layout to validate itself.
 void pickDeepListAfter(MiBounds area, MiParts list)
           
 void pickDeepListBefore(MiBounds area, MiParts list)
           
 void removeAllAttachments()
          Remove all of this MiPart's attachments.
 void removeAttachment(MiPart obj)
          Remove the given attachment from this MiPart.
 void removeAttachment(java.lang.String tag)
          Remove this MiPart's attachment with the given tag.
 void setAttachedToObject(MiPart obj)
           
 void setAttachmentDrawnAfter(java.lang.String tag, boolean drawAfter)
          The default is true, attachments drawn after attached-to part and all its parts
 void setAttachmentMargins(java.lang.String tag, MiMargins margins)
          Set this MiPart's attachment's margins with the given tag.
 boolean setAttachmentTag(MiPart obj, java.lang.String tag)
           
 java.lang.String toString()
          Returns information about this MiPart.
 
Methods inherited from class com.swfm.mica.core.MiContainer
appendPart, calcMinimumSize, calcPreferredSize, containsPart, doImport, getIndexOfPart, getIntersectionWithLine, getKeepConnectionsBelowNodes, getNumberOfParts, getPart, getPart, getSupportedImportFormats, hasEventHandlers, hasValidCachedEventHandlerInfo, insertPart, 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, appendCommandHandler, appendCommandHandler, appendCommandHandler, appendConnection, appendContainer, appendEventHandler, appendItem, appendPoint, appendPoint, applyCustomLookAndFeel, containsItem, containsOpaqueRectangles, copy, 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, 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, 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, getLayoutManipulator, getLightColor, getLineEndSize, getLineEndsRenderer, getLineEndsSizeFnOfLineWidth, getLineEndStyle, getLineStartSize, getLineStartStyle, getLineStyle, getLineWidth, getLocallyRequestedEventTypes, getManipulator, getMargins, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumPickAreaSize, getMinimumSize, getMinimumWidth, getName, getNumberOfActionHandlers, getNumberOfAttachments, getNumberOfConnections, getNumberOfDeepConnections, getNumberOfEventHandlers, getNumberOfItems, getNumberOfPoints, getNumberOfResources, getOutgoingInvalidLayoutNotificationsEnabled, getPoint, getPoint, getPointEntryAngle, getPointExitAngle, getPointX, getPointY, getPreferredSize, getPropertyDescriptions, getPropertyValue, 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, hasAttribute, hasEnterKeyFocus, hasEventHandler, hasFixedAspectRatio, hasFixedHeight, hasFixedWidth, hasKeyboardFocus, hasMouseFocus, hasOverriddenMinimumSize, hasOverriddenPreferredSize, hasProperty, hasTotallyInvalidArea, hasValidLayout, insertActionHandler, insertActionHandler, insertActionHandler, insertConnection, insertContainer, insertEventHandler, insertItem, insertPoint, insertPoint, 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, makeLayoutManipulator, makeManipulator, optimizedInvalidateArea, optimizedInvalidateDrawBoundsArea, overrideAttributes, overrideEventHandlingDisabledByContainer, packLayout, pickDeepList, preRenderToDoubleBuffer, refreshBounds, refreshLookAndFeel, refreshLookAndFeel, removeActionHandler, removeActionHandler, removeActionHandlers, removeAllActionHandlers, removeAllConnections, removeAllEventHandlers, removeAllItems, removeAllManipulators, 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, 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, setPropertyValue, 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
 

Constructor Detail

MiAttachments

public MiAttachments()

MiAttachments

public MiAttachments(MiPart obj)
Method Detail

setAttachedToObject

public void setAttachedToObject(MiPart obj)

getContainer

public MiPart getContainer(int index)
Description copied from class: MiPart
Gets the container at the given index.

Overrides:
getContainer in class MiPart
Parameters:
index - the index of the container to get
Returns:
the part at the given index

getNumberOfContainers

public int getNumberOfContainers()
Description copied from class: MiPart
Gets the number of containers of this MiPart. NOTE: at the current time the first container is considered 'special', as the one that determines the 'home' editor or window this parts is in. The other containers are considered auxilary views - probably references.

Overrides:
getNumberOfContainers in class MiPart
Returns:
the number of containers

appendAttachment

public void appendAttachment(MiPart obj,
                             int location,
                             java.lang.String tag,
                             MiMargins margins)
Description copied from class: MiPart
Append the given part to the attachments of this MiPart. The location can be one of the locations below, the number of a point (i.e. a value of 2 would attach the given part to the 3rd point of a polyline), or Mi_LAST_POINT_NUMBER. Margins are treated specially for Mi_LINE_xxx locations; margins.left is the distance from the closest 'end' of the line and margins.bottom is the orthogonal distance from the line itself. Mi_CENTER_LOCATION 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_INSIDE_LEFT_LOCATION Mi_INSIDE_RIGHT_LOCATION Mi_INSIDE_BOTTOM_LOCATION Mi_INSIDE_TOP_LOCATION Mi_INSIDE_LOWER_LEFT_LOCATION Mi_INSIDE_LOWER_RIGHT_LOCATION Mi_INSIDE_UPPER_LEFT_LOCATION Mi_INSIDE_UPPER_RIGHT_LOCATION Mi_OUTSIDE_LEFT_LOCATION Mi_OUTSIDE_RIGHT_LOCATION Mi_OUTSIDE_BOTTOM_LOCATION Mi_OUTSIDE_TOP_LOCATION Mi_OUTSIDE_LOWER_LEFT_LOCATION Mi_OUTSIDE_LOWER_RIGHT_LOCATION Mi_OUTSIDE_UPPER_LEFT_LOCATION Mi_OUTSIDE_UPPER_RIGHT_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_START_LOCATION Mi_END_LOCATION Mi_LINE_CENTER_LOCATION Mi_LINE_CENTER_TOP_OR_RIGHT_LOCATION Mi_LINE_CENTER_BOTTOM_OR_LEFT_LOCATION Mi_LINE_START_LOCATION Mi_LINE_START_TOP_OR_RIGHT_LOCATION Mi_LINE_START_BOTTOM_OR_LEFT_LOCATION Mi_LINE_END_LOCATION Mi_LINE_END_TOP_OR_RIGHT_LOCATION Mi_LINE_END_BOTTOM_OR_LEFT_LOCATION Mi_SURROUND_LOCATION Mi_ALONG_LOCATION Mi_NO_LOCATION

Overrides:
appendAttachment in class MiPart
Parameters:
obj - the attachment to append to this
location - the location relative to this MiPart to put the attachment
tag - the tag to be used to identify the attachment
margins - the margin to be used to adjust the location of the attachment

appendAttachment

public void appendAttachment(MiPart obj,
                             int location,
                             java.lang.String tag,
                             MiMargins margins,
                             boolean drawAfter)

removeAllAttachments

public void removeAllAttachments()
Description copied from class: MiPart
Remove all of this MiPart's attachments.

Overrides:
removeAllAttachments in class MiPart

removeAttachment

public void removeAttachment(MiPart obj)
Description copied from class: MiPart
Remove the given attachment from this MiPart.

Overrides:
removeAttachment in class MiPart
Parameters:
obj - the attachment to remove

hasAttachment

public boolean hasAttachment(MiPart obj)
Description copied from class: MiPart
Gets whether this MiPart has the given attachment.

Overrides:
hasAttachment in class MiPart
Parameters:
obj - the attachment to check for
Returns:
true if this MiPart has obj as an attachment

setAttachmentTag

public boolean setAttachmentTag(MiPart obj,
                                java.lang.String tag)

isBeforePart

public boolean isBeforePart(MiPart obj)

removeAttachment

public void removeAttachment(java.lang.String tag)
Description copied from class: MiPart
Remove this MiPart's attachment with the given tag.

Overrides:
removeAttachment in class MiPart
Parameters:
tag - the tag of the attachment

getAttachment

public MiPart getAttachment(java.lang.String tag)
Description copied from class: MiPart
Get this MiPart's attachment with the given tag.

Overrides:
getAttachment in class MiPart
Parameters:
tag - the tag of the attachment
Returns:
the attachment

getAttachmentMargins

public MiMargins getAttachmentMargins(java.lang.String tag)
Description copied from class: MiPart
Get this MiPart's attachment's margins with the given tag.

Overrides:
getAttachmentMargins in class MiPart
Parameters:
tag - the tag of the attachment
Returns:
the margins

setAttachmentDrawnAfter

public void setAttachmentDrawnAfter(java.lang.String tag,
                                    boolean drawAfter)
The default is true, attachments drawn after attached-to part and all its parts

Overrides:
setAttachmentDrawnAfter in class MiPart

setAttachmentMargins

public void setAttachmentMargins(java.lang.String tag,
                                 MiMargins margins)
Description copied from class: MiPart
Set this MiPart's attachment's margins with the given tag.

Overrides:
setAttachmentMargins in class MiPart
Parameters:
tag - the tag of the attachment
margins - the margins of the attachment

deepCopy

public MiPart deepCopy()
Description copied from class: MiContainer
Makes and returns a copy of this container and all of it's parts.

Overrides:
deepCopy in class MiContainer
Returns:
the copy
See Also:
MiPart.copy()

pickDeepListBefore

public void pickDeepListBefore(MiBounds area,
                               MiParts list)

pickDeepListAfter

public void pickDeepListAfter(MiBounds area,
                              MiParts list)

drawBefore

public void drawBefore(MiRenderer renderer)

drawAfter

public void drawAfter(MiRenderer renderer)

invalidateArea

public void invalidateArea()
Description copied from class: MiPart
Invalidates the entire area (drawBounds) of this MiPart. This then in turn invalidates the corresponding area of all of this MiPart's containers, ending at the container (usually an MiEditor) that is an opaque rectangle.

Overrides:
invalidateArea in class MiPart
See Also:
MiPart.setInvalidAreaNotificationsEnabled(boolean)

invalidateArea

public void invalidateArea(MiBounds area)
Description copied from class: MiPart
Invalidates the given area of this MiPart if invalid area notifications are enabled. The area must intersect the drawBounds of this MiPart. This then in turn invalidates the corresponding area of all of this MiPart's containers, ending at the container (usually an MiEditor) that is an opaque rectangle.

Overrides:
invalidateArea in class MiPart
Parameters:
area - the area to invalidate
See Also:
MiPart.setInvalidAreaNotificationsEnabled(boolean)

invalidateCachedEventHandlerInfo

public void invalidateCachedEventHandlerInfo()
Description copied from class: MiContainer
Invalidates the cached information about the event handlers assigned to this MiPart and it's containers.

Overrides:
invalidateCachedEventHandlerInfo in class MiContainer

invalidateLayouts

public void invalidateLayouts()

invalidateLayout

public void invalidateLayout()
Description copied from class: MiPart
Specifies that this MiPart has an invalid layout if incoming invalid layout notifications are enabled. This MiPart may or may not have a layout. Any attachments also have their layouts invalidated at this time. Any containers have their layouts invalidated at this time if outgoing invalid layout notifications are enabled.

Overrides:
invalidateLayout in class MiPart
See Also:
MiPart.setInvalidLayoutNotificationsEnabled(boolean), MiPart.setIncomingInvalidLayoutNotificationsEnabled(boolean), MiPart.setOutgoingInvalidLayoutNotificationsEnabled(boolean)

layoutParts

public void layoutParts()
Description copied from class: MiPart
Call any layout to validate itself. Not usually called directly, call validateLayout() instead.

Overrides:
layoutParts in class MiPart

toString

public java.lang.String toString()
Description copied from class: MiPart
Returns information about this MiPart.

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