es.prodevelop.gvsig.mobile.gui.dialog.control
Class LayersTableItem

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byes.prodevelop.gvsig.mobile.gui.dialog.control.LayersTableItem
All Implemented Interfaces:
java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.ItemListener, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable

public class LayersTableItem
extends java.awt.Container
implements java.awt.event.ItemListener, java.awt.event.MouseListener

Represents one row in the LayersTable (TOC). Contains several icons and labels to describe the state of the layer. Components are: - Visibility checkbox - user tells whether the layer has to be drawn - Scale visibility icon - indicates scale limits status: - scale not defined in layer: no icon - current scale outside layer scale limits: gray icon - current scale within layer scale limits: color icon - Infoability checkbox - user tells whether layer must be queried by info tool - symbology icon - a sample of the layer's current symbology - layer name - editable from layer settings (one of the dialog buttons)

Author:
jldominguez
See Also:
LayersTable, FLayer, Serialized Form

Field Summary
static int INFOABLE_CHECK_WIDTH
           
static int LEFT_MARGIN
           
static int LEGEND_TYPE_LINE
           
static int LEGEND_TYPE_POINT
           
static int LEGEND_TYPE_POLYGON
           
static int LEGEND_TYPE_RASTER
           
static int LEGEND_WIDTH
           
static int RIGHT_MARGIN
           
static int ROW_STEP
          Vertical distance between the top of one row and the top of the neighbouring row.
static int SCALE_CHECK_WIDTH
           
static int VISIBLE_CHECK_WIDTH
           
 
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
LayersTableItem(FLayer lyr, int maxw, LayersTable _parent)
          Constructor.
LayersTableItem(int maxw, int i, LayersTable _parent)
          Constructor.
 
Method Summary
 java.awt.Checkbox getInfoableCheck()
          Gets the checkbox associated with the infoability of the layer.
 FLayer getLayer()
          Gets associated layer
 java.awt.Label getNameLabel()
           
 ScaleVisibilityIcon getScaleVisiLabel()
          gets the icon that represents the scale visibility.
 java.awt.Checkbox getVisibleCheck()
          Gets the chechkbox associated with the visibility of the layer.
 boolean isSelected()
          Whether this row is selected.
 void itemStateChanged(java.awt.event.ItemEvent arg0)
           
 void mouseClicked(java.awt.event.MouseEvent arg0)
           
 void mouseEntered(java.awt.event.MouseEvent arg0)
           
 void mouseExited(java.awt.event.MouseEvent arg0)
           
 void mousePressed(java.awt.event.MouseEvent arg0)
           
 void mouseReleased(java.awt.event.MouseEvent arg0)
           
 void setPosition(int i, int w)
          Updates both position and wisth of this row
 void setSelected(boolean s)
          Sets selected/unselected.
 void updateBounds(int i)
          Used to reset the position of the row to the new index.
 void updateSymbol(FSymbol sym)
          Updates the symbology sample icon to represent a new symbol.
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ROW_STEP

public static int ROW_STEP
Vertical distance between the top of one row and the top of the neighbouring row.


LEFT_MARGIN

public static int LEFT_MARGIN

RIGHT_MARGIN

public static int RIGHT_MARGIN

VISIBLE_CHECK_WIDTH

public static int VISIBLE_CHECK_WIDTH

INFOABLE_CHECK_WIDTH

public static int INFOABLE_CHECK_WIDTH

SCALE_CHECK_WIDTH

public static int SCALE_CHECK_WIDTH

LEGEND_WIDTH

public static int LEGEND_WIDTH

LEGEND_TYPE_POINT

public static int LEGEND_TYPE_POINT

LEGEND_TYPE_LINE

public static int LEGEND_TYPE_LINE

LEGEND_TYPE_POLYGON

public static int LEGEND_TYPE_POLYGON

LEGEND_TYPE_RASTER

public static int LEGEND_TYPE_RASTER
Constructor Detail

LayersTableItem

public LayersTableItem(int maxw,
                       int i,
                       LayersTable _parent)
Constructor.

Parameters:
maxw - Max width of the row in pixels
i - Index. It determines the vertical position
_parent - the TOC it is contained in

LayersTableItem

public LayersTableItem(FLayer lyr,
                       int maxw,
                       LayersTable _parent)
Constructor.

Parameters:
lyr - the layer associated with this LayersTableItem
maxw - the max width of the row (in pixels)
_parent - the layerstable that contains this row
Method Detail

updateBounds

public void updateBounds(int i)
Used to reset the position of the row to the new index.

Parameters:
i -

getLayer

public FLayer getLayer()
Gets associated layer

Returns:
the associated layer

updateSymbol

public void updateSymbol(FSymbol sym)
Updates the symbology sample icon to represent a new symbol.

Parameters:
sym - the new symbol to be described by the symbology icon

setPosition

public void setPosition(int i,
                        int w)
Updates both position and wisth of this row

Parameters:
i - new index. Determines vertical position
w - width in pixels

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent arg0)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

getInfoableCheck

public java.awt.Checkbox getInfoableCheck()
Gets the checkbox associated with the infoability of the layer. If active, the layer will be queried when the info tool is used.

Returns:
the checkbox associated with the infoability

getNameLabel

public java.awt.Label getNameLabel()
Returns:
the label that keeps the name of the layer.

getScaleVisiLabel

public ScaleVisibilityIcon getScaleVisiLabel()
gets the icon that represents the scale visibility.

Returns:
the icon that represents the scale visibility

getVisibleCheck

public java.awt.Checkbox getVisibleCheck()
Gets the chechkbox associated with the visibility of the layer.


isSelected

public boolean isSelected()
Whether this row is selected.

Returns:
Whether this row is selected

setSelected

public void setSelected(boolean s)
Sets selected/unselected.

Parameters:
s - whether it has to be selected or not.

mousePressed

public void mousePressed(java.awt.event.MouseEvent arg0)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent arg0)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent arg0)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent arg0)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent arg0)
Specified by:
mouseExited in interface java.awt.event.MouseListener