| 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.Container
|
+--java.awt.Panel
|
+--ncsa.horizon.awt.color.HorizonColorModelEditor
This panel supports two modes of graphically tweaking a HorizonColorModel. First is through the color bar display at the top of the panel. Clicking and dragging the mouse on the bar will transform the color table: dragging left and right shifts the colors up and down, while dragging up and down stretches and compresses the colors. (One can also change the special colors--undefined, underflow, and overflow--see the HorizonColorModelDisplay for details.)
The second mode is by manipulating the color components seperately. In general, one can edit all four components--red, green, blue, and alpha--independently; however, if isAlphaVisible() returns false, only the RGB components are shown. For each component, a graph of the component values is shown along with tool buttons for maniputating them. The "Reset" button will restore the color model's original values for that component.
| Field Summary | |
| CurveEditPanel | alpha_CMP
|
| CurveEditPanel | blue_CMP
|
| static java.lang.String[] | defaultModeNames
the names of the default editing modes. |
| EditableColorModel | ecm
|
| CurveEditPanel | green_CMP
|
| HorizonColorModelDisplay | HCMD
|
| CurveEditPanel | red_CMP
|
| Fields inherited from class java.awt.Component | |
| BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT | |
| Constructor Summary | |
| HorizonColorModelEditor(EditableColorModel ecm)
create an editor that operates on the given EditableColorModel |
|
| HorizonColorModelEditor(EditableColorModel ecm,
boolean showAlpha)
create an editor that operates on the given EditableColorModel |
|
| Method Summary | |
| void | actionPerformed(java.awt.event.ActionEvent e)
|
| void | addHorizonColorModelListener(HorizonColorModelListener l)
add a listener of this editor. |
| void | addMenusToFrame(java.awt.Frame f)
add menu controls to the menu bar of a given frame. |
| void | colorModelUpdate(ColorModelUpdateEvent e)
forward ColorModelUpdateEvents from the current active color model to listeners of this editor. |
| StretchableColorModel | getActiveColorModel()
return the color model currently being edited. |
| static CurveEditMode[] | getDefaultModes()
create and return instances of the default editing modes used by this panel. |
| void | invertColors()
reverse the colors in the color table |
| boolean | isAlphaVisible()
return true if the subpanel used to edit the alpha component of the color model is visible. |
| void | loadIntoActiveColorModel(HorizonColorModel cm)
load the colors from a given HorizonColorModel into the current model being edited. |
| void | loadIntoActiveColorModel(java.awt.image.IndexColorModel cm)
load the colors from a given IndexColorModel into the current model being edited. |
| void | loadIntoActiveColorModel(java.io.File file)
load the colors from a file into the current model being edited. |
| static void | main(java.lang.String[] args)
|
| void | removeAllListeners()
remove all listeners |
| void | removeHorizonColorModelListener(HorizonColorModelListener l)
remove a listener |
| void | setActiveColorModel(java.awt.image.IndexColorModel cm)
replace the current color model being displayed. |
| void | setActiveColorModel(HorizonColorModel cm)
replace the current color model being displayed. |
| void | setAlphaVisible(boolean b)
show or hide the subpanel used to edit the alpha component of the color model. |
| Methods inherited from class java.awt.Panel | |
| addNotify | |
| Methods inherited from class java.awt.Container | |
| add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paint, paramString, preferredSize, printComponents, print, processContainerEvent, processEvent, removeAll, remove, remove, removeContainerListener, removeNotify, setLayout, update, validate, validateTree | |
| 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 CurveEditPanel red_CMP
protected CurveEditPanel green_CMP
protected CurveEditPanel blue_CMP
protected CurveEditPanel alpha_CMP
protected HorizonColorModelDisplay HCMD
protected EditableColorModel ecm
protected static java.lang.String[] defaultModeNames
modename.gif. This
image will appear on the button that engages the editing mode. If
such an image is not found, the string will be used as a simple label
on the button.| Constructor Detail |
public HorizonColorModelEditor(EditableColorModel ecm)
public HorizonColorModelEditor(EditableColorModel ecm,
boolean showAlpha)
ecm
- the color model to edit
showAlpha
- if false, do not show the canvas for editing
alpha component of the color model| Method Detail |
protected static CurveEditMode[] getDefaultModes()
public void setAlphaVisible(boolean b)
public boolean isAlphaVisible()
public void actionPerformed(java.awt.event.ActionEvent e)
public void setActiveColorModel(java.awt.image.IndexColorModel cm)
cm
- a IndexColorModelpublic void setActiveColorModel(HorizonColorModel cm)
cm
- a HorizonColorModelpublic StretchableColorModel getActiveColorModel()
public void loadIntoActiveColorModel(HorizonColorModel cm)
public void loadIntoActiveColorModel(java.awt.image.IndexColorModel cm)
public void loadIntoActiveColorModel(java.io.File file)
throws java.io.IOException
public void invertColors()
public void addHorizonColorModelListener(HorizonColorModelListener l)
public void removeHorizonColorModelListener(HorizonColorModelListener l)
public void removeAllListeners()
public void colorModelUpdate(ColorModelUpdateEvent e)
public void addMenusToFrame(java.awt.Frame f)
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 | ||