visad.util
Class ColorWidget
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Panel
-
- java.applet.Applet
-
- visad.util.ColorWidget
-
- All Implemented Interfaces:
- java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, ColorChangeListener
public class ColorWidget extends java.applet.Applet implements ColorChangeListener
A color widget that allows users to interactively map numeric data to RGBA tuples based on the Vis5D color widget- Since:
- Visad Utility Library, 0.5
- See Also:
- Serialized Form
-
-
Field Summary
-
Constructor Summary
Constructors Constructor and Description ColorWidget()Construct a color widget with a ColorPreview and the default ColorMapColorWidget(boolean preview)Construct a color widget with the default ColorMapColorWidget(ColorMap map)Construct a color widget with a ColorPreview and the specified ColorMapColorWidget(ColorMap map, boolean preview)Construct a color widget with the desired ColorMap and ColorPreview visibility
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddColorChangeListener(ColorChangeListener c)Add a ColorChangeListener to the listeners listvoidcolorChanged(ColorChangeEvent e)Listen to the ColorMap and re-dispatch the ColorChangeEvents to the ColorChangeListeners listening to the widgetColorMapgetColorMap()Returns the ColorMap that the color wdget is curently pointing tojava.awt.DimensiongetPreferredSize()Analyses the visible components and determines the preferred sizevoidhidePreview()Hide the preview bar at the bottom of the widgetstatic voidmain(java.lang.String[] argv)main method for standalone testingvoidremoveColorChangeListener(ColorChangeListener c)Remove a ColorChangeListener from the listeners listvoidsetColorMap(ColorMap map)Set the ColorWidget to listen to a specific ColorMapvoidshowPreview()Make the preview bar at the bottom of the widget visible-
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
ColorWidget
public ColorWidget() throws java.rmi.RemoteException, VisADExceptionConstruct a color widget with a ColorPreview and the default ColorMap- Throws:
java.rmi.RemoteExceptionVisADException
-
ColorWidget
public ColorWidget(boolean preview) throws java.rmi.RemoteException, VisADExceptionConstruct a color widget with the default ColorMap- Parameters:
preview- indicates wether or not the preview bar at the bottom of the widget should be present- Throws:
java.rmi.RemoteExceptionVisADException
-
ColorWidget
public ColorWidget(ColorMap map)
Construct a color widget with a ColorPreview and the specified ColorMap- Parameters:
map- the ColorMap for the widget to use
-
ColorWidget
public ColorWidget(ColorMap map, boolean preview)
Construct a color widget with the desired ColorMap and ColorPreview visibility- Parameters:
map- the ColorMap for the widget to usepreview- indicates wether or not the preview bar at the bottom of the widget should be present
-
-
Method Detail
-
main
public static void main(java.lang.String[] argv) throws java.rmi.RemoteException, VisADExceptionmain method for standalone testing- Throws:
java.rmi.RemoteExceptionVisADException
-
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
-
colorChanged
public void colorChanged(ColorChangeEvent e)
Listen to the ColorMap and re-dispatch the ColorChangeEvents to the ColorChangeListeners listening to the widget- Specified by:
colorChangedin interfaceColorChangeListener
-
setColorMap
public void setColorMap(ColorMap map)
Set the ColorWidget to listen to a specific ColorMap
-
showPreview
public void showPreview()
Make the preview bar at the bottom of the widget visible
-
hidePreview
public void hidePreview()
Hide the preview bar at the bottom of the widget
-
getColorMap
public ColorMap getColorMap()
Returns the ColorMap that the color wdget is curently pointing to
-
getPreferredSize
public java.awt.Dimension getPreferredSize()
Analyses the visible components and determines the preferred size- Overrides:
getPreferredSizein classjava.awt.Container
-
-
DMelt 3.0 © DataMelt by jWork.ORG