harmonic.mz.entries
Class AngleEntry

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

public class AngleEntry
extends ValueEntry

GUI widget for entering angle information. Angle may be typed in a text box, or it can be drawn in the viewport.

See Also:
Serialized Form

Field Summary
 float val
           
 
Constructor Summary
AngleEntry(java.lang.String label, float val)
          Constructs an AngleEntry
AngleEntry(java.lang.String label, java.lang.Object listener, java.lang.String callback, float val)
          Constructs an AngleEntry
 
Method Summary
 void assignFromAngleText(java.lang.String angleText)
           
 void assignFromReadout()
          Override to assign value from readout.
 void beginEntry(harmonic.viewer3D.Task parentTask)
          Start input - start viewport angle device.
 void cancelEntry()
          Called when entry or thing owning entry is canceled, as the elements of the task tree are canceled.
 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)
           
 float getAngle()
          Return current angle value
 harmonic.meshGeom.math.Vec3f getAxisDirection()
          Return current axis direction in UCS
 harmonic.meshGeom.math.Pnt3f getAxisPosition()
          Return current axis position in UCS
 harmonic.meshGeom.math.Pnt3f getCenter()
           
 java.awt.Dimension getEntrySize()
          Override to return the size of the specialized value entry controls.
 harmonic.meshGeom.math.Pnt3f getLegA()
          Return a point on first leg, if angle is formed by two legs
 harmonic.meshGeom.math.Pnt3f getLegB()
          Return a point on first leg, if angle is formed by two legs
 void initReadout()
          Override to assign readout from value.
 void makeSettingsUI()
           
 void makeValueUI()
           
 void nodeChanged(NodeEvent event)
          Node has changed
 void onAngleTextEntered(java.awt.event.TextEvent e)
           
 void onCenter(EntryEvent e)
           
 void onLegA(EntryEvent e)
           
 void onLegB(EntryEvent e)
           
 void setAngle(float angle)
          Sets the current angle value
 void setCenter(harmonic.meshGeom.math.Pnt3f center)
          Set center used to draw angle avator
 void setField(ModelNode f)
          Set field to apply angle to.
 void setLegA(harmonic.meshGeom.math.Pnt3f pnt)
          Set first leg end point of angle
 void setLegB(harmonic.meshGeom.math.Pnt3f pnt)
          Set first leg end point of angle
 void updateField()
          This is called by notifyListeners we have a EntryEvent.VALUE_CHANGED.
 
Methods inherited from class harmonic.mz.gui.ValueEntry
_notifyListeners_, add, addEntryListener, aquireInput, beginTask, cancelTask, componentHidden, componentMoved, componentResized, componentShown, contractIcon, echoFieldChange, expandCheck, expandIcon, finishTask, getField, getInstanceURL, getPreferredSize, getTaskName, getTypeURL, highlight, init, innerChange, isActive, isDoingTask, isExpanded, monologFinished, mousePressed, notifyListeners_ValueChanged, notifyListeners, onSettingsButton, removeEntryListener, savePrev, setDocURL, setInnerChange, setValue, transferListener, unlinkField, validateUISettings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

val

public float val
Constructor Detail

AngleEntry

public AngleEntry(java.lang.String label,
                  float val)
Constructs an AngleEntry

Parameters:
label - Label to draw
val - Initial angle value (in radians)

AngleEntry

public AngleEntry(java.lang.String label,
                  java.lang.Object listener,
                  java.lang.String callback,
                  float val)
Constructs an AngleEntry

Parameters:
label - Label to draw
listener - Listener to send AngleEvents to
callback - Listeners callback, declared as fnname(EntryEvent)
val - Initial angle value (in radians)
Method Detail

setField

public void setField(ModelNode f)
Set field to apply angle to.

Overrides:
setField in class ValueEntry

nodeChanged

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

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

makeValueUI

public void makeValueUI()

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

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

setAngle

public void setAngle(float angle)
Sets the current angle value


getAngle

public float getAngle()
Return current angle value


getAxisPosition

public harmonic.meshGeom.math.Pnt3f getAxisPosition()
Return current axis position in UCS


getAxisDirection

public harmonic.meshGeom.math.Vec3f getAxisDirection()
Return current axis direction in UCS


getLegA

public harmonic.meshGeom.math.Pnt3f getLegA()
Return a point on first leg, if angle is formed by two legs


setLegA

public void setLegA(harmonic.meshGeom.math.Pnt3f pnt)
Set first leg end point of angle


setLegB

public void setLegB(harmonic.meshGeom.math.Pnt3f pnt)
Set first leg end point of angle


getLegB

public harmonic.meshGeom.math.Pnt3f getLegB()
Return a point on first leg, if angle is formed by two legs


getCenter

public harmonic.meshGeom.math.Pnt3f getCenter()

setCenter

public void setCenter(harmonic.meshGeom.math.Pnt3f center)
Set center used to draw angle avator


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

beginEntry

public void beginEntry(harmonic.viewer3D.Task parentTask)
Start input - start viewport angle device.

Overrides:
beginEntry in class ValueEntry

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

cancelEntry

public void cancelEntry()
Description copied from class: ValueEntry
Called when entry or thing owning entry is canceled, as the elements of the task tree are canceled. Do listener deregistration and remove any objects from viewport.

Overrides:
cancelEntry in class ValueEntry

cleanTask

public void cleanTask()

onCenter

public void onCenter(EntryEvent e)

onLegA

public void onLegA(EntryEvent e)

onLegB

public void onLegB(EntryEvent e)

assignFromReadout

public void assignFromReadout()
Description copied from class: ValueEntry
Override to assign value from readout. Called by InputEntrySequence when next value is requested.

Overrides:
assignFromReadout in class ValueEntry

onAngleTextEntered

public void onAngleTextEntered(java.awt.event.TextEvent e)

assignFromAngleText

public void assignFromAngleText(java.lang.String angleText)

initReadout

public void initReadout()
Description copied from class: ValueEntry
Override to assign readout from value.

Overrides:
initReadout in class ValueEntry