insensa.view.image.map
Class RectColorLegent

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by insensa.view.image.map.RectColorLegent
All Implemented Interfaces:
ImageComponent, ILegendComponent, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class RectColorLegent
extends javax.swing.JComponent
implements ILegendComponent

See Also:
Serialized Form

Nested Class Summary
 class RectColorLegent.legendMotionListener
           
 class RectColorLegent.legendMouseAdapter
           
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  java.awt.Color backgroundColor
           
private  int borderSize
           
private  java.util.List<java.awt.Color> colorList
           
private  boolean enableRangeLabel
           
private  java.awt.Font font
           
private  int fontSize
           
private  int hGap
           
private  java.awt.image.BufferedImage image
           
private  java.awt.Dimension legendSize
           
private  java.awt.Point offset
           
private  java.awt.Point position
           
private  int precision
           
private  java.text.DecimalFormat precisionFormat
           
(package private)  java.util.List<ClassificationRange> rangeList
           
private  java.awt.Dimension rectColorSize
           
private static long serialVersionUID
           
private  java.awt.Dimension size
           
private  int textWidth
           
private  java.lang.String title
           
private  int vGap
           
 
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
RectColorLegent()
           
 
Method Summary
private  java.awt.image.BufferedImage addBorder(java.awt.image.BufferedImage image)
           
private  void calcSize()
           
 void createColorLegend()
           
 java.awt.image.BufferedImage createNewImage(java.awt.Dimension dim)
           
 java.awt.Color getBackgroundColor()
           
 int getBorderSize()
           
 java.util.List<java.awt.Color> getColorList()
           
 javax.swing.JComponent getComponent()
           
 java.awt.Font getFont()
           
 int getFontSize()
           
 int gethGap()
           
 java.awt.image.BufferedImage getImage()
           
 java.awt.Dimension getLegendSize()
           
 int getPrecision()
           
 java.util.List<ClassificationRange> getRangeList()
           
 java.awt.Dimension getRectColorSize()
           
 IImageMapSettings getSettingsPanel()
           
 java.awt.Dimension getSize()
           
 java.lang.String getTitle()
           
 int getvGap()
           
 boolean isEnableRangeLabel()
           
 boolean isInvert()
           
protected  void paintComponent(java.awt.Graphics g)
           
 void refresh(java.awt.Dimension dim)
           
 void refreshLegend(java.util.List<ClassificationRange> rangeList, java.util.List<java.awt.Color> colorList)
           
 void resizeImage(java.awt.Dimension dim)
           
 void setBackgroundColor(java.awt.Color backgroundColor)
           
 void setBorderSize(int borderSize)
           
 void setColorList(java.util.List<java.awt.Color> colorList)
           
 void setEnableRangeLabel(boolean enableRangeLabel)
           
 void setFont(java.awt.Font font)
           
 void setFontSize(int fontSize)
           
 void sethGap(int hGap)
           
 void setInvert(boolean invert)
           
 void setPrecision(int maxPrecision)
           
 void setRangeList(java.util.List<ClassificationRange> rangeList)
           
 void setRectColorSize(java.awt.Dimension rectColorSize)
           
 void setTitle(java.lang.String title)
           
 void setvGap(int vGap)
           
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
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, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, 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
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

image

private java.awt.image.BufferedImage image

position

private java.awt.Point position

offset

private java.awt.Point offset

legendSize

private java.awt.Dimension legendSize

size

private java.awt.Dimension size

colorList

private java.util.List<java.awt.Color> colorList

precisionFormat

private java.text.DecimalFormat precisionFormat

title

private java.lang.String title

borderSize

private int borderSize

hGap

private int hGap

vGap

private int vGap

precision

private int precision

fontSize

private int fontSize

textWidth

private int textWidth

font

private java.awt.Font font

enableRangeLabel

private boolean enableRangeLabel

rectColorSize

private java.awt.Dimension rectColorSize

backgroundColor

private java.awt.Color backgroundColor

rangeList

java.util.List<ClassificationRange> rangeList
Constructor Detail

RectColorLegent

public RectColorLegent()
Method Detail

addBorder

private java.awt.image.BufferedImage addBorder(java.awt.image.BufferedImage image)
Parameters:
image -
Returns:

calcSize

private void calcSize()

createColorLegend

public void createColorLegend()
Specified by:
createColorLegend in interface ILegendComponent
See Also:
ILegendComponent.createColorLegend()

createNewImage

public java.awt.image.BufferedImage createNewImage(java.awt.Dimension dim)
                                            throws java.io.IOException
Specified by:
createNewImage in interface ImageComponent
Returns:
Throws:
java.io.IOException
See Also:
ImageComponent.createNewImage(java.awt.Dimension)

getBackgroundColor

public java.awt.Color getBackgroundColor()
Returns:

getBorderSize

public int getBorderSize()
Specified by:
getBorderSize in interface ILegendComponent
Returns:
See Also:
ILegendComponent.getBorderSize()

getColorList

public java.util.List<java.awt.Color> getColorList()
Returns:

getComponent

public javax.swing.JComponent getComponent()
Specified by:
getComponent in interface ImageComponent
Returns:
See Also:
ImageComponent.getComponent()

getFont

public java.awt.Font getFont()
Specified by:
getFont in interface java.awt.MenuContainer
Overrides:
getFont in class java.awt.Component
See Also:
Component.getFont()

getFontSize

public int getFontSize()
Returns:

gethGap

public int gethGap()
Returns:

getImage

public java.awt.image.BufferedImage getImage()
Specified by:
getImage in interface ImageComponent
Returns:
See Also:
ImageComponent.getImage()

getLegendSize

public java.awt.Dimension getLegendSize()
Returns:

getPrecision

public int getPrecision()
Specified by:
getPrecision in interface ILegendComponent
Returns:
See Also:
ILegendComponent.getPrecision()

getRangeList

public java.util.List<ClassificationRange> getRangeList()
Returns:

getRectColorSize

public java.awt.Dimension getRectColorSize()
Returns:

getSettingsPanel

public IImageMapSettings getSettingsPanel()
Specified by:
getSettingsPanel in interface ILegendComponent
Returns:
See Also:
ILegendComponent.getSettingsPanel()

getSize

public java.awt.Dimension getSize()
Overrides:
getSize in class java.awt.Component
See Also:
Component.getSize()

getTitle

public java.lang.String getTitle()
Returns:

getvGap

public int getvGap()
Returns:

isEnableRangeLabel

public boolean isEnableRangeLabel()
Returns:

isInvert

public boolean isInvert()
Specified by:
isInvert in interface ILegendComponent
Returns:
See Also:
ILegendComponent.isInvert()

paintComponent

protected void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent
See Also:
JComponent.paintComponent(java.awt.Graphics)

refresh

public void refresh(java.awt.Dimension dim)
             throws java.io.IOException
Specified by:
refresh in interface ImageComponent
Throws:
java.io.IOException
See Also:
ImageComponent.refresh(java.awt.Dimension)

refreshLegend

public void refreshLegend(java.util.List<ClassificationRange> rangeList,
                          java.util.List<java.awt.Color> colorList)
                   throws java.io.IOException
Specified by:
refreshLegend in interface ILegendComponent
Throws:
java.io.IOException
See Also:
ILegendComponent.refreshLegend(java.util.List, java.util.List)

resizeImage

public void resizeImage(java.awt.Dimension dim)
                 throws java.io.IOException
Specified by:
resizeImage in interface ImageComponent
Throws:
java.io.IOException
See Also:
ImageComponent.resizeImage(java.awt.Dimension)

setBackgroundColor

public void setBackgroundColor(java.awt.Color backgroundColor)
Parameters:
backgroundColor -

setBorderSize

public void setBorderSize(int borderSize)
Specified by:
setBorderSize in interface ILegendComponent
See Also:
ILegendComponent.setBorderSize(int)

setColorList

public void setColorList(java.util.List<java.awt.Color> colorList)
Specified by:
setColorList in interface ILegendComponent
See Also:
ILegendComponent.setColorList(java.util.List)

setEnableRangeLabel

public void setEnableRangeLabel(boolean enableRangeLabel)
Parameters:
enableRangeLabel -

setFont

public void setFont(java.awt.Font font)
Overrides:
setFont in class javax.swing.JComponent
See Also:
JComponent.setFont(java.awt.Font)

setFontSize

public void setFontSize(int fontSize)
Parameters:
fontSize -

sethGap

public void sethGap(int hGap)
Parameters:
hGap -

setInvert

public void setInvert(boolean invert)
Specified by:
setInvert in interface ILegendComponent
See Also:
ILegendComponent.setInvert(boolean)

setPrecision

public void setPrecision(int maxPrecision)
Specified by:
setPrecision in interface ILegendComponent
See Also:
ILegendComponent.setPrecision(int)

setRangeList

public void setRangeList(java.util.List<ClassificationRange> rangeList)
Specified by:
setRangeList in interface ILegendComponent
See Also:
ILegendComponent.setRangeList(java.util.List)

setRectColorSize

public void setRectColorSize(java.awt.Dimension rectColorSize)
Parameters:
rectColorSize -

setTitle

public void setTitle(java.lang.String title)
Parameters:
title -

setvGap

public void setvGap(int vGap)
Parameters:
vGap -