Ontimize 5.2072EN

com.ontimize.gui.field
Class NavigationMenu

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.ontimize.gui.field.NavigationMenu
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
NavigatorMenuGUI

public class NavigationMenu
extends javax.swing.JPanel

See Also:
Serialized Form

Nested Class Summary
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.
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static java.lang.String BASICRENDERER
           
protected static java.lang.String BGBODY
          Identification of the "bgbody" XML tag.
protected static java.lang.String BGHEADER
          Identification of the "bgheader" XML tag.
protected  java.awt.Image bgImage
          Background image of the NavigationMenu.
static java.lang.String BLACK
           
static java.lang.String BLUE
           
protected static java.lang.String BORDER
          Identification of the "border" XML tag.
protected static java.lang.String BORDERCLASS
          Identification of the "borderclass" XML tag.
protected static java.lang.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 java.lang.String CENTERIMAGE
           
static java.lang.String CYAN
           
static java.lang.String DARKBLUE
           
static java.lang.String DARKGRAY
           
protected static java.lang.String DRAGALLMENU
          Identification of the "dragallmenu" XML tag.
protected static java.lang.String DRAGENABLE
          Identification of the "dragenable" XML tag.
static java.lang.String EAST
          Compass-direction east (right).
protected static java.lang.String ERROR_MESSAGE
          Message error.
protected  java.awt.Image fixImage
          Background image if it is wanted to fit into the NavigationMenu.
protected  int fixImagePosition
          Position to place fixImage.
protected static java.lang.String FIXIMG
           
protected static java.lang.String FIXIMGPOSITION
           
protected static java.lang.String FOREGROUND
          Identification of the "fg" XML tag.
protected static java.lang.String FOREGROUNDHEADER
          Identification of the "fgheader" XML tag.
static java.lang.String GRAY
           
static java.lang.String GREEN
           
protected static java.lang.String HEADER
          Identification of the "header" XML tag.
protected static java.lang.String HEADERHEIGHT
          Identification of the "headerheight" XML tag.
protected  int height
          Height of the NavigationMenu background image.
protected static java.lang.String HEIGHT
          Identification of the "height" XML tag.
protected static java.lang.String ICONS
          Identification of the "icons" XML tag.
protected  java.lang.String imageBasePath
          String that contains the base search route of all the images and icons of the NavigationMenu.
protected static java.lang.String IMAGEBASEPATH
           
protected static java.lang.String IMG
           
static java.lang.String LIGHTGRAY
           
static java.lang.String MAGENTA
           
protected static java.lang.String MENU_GROUP_HEADER_ICON
           
protected static java.lang.String MENUGROUP
          Identification of the "MenuGroup" XML tag.
protected static java.lang.String MENUGROUPCLASS
           
protected  NavigationMenu.MenuHeaderRenderer menuHeaderRenderer
          Renderer of the Header.
protected static java.lang.String MENUITEMCLASS
          Identification of the "menuitemclass" XML tag.
protected  NavigationMenu.MenuItemRenderer menuItemRenderer
          Renderer of the MenuItem.
protected  java.util.ArrayList menuList
          ArrayList that contains all the menuGroups contained into the NavigatioMenu.
protected  boolean mosaic
           
protected static java.lang.String MOSAIC
           
static java.lang.String NORTH
          Compass-direction North (up).
static java.lang.String NORTH_EAST
          Compass-direction north-east (upper right).
static java.lang.String NORTH_WEST
          Compass-direction north west (upper left).
protected static java.lang.String OPAQUE
          Identification of the "opaque" XML tag.
protected static java.lang.String OPTIONS
          Identification of the "options" XML tag.
static java.lang.String ORANGE
           
protected static java.lang.Class[] params
           
static java.lang.String PINK
           
static java.lang.String RED
           
protected static java.lang.String ROOT_XML
          Identification of the "NavigationMenu" XML tag.
protected static java.lang.String SEPARATOR
          Identification of the "separator" XML tag.
static java.lang.String SOUTH
          Compass-direction south (down).
static java.lang.String SOUTH_EAST
          Compass-direction south-east (lower right).
static java.lang.String SOUTH_WEST
          Compass-direction south-west (lower left).
protected static boolean useBasicRenderer
          Parameter that indicates if basic renderer is used.
static java.lang.String WEST
          Compass-direction west (left).
static java.lang.String WHITE
           
protected  int width
          Width of the NavigationMenu background image.
protected static java.lang.String WIDTH
          Identification of the "width" XML tag.
protected static java.lang.String X
          Identification of the "x" XML tag.
protected static java.lang.String Y
          Identification of the "y" XML tag.
static java.lang.String YELLOW
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, PROPERTIES, SOMEBITS
 
Constructor Summary
NavigationMenu()
          Default constructor.
NavigationMenu(java.awt.Image bgImage, java.awt.Image imageLogo, int width, int height)
          Constructs a new NavigationMenu specifying the background image, the logo image and its dimensions.
NavigationMenu(java.awt.Image bgImage, int width, int height)
          Constructs a new NavigationMenu specifying the background image and its dimensions.
NavigationMenu(java.net.URL xml)
          Constructs a new NavigationMenu.
 
Method Summary
 void add(NavigationMenu.MenuGroup mg)
          This method adds the specified MenuGroup to the NavigationMenu.
static java.awt.Color colorRGBHexToColor(java.lang.String rgb)
          This method converts the specified RGBColor into a Color object.
static java.awt.Color colorRGBToColor(java.lang.String rgb)
          This method converts the specified RGBColor into a Color object.
protected  NavigationMenu.MenuGroup createMenuGroup(org.w3c.dom.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(java.lang.String header, java.lang.String[] opts, javax.swing.ImageIcon[] icons, int x, int y, int width, int height, java.awt.Color bgHeader, java.awt.Color bgBody, java.awt.Color fg, java.awt.Color border)
          This method instantiates a new MenuGroup object with the specified parameters.
 java.awt.Component getComponent(int n)
           
 java.awt.Component[] getComponents()
           
protected  org.w3c.dom.Node getNode(org.w3c.dom.NamedNodeMap attributes, java.lang.String name)
           
 java.awt.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(org.w3c.dom.Node node)
          This method checks if the given node is an Element node of a DOM document or not.
protected  void paintComponent(java.awt.Graphics g)
          This method paints the NavigationMenu
protected  void paintFixImageToPosition(java.awt.Graphics g)
           
protected  void parse(java.net.URL xml)
          This method parses the XML Document configuration to obtain all the parameters.
static java.awt.Color parseColor(java.lang.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(java.util.ResourceBundle bundle)
          This method establishes the ResourceBundle of the NavigationMenu to all MenuGroups.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
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, 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, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, 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, setEnabled, 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, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponentAt, getComponentAt, getComponentCount, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, 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, imageUpdate, 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, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IMAGEBASEPATH

protected static final java.lang.String IMAGEBASEPATH
See Also:
Constant Field Values

CENTERIMAGE

protected static final java.lang.String CENTERIMAGE
See Also:
Constant Field Values

IMG

protected static final java.lang.String IMG
See Also:
Constant Field Values

FIXIMG

protected static final java.lang.String FIXIMG
See Also:
Constant Field Values

FIXIMGPOSITION

protected static final java.lang.String FIXIMGPOSITION
See Also:
Constant Field Values

MOSAIC

protected static final java.lang.String MOSAIC
See Also:
Constant Field Values

BASICRENDERER

protected static final java.lang.String BASICRENDERER
See Also:
Constant Field Values

NORTH

public static final java.lang.String NORTH
Compass-direction North (up).

See Also:
Constant Field Values

NORTH_EAST

public static final java.lang.String NORTH_EAST
Compass-direction north-east (upper right).

See Also:
Constant Field Values

EAST

public static final java.lang.String EAST
Compass-direction east (right).

See Also:
Constant Field Values

SOUTH_EAST

public static final java.lang.String SOUTH_EAST
Compass-direction south-east (lower right).

See Also:
Constant Field Values

SOUTH

public static final java.lang.String SOUTH
Compass-direction south (down).

See Also:
Constant Field Values

SOUTH_WEST

public static final java.lang.String SOUTH_WEST
Compass-direction south-west (lower left).

See Also:
Constant Field Values

WEST

public static final java.lang.String WEST
Compass-direction west (left).

See Also:
Constant Field Values

NORTH_WEST

public static final java.lang.String NORTH_WEST
Compass-direction north west (upper left).

See Also:
Constant Field Values

ROOT_XML

protected static final java.lang.String ROOT_XML
Identification of the "NavigationMenu" XML tag.

See Also:
Constant Field Values

MENUGROUP

protected static final java.lang.String MENUGROUP
Identification of the "MenuGroup" XML tag.

See Also:
Constant Field Values

HEADER

protected static final java.lang.String HEADER
Identification of the "header" XML tag.

See Also:
Constant Field Values

OPTIONS

protected static final java.lang.String OPTIONS
Identification of the "options" XML tag.

See Also:
Constant Field Values

ICONS

protected static final java.lang.String ICONS
Identification of the "icons" XML tag.

See Also:
Constant Field Values

X

protected static final java.lang.String X
Identification of the "x" XML tag.

See Also:
Constant Field Values

Y

protected static final java.lang.String Y
Identification of the "y" XML tag.

See Also:
Constant Field Values

WIDTH

protected static final java.lang.String WIDTH
Identification of the "width" XML tag.

See Also:
Constant Field Values

HEIGHT

protected static final java.lang.String HEIGHT
Identification of the "height" XML tag.

See Also:
Constant Field Values

BGHEADER

protected static final java.lang.String BGHEADER
Identification of the "bgheader" XML tag.

See Also:
Constant Field Values

BGBODY

protected static final java.lang.String BGBODY
Identification of the "bgbody" XML tag.

See Also:
Constant Field Values

FOREGROUND

protected static final java.lang.String FOREGROUND
Identification of the "fg" XML tag.

See Also:
Constant Field Values

FOREGROUNDHEADER

protected static final java.lang.String FOREGROUNDHEADER
Identification of the "fgheader" XML tag.

See Also:
Constant Field Values

BORDERCOLOR

protected static final java.lang.String BORDERCOLOR
Identification of the "bordercolor" XML tag.

See Also:
Constant Field Values

MENUITEMCLASS

protected static final java.lang.String MENUITEMCLASS
Identification of the "menuitemclass" XML tag.

See Also:
Constant Field Values

HEADERHEIGHT

protected static final java.lang.String HEADERHEIGHT
Identification of the "headerheight" XML tag.

See Also:
Constant Field Values

BORDERCLASS

protected static final java.lang.String BORDERCLASS
Identification of the "borderclass" XML tag.

See Also:
Constant Field Values

OPAQUE

protected static final java.lang.String OPAQUE
Identification of the "opaque" XML tag.

See Also:
Constant Field Values

DRAGENABLE

protected static final java.lang.String DRAGENABLE
Identification of the "dragenable" XML tag.

See Also:
Constant Field Values

DRAGALLMENU

protected static final java.lang.String DRAGALLMENU
Identification of the "dragallmenu" XML tag.

See Also:
Constant Field Values

SEPARATOR

protected static final java.lang.String SEPARATOR
Identification of the "separator" XML tag.

See Also:
Constant Field Values

BORDER

protected static final java.lang.String BORDER
Identification of the "border" XML tag.

See Also:
Constant Field Values

MENU_GROUP_HEADER_ICON

protected static final java.lang.String MENU_GROUP_HEADER_ICON
See Also:
Constant Field Values

MENUGROUPCLASS

protected static final java.lang.String MENUGROUPCLASS
See Also:
Constant Field Values

params

protected static final java.lang.Class[] params

ERROR_MESSAGE

protected static final java.lang.String ERROR_MESSAGE
Message error.

See Also:
Constant Field Values

GRAY

public static final java.lang.String GRAY
See Also:
Constant Field Values

BLACK

public static final java.lang.String BLACK
See Also:
Constant Field Values

BLUE

public static final java.lang.String BLUE
See Also:
Constant Field Values

RED

public static final java.lang.String RED
See Also:
Constant Field Values

YELLOW

public static final java.lang.String YELLOW
See Also:
Constant Field Values

CYAN

public static final java.lang.String CYAN
See Also:
Constant Field Values

DARKGRAY

public static final java.lang.String DARKGRAY
See Also:
Constant Field Values

GREEN

public static final java.lang.String GREEN
See Also:
Constant Field Values

LIGHTGRAY

public static final java.lang.String LIGHTGRAY
See Also:
Constant Field Values

MAGENTA

public static final java.lang.String MAGENTA
See Also:
Constant Field Values

ORANGE

public static final java.lang.String ORANGE
See Also:
Constant Field Values

PINK

public static final java.lang.String PINK
See Also:
Constant Field Values

WHITE

public static final java.lang.String WHITE
See Also:
Constant Field Values

DARKBLUE

public static final java.lang.String DARKBLUE
See Also:
Constant Field Values

menuList

protected java.util.ArrayList menuList
ArrayList that contains all the menuGroups contained into the NavigatioMenu.


bgImage

protected java.awt.Image bgImage
Background image of the NavigationMenu.


fixImage

protected java.awt.Image fixImage
Background image if it is wanted to fit into the NavigationMenu. It could be used as a centered corporative logo.


fixImagePosition

protected int fixImagePosition
Position to place fixImage. It could be: north, south, east, west, north_east, south_east, north_west, south_west.


centerImage

protected boolean centerImage
Parameter that indicates if it is wanted to center the background image into the NavigationMenu.


mosaic

protected boolean mosaic

imageBasePath

protected java.lang.String imageBasePath
String that contains the base search route of all the images and icons of the NavigationMenu.


width

protected int width
Width of the NavigationMenu background image.


height

protected int height
Height of the NavigationMenu background image.


useBasicRenderer

protected static boolean useBasicRenderer
Parameter that indicates if basic renderer is used.


menuItemRenderer

protected NavigationMenu.MenuItemRenderer menuItemRenderer
Renderer of the MenuItem.


menuHeaderRenderer

protected NavigationMenu.MenuHeaderRenderer menuHeaderRenderer
Renderer of the Header.

Constructor Detail

NavigationMenu

public NavigationMenu(java.awt.Image bgImage,
                      int width,
                      int height)
Constructs a new NavigationMenu specifying the background image and its dimensions.

Parameters:
bgImage - The background image of the NavigationMenu.
width - The width of the image.
height - The height of the image.

NavigationMenu

public NavigationMenu(java.awt.Image bgImage,
                      java.awt.Image imageLogo,
                      int width,
                      int height)
Constructs a new NavigationMenu specifying the background image, the logo image and its dimensions.

Parameters:
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.

NavigationMenu

public NavigationMenu()
               throws java.lang.Exception
Default constructor. It sets null layout to the NavigationMenu.

Throws:
java.lang.Exception

NavigationMenu

public NavigationMenu(java.net.URL xml)
               throws java.lang.Exception
Constructs a new NavigationMenu. The characteristics and parameters are read from an XML Document.

Parameters:
xml - The XML Document that contains the configuration parameters.
Throws:
java.lang.Exception
Method Detail

setMenuItemRenderer

public void setMenuItemRenderer(NavigationMenu.MenuItemRenderer menuItemRenderer)
Establishes the MenuItem renderer.

Parameters:
menuItemRenderer - The MenuItem renderer.

setMenuHeaderRenderer

public void setMenuHeaderRenderer(NavigationMenu.MenuHeaderRenderer menuHeaderRenderer)
Establishes the MenuHeader renderer.

Parameters:
menuHeaderRenderer - The MenuHeader renderer.

getPreferredSize

public java.awt.Dimension getPreferredSize()
This method obtains the preferred size of the background image of the NavigationMenu.

Returns:
a Dimension object with the background image dimensions.

getComponent

public java.awt.Component getComponent(int n)

getComponents

public java.awt.Component[] getComponents()

add

public void add(NavigationMenu.MenuGroup mg)
This method adds the specified MenuGroup to the NavigationMenu.

Parameters:
mg - The MenuGroup object to be added.

setResourceBundle

public void setResourceBundle(java.util.ResourceBundle bundle)
This method establishes the ResourceBundle of the NavigationMenu to all MenuGroups.

Parameters:
bundle - The ResourceBundle.

paintComponent

protected void paintComponent(java.awt.Graphics g)
This method paints the NavigationMenu

Parameters:
g - The graphics.

paintFixImageToPosition

protected void paintFixImageToPosition(java.awt.Graphics g)

parse

protected void parse(java.net.URL xml)
              throws java.lang.Exception
This method parses the XML Document configuration to obtain all the parameters.

Parameters:
xml - The XML Document configuration.
Throws:
java.lang.Exception

isTag

public boolean isTag(org.w3c.dom.Node node)
This method checks if the given node is an Element node of a DOM document or not.

Parameters:
node - The node to be checked.
Returns:
a boolean.

getNode

protected org.w3c.dom.Node getNode(org.w3c.dom.NamedNodeMap attributes,
                                   java.lang.String name)

createMenuGroup

protected NavigationMenu.MenuGroup createMenuGroup(org.w3c.dom.Node node)
                                            throws java.lang.Exception
This method analyzes a "MenuGroup" node of the XML Document configuration to obtain all the parameter to build a new MenuGroup into the NavigationMenu.

Parameters:
node - The "MenuGroup" node of the XML Document configuration.
Returns:
a MenuGroup object.
Throws:
java.lang.Exception

createMenuGroupInstance

protected NavigationMenu.MenuGroup createMenuGroupInstance(java.lang.String header,
                                                           java.lang.String[] opts,
                                                           javax.swing.ImageIcon[] icons,
                                                           int x,
                                                           int y,
                                                           int width,
                                                           int height,
                                                           java.awt.Color bgHeader,
                                                           java.awt.Color bgBody,
                                                           java.awt.Color fg,
                                                           java.awt.Color border)
                                                    throws java.lang.Exception
This method instantiates a new MenuGroup object with the specified parameters.

Parameters:
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.
Returns:
a MenuGroup object.
Throws:
java.lang.Exception

colorRGBToColor

public static java.awt.Color colorRGBToColor(java.lang.String rgb)
                                      throws java.lang.Exception
This method converts the specified RGBColor into a Color object.

Parameters:
rgb - String specifying a RGB color separated by semicolon "R;G;B". That is "102;23;44"
Returns:
a Color.
Throws:
java.lang.Exception

colorRGBHexToColor

public static java.awt.Color colorRGBHexToColor(java.lang.String rgb)
                                         throws java.lang.Exception
This method converts the specified RGBColor into a Color object.

Parameters:
rgb - String specifying a RGB color expressed into Hexadecimal form "#". That is "#ffffff"
Returns:
a Color.
Throws:
java.lang.Exception

parseColor

public static java.awt.Color parseColor(java.lang.String color)
                                 throws java.lang.Exception
This method analyzes a String that specifies a color and returns a Color object.

Parameters:
color - String with the color.
Returns:
a Color object.
Throws:
java.lang.Exception

isCenterImage

public boolean isCenterImage()
This method returns if it is wanted to center the background image. If it is true the background image is centered.

Returns:
a boolean.

setCenterImage

public void setCenterImage(boolean centerImage)
This method establishes that the background image have to be centered into the NavigationMenu.

Parameters:
centerImage -

Ontimize