jsynoptic.data
Class DataSourceAnimator

java.lang.Object
  extended by simtools.data.ValueProvider
      extended by simtools.data.DataSource
          extended by simtools.data.DynamicDataSource
              extended by simtools.data.DataSourceAnimator
                  extended by jsynoptic.data.DataSourceAnimator
All Implemented Interfaces:
ContextualActionProvider, DataSourceListener

public class DataSourceAnimator
extends DataSourceAnimator
implements ContextualActionProvider

Overloads the collection animator and provides actions for the popup menu in the source tree


Nested Class Summary
protected  class DataSourceAnimator.PropertiesPanel
           
 
Field Summary
static MenuResourceBundle resources
           
 
Fields inherited from class simtools.data.DataSourceAnimator
autoStop, finished, MARKER, period, target, timer
 
Fields inherited from class simtools.data.DynamicDataSource
autoRegister, cachedByte, cachedDouble, cachedFloat, cachedInteger, cachedLong, cachedObject, cachedShort, currentByte, currentDouble, currentFloat, currentInteger, currentLong, currentObject, currentShort, hasValue, info, kind, lastIndex, maxByte, maxDouble, maxFloat, maxInteger, maxLong, maxObject, maxShort, minByte, minDouble, minFloat, minInteger, minLong, minObject, minShort
 
Fields inherited from class simtools.data.DataSource
endNotificationListeners, listeners, sortedOrder
 
Fields inherited from class simtools.data.ValueProvider
ByteProvider, DoubleProvider, FloatProvider, IntegerProvider, LongProvider, ObjectProvider, ShortProvider
 
Fields inherited from interface jsynoptic.base.ContextualActionProvider
EDITOR_CONTEXT, MOUSE_OUT_CONTEXT, MOUSE_OVER_CONTEXT, MOUSE_PRESSED_CONTEXT, SHAPELIST_CONTEXT, SOURCELIST_CONTEXT
 
Constructor Summary
DataSourceAnimator(DataSource ds)
           
DataSourceAnimator(DataSource ds, int delay)
           
DataSourceAnimator(DataSource ds, int delay, long period)
           
 
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.
 java.lang.String getDataSourceInformationClass()
          This method provide the UI Data source information class name.
 
Methods inherited from class simtools.data.DataSourceAnimator
DataSourceIndexRangeChanged, DataSourceInfoChanged, DataSourceOrderChanged, DataSourceReplaced, DataSourceValueChanged, DataSourceValueRangeChanged, getPeriod, isAutoStop, isFinished, isRunning, reset, setAutoStop, setPeriod, sortedOrder, start, start, step, stop, valueClass
 
Methods inherited from class simtools.data.DynamicDataSource
bufferize, changeInfo, computeLastIndex, computeMinMax, computeStartIndex, getByteMax, getByteMin, getDoubleMax, getDoubleMin, getFloatMax, getFloatMin, getInformation, getIntegerMax, getIntegerMin, getKind, getLastIndex, getLongMax, getLongMin, getMax, getMin, getShortMax, getShortMin, getStartIndex, getValue, isAutoRegister, isComparable, registerNewValue, setAutoRegister, setByteValue, setDoubleValue, setFloatValue, setIntegerValue, setLongValue, setObjectValue, setShortValue
 
Methods inherited from class simtools.data.DataSource
addEndNotificationListener, addListener, computeMax, computeMin, computeSortedOrder, createEmptyDataSource, equals, getAuxiliarySources, getChoiceFormat, getSortedOrder, getSourceDependencies, isAuxiliary, isComparable, isCompound, notifyEndNotificationListeners, notifyListenersForDataReplaced, notifyListenersForDataReplaced, notifyListenersForIndexRangeChange, notifyListenersForInfoChange, notifyListenersForOrderChange, notifyListenersForValueChange, notifyListenersForValueRangeChange, removeEndNotificationListener, removeListener, setSlice, updateSortedOrder
 
Methods inherited from class simtools.data.ValueProvider
getByteValue, getDoubleValue, getFloatValue, getIntegerValue, getLongValue, getObjectValue, getShortValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resources

public static MenuResourceBundle resources
Constructor Detail

DataSourceAnimator

public DataSourceAnimator(DataSource ds)
Parameters:
ds -

DataSourceAnimator

public DataSourceAnimator(DataSource ds,
                          int delay)
Parameters:
ds -
delay -

DataSourceAnimator

public DataSourceAnimator(DataSource ds,
                          int delay,
                          long period)
Parameters:
ds -
delay -
period -
Method Detail

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 actions
context - 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 position
y - Coordinate, for example mouse position
o - 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 position
y - Coordinate, for example mouse position
o - 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

getDataSourceInformationClass

public java.lang.String getDataSourceInformationClass()
Description copied from class: DataSource
This method provide the UI Data source information class name. Should be overloaded in sub classes to return specified information

Overrides:
getDataSourceInformationClass in class DataSource
Returns:
the box