com.swfm.mica.widgets
Class MiStandardMenu

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.core.MiVisibleContainer
                  extended bycom.swfm.mica.widgets.MiWidget
                      extended bycom.swfm.mica.widgets.MiStandardMenu
All Implemented Interfaces:
MiiActionHandler, MiiActionTypes, MiiAttributeTypes, MiiBrowsableGrid, MiiCommandHandler, MiiCopyable, MiiDragAndDropParticipant, MiiEventTypes, MiiLayout, MiiNames, MiiPropertyTypes, MiiTypes

public class MiStandardMenu
extends MiWidget
implements MiiBrowsableGrid, MiiCommandHandler, MiiActionHandler

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

Field Summary
                   
Constructor Summary
MiStandardMenu()
           
 
Method Summary
 boolean activateItem(MiBounds cursor)
           
 void appendItem(MiMenuItem item)
           
 void browseHorizontalEndItem()
           
 void browseHorizontalHomeItem()
           
 void browseHorizontalNextItem()
           
 void browseHorizontalPreviousItem()
           
 void browseItem(MiBounds cursor)
           
 void browseVerticalEndItem()
           
 void browseVerticalHomeItem()
           
 void browseVerticalNextItem()
           
 void browseVerticalPreviousItem()
           
 void calcMinimumSize(MiSize size)
          Gets the minimum size of this MiPart.
 void calcPreferredSize(MiSize size)
          Gets the preferred size of this MiPart.
 void deBrowseAll()
           
 void deSelectAll()
           
 void draw(MiRenderer renderer)
          Draws this MiPart.
 MiShortCutHandler getAccelerators()
           
 MiAttributes getArmedItemAttributes()
           
 boolean getEachRowHasSameHeight()
           
 int getIndexOfItem(MiMenuItem item)
           
 MiPart getItem(int index)
          Gets the item of this container at the given index.
 MiMenuItem getMenuItem(int index)
           
 int getNumberOfItems()
          Gets the number of items this container has.
 void insertItem(MiMenuItem item, int index)
           
 boolean isBrowsable()
           
 boolean processAction(MiiAction action)
          Processes the given action.
 void processCommand(java.lang.String arg)
          Processes the given command.
 void refreshLookAndFeel()
           
 void removeAllAdjacentSeparators()
           
 void removeAllItems()
          Removes all items from this container.
 void removeItem(MiMenuItem item)
           
 void selectAdditionalItem(MiBounds cursor)
           
 void selectBrowsedItem()
           
 void selectInterveningItems(MiBounds cursor)
           
 boolean selectItem(MiBounds cursor)
           
 void setArmedItemAttributes(MiAttributes atts)
           
 void setEachRowHasSameHeight(boolean flag)
           
 boolean toggleSelectItem(MiBounds cursor)
           
 
Methods inherited from class com.swfm.mica.widgets.MiWidget
copy, doExport, getContents, getEnterKeyFocusAttributes, getEnterKeyFocusBackgroundColor, getEnterKeyFocusBorderLook, getEnterKeyFocusColor, getEnterKeyFocusStatusHelp, getInSensitiveAttributes, getInSensitiveBackgroundColor, getInSensitiveBorderLook, getInSensitiveColor, getInSensitiveStatusHelp, getKeyboardFocusAttributes, getKeyboardFocusBackgroundColor, getKeyboardFocusBorderLook, getKeyboardFocusColor, getKeyboardFocusStatusHelp, getMouseFocusAttributes, getMouseFocusBackgroundColor, getMouseFocusBorderLook, getMouseFocusColor, getMouseFocusStatusHelp, getNormalAttributes, getNormalBackgroundColor, getNormalBorderLook, getNormalColor, getNormalStatusHelp, getPropertyDescriptions, getPropertyValue, getRadioStateEnforcer, getSelectedAttributes, getSelectedBackgroundColor, getSelectedBorderLook, getSelectedColor, getSelectedStatusHelp, getToolkit, getValue, getWidgetAttributes, isAutoAttributesEnabled, isDesignTime, select, setAttributes, setAutoAttributesEnabled, setContents, setCurrentBackgroundColor, setCurrentColor, setEnterKeyFocus, setEnterKeyFocusAttributes, setEnterKeyFocusBackgroundColor, setEnterKeyFocusBorderLook, setEnterKeyFocusColor, setEnterKeyFocusStatusHelpMessage, setInSensitiveAttributes, setInSensitiveBackgroundColor, setInSensitiveBorderLook, setInSensitiveColor, setInSensitiveStatusHelpMessage, setKeyboardFocus, setKeyboardFocusAttributes, setKeyboardFocusBackgroundColor, setKeyboardFocusBorderLook, setKeyboardFocusColor, setKeyboardFocusStatusHelpMessage, setMouseFocus, setMouseFocusAttributes, setMouseFocusBackgroundColor, setMouseFocusBorderLook, setMouseFocusColor, setMouseFocusStatusHelpMessage, setNormalAttributes, setNormalBackgroundColor, setNormalBorderLook, setNormalColor, setNormalStatusHelpMessage, setPropertyValue, setPropertyValues, setRadioStateEnforcer, setSelectedAttributes, setSelectedBackgroundColor, setSelectedBorderLook, setSelectedColor, setSelectedStatusHelpMessage, setSensitive, setValue, setWidgetAttributes, setWidgetAttributes
 
Methods inherited from class com.swfm.mica.core.MiVisibleContainer
getContainerLayoutSpec, getDisplaysFocusBorder, getInnerBounds, getIntersectionWithLine, getOKToDrawOutsideInnerBounds, getShadowShape, getShape, getTotalMargins, getVisibleContainerAutomaticLayoutEnabled, invalidateArea, isShapeShrinkToFitEnabled, pick, setContainerLayoutSpec, setDisplaysFocusBorder, setMargins, setOKToDrawOutsideInnerBounds, setShape, setShape, setShapeShrinkToFitEnabled, setVisibleContainerAutomaticLayoutEnabled
 
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, setTarget, setUniqueElementIndex, setUniqueElementSizing, toString
 
Methods inherited from class com.swfm.mica.core.MiContainer
appendPart, containsPart, deepCopy, doImport, getIndexOfPart, getKeepConnectionsBelowNodes, getNumberOfParts, getPart, getPart, getSupportedImportFormats, hasEventHandlers, hasValidCachedEventHandlerInfo, insertPart, invalidateCachedEventHandlerInfo, isContainerOf, isContainerOf, isContainerOfWithAttachments, 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, 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, getInvalidAreaNotificationsEnabled, getInvalidLayoutNotificationsEnabled, 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, getNumberOfPoints, getNumberOfResources, getOutgoingInvalidLayoutNotificationsEnabled, getPoint, getPoint, getPointEntryAngle, getPointExitAngle, getPointX, getPointY, getPreferredSize, getPrototypeManipulator, getRelativeLocation, getResource, getResourceName, getRootWindow, getRotation, getSelectionGraphics, getShadowColor, getShadowDirection, getShadowLength, getShadowRenderer, 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, 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, makeLayoutManipulator, makeManipulator, optimizedInvalidateArea, optimizedInvalidateDrawBoundsArea, overrideAttributes, overrideEventHandlingDisabledByContainer, packLayout, pickDeepList, preRenderToDoubleBuffer, refreshBounds, refreshLookAndFeel, removeActionHandler, removeActionHandler, removeActionHandlers, removeAllActionHandlers, removeAllAttachments, removeAllConnections, removeAllEventHandlers, 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, set1DShapeStrokeBackgroundColor, set1DShapeStrokesFilled, setAcceptingEnterKeyFocus, setAcceptingKeyboardFocus, setAcceptingMouseFocus, setAcceptingTabKeys, setActionDispatchingEnabled, setAfterRenderer, setAlphaCompositeRenderMode, setAnnotationPointManager, setAttachmentDrawnAfter, setAttachmentMargins, setAttachmentsVisibility, setAttributeLockMask, setAttributePublicMask, 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, setMaximumHeight, setMaximumWidth, setMinimumHeight, setMinimumPickAreaSize, setMinimumSize, setMinimumWidth, setMovable, setName, setNumberOfPoints, setOutgoingInvalidLayoutNotificationsEnabled, setPickable, setPickableWhenTransparent, setPoint, setPoint, setPreferredSize, setPrintable, setPrototypeManipulator, setResource, setSavable, setSelectable, setSelectionGraphics, 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.widgets.MiiBrowsableGrid
isSensitive
 
Methods inherited from interface com.swfm.mica.layouts.MiiLayout
getMinimumSize, getPreferredSize, invalidateLayout
 

Constructor Detail

MiStandardMenu

public MiStandardMenu()
Method Detail

getArmedItemAttributes

public MiAttributes getArmedItemAttributes()

setArmedItemAttributes

public void setArmedItemAttributes(MiAttributes atts)

getAccelerators

public MiShortCutHandler getAccelerators()

setEachRowHasSameHeight

public void setEachRowHasSameHeight(boolean flag)

getEachRowHasSameHeight

public boolean getEachRowHasSameHeight()

appendItem

public void appendItem(MiMenuItem item)

insertItem

public void insertItem(MiMenuItem item,
                       int index)

removeItem

public void removeItem(MiMenuItem item)

removeAllItems

public void removeAllItems()
Description copied from class: MiPart
Removes all items from this container.

Overrides:
removeAllItems in class MiPart

removeAllAdjacentSeparators

public void removeAllAdjacentSeparators()

getIndexOfItem

public int getIndexOfItem(MiMenuItem item)

getNumberOfItems

public int getNumberOfItems()
Description copied from class: MiPart
Gets the number of items this container has.

Overrides:
getNumberOfItems in class MiPart
Returns:
the number of items

getItem

public MiPart getItem(int index)
Description copied from class: MiPart
Gets the item of this container at the given index.

Overrides:
getItem in class MiPart
Parameters:
index - the index of the item to get
Returns:
the item at the index

getMenuItem

public MiMenuItem getMenuItem(int index)

isBrowsable

public boolean isBrowsable()
Specified by:
isBrowsable in interface MiiBrowsableGrid

browseItem

public void browseItem(MiBounds cursor)
Specified by:
browseItem in interface MiiBrowsableGrid

activateItem

public boolean activateItem(MiBounds cursor)
Specified by:
activateItem in interface MiiBrowsableGrid

toggleSelectItem

public boolean toggleSelectItem(MiBounds cursor)
Specified by:
toggleSelectItem in interface MiiBrowsableGrid

selectItem

public boolean selectItem(MiBounds cursor)
Specified by:
selectItem in interface MiiBrowsableGrid

selectBrowsedItem

public void selectBrowsedItem()
Specified by:
selectBrowsedItem in interface MiiBrowsableGrid

browseVerticalPreviousItem

public void browseVerticalPreviousItem()
Specified by:
browseVerticalPreviousItem in interface MiiBrowsableGrid

browseVerticalNextItem

public void browseVerticalNextItem()
Specified by:
browseVerticalNextItem in interface MiiBrowsableGrid

browseHorizontalPreviousItem

public void browseHorizontalPreviousItem()
Specified by:
browseHorizontalPreviousItem in interface MiiBrowsableGrid

browseHorizontalNextItem

public void browseHorizontalNextItem()
Specified by:
browseHorizontalNextItem in interface MiiBrowsableGrid

browseVerticalHomeItem

public void browseVerticalHomeItem()
Specified by:
browseVerticalHomeItem in interface MiiBrowsableGrid

browseVerticalEndItem

public void browseVerticalEndItem()
Specified by:
browseVerticalEndItem in interface MiiBrowsableGrid

browseHorizontalHomeItem

public void browseHorizontalHomeItem()
Specified by:
browseHorizontalHomeItem in interface MiiBrowsableGrid

browseHorizontalEndItem

public void browseHorizontalEndItem()
Specified by:
browseHorizontalEndItem in interface MiiBrowsableGrid

deSelectAll

public void deSelectAll()
Specified by:
deSelectAll in interface MiiBrowsableGrid

selectAdditionalItem

public void selectAdditionalItem(MiBounds cursor)
Specified by:
selectAdditionalItem in interface MiiBrowsableGrid

selectInterveningItems

public void selectInterveningItems(MiBounds cursor)
Specified by:
selectInterveningItems in interface MiiBrowsableGrid

deBrowseAll

public void deBrowseAll()
Specified by:
deBrowseAll in interface MiiBrowsableGrid

calcPreferredSize

public void calcPreferredSize(MiSize size)
Description copied from class: MiVisibleContainer
Gets the preferred size of this MiPart. Override this, if desired, as it implements the core functionality.

Overrides:
calcPreferredSize in class MiVisibleContainer
Parameters:
size - the (returned) preferred size
See Also:
MiPart.getPreferredSize(com.swfm.mica.core.MiSize)

calcMinimumSize

public void calcMinimumSize(MiSize size)
Description copied from class: MiVisibleContainer
Gets the minimum size of this MiPart. Override this, if desired, as it implements the core functionality.

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

draw

public void draw(MiRenderer renderer)
Description copied from class: MiPart
Draws this MiPart. First checks for whether it is visible and not hidden and not clipped. This should rarely, if ever, be called from outside Mica. This is used here, and by advanced widgets from their own render() methods. Mica takes care of calling this automatically when a part needs to be redrawn.

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

processCommand

public void processCommand(java.lang.String arg)
Description copied from interface: MiiCommandHandler
Processes the given command.

Specified by:
processCommand in interface MiiCommandHandler

processAction

public boolean processAction(MiiAction action)
Description copied from interface: MiiActionHandler
Processes the given action.

Specified by:
processAction in interface MiiActionHandler
Parameters:
action - the action to process
Returns:
true if it is OK to send action to the next action handler false if it is NOT OK to send action to the next action handler

refreshLookAndFeel

public void refreshLookAndFeel()
Overrides:
refreshLookAndFeel in class MiPart