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

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.DraggableToolbar
All Implemented Interfaces:
com.ontimize.gui.field.DataComponent, com.ontimize.gui.field.FormComponent, com.ontimize.gui.field.IdentifiedElement, com.ontimize.gui.i18n.Internationalization, com.ontimize.gui.SecureElement, IGisClientComponent, IGisToolbar, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

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

Gis client component used to add a draggable tool bar panel into the gis viewer component.

This panel will show a group of aligned buttons. This toolbar contains a default group
of buttons. This buttons are:

Example code to add the draggable gis toolbar panel into a gis component:

<com.ontimize.util.gis.client.gui.OGisComponent
   attr="exampleComponent" layersconf="exampleConf">
    <com.ontimize.util.gis.client.gui.panels.DraggableToolbar attr="gisToolbar" />
 /com.ontimize.util.gis.client.gui.OGisComponent>
 
Configuration parameters: In the previous example the toolbar will contain all the defalt buttons in it.
In order to show only a group of the default buttons use the parameter actions
To disable the edition button (enabled by default) use the parameter edition="no".

For example, to set only visible the zoom buttons and the pan button
the xml definition code will be:

 <com.ontimize.util.gis.client.gui.OGisComponent
   attr="exampleComponent" layersconf="exampleConf">
    <com.ontimize.util.gis.client.gui.panel.DraggableToolbar
      attr="gisToolbar" actions="zoomIn;zoomOut;pan" edition="no"/>
 </com.ontimize.util.gis.client.gui.OGisComponent> 
 
It is possible to add new buttons to the current toolbar by using the class BasicToolbarButton:
 <com.ontimize.util.gis.client.gui.OGisComponent
   attr="exampleComponent" layersconf="exampleConf">
    <com.ontimize.util.gis.client.gui.panels.DraggableToolbar attr="gisToolbar"
    floatable="no" orientation="vertical">
       <com.ontimize.util.gis.client.gui.panels.components.BasicToolbarButton
        attr="bgetinfobutton" text="getInfo"
        icon="com/ontimize/gui/images/brush.png" >
    </com.ontimize.util.gis.client.gui.panels.DraggableToolbar>
 </com.ontimize.util.gis.client.gui.OGisComponent> 
 

See Also:
BasicToolbarButton, 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 static java.lang.String actions
           
(package private)  java.lang.String[] actionsArray
          String array that stores the list an order of buttons attributes
protected static java.lang.String attrDistance
           
protected static java.lang.String attrEdit
           
protected  java.lang.Object attribute
           
protected static java.lang.String attrPan
           
protected static java.lang.String attrZoomIn
           
protected static java.lang.String attrZoomOut
           
protected  boolean borderButtons
           
protected  java.awt.Color borderColor
           
protected  int borderWidth
           
protected  BasicToolbarButton buttonEdit
           
(package private)  java.lang.String[] buttonNames
           
protected  java.util.List<BasicToolbarButton> buttons
           
protected  boolean editionEnabled
           
protected  boolean enabled
           
protected  boolean floatable
           
protected  IGisViewer gisViewer
           
protected  boolean highlightButtons
           
protected  java.lang.String iconDistance
           
protected  java.lang.String iconEdit
           
protected  java.lang.String iconPan
           
protected  java.lang.String iconZoomIn
           
protected  java.lang.String iconZoomOut
           
protected  java.awt.event.MouseListener listenerHighlightButtons
           
protected  java.util.List<PopupMenuItem> menuItems
           
protected  boolean modifiable
           
protected  MeasurePanel mPanel
           
protected  boolean opaqueBoolean
           
protected  boolean opaqueButtons
           
protected  int orientation
           
protected  int paintState
           
protected  EmptyPanel panel
           
protected  int prevViewerState
           
protected static java.lang.String PROPERTY_FLOTABLE
           
protected static java.lang.String PROPERTY_ORIENTATION
           
protected  boolean required
           
protected  java.awt.Paint tbBGPaint
           
protected static java.lang.String textDistance
           
protected static java.lang.String textEdit
           
protected static java.lang.String textPan
           
protected static java.lang.String textZoomIn
           
protected static java.lang.String textZoomOut
           
protected  JGisToolBar toolbar
           
protected static int toolbarHeight
           
protected static java.lang.String toolbarTitle
           
protected static int toolbarWidth
           
 
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.DataComponent
COMP_FOCUS_YELLOW, GREEN_VERY_LIGHT, LIGHT_GRAY_BLUE, LIGHT_GREYISH_BLUE, VERY_LIGHT_BLUE, VERY_LIGHT_GRAY, VERY_LIGHT_PINK, VERY_LIGHT_RED, VERY_LIGHT_SKYBLUE, VERY_LIGHT_YELLOW, VERY_LIGHT_YELLOW_2
 
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
DraggableToolbar(java.util.Hashtable parameters)
           
 
Method Summary
 void add(java.awt.Component comp, java.lang.Object constraints)
           
protected  void addActionElement(java.lang.String name)
           
 void addSeparator()
          Add a separator to the current toolbar
 void addToolbarButton(BasicToolbarButton button)
          Add a new button to the toolbar
 void deleteData()
           
 void disableOuterPanel()
           
 java.lang.Object getAttribute()
           
 BasicToolbarButton getButton(java.lang.Object buttonAttr)
          Get the toolbar button reference
 java.util.List<BasicToolbarButton> getButtons()
          Get a list with the complete toolbar buttons references
 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)
           
protected  BasicToolbarButton getDistanceButton()
          Distance measurement button builder method
protected  BasicToolbarButton getEditionButton()
           
 java.lang.String getLabelComponentText()
           
protected  BasicToolbarButton getPanButton()
          Pan/Selection button builder method
 int getSQLDataType()
           
 java.util.Vector getTextsToTranslate()
           
 java.lang.Object getValue()
           
protected  BasicToolbarButton getZoomInButton()
          Zoom In button builder method
protected  BasicToolbarButton getZoomOutButton()
          Zoom Out button builder method
 void init(java.util.Hashtable parameters)
           
 void initPermissions()
           
 boolean isEmpty()
           
 boolean isEnabled()
           
 boolean isHidden()
           
 boolean isModifiable()
           
 boolean isModified()
           
 boolean isRequired()
           
 boolean isRestricted()
           
protected  void paintChildren(java.awt.Graphics g)
           
protected  void paintComponent(java.awt.Graphics g2d)
           
protected  void rebuildToobar()
           
protected  void restoreDraggableToolbar()
           
 void setComponentLocale(java.util.Locale locale)
           
 void setEnabled(boolean enabled)
           
 void setGisViewer(IGisViewer gisViewer)
          Set the gis viewer instance for the actual component
 void setModifiable(boolean modifiable)
           
 void setRequired(boolean required)
           
 void setResourceBundle(java.util.ResourceBundle res)
           
 void setValue(java.lang.Object value)
           
 void setVisible(boolean visible)
          Sets the component visible
protected  void toolbarSetup()
           
 
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, 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, 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, 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
 

Field Detail

actions

protected static java.lang.String actions

attrZoomIn

protected static java.lang.String attrZoomIn

attrZoomOut

protected static java.lang.String attrZoomOut

attrPan

protected static java.lang.String attrPan

attrDistance

protected static java.lang.String attrDistance

attrEdit

protected static java.lang.String attrEdit

textZoomIn

protected static java.lang.String textZoomIn

textZoomOut

protected static java.lang.String textZoomOut

textPan

protected static java.lang.String textPan

textDistance

protected static java.lang.String textDistance

textEdit

protected static java.lang.String textEdit

iconPan

protected java.lang.String iconPan

iconZoomIn

protected java.lang.String iconZoomIn

iconZoomOut

protected java.lang.String iconZoomOut

iconDistance

protected java.lang.String iconDistance

iconEdit

protected java.lang.String iconEdit

PROPERTY_FLOTABLE

protected static java.lang.String PROPERTY_FLOTABLE

PROPERTY_ORIENTATION

protected static java.lang.String PROPERTY_ORIENTATION

toolbarTitle

protected static java.lang.String toolbarTitle

borderColor

protected java.awt.Color borderColor

borderWidth

protected int borderWidth

opaqueBoolean

protected boolean opaqueBoolean

opaqueButtons

protected boolean opaqueButtons

highlightButtons

protected boolean highlightButtons

borderButtons

protected boolean borderButtons

listenerHighlightButtons

protected java.awt.event.MouseListener listenerHighlightButtons

modifiable

protected boolean modifiable

required

protected boolean required

enabled

protected boolean enabled

attribute

protected java.lang.Object attribute

paintState

protected int paintState

buttons

protected java.util.List<BasicToolbarButton> buttons

menuItems

protected java.util.List<PopupMenuItem> menuItems

editionEnabled

protected boolean editionEnabled

prevViewerState

protected int prevViewerState

mPanel

protected MeasurePanel mPanel

buttonEdit

protected BasicToolbarButton buttonEdit

gisViewer

protected IGisViewer gisViewer

toolbarHeight

protected static int toolbarHeight

toolbarWidth

protected static int toolbarWidth

toolbar

protected JGisToolBar toolbar

panel

protected EmptyPanel panel

buttonNames

java.lang.String[] buttonNames

floatable

protected boolean floatable

orientation

protected int orientation

tbBGPaint

protected java.awt.Paint tbBGPaint

actionsArray

java.lang.String[] actionsArray
String array that stores the list an order of buttons attributes

Constructor Detail

DraggableToolbar

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

toolbarSetup

protected void toolbarSetup()

restoreDraggableToolbar

protected void restoreDraggableToolbar()

add

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

rebuildToobar

protected void rebuildToobar()

getConstraints

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

disableOuterPanel

public void disableOuterPanel()

addActionElement

protected void addActionElement(java.lang.String name)

init

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

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

setResourceBundle

public void setResourceBundle(java.util.ResourceBundle res)
Specified by:
setResourceBundle 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

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface com.ontimize.gui.field.FormComponent
Overrides:
isEnabled in class java.awt.Component

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface com.ontimize.gui.field.FormComponent
Overrides:
setEnabled in class javax.swing.JComponent

setVisible

public void setVisible(boolean visible)
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

paintComponent

protected void paintComponent(java.awt.Graphics g2d)
Overrides:
paintComponent in class javax.swing.JComponent

paintChildren

protected void paintChildren(java.awt.Graphics g)
Overrides:
paintChildren in class javax.swing.JComponent

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

deleteData

public void deleteData()
Specified by:
deleteData in interface com.ontimize.gui.field.DataComponent

getLabelComponentText

public java.lang.String getLabelComponentText()
Specified by:
getLabelComponentText in interface com.ontimize.gui.field.DataComponent

getSQLDataType

public int getSQLDataType()
Specified by:
getSQLDataType in interface com.ontimize.gui.field.DataComponent

getValue

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

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface com.ontimize.gui.field.DataComponent

isHidden

public boolean isHidden()
Specified by:
isHidden in interface com.ontimize.gui.field.DataComponent

isModifiable

public boolean isModifiable()
Specified by:
isModifiable in interface com.ontimize.gui.field.DataComponent

isModified

public boolean isModified()
Specified by:
isModified in interface com.ontimize.gui.field.DataComponent

isRequired

public boolean isRequired()
Specified by:
isRequired in interface com.ontimize.gui.field.DataComponent

setModifiable

public void setModifiable(boolean modifiable)
Specified by:
setModifiable in interface com.ontimize.gui.field.DataComponent

setRequired

public void setRequired(boolean required)
Specified by:
setRequired in interface com.ontimize.gui.field.DataComponent

setValue

public void setValue(java.lang.Object value)
Specified by:
setValue in interface com.ontimize.gui.field.DataComponent

getButton

public BasicToolbarButton getButton(java.lang.Object buttonAttr)
Description copied from interface: IGisToolbar
Get the toolbar button reference

Specified by:
getButton in interface IGisToolbar
Parameters:
buttonAttr - Toolbar button attribute
Returns:
Resquested toolbar button

getButtons

public java.util.List<BasicToolbarButton> getButtons()
Description copied from interface: IGisToolbar
Get a list with the complete toolbar buttons references

Specified by:
getButtons in interface IGisToolbar
Returns:
Toolbar buttons list

addToolbarButton

public void addToolbarButton(BasicToolbarButton button)
Description copied from interface: IGisToolbar
Add a new button to the toolbar

Specified by:
addToolbarButton in interface IGisToolbar
Parameters:
button - New toolbar button

addSeparator

public void addSeparator()
Description copied from interface: IGisToolbar
Add a separator to the current toolbar

Specified by:
addSeparator in interface IGisToolbar

getZoomInButton

protected BasicToolbarButton getZoomInButton()
Zoom In button builder method


getZoomOutButton

protected BasicToolbarButton getZoomOutButton()
Zoom Out button builder method


getPanButton

protected BasicToolbarButton getPanButton()
Pan/Selection button builder method


getDistanceButton

protected BasicToolbarButton getDistanceButton()
Distance measurement button builder method


getEditionButton

protected BasicToolbarButton getEditionButton()