planetj.gui
Class CMMenuItemJ

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.AbstractButton
                          |
                          +--javax.swing.JMenuItem
                                |
                                +--planetj.gui.CMMenuItemJ
All Implemented Interfaces:
Accessible, ImageObserver, ItemSelectable, MenuContainer, MenuElement, Serializable, SwingConstants

public class CMMenuItemJ
extends JMenuItem

Provides I18N and some icon and focus handling events in addition to all swing features.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractButton
BORDER_PAINTED_CHANGED_PROPERTY, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CMMenuItemJ()
          CMMenuItemJ constructor comment.
CMMenuItemJ(Icon icon)
          CMMenuItemJ constructor comment.
CMMenuItemJ(String text)
          CMMenuItemJ constructor comment.
CMMenuItemJ(String text, Icon icon)
          CMMenuItemJ constructor comment.
CMMenuItemJ(String text, int mnemonic)
          CMMenuItemJ constructor comment.
 
Method Summary
 boolean equals(Object obj)
          We are comparing the name of the class so be sure to provide correct naming standards as follows below.
 Icon getFocusGainedIcon()
          This will return the focus gained icon Creation date: (1/26/00 3:08:47 PM)
 Icon getFocusLostIcon()
          This will return the focus lost icon Creation date: (1/26/00 3:08:47 PM)
 String getTranslation()
          Gets the translated String.
 String getTranslationId()
          Gets the key of the translated String.
 boolean isIconChangedOnFocusGained()
          Detirmines if the icon is suppose to change on focus gained Creation date: (1/26/00 3:03:59 PM)
static void main(String[] args)
          main entrypoint - starts the part when it is run as an application
 void setFocusGainedIcon(Icon icon)
          This will set the icon to be displayed on focus gained on this menu item
 void setFocusLostIcon(Icon newFocusLostIcon)
          This will set the icon to be displayed on focus lost on this menu item
 void setIconChangedOnFocusGained(boolean newIconChangedOnFocusGained)
          This will set whether the icon should be changed on focus gained.
 void setLabel(String key)
          Overrides the superclass to set the key for the translated String.
 void setText(String key)
          Overrides the superclass to set the key for the translated String.
 void setToolTipText(String toolTip)
          Sets the toolTipText property (java.lang.String) value.
 void setTranslation(String newTranslation)
          Sets the String without translating it.
 
Methods inherited from class javax.swing.JMenuItem
addMenuDragMouseListener, addMenuKeyListener, getAccelerator, getAccessibleContext, getComponent, getMenuDragMouseListeners, getMenuKeyListeners, getSubElements, getUIClassID, isArmed, menuSelectionChanged, processKeyEvent, processMenuDragMouseEvent, processMenuKeyEvent, processMouseEvent, removeMenuDragMouseListener, removeMenuKeyListener, setAccelerator, setArmed, setEnabled, setUI, updateUI
 
Methods inherited from class javax.swing.AbstractButton
addActionListener, addChangeListener, addItemListener, doClick, doClick, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setFocusPainted, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setMargin, setMnemonic, setMnemonic, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setUI, setVerticalAlignment, setVerticalTextPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CMMenuItemJ

public CMMenuItemJ()
CMMenuItemJ constructor comment.


CMMenuItemJ

public CMMenuItemJ(String text)
CMMenuItemJ constructor comment.

Parameters:
text - java.lang.String

CMMenuItemJ

public CMMenuItemJ(String text,
                   int mnemonic)
CMMenuItemJ constructor comment.

Parameters:
text - java.lang.String
mnemonic - int

CMMenuItemJ

public CMMenuItemJ(String text,
                   Icon icon)
CMMenuItemJ constructor comment.

Parameters:
text - java.lang.String
icon - javax.swing.Icon

CMMenuItemJ

public CMMenuItemJ(Icon icon)
CMMenuItemJ constructor comment.

Parameters:
icon - javax.swing.Icon
Method Detail

equals

public boolean equals(Object obj)
We are comparing the name of the class so be sure to provide correct naming standards as follows below. For a file, exit menu command the beanName should be fileExit for a edit, copy menu command the beanName should be editCopy Specify the menu name followed by the menuItem name as it appears in the UI

Overrides:
equals in class Object

getFocusGainedIcon

public Icon getFocusGainedIcon()
This will return the focus gained icon Creation date: (1/26/00 3:08:47 PM)

Returns:
javax.swing.Icon

getFocusLostIcon

public Icon getFocusLostIcon()
This will return the focus lost icon Creation date: (1/26/00 3:08:47 PM)

Returns:
javax.swing.Icon

getTranslation

public String getTranslation()
Gets the translated String.


getTranslationId

public String getTranslationId()
Gets the key of the translated String.


isIconChangedOnFocusGained

public boolean isIconChangedOnFocusGained()
Detirmines if the icon is suppose to change on focus gained Creation date: (1/26/00 3:03:59 PM)

Returns:
boolean

main

public static void main(String[] args)
main entrypoint - starts the part when it is run as an application

Parameters:
args - java.lang.String[]

setFocusGainedIcon

public void setFocusGainedIcon(Icon icon)
This will set the icon to be displayed on focus gained on this menu item


setFocusLostIcon

public void setFocusLostIcon(Icon newFocusLostIcon)
This will set the icon to be displayed on focus lost on this menu item


setIconChangedOnFocusGained

public void setIconChangedOnFocusGained(boolean newIconChangedOnFocusGained)
This will set whether the icon should be changed on focus gained. Creation date: (1/26/00 3:03:59 PM)

Parameters:
newIconChangedOnFocusGained - boolean

setLabel

public void setLabel(String key)
Overrides the superclass to set the key for the translated String.

Overrides:
setLabel in class AbstractButton

setText

public void setText(String key)
Overrides the superclass to set the key for the translated String.

Overrides:
setText in class AbstractButton

setToolTipText

public void setToolTipText(String toolTip)
Sets the toolTipText property (java.lang.String) value.

Overrides:
setToolTipText in class JComponent
Parameters:
toolTip - The new value for the property.
See Also:
JComponent.getToolTipText()

setTranslation

public void setTranslation(String newTranslation)
Sets the String without translating it.