public static class NavigationMenu.MenuGroup extends JComponent
JComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected ActionListener |
actionListener
The ActionListener assigned to the MenuGroup.
|
protected Color |
bgBody
Color of the background of the Menu.
|
protected Color |
bgHeader
Color of the Header of the Menu.
|
protected Border |
border
Border Object with the border of the Menu.
|
protected Color |
borderColor
Color of the border of the Menu.
|
protected String |
borderString
String with the style of the border of the Menu.
|
protected ResourceBundle |
bundle
The Resource Bundle assigned to the Menu.
|
static Color |
DEFAULT_BGBODY
Default color of the background body.
|
static Color |
DEFAULT_BGHEADER
Default color of the background header.
|
static Color |
DEFAULT_BORDERCOLOR
Default border color of the border of the Menu Group.
|
static Color |
DEFAULT_FG
Default color of the Font.
|
static Color |
DEFAULT_FGHEADER
Default color of the Header Font.
|
static Color |
DEFAULT_FGSELECTIONCOLOR
Default color of the Font when an item is selected.
|
protected static int |
DEFAULT_HEADER_HEIGHT
The default height of the Header in pixels.
|
protected static String |
DEFAULT_MENUITEM_CLASS
The location's route to the default MenuItem Class.
|
static Color |
DEFAULT_SELECTIONCOLOR
Default color when an item is selected.
|
protected boolean |
dragAllMenuEnabled
Parameter that allows to drag all Menu. by default only menu header
is draggable.
|
protected boolean |
dragEnabled
Parameter that allows to drag the Menu or not.
|
protected Color |
foregroundColor
Color of the font of the Menu.
|
protected Color |
foregroundColorHeader
Color of the font of the Menu Header.
|
protected boolean |
hasBorder
Parameter that allows to configure if the MenuGroup has or not
border.
|
protected String |
header
String with the text that will be displayed into the Header of the
Menu.
|
protected int |
headerheight
Variable that contains the header height of the Menu.
|
protected ImageIcon |
icon
Icon of the Header that indicates if the Menu Group could be dragged.
|
protected int |
itemHeight
The height of each item in pixels.
|
protected NavigationMenu.MenuHeaderRenderer |
menuHeaderRenderer
The renderer of each MenuHeader of the Menu.
|
protected NavigationMenu.MenuItem[] |
menuItem
Array with all the MenuItems of the Menu.
|
protected String |
menuItemClass
String that contains the location's route of the MenuItem Class.
|
protected NavigationMenu.MenuItemRenderer |
menuItemRenderer
The renderer of each MenuItem of the Menu.
|
protected boolean |
opaque
Parameter that allows to configure the Menu opaque or not.
|
protected int |
optionsOffset
Number of pixels of separation between the Header and the items of
the Menu.
|
protected String |
selectedOption
String that contains the selected Option into the Menu.
|
protected boolean |
separator
Parameter that displays a separator between the MenuItems of the
MenuGroup.
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
NavigationMenu.MenuGroup(Hashtable parameters)
Constructs a new MenuGroup with the specified parameters.
|
NavigationMenu.MenuGroup(String header,
String[] options,
ImageIcon[] icons,
int x,
int y,
int w,
int h,
Color bgH,
Color bgB,
Color fg,
Color borderColor)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
createMenuItems(Hashtable parameters)
This method creates all the MenuItems of the MenuGroup.
|
Color |
getBgHeader() |
Color |
getForegroundColorHeader() |
String |
getHeader()
This method returns a String with the text of the MenuGroup Header.
|
int |
getHeaderHeight() |
int |
getItemHeight()
This method returns the height of each MenuItem of the MenuGroup.
|
protected NavigationMenu.MenuItem |
getMenuAt(int x,
int y)
This method checks if the specified coordinates x and y belongs to
any MenuItem of the MenuGroup, and if it is true, the method returns
the MenuItem object selected.
|
NavigationMenu.MenuItem[] |
getMenuItem()
This method returns an Array of MenuItem objects with all the
MenuItem of the MenuGroup.
|
protected String |
getOptionAt(int x,
int y)
This method checks if the specified coordinates x and y belongs to
any MenuItem of the MenuGroup, and if it is true, the method returns
the identifier of the MenuItem selected.
|
protected int |
getOptionIndex(int x,
int y)
This method checks if the specified coordinates x and y belongs to
any MenuItem of the MenuGroup, and if it is true, the method returns
the index of the MenuItem selected.
|
int |
getX()
This method returns the coordinate x of the MenuGroup.
|
int |
getY()
This method returns the coordinate y of the MenuGroup.
|
protected void |
installMouseHandler()
This method installs the Handler of Mouse Listeners.
|
boolean |
isOpaque() |
boolean |
isVisible() |
void |
move(int despX,
int despY)
This method allows to move the MenuGroup the specified distance into
the coordinate x and y since the current position of the MenuGroup.
|
protected void |
paintComponent(Graphics g)
This method paints the MenuGroup.
|
protected void |
paintOptions(Graphics g)
This method establishes the paint options to paint each MenuItem of
the MenuGroup using the MenuItemRenderer assigned to the MenuGroup.
|
void |
reBound()
This method allows to resize the size of the MenuGroup in function of
the number of MenuItems that are visible.
|
void |
setActionListener(ActionListener l)
This method establishes the specified ActionListener to the
MenuGroup.
|
void |
setItemHeight(int itemHeight)
This method establishes the height of the MenuItem of the MenuGroup.
|
void |
setMenuGroupBounds(int x,
int y,
int width,
int height)
This method establishes the size of the MenuGroup when it is created
the first time.
|
void |
setMenuHeaderRenderer(NavigationMenu.MenuHeaderRenderer menuHeaderRenderer)
This method establishes the specified MenuHeaderRenderer to the
MenuGroup.
|
void |
setMenuItem(NavigationMenu.MenuItem[] menuItem)
This method sets the MenuItems of the MenuGroup.
|
void |
setMenuItemRenderer(NavigationMenu.MenuItemRenderer menuItemRenderer)
This method establishes the specified MenuItemRenderer to the
MenuGroup.
|
void |
setResourceBundle(ResourceBundle bundle)
This method establishes the ResourceBundle to the MenuGroup.
|
void |
setXY(int x,
int y)
This method sets the coordinates x,y of the MenuGroup.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprotected static final String DEFAULT_MENUITEM_CLASS
public static final Color DEFAULT_BGBODY
public static final Color DEFAULT_BGHEADER
public static Color DEFAULT_FG
public static final Color DEFAULT_FGHEADER
public static final Color DEFAULT_BORDERCOLOR
public static Color DEFAULT_SELECTIONCOLOR
public static Color DEFAULT_FGSELECTIONCOLOR
protected int optionsOffset
protected String menuItemClass
protected ActionListener actionListener
protected int itemHeight
protected Color bgHeader
protected Color bgBody
protected Color foregroundColor
protected Color foregroundColorHeader
protected String header
protected Color borderColor
protected Border border
protected String borderString
protected String selectedOption
protected boolean opaque
protected boolean dragEnabled
protected boolean dragAllMenuEnabled
protected boolean separator
protected boolean hasBorder
protected ResourceBundle bundle
protected NavigationMenu.MenuItem[] menuItem
protected static int DEFAULT_HEADER_HEIGHT
protected int headerheight
protected NavigationMenu.MenuItemRenderer menuItemRenderer
protected NavigationMenu.MenuHeaderRenderer menuHeaderRenderer
protected ImageIcon icon
@Deprecated public NavigationMenu.MenuGroup(String header, String[] options, ImageIcon[] icons, int x, int y, int w, int h, Color bgH, Color bgB, Color fg, Color borderColor)
header - String with the text to display into the Header of the
MenuGroup.options - String Array with the identifier of each MenuItem of the
MenuGroup.icons - ImageIcon Array with the icons to each MenuItem of the
MenuGroup.x - The coordinate x of the MenuGroup into the NavigationMenu.y - The coordinate y of the MenuGroup into the NavigationMenu.w - The width of the MenuGroup.h - The absolute height of the MenuGroup. The header height is
included into this height.bgH - The color of the MenuGroup Header.bgB - The color of the background MenuGroup.fg - The color of the MenuGroup font.borderColor - The color of the border of the MenuGroup. Use
#MenuGroup(Hashtable parameters)public NavigationMenu.MenuGroup(Hashtable parameters)
parameters - the Hashtable with the whole parameters to
configure the MenuGroup.
| attribute | values | default | required | meaning |
| header | no | String with the text to display into the Header of the MenuGroup. | ||
| headerheight | 35 | no | Height of the Header of the MenuGroup. | bgheader | Color: "214;222;230" or "#ffffff" | #434343 | no | The color of the MenuGroup Header. |
| options | "mangarusers;manageraccounts..." | yes | String Array with the identifier of each MenuItem of the MenuGroup. | |
| icons | "/buttonsbar/icon1.png;/buttonsbar/icon2.png..." | no | ImageIcon Array with the icons to each MenuItem of the MenuGroup. | |
| x | no | The coordinate x of the MenuGroup into the NavigationMenu. | ||
| y | no | The coordinate y of the MenuGroup into the NavigationMenu. | ||
| width | yes | The width of the MenuGroup. | ||
| height | no | The absolute height of the MenuGroup. The header height is included into this height. | ||
| bgbody | Color: "214;222;230" or "#ffffff" | #dedede | no | The color of the background MenuGroup. | fg | Color: "214;222;230" or "#ffffff" | #434343 | no | The color of the foreground MenuGroup. | bordercolor | Color: "214;222;230" or "#ffffff" | #f0f0f0 | no | The color of the MenuGroup border. | border | "yes/no" or "true/false" | true | no | Specifies if the MenuGroup has border. | borderclass | no | String with the border style. | opaque | "yes/no" or "true/false" | true | no | Specifies is the MenuGroup is opaque or not. | dragenable | "yes/no" or "true/false" | true | no | Specifies if the MenuGroup could be dragged. | dragallmenu | "yes/no" or "true/false" | false | no | Specifies if all the MenuGroup could be dragged or only the header. By default, only header is draggable. | separator | "yes/no" or "true/false" | true | no | Specifies if a separator would be placed between MenuItems of the MenuGroup. |
public void reBound()
public void setMenuGroupBounds(int x,
int y,
int width,
int height)
x - The coordinate x of the MenuGroup.y - The coordinate y of the MenuGroup.width - The width of the MenuGroup.height - The height of the MenuGroup.protected void createMenuItems(Hashtable parameters)
parameters - the Hashtable with the whole parameters to
configure the MenuItem.
| attribute | values | default | required | meaning |
| options | "mangarusers;manageraccounts..." | yes | String Array with the identifier of each MenuItem of the MenuGroup. | |
| icons | "/buttonsbar/icon1.png;/buttonsbar/icon2.png..." | no | ImageIcon Array with the icons to each MenuItem of the MenuGroup. | |
| menuitemclass | "com.ontimize.gui.field.NavigationMenu$MenuItem" | no | The class of the MenuItem |
public NavigationMenu.MenuItem[] getMenuItem()
Array of MenuItem.public void setMenuItem(NavigationMenu.MenuItem[] menuItem)
menuItem - Array of MenuItem objects.public int getItemHeight()
int with the MenuItem height.public void setItemHeight(int itemHeight)
itemHeight - public int getX()
getX in class JComponentint with the coordinate x of the MenuGroup.public int getY()
getY in class JComponentint with the coordinate y of the MenuGroup.public void setXY(int x,
int y)
x - Int with the coordinate x of the MenuGroup.y - Int with the coordinate y of the MenuGroup.public void move(int despX,
int despY)
public void setActionListener(ActionListener l)
l - The ActionListener.public void setMenuItemRenderer(NavigationMenu.MenuItemRenderer menuItemRenderer)
menuItemRenderer - The MenuItemRenderer.public void setMenuHeaderRenderer(NavigationMenu.MenuHeaderRenderer menuHeaderRenderer)
menuHeaderRenderer - The MenuHeaderRenderer.public String getHeader()
String with the MenuGroup Header text.public void setResourceBundle(ResourceBundle bundle)
bundle - The ResourceBundle.protected void installMouseHandler()
protected void paintOptions(Graphics g)
g - The Graphics of the MenuGroup.protected void paintComponent(Graphics g)
paintComponent in class JComponentg - The Graphics of NavigationMenu.protected NavigationMenu.MenuItem getMenuAt(int x, int y)
x - int of the coordinate x.y - int of the coordinate y.MenuItem selected.protected String getOptionAt(int x, int y)
x - int of the coordinate x.y - int of the coordinate y.String with the MenuItem identifier.protected int getOptionIndex(int x,
int y)
x - int of the coordinate x.y - int of the coordinate y.int with the MenuItem index.public int getHeaderHeight()
public Color getBgHeader()
public boolean isOpaque()
isOpaque in class JComponentpublic Color getForegroundColorHeader()
Copyright © 2016 Imatia Innovation S.L.. All rights reserved.