public class BaseRGBMap extends ColorMap implements ControlListener, MouseListener, MouseMotionListener
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_RESOLUTION
default resolution
|
static boolean |
USE_COLOR_CURSORS
change this to true to use color cursors
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
BaseRGBMap(BaseColorControl ctl)
Construct a colormap from the specified control.
|
BaseRGBMap(boolean hasAlpha)
Construct a BaseRGBMap with the default resolution
|
BaseRGBMap(float[][] vals)
Construct a colormap initialized with the supplied tuples
|
BaseRGBMap(float[][] vals,
boolean hasAlpha)
Deprecated.
hasAlpha isn't really necessary.
|
BaseRGBMap(int resolution,
boolean hasAlpha)
Construct a colormap with the specified resolution
|
| Modifier and Type | Method and Description |
|---|---|
void |
controlChanged(ControlEvent evt)
If the color data in the
Control associated with this
widget's Control has changed, update the data in
the ColorMap. |
float[][] |
getColorMap()
Get the color map (as an array of float tuples.
|
int |
getMapDimension()
Get the dimension of the map
|
int |
getMapResolution()
Get the resolution of the map
|
Dimension |
getPreferredSize()
Return the preferred size of this map, taking into account
the resolution.
|
float[] |
getRGBTuple(float value)
Implementation of the abstract function in ColorMap
WARNING: This is a really slow way to
get a color, so don't use it inside a loop.
|
float[][] |
getRGBTuples(float startVal,
float endVal,
int num)
Implementation of the abstract function in ColorMap
WARNING: This is a really slow way to
get a color, so don't use it inside a loop.
|
float[] |
getTuple(float value)
Returns the tuple at a floating point value val
WARNING: This is a really slow way to
get a color, so don't use it inside a loop.
|
float[][] |
getTuples(float firstVal,
float lastVal,
int num)
Returns the tuple at a floating point value val
|
void |
mouseClicked(MouseEvent evt)
Present to implement MouseListener, currently ignored
|
void |
mouseDragged(MouseEvent evt)
Updates the associated Control
|
void |
mouseEntered(MouseEvent evt)
MouseListener, currently ignored
|
void |
mouseExited(MouseEvent evt)
MouseListener method, currently ignored
|
void |
mouseMoved(MouseEvent evt)
MouseMovementListener method, currently ignored
|
void |
mousePressed(MouseEvent evt)
Updates the associated Control
|
void |
mouseReleased(MouseEvent evt)
Listens for releases of the right mouse button,
and changes the active color
|
void |
paint(Graphics g)
Repaints the entire JPanel
|
protected void |
sendUpdate(int left,
int right)
Redraw the between the left and
right colors
|
void |
setPreferredSize(Dimension pref)
Override the widget's calculation for the preferred size
of this map.
|
void |
setValues(float[][] newVal)
Sets the values of the internal array after the map
has been created.
|
void |
update(Graphics g)
Repaints the modified areas of the JPanel
|
addColorChangeListener, getColor, getColors, notifyListeners, removeColorChangeListenergetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardActionadd, 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, transferFocusDownCycle, validate, validateTreeaction, 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, 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, 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, transferFocusBackward, transferFocusUpCyclepublic static boolean USE_COLOR_CURSORS
public static final int DEFAULT_RESOLUTION
public BaseRGBMap(boolean hasAlpha)
throws RemoteException,
VisADException
hasAlpha - set to true is this map has
an alpha componentRemoteExceptionVisADExceptionpublic BaseRGBMap(int resolution,
boolean hasAlpha)
throws RemoteException,
VisADException
resolution - the length of the arrayhasAlpha - set to true is this map has
an alpha componentRemoteExceptionVisADExceptionpublic BaseRGBMap(float[][] vals,
boolean hasAlpha)
throws RemoteException,
VisADException
vals - the tuples used to initialize the colormaphasAlpha - true if the colormap should
have an ALPHA component.RemoteExceptionVisADExceptionpublic BaseRGBMap(float[][] vals)
throws RemoteException,
VisADException
vals - the tuples used to initialize the colormap
See setValues() for constraints on the vals array.RemoteExceptionVisADExceptionpublic BaseRGBMap(BaseColorControl ctl)
ctl - control to use as data sourcepublic void setValues(float[][] newVal)
throws RemoteException,
VisADException
newVal - the color tuples used to initialize the map.RemoteExceptionVisADExceptionpublic int getMapResolution()
getMapResolution in class ColorMappublic int getMapDimension()
getMapDimension in class ColorMappublic float[][] getColorMap()
getColorMap in class ColorMappublic float[][] getTuples(float firstVal,
float lastVal,
int num)
public float[] getTuple(float value)
public float[][] getRGBTuples(float startVal,
float endVal,
int num)
getRGBTuples in class ColorMapstartVal - the first value to translateendVal - the last value to translatenum - the number of values (including the two endpoints)
to be returned.public float[] getRGBTuple(float value)
getRGBTuple in class ColorMapvalue - a floating point number between 0 and 1protected void sendUpdate(int left,
int right)
left - the left edge of the changed area (in the range 0.0-1.0)right - the right edge of the changed areapublic void mouseClicked(MouseEvent evt)
mouseClicked in interface MouseListenerevt - ignoredpublic void mouseEntered(MouseEvent evt)
mouseEntered in interface MouseListenerevt - ignoredpublic void mouseExited(MouseEvent evt)
mouseExited in interface MouseListenerevt - ignoredpublic void mousePressed(MouseEvent evt)
mousePressed in interface MouseListenerevt - the mouse press eventpublic void mouseReleased(MouseEvent evt)
mouseReleased in interface MouseListenerevt - the release eventpublic void mouseDragged(MouseEvent evt)
mouseDragged in interface MouseMotionListenerevt - the drag eventpublic void mouseMoved(MouseEvent evt)
mouseMoved in interface MouseMotionListenerevt - ignoredpublic void paint(Graphics g)
paint in class JComponentg - The Graphics to update.public void update(Graphics g)
update in class JComponentg - The Graphics to update.public Dimension getPreferredSize()
getPreferredSize in class JComponentpublic void setPreferredSize(Dimension pref)
setPreferredSize in class JComponentpref - preferred size.public void controlChanged(ControlEvent evt) throws RemoteException, VisADException
Control associated with this
widget's Control has changed, update the data in
the ColorMap.controlChanged in interface ControlListenerevt - Data from the changed Control.RemoteExceptionVisADExceptionCopyright © 1996–2023 The SSEC Visualization Project. All rights reserved.