jsynoptic.data
Class DataSourceCollectionAnimator
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector
simtools.data.DataSourceCollection
simtools.data.DynamicDataSourceCollection
simtools.data.DataSourceCollectionAnimator
jsynoptic.data.DataSourceCollectionAnimator
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess, ContextualActionProvider, DataSourceCollectionListener
public class DataSourceCollectionAnimator
- extends DataSourceCollectionAnimator
- implements ContextualActionProvider
Overloads the collection animator and provides actions for the popup menu in the source tree
- See Also:
- Serialized Form
Fields inherited from class java.util.Vector |
capacityIncrement, elementCount, elementData |
Fields inherited from class java.util.AbstractList |
modCount |
Method Summary |
boolean |
canDoAction(double x,
double y,
java.lang.Object o,
java.lang.String action,
int context)
Returns true if, and only if, it is possible to do the action right now |
boolean |
doAction(double x,
double y,
java.lang.Object o,
java.lang.String action,
javax.swing.undo.CompoundEdit undoableEdit)
Do one of the actions previously declared by getAction. |
java.lang.String[] |
getActions(double x,
double y,
java.lang.Object o,
int context)
Return list of possible actions
the contect information may be used, or not. |
Methods inherited from class simtools.data.DataSourceCollectionAnimator |
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, createDataSource, createDataSource, DataSourceCollectionDataSourceAdded, DataSourceCollectionDataSourceRemoved, DataSourceCollectionInfoChanged, DataSourceCollectionRemoved, elementAt, elements, ensureCapacity, equals, firstElement, get, get, getInformation, getPeriod, getTargetCollection, hashCode, indexOf, indexOf, insertElementAt, isAutoStop, isEmpty, isFinished, isRunning, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, reset, retainAll, set, setAutoStop, setElementAt, setPeriod, setSize, size, start, start, step, stop, subList, toArray, toArray, toString, trimToSize |
Methods inherited from class simtools.data.DynamicDataSourceCollection |
bufferize, bufferize, bufferize, changeDataSourceInfo, changeInfo, computeLastIndex, computeMax, computeMin, computeStartIndex, getByteMax, getByteMin, getDoubleMax, getDoubleMin, getFloatMax, getFloatMin, getInformation, getIntegerMax, getIntegerMin, getKind, getLastIndex, getLongMax, getLongMin, getMax, getMin, getShortMax, getShortMin, getStartIndex, getValue, isComparable, registerNewValues, removeDataSource, removeDataSource, setByteValue, setDoubleValue, setFloatValue, setIntegerValue, setLongValue, setObjectValue, setShortValue, valueClass |
Methods inherited from class simtools.data.DataSourceCollection |
addEndNotificationListener, addListener, attachBuffer, computeLastIndex, computeStartIndex, getByteValue, getCollectionContainers, getDoubleValue, getFloatValue, getIntegerValue, getLastIndex, getLongValue, getShortValue, getStartIndex, isCompound, notifyEndNotificationListeners, notifyListenersForCollectionRemoved, notifyListenersForDataSourceAdded, notifyListenersForDataSourceRemoved, notifyListenersForInfoChange, removeEndNotificationListener, removeListener, setSlice, sortedOrder |
Methods inherited from class java.util.Vector |
removeRange |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
resources
public static MenuResourceBundle resources
DataSourceCollectionAnimator
public DataSourceCollectionAnimator(DataSourceCollection dsc)
- Parameters:
dsc
-
getActions
public java.lang.String[] getActions(double x,
double y,
java.lang.Object o,
int context)
- Description copied from interface:
ContextualActionProvider
- Return list of possible actions
the contect information may be used, or not.
- Specified by:
getActions
in interface ContextualActionProvider
- Parameters:
x
- Coordinate, mouse position in the same unit as contains(x,y)y
- Coordinate, mouse position in the same unit as contains(x,y)o
- Object the actions should work on. Possibly null => default or all actionscontext
- one of the context defined in the ContextualActionProvider class
- Returns:
- The list of possible actions, possibly null or an empty array
doAction
public boolean doAction(double x,
double y,
java.lang.Object o,
java.lang.String action,
javax.swing.undo.CompoundEdit undoableEdit)
- Description copied from interface:
ContextualActionProvider
- Do one of the actions previously declared by getAction.
- Specified by:
doAction
in interface ContextualActionProvider
- Parameters:
x
- Coordinate, for example mouse positiony
- Coordinate, for example mouse positiono
- Object the action should work on.action
- An action returned by a previous getActions call with the same x, y, o parameters
It may be null, in which case the default action is requested for this x,y,o.undoableEdit
- current edit for undo/redo operation
If not null, this action is undoable.
- Returns:
- true if the action could be performed
canDoAction
public boolean canDoAction(double x,
double y,
java.lang.Object o,
java.lang.String action,
int context)
- Description copied from interface:
ContextualActionProvider
- Returns true if, and only if, it is possible to do the action right now
- Specified by:
canDoAction
in interface ContextualActionProvider
- Parameters:
x
- Coordinate, for example mouse positiony
- Coordinate, for example mouse positiono
- Object the action should work on.action
- An action returned by a previous getActions call with the same x, y, o parameters
It may be null, in which case the default action is requested for this x,y,o.context
- one of the context defined in the ContextualActionProvider class
- Returns:
- true if the action can be performed