ilog.views.maps.beans
Class IlvMapAnnotationToolBar

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JToolBar
                  extended by ilog.views.maps.beans.IlvMapAnnotationToolBar
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants

public class IlvMapAnnotationToolBar
extends JToolBar

A toolbar displaying buttons for creating map annotations. Map annotations are graphic objects that are displayed on a map to provide additional visual information. By default this tool bar displays:

These buttons are associated with interactors that create graphic annotations on a map. These annotations can also be labeled.

Since:
JViews 8.0
See Also:
Serialized Form

Nested Class Summary
static class IlvMapAnnotationToolBar.MapGraphicPath
          An IlvMapGraphicPath for annotations.
static class IlvMapAnnotationToolBar.MapMarker
          An IlvMapMarker annotation extension.
static class IlvMapAnnotationToolBar.MapPolyline
          An IlvMapPolyline with annotation extensions.
 class IlvMapAnnotationToolBar.ToolBarButton
          A JToggleButton that can be associated with and trigger an IlvManagerViewInteractor.
 
Nested classes/interfaces inherited from class javax.swing.JToolBar
JToolBar.AccessibleJToolBar, JToolBar.Separator
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String ANNOTATION_PROPERTY_NAME
          The name of the attribute displayed as a label by the annotation.
static String EXT_ANNOTATION_PROPERTY_NAME
          The name of the attribute displayed as an extended description by the annotation.
static int POINT_BUTTON
          The index of the point annotation button.
static int POLYGON_BUTTON
          The index of the polygon annotation button.
static int POLYLINE_BUTTON
          The index of the polyline annotation button.
 
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 javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
IlvMapAnnotationToolBar()
          Creates a new IlvMapAnnotationToolBar with the default set of buttons: A polyline button A polygon button A point button These buttons are associated with interactors that create graphic annotations on a map.
 
Method Summary
protected  void addImpl(Component comp, Object constraints, int index)
          
 String askForString(String old)
          Called at graphic annotation creation to provide a string to be displayed as the annotation label.
 String[] askForStrings(String o1, String o2)
          Pops a dialog to ask for the label and the extended description.
protected  JMenuItem deleteItem()
          Creates a menu item that allows you to delete the annotation.
 IlvMapAnnotationToolBar.ToolBarButton getButton(int i)
          Returns the nth ToolBarButton button of the toolbar.
 Dimension getButtonSize()
          Retrieves the button size set by setButtonSize().
 JPopupMenu getPopupMenu()
          Returns the popup menu that is displayed for the graphic objects created by this toolbar.
 IlvManagerView getView()
          Returns the view associated with this annotation toolbar.
 boolean isChecking()
          Indicates if the point validity is checked or not.
protected  JMenuItem labelItem()
          Creates a menu item that allows you to change the label of the annotation.
 void setButtonSize(Dimension buttonSize)
          Forces the button sizes for the buttons contained by this toolbar.
 void setChecking(boolean check)
          Requests this toolbar to check if the points entered are valid or not.
 void setView(IlvManagerView v)
          Sets the view for this annotation toolbar.
protected  JMenuItem styleItem()
          Creates a menu item that allows you to change the style of the annotation.
 
Methods inherited from class javax.swing.JToolBar
add, addSeparator, addSeparator, createActionChangeListener, createActionComponent, getAccessibleContext, getComponentAtIndex, getComponentIndex, getMargin, getOrientation, getUI, getUIClassID, isBorderPainted, isFloatable, isRollover, paintBorder, paramString, setBorderPainted, setFloatable, setLayout, setMargin, setOrientation, setRollover, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, 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
 

Field Detail

POLYLINE_BUTTON

public static final int POLYLINE_BUTTON
The index of the polyline annotation button.

See Also:
Constant Field Values

POLYGON_BUTTON

public static final int POLYGON_BUTTON
The index of the polygon annotation button.

See Also:
Constant Field Values

POINT_BUTTON

public static final int POINT_BUTTON
The index of the point annotation button.

See Also:
Constant Field Values

ANNOTATION_PROPERTY_NAME

public static String ANNOTATION_PROPERTY_NAME
The name of the attribute displayed as a label by the annotation.


EXT_ANNOTATION_PROPERTY_NAME

public static String EXT_ANNOTATION_PROPERTY_NAME
The name of the attribute displayed as an extended description by the annotation.

Constructor Detail

IlvMapAnnotationToolBar

public IlvMapAnnotationToolBar()
Creates a new IlvMapAnnotationToolBar with the default set of buttons: These buttons are associated with interactors that create graphic annotations on a map. These annotations can be labeled.

Method Detail

setView

public void setView(IlvManagerView v)
Sets the view for this annotation toolbar.

Parameters:
v - The view to be associated with this annotation toolbar.

getView

public IlvManagerView getView()
Returns the view associated with this annotation toolbar.

Returns:
The view associated with this annotation toolbar.

addImpl

protected void addImpl(Component comp,
                       Object constraints,
                       int index)

Overrides:
addImpl in class JToolBar

getButton

public IlvMapAnnotationToolBar.ToolBarButton getButton(int i)
Returns the nth ToolBarButton button of the toolbar.

Parameters:
i - The nth button or null if the index is out of range. You can also retrieve the polyline annotation button by passing IlvMapAnnotationToolBar.POLYLINE_BUTTON as index, the polygon annotation button by passing IlvMapAnnotationToolBar.POLYGON_BUTTON, or the point annotation button by passing IlvMapAnnotationToolBar.POINT_BUTTON.
Returns:
The requested button or null if the given index is out of range or if the component is not a ToolBarButton.

labelItem

protected JMenuItem labelItem()
Creates a menu item that allows you to change the label of the annotation.

Returns:
The label item menu.

deleteItem

protected JMenuItem deleteItem()
Creates a menu item that allows you to delete the annotation.

Returns:
The delete item menu.

styleItem

protected JMenuItem styleItem()
Creates a menu item that allows you to change the style of the annotation.

Returns:
The style item menu.

getPopupMenu

public JPopupMenu getPopupMenu()
Returns the popup menu that is displayed for the graphic objects created by this toolbar. This implementation returns a JPopupMenu allowing you to change the value attribute of the IlvGraphic, to delete the annotation, and to change/add a new style.

Returns:
The popup menu that is displayed for the graphic objects created by this toolbar.

isChecking

public boolean isChecking()
Indicates if the point validity is checked or not.

Returns:
If set to true checking is performed, false otherwise.

setChecking

public void setChecking(boolean check)
Requests this toolbar to check if the points entered are valid or not.

Parameters:
check - If set to true checking is performed, false otherwise.

askForString

public String askForString(String old)
Called at graphic annotation creation to provide a string to be displayed as the annotation label.

Parameters:
old - The old string value.
Returns:
The new string to be displayed as an annotation label.

askForStrings

public String[] askForStrings(String o1,
                              String o2)
Pops a dialog to ask for the label and the extended description. The extended description can be html formated.

Parameters:
o1 - A label to fill the label field of the dialog or null
o2 - A description to fill the description field of the dialog or null
Returns:
An array of two strings : The label and the extended description.

getButtonSize

public Dimension getButtonSize()
Retrieves the button size set by setButtonSize().

Returns:
The button size set by setButtonSize().

setButtonSize

public void setButtonSize(Dimension buttonSize)
Forces the button sizes for the buttons contained by this toolbar.

Parameters:
buttonSize - The forced button size.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.