| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Canvas
|
+--ncsa.horizon.awt.color.HorizonColorBar
Indexed ColorModels can be passed to this class (via the constructor or the setActiveColorModel() method) in the form of an IndexColorModel, a HorizonColorModel, or a StretchableColorModel. If the color model reference is of the last kind, the bar will allow the user to mutate the model via mouse drags on the canvas (see below).
The width of the bar by default is the size of the color table, and the height is 32 pixels; however, it can be resized as necessary.
The color model can be fiddled if it has been passed in the form of a StretchableColorModel. This fiddling comes in two modes: shifting and stretching. Shifting is done by dragging the mouse left or right; this causes the values in the color table to be shifted. By dragging the mouse up or down, one can compress or stretch the array of colors in the color table.
| Fields inherited from class java.awt.Component | |
| BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT | |
| Constructor Summary | |
| HorizonColorBar(HorizonColorModel horizoncolormodel)
Given a HorizonColorModel, instantiates a default sized HorizonColorBar. |
|
| HorizonColorBar(java.awt.image.IndexColorModel indexcolormodel)
Given an IndexColorModel, instantiates a default sized HorizonColorBar. |
|
| HorizonColorBar(java.awt.image.IndexColorModel indexcolormodel,
int canvas_width,
int canvas_height)
Given an IndexColorModel, instantiates a HorizonColorBar with a given width and height. |
|
| HorizonColorBar(HorizonColorModel horizoncolormodel,
int canvas_width,
int canvas_height)
Given a HorizonColorModel, instantiate a HorizonColorBar with a given width and height. |
|
| HorizonColorBar(StretchableColorModel stretchablecm,
boolean allowFiddling,
int canvas_width,
int canvas_height)
display a StretchableColorModel |
|
| HorizonColorBar(StretchableColorModel stretchablecm,
boolean allowFiddling)
display a StretchableColorModel |
|
| Method Summary | |
| StretchableColorModel | getActiveColorModel()
Returns the current colormodel used by HorizonColorBar. |
| java.awt.Dimension | getPreferredSize()
|
| boolean | isModelMutable()
return true if the user can mutate the color model graphically. |
| static void | main(java.lang.String[] args)
|
| void | paint(java.awt.Graphics g)
|
| void | setActiveColorModel(java.awt.image.IndexColorModel cm)
set the bar to display a new IndexColorModel. |
| void | setActiveColorModel(HorizonColorModel cm)
set the bar to display a new HorizonColorModel. |
| void | setActiveColorModel(StretchableColorModel cm,
boolean allowFiddling)
set the bar to display a new StretchableColorModel. |
| void | setBounds(int x,
int y,
int width,
int height)
|
| void | setMouseLock(boolean setXmouselock,
boolean setYmouselock)
Allows one to lock out mouse movement in the X or Y direction. |
| void | wakeupColorBar()
|
| void | xShift(int deltaX)
Shifts the HorizonColorBar by a distance of deltaX. |
| void | yShift(double deltaY)
Stretches/Narrows the HorizonColorBar by a distance of deltaY. |
| Methods inherited from class java.awt.Canvas | |
| addNotify, paint | |
| Methods inherited from class java.awt.Component | |
| action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate | |
| Methods inherited from class java.lang.Object | |
| clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait | |
| Constructor Detail |
public HorizonColorBar(HorizonColorModel horizoncolormodel)
horizoncolormodel
- a HorizonColorModelpublic HorizonColorBar(java.awt.image.IndexColorModel indexcolormodel)
indexcolormodel
- an IndexColorModel
public HorizonColorBar(java.awt.image.IndexColorModel indexcolormodel,
int canvas_width,
int canvas_height)
indexcolormodel
- an IndexColorModel
canvas_width
- an int for the desired Display width.
canvas_height
- an int for the desired Display height.
public HorizonColorBar(HorizonColorModel horizoncolormodel,
int canvas_width,
int canvas_height)
Horizoncolormodel
- a HorizonColorModel
canvas_width
- an int for the desired Display width.
canvas_height
- an int for the desired Display height.
public HorizonColorBar(StretchableColorModel stretchablecm,
boolean allowFiddling,
int canvas_width,
int canvas_height)
model
- a StretchableColorModel
allowFiddling
- if true, this class will allow the color model
to be fiddled with.
canvas_width
- the width of the canvas
canvas_height
- the height of the canvas
public HorizonColorBar(StretchableColorModel stretchablecm,
boolean allowFiddling)
model
- a StretchableColorModel
allowFiddling
- if true, this class will allow the color model
to be fiddled with.| Method Detail |
public boolean isModelMutable()
public void setActiveColorModel(java.awt.image.IndexColorModel cm)
public void setActiveColorModel(HorizonColorModel cm)
public void setActiveColorModel(StretchableColorModel cm,
boolean allowFiddling)
cm
- the colormodel
allowFiddling
- if true, allow the user to fiddle the
color model.
public void setMouseLock(boolean setXmouselock,
boolean setYmouselock)
setXmouselock
- A boolean that will lock out shifting
in the X direction.
setYmouselock
- A boolean that will lock out shifting
in the Y direction.public void xShift(int deltaX)
deltaX
- An int which will adjust the HorizonColorBar.public void yShift(double deltaY)
deltaY
- An int which will adjust the HorizonColorBar.public java.awt.Dimension getPreferredSize()
public StretchableColorModel getActiveColorModel()
public void setBounds(int x,
int y,
int width,
int height)
public void paint(java.awt.Graphics g)
public void wakeupColorBar()
public static void main(java.lang.String[] args)
| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||