org.robokind.api.animation.editor
Class MotionPathEditor
java.lang.Object
org.robokind.api.common.property.PropertyChangeNotifier
org.robokind.api.animation.editor.AbstractEditor<Point2D,ControlPointEditor>
org.robokind.api.animation.editor.MotionPathEditor
- All Implemented Interfaces:
- org.robokind.api.common.property.PropertyChangeSource
public class MotionPathEditor
- extends AbstractEditor<Point2D,ControlPointEditor>
- Author:
- Matthew Stevenson
Method Summary |
protected int |
addChildBase(Object invoker,
org.robokind.api.common.utils.Source<Point2D> p,
int i)
Called when a child is requested to be added. |
protected ControlPointEditor |
createChildController(Point2D point)
Called when a new Controller needs to be created |
int |
dragSelectedPoint(Object invoker,
long time,
double pos)
|
void |
endPathChange()
|
CompiledPath |
getCompiledPath(long start,
long end,
long stepLength)
|
List<Point2D> |
getControlPoints()
|
double |
getEnd()
|
List<Point2D> |
getInterpolatedPoints()
|
InterpolatorFactory |
getInterpolatorFactory()
|
protected MotionPath |
getMotionPath()
|
String |
getName()
|
double |
getStart()
|
MotionPath |
getTempPath()
|
protected int |
insertChildControllerBase(ControlPointEditor controller,
int i)
Called when inserting an existing ChildController. |
boolean |
isChildUIController()
This should return true if ChildController extends AbstractEditor. |
void |
movePath(Object invoker,
long timeOffset,
double posOffset)
|
int |
movePoint(Object invoker,
int i,
long time,
double pos)
|
protected Point2D |
removeChild(Object invoker,
int i)
Called when the child with the given index is requested to be removed. |
void |
scalePath(Object invoker,
double scale,
long refTime)
|
void |
setInterpolatorFactory(Object invoker,
InterpolatorFactory factory)
|
void |
setName(String name)
|
void |
setPoints(Object invoker,
List<Point2D> points)
|
void |
setState(Object invoker,
EditState state,
boolean value)
|
int |
size()
|
void |
startPathChange()
|
Methods inherited from class org.robokind.api.animation.editor.AbstractEditor |
addChild, addConsumer, addRecursiveToChild, clearConsumers, deselect, fireItemAddedEvent, fireItemAddedEvent, fireItemMovedEvent, fireItemMovedEvent, fireItemRemovedEvent, fireItemRemovedEvent, fireSelectionChangeEvent, fireSelectionChangeEvent, fireStateChangedEvent, fireStateChangedEvent, fireStructureChangedEvent, fireStructureChangedEvent, getChild, getChildren, getInheritedFlags, getParent, getRestrictiveFlags, getSelected, getSelectedIndex, getSharedHistory, getStateFlags, getStates, hasFlag, insertChild, insertChildController, isLocked, recursiveAdd, recursiveRemove, removeChild, removeChildByIndex, removeConsumer, removeFromConsumerList, removeFromRecursiveList, select, setChildren, setParent, setSelected |
Methods inherited from class org.robokind.api.common.property.PropertyChangeNotifier |
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MotionPathEditor
public MotionPathEditor(MotionPath mp,
HistoryStack hist)
- Parameters:
mp
- properties
- hist
-
getName
public String getName()
- Specified by:
getName
in class AbstractEditor<Point2D,ControlPointEditor>
- Returns:
setName
public void setName(String name)
- Specified by:
setName
in class AbstractEditor<Point2D,ControlPointEditor>
- Parameters:
name
-
createChildController
protected ControlPointEditor createChildController(Point2D point)
- Description copied from class:
AbstractEditor
- Called when a new Controller needs to be created
- Specified by:
createChildController
in class AbstractEditor<Point2D,ControlPointEditor>
- Parameters:
point
- the ChildBase for the requested ChildController
- Returns:
- return a new ChildController created from the ChildBase
isChildUIController
public boolean isChildUIController()
- Description copied from class:
AbstractEditor
- This should return true if ChildController extends AbstractEditor.
Additional functionality can be provided for Children UIControllers.
This abstract method was introduced to avoid use of instanceof.
- Specified by:
isChildUIController
in class AbstractEditor<Point2D,ControlPointEditor>
- Returns:
- true if ChildController extends AbstractEditor
addChildBase
protected int addChildBase(Object invoker,
org.robokind.api.common.utils.Source<Point2D> p,
int i)
- Description copied from class:
AbstractEditor
- Called when a child is requested to be added. This method should do everything
necessary to add a ChildBase. Shortly after this is called, a call will be
made to createChildController(...), the resulting controller will be added
to myChildren at the index returned from this method.
To cancel adding the ChildBase, return -1
- Specified by:
addChildBase
in class AbstractEditor<Point2D,ControlPointEditor>
p
- the ChildBase to be added
- Returns:
- the index where the ChildBase, return -1 to cancel adding the ChildBase.
insertChildControllerBase
protected int insertChildControllerBase(ControlPointEditor controller,
int i)
- Description copied from class:
AbstractEditor
- Called when inserting an existing ChildController.
This method is expected to add the ChildBase from the ChildController to
this Controller's underlying type.
- Specified by:
insertChildControllerBase
in class AbstractEditor<Point2D,ControlPointEditor>
- Parameters:
controller
- ChildController that is being addedi
- the index the child should be added at
- Returns:
- the index the child is added at
size
public int size()
- Returns:
removeChild
protected Point2D removeChild(Object invoker,
int i)
- Description copied from class:
AbstractEditor
- Called when the child with the given index is requested to be removed.
- Specified by:
removeChild
in class AbstractEditor<Point2D,ControlPointEditor>
i
- the index of the child to remove
- Returns:
dragSelectedPoint
public int dragSelectedPoint(Object invoker,
long time,
double pos)
- Parameters:
invoker
- time
- pos
-
- Returns:
movePoint
public int movePoint(Object invoker,
int i,
long time,
double pos)
- Parameters:
invoker
- i
- time
- pos
-
- Returns:
getTempPath
public MotionPath getTempPath()
- Returns:
startPathChange
public void startPathChange()
endPathChange
public void endPathChange()
movePath
public void movePath(Object invoker,
long timeOffset,
double posOffset)
- Parameters:
invoker
- timeOffset
- posOffset
-
scalePath
public void scalePath(Object invoker,
double scale,
long refTime)
- Parameters:
invoker
- scale
- refTime
-
setPoints
public void setPoints(Object invoker,
List<Point2D> points)
- Parameters:
invoker
- points
-
getCompiledPath
public CompiledPath getCompiledPath(long start,
long end,
long stepLength)
- Parameters:
start
- end
- stepLength
-
- Returns:
getInterpolatedPoints
public List<Point2D> getInterpolatedPoints()
- Returns:
getControlPoints
public List<Point2D> getControlPoints()
- Returns:
getInterpolatorFactory
public InterpolatorFactory getInterpolatorFactory()
- Returns:
setInterpolatorFactory
public void setInterpolatorFactory(Object invoker,
InterpolatorFactory factory)
- Parameters:
invoker
- factory
-
getEnd
public double getEnd()
- Returns:
getStart
public double getStart()
setState
public void setState(Object invoker,
EditState state,
boolean value)
- Overrides:
setState
in class AbstractEditor<Point2D,ControlPointEditor>
- Parameters:
invoker
- state
- value
-
getMotionPath
protected MotionPath getMotionPath()
- Returns:
Copyright © 2011. All Rights Reserved.