org.robokind.api.animation.editor
Class ChannelEditor

java.lang.Object
  extended by org.robokind.api.common.property.PropertyChangeNotifier
      extended by org.robokind.api.animation.editor.AbstractEditor<MotionPath,MotionPathEditor>
          extended by org.robokind.api.animation.editor.ChannelEditor
All Implemented Interfaces:
org.robokind.api.common.property.PropertyChangeSource

public class ChannelEditor
extends AbstractEditor<MotionPath,MotionPathEditor>

Author:
Matthew Stevenson

Field Summary
 
Fields inherited from class org.robokind.api.animation.editor.AbstractEditor
myChildren, myConsumers, myParent, myRecursiveConsumers, mySelectedIndex, mySharedHistory, myStates, PROP_NAME
 
Constructor Summary
ChannelEditor(Channel channel, HistoryStack hist)
           
 
Method Summary
protected  int addChildBase(Object invoker, org.robokind.api.common.utils.Source<MotionPath> pathSource, int i)
          Called when a child is requested to be added.
protected  MotionPathEditor createChildController(MotionPath path)
          Called when a new Controller needs to be created
protected  Channel getChannel()
           
static Color getChannelColor(Integer i)
           
protected  Channel getChannelView()
           
 CompiledPath getCompiledPath(long start, long end, long stepLength)
           
 long getEnd()
           
 int getId()
           
 List<Point2D> getInterpolatedPoints()
           
 String getName()
           
 Color getPrimaryColor()
           
 long getStart()
           
protected  int insertChildControllerBase(MotionPathEditor controller, int i)
          Called when inserting an existing ChildController.
 boolean isChildUIController()
          This should return true if ChildController extends AbstractEditor.
protected  MotionPath removeChild(Object invoker, int i)
          Called when the child with the given index is requested to be removed.
protected  void setEnabled(MotionPath mp, boolean enabled)
           
 void setName(String name)
           
 void setPrimaryColor(Object invoker, Color col)
           
 
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, setState
 
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
 

Constructor Detail

ChannelEditor

public ChannelEditor(Channel channel,
                     HistoryStack hist)
Parameters:
channel -
properties -
hist -
Method Detail

removeChild

protected MotionPath 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<MotionPath,MotionPathEditor>
i - the index of the child to remove
Returns:

getChannelView

protected Channel getChannelView()
Returns:

getCompiledPath

public CompiledPath getCompiledPath(long start,
                                    long end,
                                    long stepLength)
Parameters:
start -
end -
stepLength -
Returns:

getInterpolatedPoints

public List<Point2D> getInterpolatedPoints()
Returns:

setName

public void setName(String name)
Specified by:
setName in class AbstractEditor<MotionPath,MotionPathEditor>
Parameters:
name -

getName

public String getName()
Specified by:
getName in class AbstractEditor<MotionPath,MotionPathEditor>
Returns:

getPrimaryColor

public Color getPrimaryColor()
Returns:

getChannelColor

public static Color getChannelColor(Integer i)

setPrimaryColor

public void setPrimaryColor(Object invoker,
                            Color col)
Parameters:
invoker -
col -

getEnd

public long getEnd()
Returns:

getStart

public long getStart()

setEnabled

protected void setEnabled(MotionPath mp,
                          boolean enabled)
Parameters:
mp -
enabled -

createChildController

protected MotionPathEditor createChildController(MotionPath path)
Description copied from class: AbstractEditor
Called when a new Controller needs to be created

Specified by:
createChildController in class AbstractEditor<MotionPath,MotionPathEditor>
Parameters:
path - 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<MotionPath,MotionPathEditor>
Returns:
true if ChildController extends AbstractEditor

addChildBase

protected int addChildBase(Object invoker,
                           org.robokind.api.common.utils.Source<MotionPath> pathSource,
                           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<MotionPath,MotionPathEditor>
pathSource - the ChildBase to be added
Returns:
the index where the ChildBase, return -1 to cancel adding the ChildBase.

insertChildControllerBase

protected int insertChildControllerBase(MotionPathEditor 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<MotionPath,MotionPathEditor>
Parameters:
controller - ChildController that is being added
i - the index the child should be added at
Returns:
the index the child is added at

getChannel

protected Channel getChannel()
Returns:

getId

public int getId()
Returns:


Copyright © 2011. All Rights Reserved.