visad.util
Class ColorMap
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- visad.util.ColorMap
-
- All Implemented Interfaces:
- java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
- Direct Known Subclasses:
- BaseRGBMap
public abstract class ColorMap extends javax.swing.JPanelThe abstract class that all color-mapping widgets must extend. This class manages all of the listener notification for the ColorMaps.- Since:
- Visad Utility Library, 0.5
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Field Summary
-
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor and Description ColorMap()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidaddColorChangeListener(ColorChangeListener c)Add a ColorChangeListener to the listeners listjava.awt.ColorgetColor(float value)Maps a floating point value (in the range 0 to 1) onto a Color, returns Color.black if the number is out of range If you're getting more than 1 or 2 colors, use getColors() instead.abstract float[][]getColorMap()Returns a copy of the ColorMapjava.awt.Color[]getColors(float start, float end, int num)Map a range of floating point values (in the range 0 to 1) onto a range of Colors.abstract intgetMapDimension()Returns the dimension of the mapabstract intgetMapResolution()Returns the current map resolutionabstract float[]getRGBTuple(float value)Maps a floating point value (in the range 0 to 1) onto an RGB triplet of floating point numbers in the range 0 to 1) If you're getting more than 1 or 2 tuples, use getRGBTuples() instead.abstract float[][]getRGBTuples(float start, float end, int count)Maps the specified floating point values (in the range 0 to 1) onto a group of RGB triplets of floating point numbers in the range 0 to 1.abstract float[]getTuple(float value)Maps a floating point value (in the range 0 to 1) into a tuple with dimension of the map If you're getting more than 1 or 2 tuples, use getTuples() instead.abstract float[][]getTuples(float start, float end, int count)Maps the specified floating point values (in the range 0 to 1) onto a group of floating point tuples with the dimension of the map.voidremoveColorChangeListener(ColorChangeListener c)Remove a ColorChangeListener from the listeners list-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, 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
-
-
-
-
Method Detail
-
getColor
public java.awt.Color getColor(float value)
Maps a floating point value (in the range 0 to 1) onto a Color, returns Color.black if the number is out of range If you're getting more than 1 or 2 colors, use getColors() instead.
-
getColors
public java.awt.Color[] getColors(float start, float end, int num)Map a range of floating point values (in the range 0 to 1) onto a range of Colors.
-
getRGBTuple
public abstract float[] getRGBTuple(float value)
Maps a floating point value (in the range 0 to 1) onto an RGB triplet of floating point numbers in the range 0 to 1) If you're getting more than 1 or 2 tuples, use getRGBTuples() instead.
-
getRGBTuples
public abstract float[][] getRGBTuples(float start, float end, int count)Maps the specified floating point values (in the range 0 to 1) onto a group of RGB triplets of floating point numbers in the range 0 to 1. The endpoints are included in count so if count=1, only the RGBTuple for start is returned; if count=3, then RGBTuples are returned for start, the midpoint between start and end, and for end.- Parameters:
start- the first value to translateend- the last value to translatecount- the number of values (including the two endpoints) to be returned.
-
getTuple
public abstract float[] getTuple(float value)
Maps a floating point value (in the range 0 to 1) into a tuple with dimension of the map If you're getting more than 1 or 2 tuples, use getTuples() instead.
-
getTuples
public abstract float[][] getTuples(float start, float end, int count)Maps the specified floating point values (in the range 0 to 1) onto a group of floating point tuples with the dimension of the map. The endpoints are included in count so if count=1, only the tuple for start is returned; if count=3, then tuples are returned for start, the midpoint between start and end, and for end.- Parameters:
start- The first value to translateend- The last value to translatecount- The number of values (including the two endpoints) to be returned.
-
getMapResolution
public abstract int getMapResolution()
Returns the current map resolution
-
getMapDimension
public abstract int getMapDimension()
Returns the dimension of the map
-
getColorMap
public abstract float[][] getColorMap()
Returns a copy of the ColorMap
-
addColorChangeListener
public void addColorChangeListener(ColorChangeListener c)
Add a ColorChangeListener to the listeners list
-
removeColorChangeListener
public void removeColorChangeListener(ColorChangeListener c)
Remove a ColorChangeListener from the listeners list
-
-
DMelt 3.0 © DataMelt by jWork.ORG