public class IlvJMapLegend extends JPanel
IlvManagerView
.
The map legend is displayed in a rectangle that contains the list of
the layer names. For each layer, a check box lets the user change the visibility
of the layer. However, the visibility flag does not override the visibility filters, such as
instances of IlvScaleVisibilityFilter
set on the layer. A component
can be specified for each layer to show a typical representation of the layer theme.
This component can eventually be a GUI component written for the purpose of a map application,
for instance a button to change the colors of the graphic objects in a layer.
This class is packaged as a Java Bean and is designed to be used very easily in a Java development environment supporting visual programming with Beans.
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IlvJMapLegend()
Instantiates a map legend.
|
Modifier and Type | Method and Description |
---|---|
JLabel |
createLayerLabel(String label)
This method is called when the legend needs to create its labels.
|
String |
getFilteredText()
Returns the text used to print the display status of a layer.
|
JLabel |
getLayerLabel(IlvManagerLayer layer)
Returns the
JLabel object representing the layer label. |
String |
getLayerName(IlvManagerLayer layer)
Returns the name used to display a layer if the internal name has been overridden.
|
Component |
getLayerRepresentation(IlvManagerLayer layer)
Returns the representation component that is used to show a typical item
of the layer content.
|
LayoutManager |
getLegendLayout(IlvManagerLayer layer)
Returns the layout manager used to display the items representing
the specified layer if the default layout has been overridden.
|
String |
getUnnamedLayerText()
Returns the text used as the name of unnamed layers.
|
IlvManagerView |
getView()
Returns the view for which the legend is displayed by this component.
|
boolean |
isEditable()
Returns the editing mode for the
IlvJMapLegend . |
boolean |
isLayerGlobalVisibilityMode()
Tests whether this legend instance controls the global visibility
of the manager layers for all views or the associated view only.
|
void |
setEditable(boolean editable)
Sets the editable mode of the
IlvJMapLegend . |
void |
setFilteredText(String text)
Sets the
String used to print the display status of
a layer. |
void |
setLayerGlobalVisibilityMode(boolean set)
Sets whether this legend instance controls the global visibility
of the manager layers for all views or the associated view only.
|
void |
setLayerName(IlvManagerLayer layer,
String name)
Sets the name for the specified layer.
|
void |
setLayerRepresentation(IlvManagerLayer layer,
Component representation)
Specifies a representation component that can be used to show a typical item
of the layer content.
|
void |
setLegendLayout(IlvManagerLayer layer,
LayoutManager layout)
Changes the layout manager used to display the items representing
the specified layer.
|
void |
setUnnamedLayerText(String text)
Sets the
String used as the name of unnamed layers. |
void |
setView(IlvManagerView view)
Sets the manager view for which the legend will be displayed.
|
void |
updateAll()
Updates the legend display.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
public IlvJMapLegend()
IlvManagerView
view is set. setView(ilog.views.IlvManagerView)
public final void setView(IlvManagerView view)
view
- The manager view.public final IlvManagerView getView()
public void updateAll()
public void setLayerGlobalVisibilityMode(boolean set)
Setting | Description |
false | visible to the associated view only |
true | visible for all the views |
By default, this value is set to false
.
set
- Set to true
so the layer is global, that is,
visible to all associated layers.public boolean isLayerGlobalVisibilityMode()
false
, that is, this legend instance controls
the visibility for the associated view only.setLayerGlobalVisibilityMode(boolean)
public void setLayerName(IlvManagerLayer layer, String name)
IlvManagerLayer.setName
).layer
- The layer.name
- The name to be used to represent the layer.public String getLayerName(IlvManagerLayer layer)
layer
- The layer.layer
or null
if the layer internal name has not been overridden.public void setLayerRepresentation(IlvManagerLayer layer, Component representation)
IlvMarker
, IlvPolyPoints
or IlvPolygon
.layer
- The layer whose representation is specified.representation
- The component that paints the representation.public Component getLayerRepresentation(IlvManagerLayer layer)
layer
- The layer whose representation is to be returned.layer
or
null
if no representation has been associated with
this layer.public JLabel getLayerLabel(IlvManagerLayer layer)
JLabel
object representing the layer label.
Use this method to customize the layer label. For example, to change the
foreground color and the font for the label.layer
- The layer whose label is to be returned.JLabel
associated with layer
or
null
if no label has been associated with
this layer.public JLabel createLayerLabel(String label)
JLabel
instance
used by the legend.label
- The string associated to the layer. This string is returned
by the method getLayerName(IlvManagerLayer)
.JLabel
instance used in the legend.public void setLegendLayout(IlvManagerLayer layer, LayoutManager layout)
layer
- The layer whose representation is specified.layout
- The layout manager.public LayoutManager getLegendLayout(IlvManagerLayer layer)
layer
- The layer.layer
or
null
if no layout manager have been associated with
this layer.public void setEditable(boolean editable)
IlvJMapLegend
.
When the IlvJMapLegend
is in editable mode,
the user can change the layer order
by dragging the components representing the layers.editable
- The new mode.public boolean isEditable()
IlvJMapLegend
.true
if the layer is editable, false
otherwise.public void setFilteredText(String text)
String
used to print the display status of
a layer.
A layer is filtered if it is not displayed in a view due to
its visibility filters. The default text is " (Filtered)"text
- The text to use when a layer is filtered.getFilteredText()
public String getFilteredText()
setFilteredText(java.lang.String)
public void setUnnamedLayerText(String text)
String
used as the name of unnamed layers.
The default text is "(No name)".text
- The text to use when a layer is filtered.getUnnamedLayerText()
public String getUnnamedLayerText()
setUnnamedLayerText(java.lang.String)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.