## com.bbn.openmap.gui
Class LayerPane

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  javax.swing.JPanel
                      com.bbn.openmap.gui.LayerPane

All Implemented Interfaces:
  javax.accessibility.Accessible, java.awt.event.ActionListener, java.awt.event.ComponentListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

Direct Known Subclasses:
  LayerStatusPane

public class LayerPane
extends javax.swing.JPanel
implements java.io.Serializable, java.awt.event.ActionListener, java.awt.event.ComponentListener

A LayerPane is a single instance of how a layer represented in the LayersPanel. It contains three widgets: an on/off button; a palette button; and a toggle button with the layer name.

See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class javax.swing.JPanel
`javax.swing.JPanel.AccessibleJPanel`

Nested classes inherited from class javax.swing.JComponent
`javax.swing.JComponent.AccessibleJComponent`

Nested classes inherited from class java.awt.Container
`java.awt.Container.AccessibleAWTContainer`

Nested classes inherited from class java.awt.Component
`java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

Field Summary
`protected static LayerPane` `backgroundLayerSeparator`
`protected I18n` `i18n`
`protected Layer` `layer`
`protected LayerHandler` `layerHandler`
`protected javax.swing.JToggleButton` `layerName`
`protected static javax.swing.ImageIcon` `layerOffIcon`
`protected static javax.swing.ImageIcon` `layerOnIcon`
`protected java.awt.Color` `offColor`
`protected java.awt.Color` `onColor`
`protected javax.swing.AbstractButton` `onoffButton`
`protected javax.swing.AbstractButton` `paletteButton`
`protected static javax.swing.ImageIcon` `paletteIcon`
`protected static javax.swing.ImageIcon` `paletteOnIcon`
`protected boolean` `selected`
`static java.lang.String` `showPaletteCmd`
`static java.lang.String` `toggleLayerCmd`
`protected static java.net.URL` `url1`
`protected static java.net.URL` `url2`
`protected static java.net.URL` `url3`
`protected static java.net.URL` `url4`

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
`` `LayerPane(Layer layer, LayerHandler layerHandler, javax.swing.ButtonGroup bg)`
`protected` `LayerPane(java.lang.String title)` Used for the background LayerPanel marker.

Method Summary
`void` `actionPerformed(java.awt.event.ActionEvent e)` ActionListener interface.
`void` `cleanup()` LayerPane disconnects from listeners, nulls out components.
`void` `cleanup(javax.swing.ButtonGroup bg)` Same as cleanup, except the layer name toggle button gets removed from the given button group.
`void` `componentHidden(java.awt.event.ComponentEvent e)` Invoked when component has been hidden.
`void` `componentMoved(java.awt.event.ComponentEvent e)` Invoked when component has been moved.
`void` `componentResized(java.awt.event.ComponentEvent e)` Invoked when component has been resized.
`void` `componentShown(java.awt.event.ComponentEvent e)` Invoked when component has been shown.
`protected void` `createGUI(javax.swing.ButtonGroup bg)`
`protected javax.swing.AbstractButton` `createOnOffButton()` Simply creates the AbstractButton object that turns the layer on/off.
`protected javax.swing.AbstractButton` `createPaletteButton()` Simply creates the AbstractButton object that turns the layer palette on/off.
`void` `finalize()`
`static LayerPane` `getBackgroundLayerSeparator(java.lang.String title)`
`Layer` `getLayer()`
`protected LayerHandler` `getLayerHandler()`
`java.awt.Dimension` `getMinimumSize()`
`protected javax.swing.AbstractButton` `getOnOffButton()` Calls createOnOFfButton to create the button, and then adds all the behavior settings to the button.
`protected javax.swing.AbstractButton` `getPaletteButton()` Calls createPaletteButton to create the button, and then adds all the behavior settings to the button.
`java.awt.Dimension` `getPreferredSize()`
`protected void` `hidePalette()`
`boolean` `isLayerOn()`
`boolean` `isPaletteOn()`
`boolean` `isSelected()`
`void` `setLayerHandler(LayerHandler in_layerHandler)`
`void` `setLayerOn(boolean value)` Turns the button on or off
`void` `setPaletteOn(boolean value)` Turns the palette button on or off
`void` `setSelected(boolean select)` Highlights/unhighlights the layerName toggle button
`protected void` `showPalette()`
`void` `updateLayerLabel()` Tell the pane to check with the layer to get the current layer name for it's label.

Methods inherited from class javax.swing.JPanel
`getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI`

Methods inherited from class javax.swing.JComponent

`addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### onoffButton

    protected transient javax.swing.AbstractButton onoffButton

### paletteButton

    protected transient javax.swing.AbstractButton paletteButton

### layerName

    protected transient javax.swing.JToggleButton layerName

### selected

    protected transient boolean selected

### layer

    protected transient Layer layer

### layerHandler

    protected transient LayerHandler layerHandler

### url1

    protected static transient java.net.URL url1

### paletteIcon

    protected static transient javax.swing.ImageIcon paletteIcon

### url2

    protected static transient java.net.URL url2

### paletteOnIcon

    protected static transient javax.swing.ImageIcon paletteOnIcon

### url3

    protected static transient java.net.URL url3

### layerOnIcon

    protected static transient javax.swing.ImageIcon layerOnIcon

### url4

    protected static transient java.net.URL url4

### layerOffIcon

    protected static transient javax.swing.ImageIcon layerOffIcon

### showPaletteCmd

    public static final transient java.lang.String showPaletteCmd

See Also:
  Constant Field Values

### toggleLayerCmd

    public static final transient java.lang.String toggleLayerCmd

See Also:
  Constant Field Values

### offColor

    protected java.awt.Color offColor

### onColor

    protected java.awt.Color onColor

### i18n

    protected I18n i18n

### backgroundLayerSeparator

    protected static LayerPane backgroundLayerSeparator

Constructor Detail

### LayerPane

    public LayerPane(Layer layer,
                     LayerHandler layerHandler,
                     javax.swing.ButtonGroup bg)

Parameters:
  `layer` - the layer to be represented by the pane.
  `bg` - the buttongroup for the layer
  `layerHandler` - the LayerHandler that contains information about the Layers.

### LayerPane

    protected LayerPane(java.lang.String title)

  Used for the background LayerPanel marker.

Method Detail

### createGUI

    protected void createGUI(javax.swing.ButtonGroup bg)

### createOnOffButton

    protected javax.swing.AbstractButton createOnOffButton()

  Simply creates the AbstractButton object that turns the layer on/off. Override this if you want to change the kind of button used.

  Returns:
    AbstractButton in an off state.

### getOnOffButton

    protected javax.swing.AbstractButton getOnOffButton()

  Calls createOnOFfButton to create the button, and then adds all the behavior settings to the button. Override this if you want to change everything about the button.

  Returns:
    AbstractButton in an off state.

### createPaletteButton

    protected javax.swing.AbstractButton createPaletteButton()

  Simply creates the AbstractButton object that turns the layer palette on/off. Override this if you want to change the kind of button used.

  Returns:
    AbstractButton in an off state.

### getPaletteButton

    protected javax.swing.AbstractButton getPaletteButton()

  Calls createPaletteButton to create the button, and then adds all the behavior settings to the button. Override this if you want to change everything about the button.

  Returns:
    AbstractButton in an off state.

### setLayerHandler

    public void setLayerHandler(LayerHandler in_layerHandler)

### getLayerHandler

    protected LayerHandler getLayerHandler()

  Returns:
    LayerHandler if it has been found in the MapHandler or set.

### cleanup

    public void cleanup(javax.swing.ButtonGroup bg)

  Same as cleanup, except the layer name toggle button gets removed from the given button group.

### cleanup

    public void cleanup()

  LayerPane disconnects from listeners, nulls out components.

### getPreferredSize

    public java.awt.Dimension getPreferredSize()

### getMinimumSize

    public java.awt.Dimension getMinimumSize()

### isLayerOn

    public boolean isLayerOn()

  Returns:
    whether the layer is on

### setLayerOn

    public void setLayerOn(boolean value)

  Turns the button on or off

### isPaletteOn

    public boolean isPaletteOn()

  Returns:
    whether the palette for this layer is on

### setPaletteOn

    public void setPaletteOn(boolean value)

  Turns the palette button on or off

### isSelected

    public boolean isSelected()

  Returns:
    the status of the layerName toggle button

### setSelected

    public void setSelected(boolean select)

  Highlights/unhighlights the layerName toggle button

### getLayer

    public Layer getLayer()

  Returns:
    the layer represented by this LayerPane

### finalize

    public void finalize()

### updateLayerLabel

    public void updateLayerLabel()

  Tell the pane to check with the layer to get the current layer name for it's label.

### showPalette

    protected void showPalette()

### hidePalette

    protected void hidePalette()

### actionPerformed

    public void actionPerformed(java.awt.event.ActionEvent e)

  ActionListener interface.

  Specified by:
    `actionPerformed` in interface `java.awt.event.ActionListener`
  Parameters:
    `e` - ActionEvent

### componentResized

    public void componentResized(java.awt.event.ComponentEvent e)

  Invoked when component has been resized.

  Specified by:
    `componentResized` in interface `java.awt.event.ComponentListener`

### componentMoved

    public void componentMoved(java.awt.event.ComponentEvent e)

  Invoked when component has been moved.

  Specified by:
    `componentMoved` in interface `java.awt.event.ComponentListener`

### componentShown

    public void componentShown(java.awt.event.ComponentEvent e)

  Invoked when component has been shown.

  Specified by:
    `componentShown` in interface `java.awt.event.ComponentListener`

### componentHidden

    public void componentHidden(java.awt.event.ComponentEvent e)

  Invoked when component has been hidden.

  Specified by:
    `componentHidden` in interface `java.awt.event.ComponentListener`

### getBackgroundLayerSeparator

    public static LayerPane getBackgroundLayerSeparator(java.lang.String title)

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details