org.robokind.api.animation.editor
Class ControlPointEditor
java.lang.Object
org.robokind.api.common.property.PropertyChangeNotifier
org.robokind.api.animation.editor.AbstractEditor<Point2D,Point2D>
org.robokind.api.animation.editor.ControlPointEditor
- All Implemented Interfaces:
- org.robokind.api.common.property.PropertyChangeSource
public class ControlPointEditor
- extends AbstractEditor<Point2D,Point2D>
- Author:
- Matthew Stevenson
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, getChildren, getInheritedFlags, getParent, getRestrictiveFlags, 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 |
ControlPointEditor
public ControlPointEditor(Point2D p,
HistoryStack hist)
- Parameters:
p
- properties
- hist
-
setName
public void setName(String name)
- Specified by:
setName
in class AbstractEditor<Point2D,Point2D>
- Parameters:
name
-
getName
public String getName()
- Specified by:
getName
in class AbstractEditor<Point2D,Point2D>
- Returns:
setPoint
public void setPoint(Point2D p)
- Parameters:
p
-
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,Point2D>
- Parameters:
x
- y
- s
- distance
-
- Returns:
- public boolean contains(int x1, int y1, CoordinateScalar s, double distance){
Point2D p = getSelected();
return Point2D.Double.distance(s.scaleX(p), s.scaleY(p), x, y) <= distance;
}
createChildController
protected Point2D createChildController(Point2D childBase)
- Description copied from class:
AbstractEditor
- Called when a new Controller needs to be created
- Specified by:
createChildController
in class AbstractEditor<Point2D,Point2D>
- Parameters:
childBase
- 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,Point2D>
- Returns:
- true if ChildController extends AbstractEditor
addChildBase
protected int addChildBase(Object invoker,
org.robokind.api.common.utils.Source<Point2D> childBase,
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,Point2D>
childBase
- the ChildBase to be added
- Returns:
- the index where the ChildBase, return -1 to cancel adding the ChildBase.
insertChildControllerBase
protected int insertChildControllerBase(Point2D 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,Point2D>
- Parameters:
controller
- ChildController that is being addedi
- the index the child should be added at
- Returns:
- the index the child is added at
getChild
public Point2D getChild(int i)
- Overrides:
getChild
in class AbstractEditor<Point2D,Point2D>
- Parameters:
i
-
- Returns:
getSelected
public Point2D getSelected()
- Overrides:
getSelected
in class AbstractEditor<Point2D,Point2D>
- Returns:
Copyright © 2011. All Rights Reserved.