Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.modama.gui.viewer
Class LookupTableViewer  view LookupTableViewer download LookupTableViewer.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byorg.modama.gui.viewer.LookupTableViewer
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class LookupTableViewer
extends javax.swing.JComponent

a panel that shows a lookuptable (either a LooktuTableJAI, or a LUTProperties) and a scale
this is written for 3 band luts with a size ox 0x10000 and a zero offset (byte[3][0x10000])


Nested Class Summary
 
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  boolean enabledscale
          if false, no scale is drawn
protected  LookupTableJAI lut
          the lookuptable, only one should be not null
protected  double lutmax
          max value for the lut (also the maxvalue for the scale)
protected  double lutmin
          min value for the lut (also the minvalue for the scale)
protected  org.modama.gui.viewer.lookuptable.LUTProperties lutprop
           
protected static int PREFERREDCOLORBARHEIGHT
          preferred colorbarheight
protected  org.modama.gui.viewer.rule.RulePropertys propertys
          propertys for the rule
protected  org.modama.gui.viewer.rule.RuleFactory rulefactory
          for creating the scale
protected  java.awt.image.BufferedImage scale
          the scaling axe of the lut
protected  boolean updatescale
          if the lutmin or lutmax values change, this is set to true, so we know we have to recreate the scale when drawing
 
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.Container
 
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
LookupTableViewer()
           
 
Method Summary
protected  void createNewScale(int width)
          creates the image for the scale
protected  java.awt.Color getColor(int index, int width)
          get the color for the index of the lut
 double getLUTMax()
           
 double getLUTMin()
           
 java.awt.Dimension getPreferredSize()
          Get the component's preferred size.
 org.modama.gui.viewer.rule.RulePropertys getRulePropertys()
           
 boolean isEnabledscale()
           
static void main(java.lang.String[] args)
           
protected  void paintComponent(java.awt.Graphics g)
          paint the colorbar and the scale, checks also if the size has changed, and if so an new scale image is produced
 void setEnabledscale(boolean enabledscale)
           
 void setLookupTable(LookupTableJAI lut)
           
 void setLUTMax(double lutmax)
           
 void setLUTMin(double lutmin)
           
 void setRulePropertys(org.modama.gui.viewer.rule.RulePropertys propertys)
           
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, 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, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PREFERREDCOLORBARHEIGHT

protected static final int PREFERREDCOLORBARHEIGHT
preferred colorbarheight

See Also:
Constant Field Values

lut

protected LookupTableJAI lut
the lookuptable, only one should be not null


lutprop

protected org.modama.gui.viewer.lookuptable.LUTProperties lutprop

scale

protected java.awt.image.BufferedImage scale
the scaling axe of the lut


lutmin

protected double lutmin
min value for the lut (also the minvalue for the scale)


lutmax

protected double lutmax
max value for the lut (also the maxvalue for the scale)


rulefactory

protected org.modama.gui.viewer.rule.RuleFactory rulefactory
for creating the scale


propertys

protected org.modama.gui.viewer.rule.RulePropertys propertys
propertys for the rule


enabledscale

protected boolean enabledscale
if false, no scale is drawn


updatescale

protected boolean updatescale
if the lutmin or lutmax values change, this is set to true, so we know we have to recreate the scale when drawing

Constructor Detail

LookupTableViewer

public LookupTableViewer()
Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize()
Description copied from class: javax.swing.JComponent
Get the component's preferred size. If the JComponent.preferredSize>JComponent.preferredSize 55 property has been explicitly set, it is returned. If the JComponent.preferredSize>JComponent.preferredSize 55 property has not been set but the JComponent.ui>JComponent.ui 55 property has been, the result of ComponentUI.getPreferredSize(javax.swing.JComponent)>ComponentUI.getPreferredSize(javax.swing.JComponent) 55 is returned. If neither property has been set, the result of Container.getPreferredSize()>Container.getPreferredSize() 55 is returned.


paintComponent

protected void paintComponent(java.awt.Graphics g)
paint the colorbar and the scale, checks also if the size has changed, and if so an new scale image is produced


getColor

protected java.awt.Color getColor(int index,
                                  int width)
get the color for the index of the lut


createNewScale

protected void createNewScale(int width)
creates the image for the scale


setLookupTable

public void setLookupTable(LookupTableJAI lut)

getLUTMin

public double getLUTMin()

setLUTMin

public void setLUTMin(double lutmin)

getLUTMax

public double getLUTMax()

setLUTMax

public void setLUTMax(double lutmax)

getRulePropertys

public org.modama.gui.viewer.rule.RulePropertys getRulePropertys()

setRulePropertys

public void setRulePropertys(org.modama.gui.viewer.rule.RulePropertys propertys)

isEnabledscale

public boolean isEnabledscale()

setEnabledscale

public void setEnabledscale(boolean enabledscale)

main

public static void main(java.lang.String[] args)