com.swfm.mica.core
Class MiWindow

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.core.MiWindow
All Implemented Interfaces:
MiiActionTypes, MiiAttributeTypes, MiiDragAndDropParticipant, MiiEventTypes, MiiNames, MiiPropertyTypes, MiiScrollableData, MiiTypes
Direct Known Subclasses:
MiInternalWindow, MiNativeWindow

public class MiWindow
extends MiEditor

This class is a MiEditor that implements the additional functionality assocaited with a 'window'. This includes managing how events are dispatched to MiParts, so that special kinds of event handlers can be supported. This includes managing the keyboard and enter-key focus's and drag and drop.

A special kind of MiWindow is called the 'root' window. Being a root window means a number of things: mainly that the window interacts (receives events and draws) directly with the AWT (java.awt.Canvas). That means that a root window is not contained in another Mica container (whereas non-root windows must be).

Event Dispatching

Events are dispatched to MiParts whose event handlers get a chance to process the event. Each event is sent first to the top MiPart at the location of the event (which is typically the location of the mouse cursor). The event is then 'bubbled up' until the root window sends the event to it's own event handlers.

This dispatching is done multiple times, potentially once for each kind of event handler. The first time the event is sent to all event 'monitors' which are special event handlers that cannot consume events. Any 'global' event monitors get the event first, and then the event is 'bubbled up' through the event monitors assigned to the MiParts at the event location.

Then, if there are event handlers that are 'grabbing' all events, the event is * sent to them and the event is then discarded. If there are not any event handlers that are 'grabbing' all events, then the event is sent to any 'global' event handlers. Global event handlers are not position dependent and so process events no matter where they occur in the window, irregardless of which MiPart they are assigned to. If not consumed by any of the global event handlers, then the event is 'bubbled up' through the event handlers assigned to the MiParts at the event location.

Root windows have a MiKeyboardFocusManager and a MiDragAndDropManager.

All windows have a MiiKeyFocusTraversalGroup and a MiStatusBarFocusManager.

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

Field Summary
                 
Constructor Summary
MiWindow()
          Constructs a new MiWindow with a size of 400x400 device coordinates.
MiWindow(MiBounds deviceBounds)
          Constructs a new MiWindow with the given device bounds.
 
Method Summary
 void appendGlobalEventHandler(MiiEventHandler eh)
          Appends the given event handler to the list of 'global' event handlers.
 void createGraphicsContents()
          This method is called to create the graphics for this MiWindow when this window is first created.
 int dispatchEvent(MiEvent event)
          Dispatches the given event to all event handlers assigned to the MiPart's in this window, and then, if not consumed, to their containers, and so on until the the event is dispatched to the event handlers of this window.
 void draw(MiRenderer renderer)
          Draws this MiWindow.
 void exposeArea(MiBounds device)
          Notify this MiWindow that the given area has been revealed to the end-user.
 MiAnimationManager getAnimationManager()
          Gets the animation manager for this window (and for all other MiParts in the root window).
 MiCanvas getCanvas()
          Gets the canvas this MiWindow uses to draw and receive events.
 MiDragAndDropManager getDragAndDropManager()
          Gets the drag and drop manager for this window.
 MiiEventHandler getGlobalEventHandler(int index)
          Gets the global event handler at the given index.
 MiiEventHandler getGrabEventHandler(int index)
          Gets the grabbing event handler at the given index.
 MiKeyboardFocusManager getKeyboardFocusManager()
          Gets the keyboard focus manager of this window.
 MiiKeyFocusTraversalGroup getKeyFocusTraversalGroup()
          Gets the keyboard and enter-key focus traversal group mamager for this window.
 int getNumberOfGlobalEventHandlers()
          Gets the number of global event handlers.
 int getNumberOfGrabEventHandlers()
          Gets the number of grabbing event handlers.
 MiStatusBarFocusManager getStatusBarFocusManager()
          Gets the status bar focus manager for this window.
 void insertGlobalEventHandler(MiiEventHandler eh, int index)
           
 void invalidateEditorPartLayout(MiPart part)
          Registers the given MiPart as needing to have it's layout validated.
 boolean isConsumingAllEventsWheneverAnyEventIsGrabbed()
           
 boolean isEmbeddedWindow()
          Gets whether this window is treated as a part of it's Mica container or as an attachment of it's container.
 boolean isRootWindow()
          Gets whether this is a root window.
 boolean needsToBeRedrawn()
          Gets whether this MiWindow, or one of it's MiParts needs to be redrawn (or re-laid out and then redrawn).
 void prependGrabEventHandler(MiiEventHandler eh)
          Prepends the given event handler to the list of 'grab' event handlers.
 void pushBackEvent(MiEvent event)
          Puts the given MiEvent into the internal queue so that it will be the next event dispatched.
 void removeGlobalEventHandler(MiiEventHandler eh)
          Removes the given event handler to the list of 'global' event handlers.
 void removeGrabEventHandler(MiiEventHandler eh)
          Removes the given event handler to the list of 'grab' event handlers.
 boolean requestEnterKeyFocus(MiPart part)
          Requests that the given MiPart gets this window's enter-key focus.
 boolean requestKeyboardFocus(MiPart part)
          Requests that the given MiPart gets this window's keyboard focus.
 void resume()
           
 void setConsumingAllEventsWheneverAnyEventIsGrabbed(boolean flag)
           
 void setDefaultEnterKeyFocus(MiPart obj)
          Specifies that the given MiPart is to get the enter-key focus whenever this window is first made visible.
 void setDefaultKeyboardFocus(MiPart part)
          Specifies that the given MiPart is to get the keyboard focus whenever this window is first made visible.
 void setIsEmbeddedWindow(boolean flag)
          Specifies whether this window is treated as a part of it's Mica container or as an attachment of it's container.
 void setKeyFocusTraversalGroup(MiiKeyFocusTraversalGroup group)
          Sets the keyboard and enter-key focus traversal group mamager for this window.
 void setStatusBarFocusManager(MiStatusBarFocusManager manager)
          Sets the status bar focus manager for this window.
 void setStatusBarFocusMessage(MiiHelpInfo messageInfo)
          Sets the message that the status bar should display because of what MiPart is under the mouse cursor.
 void setTitle(java.lang.String str)
          Sets the title text in the border of the window.
 void setVisible(boolean flag)
          Specifies whether this MiPart is visible.
 void stop()
           
 void suspend()
           
 void validateLayout()
          Validates this MiWindow's layout, and if this is a root window, prohibits the recalculation of preferred sizes during the layout and validations the layouts of any editor's in this root windwo that need it.
 
Methods inherited from class com.swfm.mica.core.MiEditor
appendItem, appendLayer, autopanForMovingObj, calcMinimumSize, calcPreferredSize, containsItem, copy, deSelect, deSelectAll, endOverrideMouseAppearance, getActiveLayer, getAFewSelectedParts, 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, overrideMouseAppearance, popMouseAppearance, pushMouseAppearance, reCalcBounds, reCalcBoundsOfContents, removeAllItems, 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
 
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, 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, 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, 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, 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

MiWindow

public MiWindow()
Constructs a new MiWindow with a size of 400x400 device coordinates.


MiWindow

public MiWindow(MiBounds deviceBounds)
Constructs a new MiWindow with the given device bounds.

Parameters:
deviceBounds - the size of the new window in device space.
Method Detail

isRootWindow

public boolean isRootWindow()
Gets whether this is a root window. It is a root window when this MiWindow writes directly to a java.awt.Canvas (and therefore this window's device coordinate space is actually in pixels).

Overrides:
isRootWindow in class MiEditor
Returns:
true if a root window

resume

public void resume()

suspend

public void suspend()

stop

public void stop()

getCanvas

public MiCanvas getCanvas()
Gets the canvas this MiWindow uses to draw and receive events. This will be null if this is not a root window.

Returns:
the canvas

getAnimationManager

public MiAnimationManager getAnimationManager()
Gets the animation manager for this window (and for all other MiParts in the root window). There is an animation manager for each java.awt.Canvas.

Overrides:
getAnimationManager in class MiEditor
Returns:
the animation manager
See Also:
MiEditor.getAnimationManager(), MiCanvas.getAnimationManager()

createGraphicsContents

public void createGraphicsContents()
This method is called to create the graphics for this MiWindow when this window is first created. This approach to delaying the creation of graphics until after the window is created is optional.


setIsEmbeddedWindow

public void setIsEmbeddedWindow(boolean flag)
Specifies whether this window is treated as a part of it's Mica container or as an attachment of it's container. This is only useful if this is a Mica window (i.e. MiInternalWindow).

Parameters:
flag - true if an embedded window

isEmbeddedWindow

public boolean isEmbeddedWindow()
Gets whether this window is treated as a part of it's Mica container or as an attachment of it's container.

Returns:
true if an embedded window

setConsumingAllEventsWheneverAnyEventIsGrabbed

public void setConsumingAllEventsWheneverAnyEventIsGrabbed(boolean flag)

isConsumingAllEventsWheneverAnyEventIsGrabbed

public boolean isConsumingAllEventsWheneverAnyEventIsGrabbed()

getDragAndDropManager

public MiDragAndDropManager getDragAndDropManager()
Gets the drag and drop manager for this window. This is null if this is not a root window.

Returns:
the drag and drop manager
See Also:
MiDragAndDropManager

setVisible

public void setVisible(boolean flag)
Specifies whether this MiPart is visible. In addition, if this is a root window and it has just been made visible, then the keyboard focus manager initializes the keyboard and enter-key focus to their default initial settings.

Overrides:
setVisible in class MiPart
Parameters:
flag - true if this MiPart is to be visible
See Also:
MiPart.setVisible(boolean), setDefaultKeyboardFocus(com.swfm.mica.core.MiPart), setDefaultEnterKeyFocus(com.swfm.mica.core.MiPart)

getKeyboardFocusManager

public MiKeyboardFocusManager getKeyboardFocusManager()
Gets the keyboard focus manager of this window. This will be null if this is not a root window.

Returns:
the keyboad focus manager
See Also:
MiKeyboardFocusManager

requestKeyboardFocus

public boolean requestKeyboardFocus(MiPart part)
Requests that the given MiPart gets this window's keyboard focus. This window must be a root window.

Parameters:
part - the part to get keyboard focus
Returns:
true if the MiPart now has the keyboard focus
See Also:
MiPart.requestKeyboardFocus(), setDefaultKeyboardFocus(com.swfm.mica.core.MiPart)

requestEnterKeyFocus

public boolean requestEnterKeyFocus(MiPart part)
Requests that the given MiPart gets this window's enter-key focus. This window must be a root window.

Parameters:
part - the part to get enter key focus
Returns:
true if the MiPart now has the enter-key focus
See Also:
MiPart.requestEnterKeyFocus(), setDefaultEnterKeyFocus(com.swfm.mica.core.MiPart)

setDefaultKeyboardFocus

public void setDefaultKeyboardFocus(MiPart part)
Specifies that the given MiPart is to get the keyboard focus whenever this window is first made visible. enter-key focus. This window must be a root window.

Parameters:
part - the part to get keyboard focus first
See Also:
setVisible(boolean), setDefaultEnterKeyFocus(com.swfm.mica.core.MiPart)

setDefaultEnterKeyFocus

public void setDefaultEnterKeyFocus(MiPart obj)
Specifies that the given MiPart is to get the enter-key focus whenever this window is first made visible. enter-key focus. This window must be a root window.

See Also:
setVisible(boolean), setDefaultKeyboardFocus(com.swfm.mica.core.MiPart)

getKeyFocusTraversalGroup

public MiiKeyFocusTraversalGroup getKeyFocusTraversalGroup()
Gets the keyboard and enter-key focus traversal group mamager for this window.

Overrides:
getKeyFocusTraversalGroup in class MiPart
Returns:
the focus traversal group
See Also:
setKeyFocusTraversalGroup(com.swfm.mica.core.MiiKeyFocusTraversalGroup)

setKeyFocusTraversalGroup

public void setKeyFocusTraversalGroup(MiiKeyFocusTraversalGroup group)
Sets the keyboard and enter-key focus traversal group mamager for this window.

Overrides:
setKeyFocusTraversalGroup in class MiPart
Parameters:
group - the focus traversal group
See Also:
getKeyFocusTraversalGroup()

getStatusBarFocusManager

public MiStatusBarFocusManager getStatusBarFocusManager()
Gets the status bar focus manager for this window. There is by default no status bar focus manager.

Returns:
the status bar focus manager.
See Also:
setStatusBarFocusManager(com.swfm.mica.core.MiStatusBarFocusManager), MiStatusBarFocusManager

setStatusBarFocusManager

public void setStatusBarFocusManager(MiStatusBarFocusManager manager)
Sets the status bar focus manager for this window. There is no status bar focus manager unless this method is used.

Parameters:
manager - the status bar focus manager.
See Also:
getStatusBarFocusManager(), MiStatusBarFocusManager

setStatusBarFocusMessage

public void setStatusBarFocusMessage(MiiHelpInfo messageInfo)
Sets the message that the status bar should display because of what MiPart is under the mouse cursor.

Parameters:
messageInfo - the status bar message and attributes
See Also:
MiiHelpInfo, MiStatusBarFocusManager

exposeArea

public void exposeArea(MiBounds device)
Notify this MiWindow that the given area has been revealed to the end-user. This MiWindow will then initiate a redraw of the area and all of this window's sub-windows in the area.

Parameters:
device - the area in device coordinates

needsToBeRedrawn

public boolean needsToBeRedrawn()
Gets whether this MiWindow, or one of it's MiParts needs to be redrawn (or re-laid out and then redrawn).

Returns:
true if needs to be drawn

draw

public void draw(MiRenderer renderer)
Draws this MiWindow. First checks for whether it is visible and not hidden and not clipped.

Overrides:
draw in class MiPart
Parameters:
renderer - the renderer to use for drawing

validateLayout

public void validateLayout()
Validates this MiWindow's layout, and if this is a root window, prohibits the recalculation of preferred sizes during the layout and validations the layouts of any editor's in this root windwo that need it.

Overrides:
validateLayout in class MiEditor
See Also:
MiEditor.validateLayout()

invalidateEditorPartLayout

public void invalidateEditorPartLayout(MiPart part)
Registers the given MiPart as needing to have it's layout validated. This is used (1) by parts that do not want to invalidate their containers and their containers up the hierarchy like everybody else and (2) by MiEditors that are parts (or parts of part) in this MiWindow. This is useful because some parts (and all editors) do not change their size or location when their layout's are validated (for example MiScrolledBox). The given part will be registered just once between the validation of layouts, no matter how many times this method is called.

Parameters:
part - the part that has an invalid layout
See Also:
validateLayout(), #hasInvalidateEditorPartLayout

pushBackEvent

public void pushBackEvent(MiEvent event)
Puts the given MiEvent into the internal queue so that it will be the next event dispatched.

Parameters:
event - the event to dispatch again
See Also:
MiCanvas.pushBackEvent(com.swfm.mica.events.MiEvent)

dispatchEvent

public int dispatchEvent(MiEvent event)
Dispatches the given event to all event handlers assigned to the MiPart's in this window, and then, if not consumed, to their containers, and so on until the the event is dispatched to the event handlers of this window.

Overrides:
dispatchEvent in class MiEditor
Parameters:
event - The event
Returns:
Mi_CONSUME_EVENT if no other event handlers should see this event Mi_PROPOGATE_EVENT if other event handlers can also see this event
See Also:
MiPart.dispatchEvent(com.swfm.mica.events.MiEvent)

prependGrabEventHandler

public void prependGrabEventHandler(MiiEventHandler eh)
Prepends the given event handler to the list of 'grab' event handlers. This is a special list of event handlers that are executed immediately after all event monitors and before any other event handlers in the containing root window. This is used when an event handler needs complete control over the event handling for a short period of time. The MiEvents sent to the event handler will be transformed to the coordinate space of the eh.getObject(). If eh.getObject() is null then it is set to be equal to this MiWindow.

Overrides:
prependGrabEventHandler in class MiEditor
Parameters:
eh - the event handler to prepend
See Also:
removeGrabEventHandler(com.swfm.mica.events.MiiEventHandler)

removeGrabEventHandler

public void removeGrabEventHandler(MiiEventHandler eh)
Removes the given event handler to the list of 'grab' event handlers.

Overrides:
removeGrabEventHandler in class MiEditor
Parameters:
eh - the event handler to remove
Throws:
java.lang.RuntimeException - if the given event handler is not in the list of 'grab' event handlers
See Also:
prependGrabEventHandler(com.swfm.mica.events.MiiEventHandler)

appendGlobalEventHandler

public void appendGlobalEventHandler(MiiEventHandler eh)
Appends the given event handler to the list of 'global' event handlers. This is a special list of event handlers that are executed immediately before sending the event to the event handlers of the parts in the targetPath. This is used when an event handler processes events that can occur anywhere in the window. An event handler specifies this fact by using it's setPositionDependent() method. The MiEvents sent to the event handler will be transformed to the coordinate space of the eh.getObject(). If eh.getObject() is null then it is set to be equal to this MiWindow.

Parameters:
eh - the event handler to append
See Also:
removeGlobalEventHandler(com.swfm.mica.events.MiiEventHandler), MiEventHandler.setPositionDependent(boolean)

insertGlobalEventHandler

public void insertGlobalEventHandler(MiiEventHandler eh,
                                     int index)

removeGlobalEventHandler

public void removeGlobalEventHandler(MiiEventHandler eh)
Removes the given event handler to the list of 'global' event handlers.

Parameters:
eh - the event handler to remove
Throws:
java.lang.RuntimeException - if the given event handler is not in the list of 'global' event handlers
See Also:
appendGlobalEventHandler(com.swfm.mica.events.MiiEventHandler)

getNumberOfGlobalEventHandlers

public int getNumberOfGlobalEventHandlers()
Gets the number of global event handlers.

See Also:
appendGlobalEventHandler(com.swfm.mica.events.MiiEventHandler), getGlobalEventHandler(int)

getGlobalEventHandler

public MiiEventHandler getGlobalEventHandler(int index)
Gets the global event handler at the given index.

Parameters:
index - index of the event handler to get
See Also:
getNumberOfGlobalEventHandlers()

getNumberOfGrabEventHandlers

public int getNumberOfGrabEventHandlers()
Gets the number of grabbing event handlers.

See Also:
prependGrabEventHandler(com.swfm.mica.events.MiiEventHandler), getGrabEventHandler(int)

getGrabEventHandler

public MiiEventHandler getGrabEventHandler(int index)
Gets the grabbing event handler at the given index.

Parameters:
index - index of the event handler to get
See Also:
getNumberOfGrabEventHandlers()

setTitle

public void setTitle(java.lang.String str)
Sets the title text in the border of the window.

Parameters:
str - the title text