ilog.views.maps.beans
Class IlvMapLegend

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by ilog.views.maps.beans.IlvMapLegend
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, TreeModelListener

public class IlvMapLegend
extends JPanel
implements TreeModelListener

Class for displaying a legend. A legend is a visual summary of the layers a map displays. This class is designed to work with a IlvMapLayerTreeModel which holds the IlvMapLayer displayed by this legend. The items of the legend can be displayed in categories. The control of the categories, the text displayed and the grouping of legend items is made from the values found in the IlvMapStyle of each IlvMapLayer displayed. The values of the properties IlvMapStyle.CATEGORY and IlvMapStyle.LEGEND_GROUP controls the category in which the layer will fit, the aggregation of layers and the text displayed in the legend.

Since:
JViews 7.5
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
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
 
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, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
IlvMapLegend()
          Constructs an IlvMapLegend.
 
Method Summary
 String getDescription(IlvMapLayer layer)
          Returns the description of the layer.
 IlvManagerView getView()
          Retrieves the view attached to this legend.
 boolean isDoRasters()
          Returns true if raster layers should be shown in legend.
 void setDoRasters(boolean dor)
          Displays or hide raster layers in the legend.
 void setView(IlvManagerView v)
          Sets the IlvManagerView seen by this legend.
 void treeNodesChanged(TreeModelEvent e)
          Invoked after a node (or a set of siblings) has changed in some way.
 void treeNodesInserted(TreeModelEvent e)
          Invoked after layers have been inserted into the tree.
 void treeNodesRemoved(TreeModelEvent e)
          Invoked after layers have been removed from the tree.
 void treeStructureChanged(TreeModelEvent e)
          Invoked after the tree has drastically changed structure from a given node down.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, 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, paintBorder, 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, 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
 

Constructor Detail

IlvMapLegend

public IlvMapLegend()
Constructs an IlvMapLegend.

Method Detail

setView

public void setView(IlvManagerView v)
Sets the IlvManagerView seen by this legend. The list of layers displayed by the legend is found on the IlvMapLayerTreeModel of the IlvMapLayerTreeProperty attached to the manager associated with the view.

Parameters:
v - The IlvManagerView to attach.

getView

public IlvManagerView getView()
Retrieves the view attached to this legend.

Returns:
The IlvManagerView attached to this legend.

treeNodesChanged

public void treeNodesChanged(TreeModelEvent e)
Invoked after a node (or a set of siblings) has changed in some way. Default implementation does nothing.

Specified by:
treeNodesChanged in interface TreeModelListener
See Also:
TreeModelListener.treeNodesChanged(javax.swing.event.TreeModelEvent)

treeNodesInserted

public void treeNodesInserted(TreeModelEvent e)
Invoked after layers have been inserted into the tree.

Specified by:
treeNodesInserted in interface TreeModelListener
See Also:
TreeModelListener.treeNodesInserted(javax.swing.event.TreeModelEvent)

treeNodesRemoved

public void treeNodesRemoved(TreeModelEvent e)
Invoked after layers have been removed from the tree.

Specified by:
treeNodesRemoved in interface TreeModelListener
See Also:
TreeModelListener.treeNodesRemoved(javax.swing.event.TreeModelEvent)

treeStructureChanged

public void treeStructureChanged(TreeModelEvent e)
Invoked after the tree has drastically changed structure from a given node down.

Specified by:
treeStructureChanged in interface TreeModelListener
See Also:
Default implementation does nothing.

getDescription

public String getDescription(IlvMapLayer layer)
Returns the description of the layer. The description of the layer is the text that will be shown in the legend. This default implementation return the name of the layer.

Parameters:
layer - The layer whose description is returned.
Returns:
The description of the layer.

isDoRasters

public boolean isDoRasters()
Returns true if raster layers should be shown in legend.

Returns:
true if raster layers should be shown in legend.

setDoRasters

public void setDoRasters(boolean dor)
Displays or hide raster layers in the legend. Default is to hide rasters. Showing rasters in the legend may cause performance issues, as JViews will update the raster preview image each time the image itself changes.

Parameters:
dor - indicates whether raster layers should be shown in legend.


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