Class LegendObj

java.lang.Object
  |
  +--java.awt.Component
        |
        +--DrawObj
              |
              +--PointObj
                    |
                    +--LegendObj

public class LegendObj
extends PointObj
implements java.awt.event.KeyListener

This class is used to associated a pixel color and a string. When the user click in the map, it will take the pixel color and prompt the associated string. this object doesn't send any submit. It's inherit form PointObj.

Author:
Guy Parent
See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
private  java.lang.String kstrLegendParam
          String parameter used to get the correlation table
protected  int m_alpha
          Use to separate the RGB value
protected  java.util.Vector m_anColor
           
protected  Rosa2000 m_applet
           
protected  java.util.Vector m_astrDesc
           
protected  int m_blue
           
protected  int m_green
           
protected  int m_red
           
 
Fields inherited from class PointObj
m_map, x, y
 
Fields inherited from class DrawObj
color, g
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
LegendObj(Map parent, Rosa2000 applet)
           
 
Method Summary
protected  void addItemInLookup(java.lang.String strItem)
          Extract the pixel color value and the associated string and add them in the lookup table.
 void destroyEvent()
          Remove the mouse listener and the key listener.
protected  java.lang.String getLookupString(java.lang.Integer color)
          Get the description associated to the color passed in parameter.
 int getPixels(java.awt.Image img, int x, int y, int w, int h)
          Return the color take in the image passed in parameter a the XY location.
 java.lang.String getSubmitValue()
          Do nothing
private  void handleSinglePixel(int pixel)
           
protected  void initLookupTable(Rosa2000 applet)
          Get the lookup table from the parameters applet.
 void keyPressed(java.awt.event.KeyEvent e)
          Use to stop the processing, If the user press on escape key, the current command will stop.
 void keyReleased(java.awt.event.KeyEvent e)
          do nothing
 void keyTyped(java.awt.event.KeyEvent e)
          do nothing
 void mouseReleased(java.awt.event.MouseEvent evt)
          Get the pixel color at the location from the mouse event and prompt the associated description.
 
Methods inherited from class PointObj
draw, drawPoint, mouseClicked, mouseEntered, mouseExited, mousePressed, resize
 
Methods inherited from class DrawObj
getColor, paint, setColor
 
Methods inherited from class java.awt.Component
, action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, constructComponentName, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventEnabled, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getIntrinsicCursor, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, initIDs, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, lightweightPrint, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, postsOldMouseEvents, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, readObject, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

kstrLegendParam

private final java.lang.String kstrLegendParam
String parameter used to get the correlation table

m_alpha

protected int m_alpha
Use to separate the RGB value

m_red

protected int m_red

m_green

protected int m_green

m_blue

protected int m_blue

m_astrDesc

protected java.util.Vector m_astrDesc

m_anColor

protected java.util.Vector m_anColor

m_applet

protected Rosa2000 m_applet
Constructor Detail

LegendObj

public LegendObj(Map parent,
                 Rosa2000 applet)
Method Detail

initLookupTable

protected void initLookupTable(Rosa2000 applet)
Get the lookup table from the parameters applet. All item should be separate by "|" token.

addItemInLookup

protected void addItemInLookup(java.lang.String strItem)
Extract the pixel color value and the associated string and add them in the lookup table.
Parameters:
strItem - Item string. It would define a color and an associated string like FF0000=Lake And river

getSubmitValue

public java.lang.String getSubmitValue()
Do nothing
Overrides:
getSubmitValue in class PointObj
Tags copied from class: DrawObj
Returns:
String containing the submit value.
See Also:
Rosa applet parameters

handleSinglePixel

private void handleSinglePixel(int pixel)

getPixels

public int getPixels(java.awt.Image img,
                     int x,
                     int y,
                     int w,
                     int h)
Return the color take in the image passed in parameter a the XY location.

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent evt)
Get the pixel color at the location from the mouse event and prompt the associated description.
Overrides:
mouseReleased in class PointObj

getLookupString

protected java.lang.String getLookupString(java.lang.Integer color)
Get the description associated to the color passed in parameter.
Parameters:
color - Color to search for.
Returns:
Description associated to the color passed in parameter.

destroyEvent

public void destroyEvent()
Remove the mouse listener and the key listener.
Overrides:
destroyEvent in class PointObj

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Use to stop the processing, If the user press on escape key, the current command will stop.
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
do nothing
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
do nothing
Specified by:
keyTyped in interface java.awt.event.KeyListener