harmonic.mz.entries
Class ColorEntry

java.lang.Object
  |
  +--HWPanel
        |
        +--harmonic.mz.gui.ValueEntry
              |
              +--harmonic.mz.entries.ColorEntry
All Implemented Interfaces:
java.awt.event.ComponentListener, Documentable, java.util.EventListener, NodeListener, harmonic.viewer3D.Task

public class ColorEntry
extends ValueEntry
implements NodeListener

GUI widget for setting a color value. Has six scroll bars corisponding to r g b, and h s v. r g b may be changed indepently, but doing so effects h s v. h s v may also be changed indpendantly, which effects r g b. r g b always have a gradient from back to fully colored. h is ranges across all hues, but the bar is be rendered to corispond to the saturation and value. Note that s and v dont effect the thumb position of h, only the bar rendering. s ranges from unsaturated to fully satruated, for the color corisponding to h, value corisplonding to v. And v ranges form dark to bright, for color corisponding to h, and to s.

See Also:
Serialized Form

Constructor Summary
ColorEntry(java.lang.String _label, harmonic.meshGeom.math.Clr3f _color)
          Constructs a ColorEntry
ColorEntry(java.lang.String _label, java.lang.Object listener, java.lang.String callback, harmonic.meshGeom.math.Clr3f _color)
          Constructs a ColorEntry
 
Method Summary
 void blueChanged(HWScrollEvent e)
           
 void cleanTask()
           
 void contract()
          Shrink to small size.
 void expand()
          Expand to full size.
 void finishEntry()
          Called when entry is properly finished.
 void format(int w, int h)
           
 harmonic.meshGeom.math.Clr3f getColor()
          Returns color value.
 java.awt.Dimension getEntrySize()
          Override to return the size of the specialized value entry controls.
 void greenChanged(HWScrollEvent e)
           
 void hueChanged(HWScrollEvent e)
           
 void makeSettingsUI()
           
 void makeValueUI()
           
 void nodeChanged(NodeEvent field)
          Node has changed
 void onAddPreset()
           
 void onGetPreset()
           
 void onPreset(EntryEvent e)
           
 void redChanged(HWScrollEvent e)
           
 void satChanged(HWScrollEvent e)
           
 void setColor(harmonic.meshGeom.math.Clr3f c)
          Sets color value.
 void setField(ModelNode f)
          Sets field to effect.
 void setValue(ModelNode linkTo)
          Override to set value of corisponding data node.
 void updateField()
          This is called by notifyListeners we have a EntryEvent.VALUE_CHANGED.
 void valChanged(HWScrollEvent e)
           
 
Methods inherited from class harmonic.mz.gui.ValueEntry
_notifyListeners_, add, addEntryListener, aquireInput, assignFromReadout, beginEntry, beginTask, cancelEntry, cancelTask, componentHidden, componentMoved, componentResized, componentShown, contractIcon, echoFieldChange, expandCheck, expandIcon, finishTask, getField, getInstanceURL, getPreferredSize, getTaskName, getTypeURL, highlight, init, initReadout, innerChange, isActive, isDoingTask, isExpanded, monologFinished, mousePressed, notifyListeners_ValueChanged, notifyListeners, onSettingsButton, removeEntryListener, savePrev, setDocURL, setInnerChange, transferListener, unlinkField, validateUISettings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorEntry

public ColorEntry(java.lang.String _label,
                  harmonic.meshGeom.math.Clr3f _color)
Constructs a ColorEntry

Parameters:
_color - Initial color value

ColorEntry

public ColorEntry(java.lang.String _label,
                  java.lang.Object listener,
                  java.lang.String callback,
                  harmonic.meshGeom.math.Clr3f _color)
Constructs a ColorEntry

Parameters:
listener - Listener to send ColorEvents to
callback - Listeners callback, declared as fnname(EntryEvent)
_color - Initial color value
Method Detail

setField

public void setField(ModelNode f)
Sets field to effect.

Overrides:
setField in class ValueEntry

setColor

public void setColor(harmonic.meshGeom.math.Clr3f c)
Sets color value.


getColor

public harmonic.meshGeom.math.Clr3f getColor()
Returns color value.


nodeChanged

public void nodeChanged(NodeEvent field)
Description copied from interface: NodeListener
Node has changed

Specified by:
nodeChanged in interface NodeListener
Overrides:
nodeChanged in class ValueEntry

setValue

public void setValue(ModelNode linkTo)
Description copied from class: ValueEntry
Override to set value of corisponding data node. This version uses getField().

Overrides:
setValue in class ValueEntry
Parameters:
linkTo - to set to

makeValueUI

public void makeValueUI()

format

public void format(int w,
                   int h)

getEntrySize

public java.awt.Dimension getEntrySize()
Description copied from class: ValueEntry
Override to return the size of the specialized value entry controls.

Overrides:
getEntrySize in class ValueEntry

makeSettingsUI

public void makeSettingsUI()

expand

public void expand()
Description copied from class: ValueEntry
Expand to full size. Default does nothing. There are no assumptions built into how the expand is accomplished, but a general pattern would be to add child components, calling reformat() when finished. These functions (expand() and contract()) provide users of ValueEntries to handle these ideas generally.

Overrides:
expand in class ValueEntry

contract

public void contract()
Description copied from class: ValueEntry
Shrink to small size.

Overrides:
contract in class ValueEntry

redChanged

public void redChanged(HWScrollEvent e)

greenChanged

public void greenChanged(HWScrollEvent e)

blueChanged

public void blueChanged(HWScrollEvent e)

hueChanged

public void hueChanged(HWScrollEvent e)

satChanged

public void satChanged(HWScrollEvent e)

valChanged

public void valChanged(HWScrollEvent e)

updateField

public void updateField()
Description copied from class: ValueEntry
This is called by notifyListeners we have a EntryEvent.VALUE_CHANGED. It is a good place to insert code that updates a data nodes value from this. The policy is to update the field if it is known, rather than expecting a field to update it self by adding itself as a EntryListener. The caller of this changes the transientness of the field to match the EntryEvent.FINAL/INCREMENTAL flag.

Overrides:
updateField in class ValueEntry

onGetPreset

public void onGetPreset()

onAddPreset

public void onAddPreset()

onPreset

public void onPreset(EntryEvent e)

finishEntry

public void finishEntry()
Description copied from class: ValueEntry
Called when entry is properly finished. Do listener deregistration and remove any objects from viewport.

Overrides:
finishEntry in class ValueEntry

cleanTask

public void cleanTask()
Specified by:
cleanTask in interface harmonic.viewer3D.Task