net.nexttext.behaviour.dform
Class Reform

java.lang.Object
  extended by net.nexttext.behaviour.AbstractAction
      extended by net.nexttext.behaviour.dform.DForm
          extended by net.nexttext.behaviour.dform.Reform
All Implemented Interfaces:
Action

public class Reform
extends DForm

A DForm which reverts TextObject to its original shape.

Different ways of reforming the glyphs are provided, which given different visual effects.

The current ActionResult returned specifies that a Reform action never terminates, it sends a true event once it's reformed. We probably want to change it so that it can terminate. If needs be, the Reform could be put into a Repeat behaviour.


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.nexttext.behaviour.Action
Action.ActionResult
 
Field Summary
static int STYLE_EXPONENTIAL
           
static int STYLE_LINEAR
           
 
Constructor Summary
Reform()
          Constructs a default Reform of linear style with a default speed of 0.05.
Reform(float speed, int style)
          Constructs a custom Reform with given style and appropriate speed.
 
Method Summary
 Action.ActionResult behave(TextObjectGlyph to)
          DForms generally just make sense on TextObjectGlyphs.
 float getExponentialSpeed()
           
 float getLinearSpeed()
           
 void setExponentialSpeed(float exponentialSpeed)
          Sets the speed of the reform when using the exponential style.
 void setLinearSpeed(float linearSpeed)
          Sets the speed of the reform when using the linear style.
 void setStyleExponential()
          Exponential style reformation preserves deformations longer.
 void setStyleLinear()
          Linear style of reformation doesn't deform glyph shape.
 
Methods inherited from class net.nexttext.behaviour.dform.DForm
behave, getControlPoints
 
Methods inherited from class net.nexttext.behaviour.AbstractAction
behave, behave, complete, getDisplayName, getRequiredProperties, makeBehaviour, properties, setDisplayName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLE_LINEAR

public static final int STYLE_LINEAR
See Also:
Constant Field Values

STYLE_EXPONENTIAL

public static final int STYLE_EXPONENTIAL
See Also:
Constant Field Values
Constructor Detail

Reform

public Reform()
Constructs a default Reform of linear style with a default speed of 0.05.


Reform

public Reform(float speed,
              int style)
Constructs a custom Reform with given style and appropriate speed.

In exponential style, smaller values give faster reforms, the default value is 2000.

In linear style, smaller values give slower reforms, the default value is 0.05

.

Parameters:
speed - the speed value according to the chosen style
style - the type of reformation (linear or exponential)
Method Detail

behave

public Action.ActionResult behave(TextObjectGlyph to)
Description copied from class: DForm
DForms generally just make sense on TextObjectGlyphs.

Specified by:
behave in class DForm

getExponentialSpeed

public float getExponentialSpeed()

setExponentialSpeed

public void setExponentialSpeed(float exponentialSpeed)
Sets the speed of the reform when using the exponential style.

Parameters:
exponentialSpeed - an appropriate speed for exponential style

getLinearSpeed

public float getLinearSpeed()

setLinearSpeed

public void setLinearSpeed(float linearSpeed)
Sets the speed of the reform when using the linear style.

Parameters:
linearSpeed - an appropriate speed for linear style

setStyleLinear

public void setStyleLinear()
Linear style of reformation doesn't deform glyph shape.


setStyleExponential

public void setStyleExponential()
Exponential style reformation preserves deformations longer.