org.objectweb.jac.aspects.gui.swing
Class Menu
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.AbstractButton
|
+--javax.swing.JMenuItem
|
+--javax.swing.JMenu
|
+--org.objectweb.jac.aspects.gui.swing.Menu
- All Implemented Interfaces:
- Accessible, ActionListener, EventListener, ImageObserver, ItemSelectable, MenuContainer, MenuElement, MenuView, Serializable, SwingConstants, View, ViewIdentity
- public class Menu
- extends JMenu
- implements MenuView, ActionListener
- See Also:
- Serialized Form
Fields inherited from class javax.swing.AbstractButton |
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, 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, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, 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 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 |
Methods inherited from class javax.swing.JMenu |
add, add, add, add, add, addMenuListener, addSeparator, applyComponentOrientation, configurePropertiesFromAction, createActionChangeListener, createActionComponent, createWinListener, doClick, fireMenuCanceled, fireMenuDeselected, fireMenuSelected, getAccessibleContext, getComponent, getDelay, getItem, getItemCount, getMenuComponent, getMenuComponentCount, getMenuComponents, getMenuListeners, getPopupMenu, getPopupMenuOrigin, getSubElements, getUIClassID, insert, insert, insert, insertSeparator, isMenuComponent, isPopupMenuVisible, isSelected, isTearOff, isTopLevelMenu, menuSelectionChanged, paramString, processKeyEvent, remove, remove, remove, removeAll, removeMenuListener, setAccelerator, setComponentOrientation, setDelay, setMenuLocation, setModel, setPopupMenuVisible, setSelected, updateUI |
Methods inherited from class javax.swing.JMenuItem |
addMenuDragMouseListener, addMenuKeyListener, createActionPropertyChangeListener, fireMenuDragMouseDragged, fireMenuDragMouseEntered, fireMenuDragMouseExited, fireMenuDragMouseReleased, fireMenuKeyPressed, fireMenuKeyReleased, fireMenuKeyTyped, getAccelerator, getMenuDragMouseListeners, getMenuKeyListeners, init, isArmed, processKeyEvent, processMenuDragMouseEvent, processMenuKeyEvent, processMouseEvent, removeMenuDragMouseListener, removeMenuKeyListener, setArmed, setEnabled, setUI |
Methods inherited from class javax.swing.AbstractButton |
addActionListener, addChangeListener, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createChangeListener, createItemListener, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, 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, paintBorder, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setFocusPainted, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setMargin, setMnemonic, setMnemonic, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelectedIcon, setText, 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, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle |
Methods inherited from interface org.objectweb.jac.aspects.gui.View |
getLabel |
Menu
public Menu(ViewFactory factory,
DisplayContext context)
Menu
public Menu()
getViewBorder
public Border getViewBorder()
- Get the value of viewBorder.
- Specified by:
getViewBorder
in interface View
- Returns:
- value of viewBorder.
setViewBorder
public void setViewBorder(Border v)
- Set the value of viewBorder.
- Specified by:
setViewBorder
in interface View
- Parameters:
v
- Value to assign to viewBorder.
setStyle
public void setStyle(String style)
- Description copied from interface:
View
- Sets the view style. The style can be exploited in different
maners depending on the GUI supports (e.g. with CSS for the
WEB). Styles are user-defined.
- Specified by:
setStyle
in interface View
getStyle
public String getStyle()
- Description copied from interface:
View
- Gets the user-defined style for this view.
- Specified by:
getStyle
in interface View
- Returns:
- the style, null if undefined
addSubMenu
public void addSubMenu(String label,
String icon,
MenuView submenu)
- Description copied from interface:
MenuView
- Adds a sub-menu in this menu.
- Specified by:
addSubMenu
in interface MenuView
- Parameters:
label
- the sub-menu's labelicon
- the sub-menu's iconsubmenu
- the submenu
addAction
public void addAction(String label,
String icon,
Callback callback)
- Description copied from interface:
MenuView
- Adds an action to this menu.
- Specified by:
addAction
in interface MenuView
- Parameters:
label
- the sub-menu's labelicon
- the sub-menu's iconcallback
- the actual action
getPosition
public String getPosition()
- Get the value of position.
- Specified by:
getPosition
in interface MenuView
- Returns:
- value of position.
- See Also:
Menu
setPosition
public void setPosition(String v)
- Set the value of position.
- Specified by:
setPosition
in interface MenuView
- Parameters:
v
- Value to assign to position.- See Also:
Menu
getDescription
public String getDescription()
- Get the value of description.
- Specified by:
getDescription
in interface View
- Returns:
- value of description.
setDescription
public void setDescription(String v)
- Set the value of description.
- Specified by:
setDescription
in interface View
- Parameters:
v
- Value to assign to description.- See Also:
View.setMessage(MethodItem)
getParentView
public View getParentView()
- Get the value of parentView.
- Specified by:
getParentView
in interface View
- Returns:
- value of parentView.
- See Also:
CompositeView
setParentView
public void setParentView(View v)
- Set the value of parentView.
- Specified by:
setParentView
in interface View
- Parameters:
v
- Value to assign to parentView.- See Also:
CompositeView
getRootView
public View getRootView()
- Description copied from interface:
View
- Gets the ancestor view whose parent is null
- Specified by:
getRootView
in interface View
isDescendantOf
public boolean isDescendantOf(View ancestor)
- Description copied from interface:
View
- Tells wether this view has a given view in its ancestors
- Specified by:
isDescendantOf
in interface View
- Parameters:
ancestor
- the ancestor
getMessage
public MethodItem getMessage()
- Get the value of message.
- Specified by:
getMessage
in interface View
- Returns:
- value of message.
setMessage
public void setMessage(MethodItem v)
- Set the value of message.
- Specified by:
setMessage
in interface View
- Parameters:
v
- Value to assign to message.- See Also:
View.setDescription(String)
setContext
public void setContext(DisplayContext context)
- Description copied from interface:
View
- Sets the display context for this view.
The display context contains the factory that is used for
this view.
- Specified by:
setContext
in interface View
getContext
public DisplayContext getContext()
- Specified by:
getContext
in interface View
- Returns:
- the DisplayContext of the view
setFactory
public void setFactory(ViewFactory factory)
- Description copied from interface:
View
- Sets the factory for this view (WEB, SWING or other supported
factory).
- Specified by:
setFactory
in interface View
getFactory
public ViewFactory getFactory()
- Description copied from interface:
View
- Gets the factory.
- Specified by:
getFactory
in interface View
setLabel
public void setLabel(String label)
- Description copied from interface:
View
- Sets the label (the identifier) of the view.
- Specified by:
setLabel
in interface View
- Overrides:
setLabel
in class AbstractButton
- Parameters:
label
- a string that identifies the view
setSize
public void setSize(Length width,
Length height)
- Description copied from interface:
View
- Sets the preferred size for this view.
- Specified by:
setSize
in interface View
- Parameters:
width
- the preferred width. If null, the preferred width is not changed.height
- the preferred height. If null, the preferred height is not changed.
setType
public void setType(String type)
- Description copied from interface:
ViewIdentity
- Set the view type.
- Specified by:
setType
in interface ViewIdentity
getType
public String getType()
- Description copied from interface:
ViewIdentity
- Gets the view type.
- Specified by:
getType
in interface ViewIdentity
- Returns:
- view type string as declared in web.acc or swing.acc
depending on the GUI target
equalsView
public boolean equalsView(ViewIdentity view)
- Description copied from interface:
ViewIdentity
- Tells if a view is the same as another one, ie it has the same
type and parameters.
- Specified by:
equalsView
in interface ViewIdentity
equalsView
public boolean equalsView(String type,
Object[] parameters)
- Specified by:
equalsView
in interface ViewIdentity
setParameters
public void setParameters(Object[] parameters)
- Description copied from interface:
ViewIdentity
- Sets the parameters that were used to construct the view.
- Specified by:
setParameters
in interface ViewIdentity
getParameters
public Object[] getParameters()
- Description copied from interface:
ViewIdentity
- The parameters that were used to compile the view.
- Specified by:
getParameters
in interface ViewIdentity
close
public void close(boolean validate)
- Description copied from interface:
View
- Close this view. This should be upcalled when the view is closed
in order to free resources or close other dependant views.
- Specified by:
close
in interface View
- Parameters:
validate
- wether to validate any value contained in editors.
isClosed
public boolean isClosed()
- Description copied from interface:
View
- Tells if this view has been closed by the GUI or the user.
- Specified by:
isClosed
in interface View
setFocus
public void setFocus(FieldItem field,
Object option)
- Description copied from interface:
View
- Focus a field of an object's view.
- Specified by:
setFocus
in interface View
- Parameters:
field
- the field to focusoption
- an extra option
actionPerformed
public void actionPerformed(ActionEvent event)
- Specified by:
actionPerformed
in interface ActionListener
toString
public String toString()
- Overrides:
toString
in class Component