Ontimize 5.2072EN

com.ontimize.gui.field
Class NavigatorMenuGUI

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
                      extended bycom.ontimize.gui.field.NavigatorMenuGUI
All Implemented Interfaces:
AccessForm, javax.accessibility.Accessible, FormComponent, HasPreferenceComponent, IdentifiedElement, java.awt.image.ImageObserver, Internationalization, java.awt.MenuContainer, SecureElement, java.io.Serializable

public class NavigatorMenuGUI
extends NavigationMenu
implements IdentifiedElement, AccessForm, FormComponent, HasPreferenceComponent

See Also:
Serialized Form

Nested Class Summary
static class NavigatorMenuGUI.GroupSelectableItem
          This class introduces a group of SelectableItem objects into a SelectableItem.
static class NavigatorMenuGUI.InnerLabel
           
static class NavigatorMenuGUI.MenuGroupGUI
          This class integrate Ontimize characteristics into the MenuGroup.
static class NavigatorMenuGUI.MenuItemGUI
          This class integrate Ontimize characteristics into the MenuItem.
static class NavigatorMenuGUI.MenuItemInformation
          This class is necessary to the visibility configuration of the MenuItems.
static class NavigatorMenuGUI.SetupDialog
          This class configures the JDialog in which the visibility of the MenuItems of the MenuGroups are configured.
 
Nested classes inherited from class com.ontimize.gui.field.NavigationMenu
NavigationMenu.BasicMenuHeaderRenderer, NavigationMenu.DefaultMenuHeaderRenderer, NavigationMenu.DefaultMenuItemRenderer, NavigationMenu.MenuGroup, NavigationMenu.MenuHeaderRenderer, NavigationMenu.MenuItem, NavigationMenu.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  ApplicationPreferences aPreferences
           
protected  java.lang.Object attribute
           
protected  java.util.ResourceBundle bundle
           
protected  NavigatorMenuGUI.SetupDialog dialog
           
protected  FormPermission enabledPermision
           
static java.lang.String NAVIGATOR_MENU
           
protected  Form parentForm
           
protected  javax.swing.JPopupMenu popupmenu
           
static java.lang.String RESTORE_DEFAULTS
           
protected  boolean restricted
           
static java.lang.String SRC
           
static java.awt.BasicStroke stroke
           
protected  java.lang.String userPrefs
           
static java.lang.String VISIBLE_ITEMS
           
protected  FormPermission visiblePermission
           
 
Fields inherited from class com.ontimize.gui.field.NavigationMenu
BASICRENDERER, BGBODY, BGHEADER, bgImage, BLACK, BLUE, BORDER, BORDERCLASS, BORDERCOLOR, centerImage, CENTERIMAGE, CYAN, DARKBLUE, DARKGRAY, DRAGALLMENU, DRAGENABLE, EAST, ERROR_MESSAGE, fixImage, fixImagePosition, FIXIMG, FIXIMGPOSITION, FOREGROUND, FOREGROUNDHEADER, GRAY, GREEN, HEADER, HEADERHEIGHT, height, HEIGHT, ICONS, imageBasePath, IMAGEBASEPATH, IMG, LIGHTGRAY, MAGENTA, MENU_GROUP_HEADER_ICON, MENUGROUP, MENUGROUPCLASS, menuHeaderRenderer, MENUITEMCLASS, menuItemRenderer, menuList, mosaic, MOSAIC, NORTH, NORTH_EAST, NORTH_WEST, OPAQUE, OPTIONS, ORANGE, params, PINK, RED, ROOT_XML, SEPARATOR, SOUTH, SOUTH_EAST, SOUTH_WEST, useBasicRenderer, WEST, WHITE, width, WIDTH, X, Y, 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 com.ontimize.gui.SecureElement
DESACTIVATE_COMPONENT_BY_PERMISSION_TIP
 
Fields inherited from interface com.ontimize.gui.field.FormComponent
DEBUG
 
Fields inherited from interface com.ontimize.gui.i18n.Internationalization
DEBUG_LANGUAGE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, PROPERTIES, SOMEBITS
 
Constructor Summary
NavigatorMenuGUI(java.util.Hashtable h)
          Method that configures the component.
 
Method Summary
protected  boolean checkEnabledPermission()
           
protected  boolean checkVisiblePermission()
           
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 MenuGroupGUI into the NavigationMenu.
protected  NavigatorMenuGUI.MenuGroupGUI createMenuGroupInstance(java.util.Hashtable parameters)
          This method instantiates a new MenuGroupGUI object with the specified parameters.
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)
          Deprecated.  
 java.lang.Object getAttribute()
          Gets the object attribute.
 java.lang.Object getConstraints(java.awt.LayoutManager parentLayout)
          Description method to return the constraints component to place correctly in parent container.
protected  java.lang.String getNavigationMenuPreferenceKey()
          This method returns a unequivocal key name to assign to this MenuNavigator that will be used into the Preferences.
protected  java.lang.String getNavigationMenuPreferenceValue()
          This method obtains the current values of MenuGroups and builds a String with the preference values of these MenuGroups.
 java.lang.String getPreferenceItems(NavigationMenu.MenuItem[] items)
          This is an auxiliary method to check the visibility value of the MenuItem and builds a String with them to be used into the preference values.
 java.lang.String getPreferencesStructure(java.util.ArrayList menulist)
          This method obtains the current visibility values of the MenuItems of the MenuGroups and builds a String to be used into the preference values.
 java.awt.Dimension getPreferredSize()
          This method obtains the preferred size of the background image of the NavigationMenu.
 java.util.Vector getTextsToTranslate()
          Returns all the texts in the element suitable for being translated.
 void init(java.util.Hashtable arguments)
          This method gets the Hashtable and initializes the component
 void initPermissions()
           
 void initPreferences(ApplicationPreferences ap, java.lang.String user)
           
protected  void installMouseHandler()
           
 boolean isRestricted()
           
protected  void resizeMenuGroup(java.lang.String header)
          This method resizes the specified MenuGroup.
protected  void saveNavigationMenuPreference()
           
protected  void saveNavigationMenuPreference(boolean bSaveRemote)
          This method save the current preference values.
 void setComponentLocale(java.util.Locale l)
           
protected  void setDefaultValues()
          This method restore the default values of the MenuGroups of the NavigationMenu.
protected  void setMenuGroupValue(java.lang.String name, int x, int y)
          This method establishes the position (x,y) of the specified MenuGroup
protected  void setMenuGroupValue(java.lang.String name, java.lang.String manager, boolean visibility)
          This method establishes the visibility of the MenuItems of the specified MenuGroup.
protected  void setNavigationMenuPreferenceValue(java.lang.String value)
          This method recovers the preference values from the specified String and sets them to the MenuGroup.
 void setParentForm(Form form)
          Method declaration to set the form that contains the component.
 void setResourceBundle(java.util.ResourceBundle bundle)
          Sets the language resource bundle.
protected  void showPopupMenu(java.awt.event.MouseEvent e)
          This method shows a PopupMenu when a right mouse button click is done.
 void updateVisibleItemsValues(java.util.Hashtable data)
          This method updates the visibility values of each MenuItem of each MenuGroup with the information contained into the Hashtable received.
 
Methods inherited from class com.ontimize.gui.field.NavigationMenu
add, colorRGBHexToColor, colorRGBToColor, getComponent, getComponents, getNode, isCenterImage, isTag, paintComponent, paintFixImageToPosition, parse, parseColor, setCenterImage, setMenuHeaderRenderer, setMenuItemRenderer
 
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
 
Methods inherited from interface com.ontimize.gui.field.FormComponent
isEnabled, setEnabled, setVisible
 

Field Detail

SRC

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

attribute

protected java.lang.Object attribute

visiblePermission

protected FormPermission visiblePermission

enabledPermision

protected FormPermission enabledPermision

parentForm

protected Form parentForm

restricted

protected boolean restricted

NAVIGATOR_MENU

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

popupmenu

protected javax.swing.JPopupMenu popupmenu

bundle

protected java.util.ResourceBundle bundle

RESTORE_DEFAULTS

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

VISIBLE_ITEMS

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

dialog

protected NavigatorMenuGUI.SetupDialog dialog

aPreferences

protected ApplicationPreferences aPreferences

userPrefs

protected java.lang.String userPrefs

stroke

public static java.awt.BasicStroke stroke
Constructor Detail

NavigatorMenuGUI

public NavigatorMenuGUI(java.util.Hashtable h)
                 throws java.lang.Exception
Method that configures the component.

Parameters:
h - Hashtable with the parameters.
Throws:
java.lang.Exception
Method Detail

getConstraints

public java.lang.Object getConstraints(java.awt.LayoutManager parentLayout)
Description copied from interface: FormComponent
Description method to return the constraints component to place correctly in parent container.

Specified by:
getConstraints in interface FormComponent
Parameters:
parentLayout - the parent container reference
Returns:
the constraints for the component

init

public void init(java.util.Hashtable arguments)
          throws java.lang.Exception
This method gets the Hashtable and initializes the component

Specified by:
init in interface FormComponent
Parameters:
arguments - the Hashtable with parameters

attribute values default required meaning
attr yes Indicates the component attribute.
src yes Resource path to locate the configuration XML.
Throws:
java.lang.Exception - when Exception occurs

installMouseHandler

protected void installMouseHandler()

getAttribute

public java.lang.Object getAttribute()
Description copied from interface: IdentifiedElement
Gets the object attribute. This attribute allows to identify the object

Specified by:
getAttribute in interface IdentifiedElement

initPermissions

public void initPermissions()
Specified by:
initPermissions in interface SecureElement

checkVisiblePermission

protected boolean checkVisiblePermission()

checkEnabledPermission

protected boolean checkEnabledPermission()

isRestricted

public boolean isRestricted()
Specified by:
isRestricted in interface SecureElement

setParentForm

public void setParentForm(Form form)
Description copied from interface: AccessForm
Method declaration to set the form that contains the component. This method must be called automatically during the form building.

Specified by:
setParentForm in interface AccessForm
Parameters:
form - the form reference

getTextsToTranslate

public java.util.Vector getTextsToTranslate()
Description copied from interface: Internationalization
Returns all the texts in the element suitable for being translated.

Specified by:
getTextsToTranslate in interface Internationalization
Returns:
all the texts in the element suitable for being translated.

setComponentLocale

public void setComponentLocale(java.util.Locale l)
Specified by:
setComponentLocale in interface Internationalization

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 MenuGroupGUI into the NavigationMenu.

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

createMenuGroupInstance

protected NavigatorMenuGUI.MenuGroupGUI createMenuGroupInstance(java.util.Hashtable parameters)
This method instantiates a new MenuGroupGUI object with the specified parameters.

Returns:
a MenuGroupGUI object.

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
Deprecated.  

* Constructs a new MenuGroupGUI with the specified parameters.

Overrides:
createMenuGroupInstance in class NavigationMenu
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. Use createMenuGroupInstance(Hashtable parameters)
Returns:
a MenuGroup object.
Throws:
java.lang.Exception

getPreferredSize

public java.awt.Dimension getPreferredSize()
Description copied from class: NavigationMenu
This method obtains the preferred size of the background image of the NavigationMenu.

Overrides:
getPreferredSize in class NavigationMenu
Returns:
a Dimension object with the background image dimensions.

initPreferences

public void initPreferences(ApplicationPreferences ap,
                            java.lang.String user)
Specified by:
initPreferences in interface HasPreferenceComponent

getNavigationMenuPreferenceKey

protected java.lang.String getNavigationMenuPreferenceKey()
This method returns a unequivocal key name to assign to this MenuNavigator that will be used into the Preferences.

Returns:
a String with the name.

saveNavigationMenuPreference

protected void saveNavigationMenuPreference(boolean bSaveRemote)
This method save the current preference values.


saveNavigationMenuPreference

protected void saveNavigationMenuPreference()

getNavigationMenuPreferenceValue

protected java.lang.String getNavigationMenuPreferenceValue()
This method obtains the current values of MenuGroups and builds a String with the preference values of these MenuGroups.
The preference values saved are:

- position: The coordinates x and y of each MenuGroup.

- items: The current state of visibility of each MenuItem of each MenuGroup.

*

Returns:
a String with the preference values.

setMenuGroupValue

protected void setMenuGroupValue(java.lang.String name,
                                 int x,
                                 int y)
This method establishes the position (x,y) of the specified MenuGroup

Parameters:
name - The name of the MenuGroup.
x - The coordinate x of the MenuGroup.
y - The coordinate y of the MenuGroup.

setMenuGroupValue

protected void setMenuGroupValue(java.lang.String name,
                                 java.lang.String manager,
                                 boolean visibility)
This method establishes the visibility of the MenuItems of the specified MenuGroup.

Parameters:
name - The name of the MenuGroup.
manager - The identifier of the MenuItem of the MenuGroup
visibility - Boolean with the visibility value.

setNavigationMenuPreferenceValue

protected void setNavigationMenuPreferenceValue(java.lang.String value)
This method recovers the preference values from the specified String and sets them to the MenuGroup.

Parameters:
value - Preference values String.

getPreferencesStructure

public java.lang.String getPreferencesStructure(java.util.ArrayList menulist)
This method obtains the current visibility values of the MenuItems of the MenuGroups and builds a String to be used into the preference values.

Parameters:
menulist - ArrayList with the whole MenuGroups of the NavigationMenu.
Returns:
a String

getPreferenceItems

public java.lang.String getPreferenceItems(NavigationMenu.MenuItem[] items)
This is an auxiliary method to check the visibility value of the MenuItem and builds a String with them to be used into the preference values.

Parameters:
items - An Array of MenuItem objects of a MenuGroup.
Returns:
a String.

resizeMenuGroup

protected void resizeMenuGroup(java.lang.String header)
This method resizes the specified MenuGroup.

Parameters:
header - String with the header name of the MenuGroup.

setDefaultValues

protected void setDefaultValues()
This method restore the default values of the MenuGroups of the NavigationMenu.


setResourceBundle

public void setResourceBundle(java.util.ResourceBundle bundle)
Description copied from interface: Internationalization
Sets the language resource bundle. When the application changes the configured language, for all the objects that implement this interface this method must be called with the new file.
The method must translate all the elements that have texts in the GUI

Specified by:
setResourceBundle in interface Internationalization
Overrides:
setResourceBundle in class NavigationMenu
Parameters:
bundle - The ResourceBundle.

showPopupMenu

protected void showPopupMenu(java.awt.event.MouseEvent e)
This method shows a PopupMenu when a right mouse button click is done.

Parameters:
e - Mouse event.

updateVisibleItemsValues

public void updateVisibleItemsValues(java.util.Hashtable data)
This method updates the visibility values of each MenuItem of each MenuGroup with the information contained into the Hashtable received. The information is returned by the visibility configuration JDialog.

Parameters:
data - HashTable with the MenuItem visibility information. Pair values like:
key values
"MenuGroupName" MenuItemInformation Object

Ontimize