com.swfm.mica.view
Class MiGraphicsEditor

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

public class MiGraphicsEditor
extends MiEditor

This class creates a graphics editor that supports the loading, displaying, editing and saving of MiiModelDocuments.

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

Field Summary
                 
Constructor Summary
MiGraphicsEditor()
          Constructs a new MiGraphicsEditor.
 
Method Summary
 MiEditingPermissions getEditingPermissions()
          Gets the editing permissions for the currently open document.
 MiiController getOpenDocumentController()
          Gets the manager of the current open document.
 java.lang.String getOpenDocumentTitle()
          Gets the title of the open document, if any.
 void load(java.io.BufferedInputStream inputStream, java.lang.String filename)
          Loads the contents of the graphics editor from the given stream.
 boolean save(java.io.OutputStream outputStream, java.lang.String streamName)
          Saves the contents of the graphics editor.
 void setOpenDocumentController(MiiController controller)
          Sets the manager of the current open document.
 void setPrototypeController(MiiController controller)
          Sets the default controller to use to load documents with.
 
Methods inherited from class com.swfm.mica.core.MiEditor
appendItem, appendLayer, autopanForMovingObj, calcMinimumSize, calcPreferredSize, containsItem, copy, deSelect, deSelectAll, dispatchEvent, endOverrideMouseAppearance, getActiveLayer, getAFewSelectedParts, getAnimationManager, getAutopanningCanExpandUniverse, getCurrentConnectionLayer, getCurrentLayer, getDeviceBounds, getDeviceBounds, getFilter, getIndexOfItem, getIndexOfLayer, getInnerBounds, getItem, getItem, getIterator, getLayer, getMouseAppearance, getMousePosition, getMousePosition, getNormalizedHorizontalAmountVisible, getNormalizedHorizontalPosition, getNormalizedVerticalAmountVisible, getNormalizedVerticalPosition, getNumberOfItems, getNumberOfLayers, getNumberOfPartsSelected, getPageManager, getRenderer, getSelectedParts, getSelectionManager, getSnapManager, getTransform, getTransformFromHereToRoot, getUniverseBounds, getUniverseBounds, getViewport, getViewportSizeLayout, getWorldBounds, getWorldBounds, hasLayers, hasValidLayout, insertItem, insertLayer, invalidateLayout, isBitbltScrollingEnabled, isHandlingScrollingDiscreteAmountsLocally, isLayer, isRootWindow, overrideMouseAppearance, popMouseAppearance, prependGrabEventHandler, pushMouseAppearance, reCalcBounds, reCalcBoundsOfContents, removeAllItems, removeGrabEventHandler, removeItem, removeItem, removeLayer, render, restoreNormalMouseAppearance, scale, scrollChunkDown, scrollChunkLeft, scrollChunkRight, scrollChunkUp, scrollLineDown, scrollLineLeft, scrollLineRight, scrollLineUp, scrollPageDown, scrollPageLeft, scrollPageRight, scrollPageUp, scrollToBottom, scrollToLeftSide, scrollToNormalizedHorizontalPosition, scrollToNormalizedVerticalPosition, scrollToRightSide, scrollToTop, select, selectAdditional, setActiveLayer, setAutopanningCanExpandUniverse, setBitbltScrollingEnabled, setBounds, setCurrentConnectionLayer, setCurrentLayer, setCurrentLayer, setDeviceBounds, setFilter, setHasLayers, setItem, setLayer, setMouseAppearance, setMousePosition, setPageManager, setSelectionManager, setSnapManager, setUniverseBounds, setViewportSizeLayout, setWorldBounds, snapMovingPart, snapMovingPoint, snapPart, transformFromChildSpace, transformLocalWorldToRootWorld, transformRootWorldToLocalWorld, transformToChildSpace, transformToOtherEditorSpace, translate, translatePart, updateLayerBounds, validateLayout
 
Methods inherited from class com.swfm.mica.core.MiContainer
appendPart, containsPart, deepCopy, doImport, getIndexOfPart, getIntersectionWithLine, getKeepConnectionsBelowNodes, getNumberOfParts, getPart, getPart, getSupportedImportFormats, 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, appendPoint, appendPoint, applyCustomLookAndFeel, containsOpaqueRectangles, copy, deleteAllConnections, deleteAllParts, deleteSelf, dispatchAction, dispatchAction, dispatchAction, dispatchActionRequest, dispatchActionRequest, dispatchActionRequest, 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, getInnerBounds, getInvalidAreaNotificationsEnabled, getInvalidLayoutNotificationsEnabled, 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, 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, getTransparency, getValidatingLayout, getVisibilityAnimator, getWhiteColor, getWidth, getWriteMode, getXmax, getXmin, getXorColor, getYmax, getYmin, hasAttachment, hasAttribute, hasEnterKeyFocus, hasEventHandler, hasFixedAspectRatio, hasFixedHeight, hasFixedWidth, hasKeyboardFocus, hasMouseFocus, hasOverriddenMinimumSize, hasOverriddenPreferredSize, hasProperty, hasTotallyInvalidArea, insertActionHandler, insertActionHandler, insertActionHandler, insertConnection, insertContainer, insertEventHandler, insertPoint, insertPoint, invalidateArea, invalidateArea, 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, layoutParts, makeImageFromArea, makeLayoutManipulator, makeManipulator, optimizedInvalidateArea, optimizedInvalidateDrawBoundsArea, overrideAttributes, overrideEventHandlingDisabledByContainer, packLayout, pickDeepList, preRenderToDoubleBuffer, refreshBounds, refreshLookAndFeel, refreshLookAndFeel, removeActionHandler, removeActionHandler, removeActionHandlers, removeAllActionHandlers, removeAllAttachments, removeAllConnections, removeAllEventHandlers, removeAllManipulators, removeAttachment, removeAttachment, removeCommandHandler, removeCommandHandler, removeConnection, removeConnection, removeContainer, removeContainer, removeEventHandler, removeFromAllContainers, removePoint, removeResource, removeSelf, replaceDrawBounds, replaceSelf, requestEnterKeyFocus, requestKeyboardFocus, rotate, rotate, rotateTo, 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, 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, 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, toString, translate, translatePoint, validatePropertyValue, waitUntilRedrawn
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MiGraphicsEditor

public MiGraphicsEditor()
Constructs a new MiGraphicsEditor.

Method Detail

setPrototypeController

public void setPrototypeController(MiiController controller)
Sets the default controller to use to load documents with. Note that this is copied before use because a document may specify it's own MiIOFormatManager and MiViewManagers.

Parameters:
controller - the default controller

getOpenDocumentController

public MiiController getOpenDocumentController()
Gets the manager of the current open document.

Returns:
the document manager

setOpenDocumentController

public void setOpenDocumentController(MiiController controller)
Sets the manager of the current open document.

Parameters:
controller - the document manager

save

public boolean save(java.io.OutputStream outputStream,
                    java.lang.String streamName)
Saves the contents of the graphics editor.

Parameters:
streamName - the name of the stream
Returns:
true if successful

load

public void load(java.io.BufferedInputStream inputStream,
                 java.lang.String filename)
          throws java.io.IOException
Loads the contents of the graphics editor from the given stream. The first line of the stream is examined to determine the format of the stream.

Throws:
java.io.IOException

getEditingPermissions

public MiEditingPermissions getEditingPermissions()
Gets the editing permissions for the currently open document.

Returns:
the editing permissions

getOpenDocumentTitle

public java.lang.String getOpenDocumentTitle()
Gets the title of the open document, if any.

Returns:
the title or null