public class BaseRGBMap extends ColorMap implements ControlListener, MouseListener, MouseMotionListener
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.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_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, 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, removeColorChangeListener
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, 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, unregisterKeyboardAction
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusUpCycle
public 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 componentRemoteException
VisADException
public BaseRGBMap(int resolution, boolean hasAlpha) throws RemoteException, VisADException
resolution
- the length of the arrayhasAlpha
- set to true is this map has
an alpha componentRemoteException
VisADException
public 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.RemoteException
VisADException
public BaseRGBMap(float[][] vals) throws RemoteException, VisADException
vals
- the tuples used to initialize the colormap
See setValues() for constraints on the vals array.RemoteException
VisADException
public 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.RemoteException
VisADException
public int getMapResolution()
getMapResolution
in class ColorMap
public int getMapDimension()
getMapDimension
in class ColorMap
public float[][] getColorMap()
getColorMap
in class ColorMap
public 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 ColorMap
startVal
- 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 ColorMap
value
- 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 MouseListener
evt
- ignoredpublic void mouseEntered(MouseEvent evt)
mouseEntered
in interface MouseListener
evt
- ignoredpublic void mouseExited(MouseEvent evt)
mouseExited
in interface MouseListener
evt
- ignoredpublic void mousePressed(MouseEvent evt)
mousePressed
in interface MouseListener
evt
- the mouse press eventpublic void mouseReleased(MouseEvent evt)
mouseReleased
in interface MouseListener
evt
- the release eventpublic void mouseDragged(MouseEvent evt)
mouseDragged
in interface MouseMotionListener
evt
- the drag eventpublic void mouseMoved(MouseEvent evt)
mouseMoved
in interface MouseMotionListener
evt
- ignoredpublic void paint(Graphics g)
paint
in class JComponent
g
- The Graphics to update.public void update(Graphics g)
update
in class JComponent
g
- The Graphics to update.public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public void setPreferredSize(Dimension pref)
setPreferredSize
in class JComponent
pref
- 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 ControlListener
evt
- Data from the changed Control
.RemoteException
VisADException
Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.