com.ontimize.util.gis.client.gui.panels
Class PopupMenuPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.ontimize.util.gis.client.gui.panels.PopupMenuPanel
All Implemented Interfaces:
com.ontimize.gui.field.FormComponent, com.ontimize.gui.field.IdentifiedElement, com.ontimize.gui.i18n.Internationalization, com.ontimize.gui.SecureElement, IGisClientComponent, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class PopupMenuPanel
extends javax.swing.JComponent
implements IGisClientComponent, com.ontimize.gui.field.FormComponent, com.ontimize.gui.field.IdentifiedElement, com.ontimize.gui.i18n.Internationalization

Gis client component used to show a pop up menu visible by clicking with the right mouse button
over the gis map viewer.

This panel will contain a group of buttons with a related name and icon and a action performing class.

Example code to add the pop up menu panel with two buttons into a gis component:

 <com.ontimize.util.gis.client.gui.OGisComponent
   attr=>exampleComponent> layersconf=>exampleConf>>
    <com.ontimize.util.gis.client.gui.panels.PopupMenuPanel>
        <com.ontimize.util.gis.client.gui.panels.components.PopupMenuItem
            attr=>POPUP_MENU_ITEM_SAVE_BBOX> img=>com/ontimize/util/gis/client/gui/images/earth.png>
            actionClass=>com.ontimize.util.gis.client.gui.panels.actions.BBoxAction> />
        <com.ontimize.util.gis.client.gui.panels.components.PopupMenuItem
            attr=>POPUP_MENU_ITEM_GO_TO> img=>com/ontimize/util/gis/client/gui/images/bullseye.png>
            actionClass=>com.ontimize.util.gis.client.gui.panels.actions.GoToAction> />
     </com.ontimize.util.gis.client.gui.panels.PopupMenuPanel>
 /com.ontimize.util.gis.client.gui.OGisComponent>
 

See Also:
PopupMenuItem, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean borderButtons
           
protected  IGisViewer gisViewer
           
protected  boolean highlightButtons
           
(package private)  java.util.List<PopupMenuItem> items
           
protected  boolean listenerAdded
           
protected  java.awt.event.MouseListener listenerHighlightButtons
           
protected  javax.swing.JPopupMenu menu
           
protected  boolean opaqueButtons
           
protected  java.awt.event.MouseListener popupListener
           
 
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.field.FormComponent
DEBUG
 
Fields inherited from interface com.ontimize.gui.i18n.Internationalization
DEBUG_LANGUAGE
 
Fields inherited from interface com.ontimize.gui.SecureElement
DESACTIVATE_COMPONENT_BY_PERMISSION_TIP
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PopupMenuPanel()
           
PopupMenuPanel(java.util.Hashtable parameters)
           
 
Method Summary
 void add(java.awt.Component comp, java.lang.Object constraints)
           
 java.lang.Object getAttribute()
           
 java.awt.Rectangle getComponentLimits()
          Get the component drawing limits, since the component it's not painted on all the extension of the panel.
 java.lang.Object getConstraints(java.awt.LayoutManager layoutManager)
           
 java.util.Vector getTextsToTranslate()
           
 void init(java.util.Hashtable parameters)
           
 void initPermissions()
           
 boolean isRestricted()
           
 void setBackground(java.awt.Color color)
           
 void setComponentLocale(java.util.Locale locale)
           
 void setGisViewer(IGisViewer gisViewer)
          Set the gis viewer instance for the actual component
 void setResourceBundle(java.util.ResourceBundle res)
           
 void setVisible(boolean flag)
          Sets the component visible
 
Methods inherited from class javax.swing.JComponent
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, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
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, 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, 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, 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
 

Field Detail

listenerAdded

protected boolean listenerAdded

gisViewer

protected IGisViewer gisViewer

popupListener

protected java.awt.event.MouseListener popupListener

menu

protected javax.swing.JPopupMenu menu

items

java.util.List<PopupMenuItem> items

opaqueButtons

protected boolean opaqueButtons

highlightButtons

protected boolean highlightButtons

borderButtons

protected boolean borderButtons

listenerHighlightButtons

protected java.awt.event.MouseListener listenerHighlightButtons
Constructor Detail

PopupMenuPanel

public PopupMenuPanel()

PopupMenuPanel

public PopupMenuPanel(java.util.Hashtable parameters)
               throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getComponentLimits

public java.awt.Rectangle getComponentLimits()
Description copied from interface: IGisClientComponent
Get the component drawing limits, since the component it's not painted on all the extension of the panel. This method is used principally in events management

Specified by:
getComponentLimits in interface IGisClientComponent
Returns:
component painting area

setGisViewer

public void setGisViewer(IGisViewer gisViewer)
Description copied from interface: IGisClientComponent
Set the gis viewer instance for the actual component

Specified by:
setGisViewer in interface IGisClientComponent
Parameters:
gisViewer - Gis viewer instanceof

setResourceBundle

public void setResourceBundle(java.util.ResourceBundle res)
Specified by:
setResourceBundle in interface com.ontimize.gui.i18n.Internationalization

getConstraints

public java.lang.Object getConstraints(java.awt.LayoutManager layoutManager)
Specified by:
getConstraints in interface com.ontimize.gui.field.FormComponent

init

public void init(java.util.Hashtable parameters)
          throws java.lang.Exception
Specified by:
init in interface com.ontimize.gui.field.FormComponent
Throws:
java.lang.Exception

add

public void add(java.awt.Component comp,
                java.lang.Object constraints)
Overrides:
add in class java.awt.Container

getTextsToTranslate

public java.util.Vector getTextsToTranslate()
Specified by:
getTextsToTranslate in interface com.ontimize.gui.i18n.Internationalization

setComponentLocale

public void setComponentLocale(java.util.Locale locale)
Specified by:
setComponentLocale in interface com.ontimize.gui.i18n.Internationalization

getAttribute

public java.lang.Object getAttribute()
Specified by:
getAttribute in interface com.ontimize.gui.field.IdentifiedElement

initPermissions

public void initPermissions()
Specified by:
initPermissions in interface com.ontimize.gui.SecureElement

isRestricted

public boolean isRestricted()
Specified by:
isRestricted in interface com.ontimize.gui.SecureElement

setVisible

public void setVisible(boolean flag)
Description copied from interface: IGisClientComponent
Sets the component visible

Specified by:
setVisible in interface com.ontimize.gui.field.FormComponent
Specified by:
setVisible in interface IGisClientComponent
Overrides:
setVisible in class javax.swing.JComponent

setBackground

public void setBackground(java.awt.Color color)
Overrides:
setBackground in class javax.swing.JComponent