| 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.CurveEditCanvas
This class is used by Horizon to edit one color component of an EditableColorModel; however, its design and implementation is fairly general and can be used to edit any array of integers. To edit the array, the class must be provided with an CurveEditMode object which controls how the data is edited.
The canvas plots the current values of the array as a graph. Additional graphics used to edit the curve may be added by the CurveEditMode in use. The CurveEditMode also handles all the mouse events to update the values in the array.
| Field Summary | |
| int[] | curve
|
| CurveEditMode | mode
|
| Fields inherited from class java.awt.Component | |
| BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT | |
| Constructor Summary | |
| CurveEditCanvas()
create an edit canvas with an initial uneditable state |
|
| CurveEditCanvas(int width,
int height)
create an edit canvas with an initial uneditable state |
|
| CurveEditCanvas(int[] data,
CurveEditMode cem,
int width,
int height)
create an edit canvas with a given array of data and a mode for editing it. |
|
| Method Summary | |
| void | actionPerformed(java.awt.event.ActionEvent ev)
|
| void | addActionListener(java.awt.event.ActionListener l)
|
| int[] | getCurve()
return the array this canvas is displaying and editing |
| CurveEditMode | getMode()
return a reference to the current editing mode |
| java.awt.Dimension | getPreferredSize()
|
| static void | main(java.lang.String[] args)
|
| void | paint(java.awt.Graphics g)
|
| void | removeActionListener(java.awt.event.ActionListener l)
|
| void | setMode(CurveEditMode cem)
set the current mode for editing the curve |
| 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 | |
| Field Detail |
protected CurveEditMode mode
protected int[] curve
| Constructor Detail |
public CurveEditCanvas()
public CurveEditCanvas(int width,
int height)
width
- the width of the canvas. A non-positive
value means use the default.
height
- the height of the canvas. A non-positive
value means use the default.
public CurveEditCanvas(int[] data,
CurveEditMode cem,
int width,
int height)
data
- the integer array to edit
cem
- the editing mode to use
width
- the width of the canvas. A non-positive
value means use the default.
height
- the height of the canvas. A non-positive
value means use the default.| Method Detail |
public java.awt.Dimension getPreferredSize()
public void paint(java.awt.Graphics g)
public int[] getCurve()
public void setMode(CurveEditMode cem)
public CurveEditMode getMode()
public void addActionListener(java.awt.event.ActionListener l)
public void removeActionListener(java.awt.event.ActionListener l)
public void actionPerformed(java.awt.event.ActionEvent ev)
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 | ||