public class NavigationMenu extends JPanel
| Modifier and Type | Class and Description |
|---|---|
static class |
NavigationMenu.BasicMenuHeaderRenderer
Class that determines a MenuItem renderer by default.
|
static class |
NavigationMenu.DefaultMenuHeaderRenderer
Class that determines a MenuHeader renderer by default.
|
static class |
NavigationMenu.DefaultMenuItemRenderer
Class that determines a MenuItem renderer by default.
|
static class |
NavigationMenu.MenuGroup
Class that contains each Menu displayed into the NavigationMenu.
|
static interface |
NavigationMenu.MenuHeaderRenderer
Interface MenuHeaderRenderer.
|
static class |
NavigationMenu.MenuItem
Class that contains each Item displayed into the MenuGroup of the
NavigationMenu.
|
static interface |
NavigationMenu.MenuItemRenderer
Interface MenuItemRenderer.
|
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected static String |
BASICRENDERER |
protected static String |
BGBODY
Identification of the "bgbody" XML tag.
|
protected static String |
BGHEADER
Identification of the "bgheader" XML tag.
|
protected Image |
bgImage
Background image of the NavigationMenu.
|
static String |
BLACK |
static String |
BLUE |
protected static String |
BORDER
Identification of the "border" XML tag.
|
protected static String |
BORDERCLASS
Identification of the "borderclass" XML tag.
|
protected static String |
BORDERCOLOR
Identification of the "bordercolor" XML tag.
|
protected boolean |
centerImage
Parameter that indicates if it is wanted to center the background image
into the NavigationMenu.
|
protected static String |
CENTERIMAGE |
static String |
CYAN |
static String |
DARKBLUE |
static String |
DARKGRAY |
protected static String |
DRAGALLMENU
Identification of the "dragallmenu" XML tag.
|
protected static String |
DRAGENABLE
Identification of the "dragenable" XML tag.
|
static String |
EAST
Compass-direction east (right).
|
protected static String |
ERROR_MESSAGE
Message error.
|
protected Image |
fixImage
Background image if it is wanted to fit into the NavigationMenu.
|
protected int |
fixImagePosition
Position to place fixImage.
|
protected static String |
FIXIMG |
protected static String |
FIXIMGPOSITION |
protected static String |
FOREGROUND
Identification of the "fg" XML tag.
|
protected static String |
FOREGROUNDHEADER
Identification of the "fgheader" XML tag.
|
static String |
GRAY |
static String |
GREEN |
protected static String |
HEADER
Identification of the "header" XML tag.
|
protected static String |
HEADERHEIGHT
Identification of the "headerheight" XML tag.
|
protected int |
height
Height of the NavigationMenu background image.
|
protected static String |
HEIGHT
Identification of the "height" XML tag.
|
protected static String |
ICONS
Identification of the "icons" XML tag.
|
protected String |
imageBasePath
String that contains the base search route of all the images and icons of
the NavigationMenu.
|
protected static String |
IMAGEBASEPATH |
protected static String |
IMG |
static String |
LIGHTGRAY |
static String |
MAGENTA |
protected static String |
MENU_GROUP_HEADER_ICON |
protected static String |
MENUGROUP
Identification of the "MenuGroup" XML tag.
|
protected static String |
MENUGROUPCLASS |
protected NavigationMenu.MenuHeaderRenderer |
menuHeaderRenderer
Renderer of the Header.
|
protected static String |
MENUITEMCLASS
Identification of the "menuitemclass" XML tag.
|
protected NavigationMenu.MenuItemRenderer |
menuItemRenderer
Renderer of the MenuItem.
|
protected ArrayList |
menuList
ArrayList that contains all the menuGroups contained into the
NavigatioMenu.
|
protected boolean |
mosaic |
protected static String |
MOSAIC |
static String |
NORTH
Compass-direction North (up).
|
static String |
NORTH_EAST
Compass-direction north-east (upper right).
|
static String |
NORTH_WEST
Compass-direction north west (upper left).
|
protected static String |
OPAQUE
Identification of the "opaque" XML tag.
|
protected static String |
OPTIONS
Identification of the "options" XML tag.
|
static String |
ORANGE |
protected static Class[] |
params |
static String |
PINK |
static String |
RED |
protected static String |
ROOT_XML
Identification of the "NavigationMenu" XML tag.
|
protected static String |
SEPARATOR
Identification of the "separator" XML tag.
|
static String |
SOUTH
Compass-direction south (down).
|
static String |
SOUTH_EAST
Compass-direction south-east (lower right).
|
static String |
SOUTH_WEST
Compass-direction south-west (lower left).
|
protected static boolean |
useBasicRenderer
Parameter that indicates if basic renderer is used.
|
static String |
WEST
Compass-direction west (left).
|
static String |
WHITE |
protected int |
width
Width of the NavigationMenu background image.
|
protected static String |
WIDTH
Identification of the "width" XML tag.
|
protected static String |
X
Identification of the "x" XML tag.
|
protected static String |
Y
Identification of the "y" XML tag.
|
static String |
YELLOW |
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, PROPERTIES, SOMEBITS| Constructor and Description |
|---|
NavigationMenu()
Default constructor.
|
NavigationMenu(Image bgImage,
Image imageLogo,
int width,
int height)
Constructs a new NavigationMenu specifying the background image, the logo
image and its dimensions.
|
NavigationMenu(Image bgImage,
int width,
int height)
Constructs a new NavigationMenu specifying the background image and its
dimensions.
|
NavigationMenu(URL xml)
Constructs a new NavigationMenu.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(NavigationMenu.MenuGroup mg)
This method adds the specified MenuGroup to the NavigationMenu.
|
static Color |
colorRGBHexToColor(String rgb)
This method converts the specified RGBColor into a Color object.
|
static Color |
colorRGBToColor(String rgb)
This method converts the specified RGBColor into a Color object.
|
protected NavigationMenu.MenuGroup |
createMenuGroup(Node node)
This method analyzes a "MenuGroup" node of the XML Document configuration
to obtain all the parameter to build a new MenuGroup into the
NavigationMenu.
|
protected NavigationMenu.MenuGroup |
createMenuGroupInstance(String header,
String[] opts,
ImageIcon[] icons,
int x,
int y,
int width,
int height,
Color bgHeader,
Color bgBody,
Color fg,
Color border)
This method instantiates a new MenuGroup object with the specified
parameters.
|
Component |
getComponent(int n) |
Component[] |
getComponents() |
protected Node |
getNode(NamedNodeMap attributes,
String name) |
Dimension |
getPreferredSize()
This method obtains the preferred size of the background image of the
NavigationMenu.
|
boolean |
isCenterImage()
This method returns if it is wanted to center the background image.
|
boolean |
isTag(Node node)
This method checks if the given node is an Element node of a DOM document
or not.
|
protected void |
paintComponent(Graphics g)
This method paints the NavigationMenu
|
protected void |
paintFixImageToPosition(Graphics g) |
protected void |
parse(URL xml)
This method parses the XML Document configuration to obtain all the
parameters.
|
static Color |
parseColor(String color)
This method analyzes a String that specifies a color and returns a Color
object.
|
void |
setCenterImage(boolean centerImage)
This method establishes that the background image have to be centered
into the NavigationMenu.
|
void |
setMenuHeaderRenderer(NavigationMenu.MenuHeaderRenderer menuHeaderRenderer)
Establishes the MenuHeader renderer.
|
void |
setMenuItemRenderer(NavigationMenu.MenuItemRenderer menuItemRenderer)
Establishes the MenuItem renderer.
|
void |
setResourceBundle(ResourceBundle bundle)
This method establishes the ResourceBundle of the NavigationMenu to all
MenuGroups.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, 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, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponentAt, getComponentAt, getComponentCount, 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, 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, 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 IMAGEBASEPATH
protected static final String CENTERIMAGE
protected static final String IMG
protected static final String FIXIMG
protected static final String FIXIMGPOSITION
protected static final String MOSAIC
protected static final String BASICRENDERER
public static final String NORTH
public static final String NORTH_EAST
public static final String EAST
public static final String SOUTH_EAST
public static final String SOUTH
public static final String SOUTH_WEST
public static final String WEST
public static final String NORTH_WEST
protected static final String ROOT_XML
protected static final String MENUGROUP
protected static final String HEADER
protected static final String OPTIONS
protected static final String ICONS
protected static final String X
protected static final String Y
protected static final String WIDTH
protected static final String HEIGHT
protected static final String BGHEADER
protected static final String BGBODY
protected static final String FOREGROUND
protected static final String FOREGROUNDHEADER
protected static final String BORDERCOLOR
protected static final String MENUITEMCLASS
protected static final String HEADERHEIGHT
protected static final String BORDERCLASS
protected static final String OPAQUE
protected static final String DRAGENABLE
protected static final String DRAGALLMENU
protected static final String SEPARATOR
protected static final String BORDER
protected static final String MENU_GROUP_HEADER_ICON
protected static final String MENUGROUPCLASS
protected static final Class[] params
protected static final String ERROR_MESSAGE
public static final String GRAY
public static final String BLACK
public static final String BLUE
public static final String RED
public static final String YELLOW
public static final String CYAN
public static final String DARKGRAY
public static final String GREEN
public static final String LIGHTGRAY
public static final String MAGENTA
public static final String ORANGE
public static final String PINK
public static final String WHITE
public static final String DARKBLUE
protected ArrayList menuList
protected Image bgImage
protected Image fixImage
protected int fixImagePosition
protected boolean centerImage
protected boolean mosaic
protected String imageBasePath
protected int width
protected int height
protected static boolean useBasicRenderer
protected NavigationMenu.MenuItemRenderer menuItemRenderer
protected NavigationMenu.MenuHeaderRenderer menuHeaderRenderer
public NavigationMenu(Image bgImage, int width, int height)
bgImage - The background image of the NavigationMenu.width - The width of the image.height - The height of the image.public NavigationMenu(Image bgImage, Image imageLogo, int width, int height)
bgImage - The background image of the NavigationMenu.imageLogo - The logo image of the NavigationMenu.width - The width of the image.height - The height of the image.public NavigationMenu()
throws Exception
Exceptionpublic void setMenuItemRenderer(NavigationMenu.MenuItemRenderer menuItemRenderer)
menuItemRenderer - The MenuItem renderer.public void setMenuHeaderRenderer(NavigationMenu.MenuHeaderRenderer menuHeaderRenderer)
menuHeaderRenderer - The MenuHeader renderer.public Dimension getPreferredSize()
getPreferredSize in class JComponentDimension object with the background image
dimensions.public Component getComponent(int n)
getComponent in class Containerpublic Component[] getComponents()
getComponents in class Containerpublic void add(NavigationMenu.MenuGroup mg)
mg - The MenuGroup object to be added.public void setResourceBundle(ResourceBundle bundle)
bundle - The ResourceBundle.protected void paintComponent(Graphics g)
paintComponent in class JComponentg - The graphics.protected void paintFixImageToPosition(Graphics g)
protected void parse(URL xml) throws Exception
xml - The XML Document configuration.Exceptionpublic boolean isTag(Node node)
node - The node to be checked.boolean.protected Node getNode(NamedNodeMap attributes, String name)
protected NavigationMenu.MenuGroup createMenuGroup(Node node) throws Exception
node - The "MenuGroup" node of the XML Document configuration.MenuGroup object.Exceptionprotected NavigationMenu.MenuGroup createMenuGroupInstance(String header, String[] opts, ImageIcon[] icons, int x, int y, int width, int height, Color bgHeader, Color bgBody, Color fg, Color border) throws Exception
header - String with the text to display into the Header of the
MenuGroup.opts - 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.width - The width of the MenuGroup.height - The absolute height of the MenuGroup. The header height is
included into this height.bgHeader - The color of the MenuGroup Header.bgBody - The color of the background MenuGroup.fg - The color of the MenuGroup font.border - The color of the border of the MenuGroup.MenuGroup object.Exceptionpublic static Color colorRGBToColor(String rgb) throws Exception
rgb - String specifying a RGB color separated by semicolon "R;G;B".
That is "102;23;44"Color.Exceptionpublic static Color colorRGBHexToColor(String rgb) throws Exception
rgb - String specifying a RGB color expressed into Hexadecimal form
"#". That is "#ffffff"Color.Exceptionpublic static Color parseColor(String color) throws Exception
color - String with the color.Color object.Exceptionpublic boolean isCenterImage()
boolean.public void setCenterImage(boolean centerImage)
centerImage - Copyright © 2016 Imatia Innovation S.L.. All rights reserved.