Package org.emrick.project.effect
Class EffectManager
java.lang.Object
org.emrick.project.effect.EffectManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FootballFieldPanelprivate final Stack<UndoableAction> private TimeManagerprivate final Stack<UndoableAction> -
Constructor Summary
ConstructorsConstructorDescriptionEffectManager(FootballFieldPanel footballFieldPanel, TimeManager timeManager, HashMap<Integer, RFTrigger> count2RFTrigger) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddEffectToSelectedLEDStrips(Effect effect) Get the effect based on current count as specified by attribute of FootballFieldPanel.getEffectsFromSelectedLEDStrips(long time) getIds()longgetNextEffectOrTriggerStartMS(long currentMS) booleanChecks if an effect can be validly created.booleanbooleanChecks if an RF trigger can be validly created.intnextId()voidredo()voidvoidvoidvoidreplaceEffectForSelectedLEDStrips(Effect oldEffect, Effect newEffect) voidsetCount2RFTrigger(HashMap<Integer, RFTrigger> count2RFTrigger) voidvoidshowAddEffectErrorDialog(LEDStrip ledStrip) voidshowAddRFTriggerErrorDialog(LEDStrip ledStrip) voidvoidundo()
-
Field Details
-
undoStack
-
redoStack
-
footballFieldPanel
-
timeManager
-
count2RFTrigger
-
ids
-
-
Constructor Details
-
EffectManager
public EffectManager(FootballFieldPanel footballFieldPanel, TimeManager timeManager, HashMap<Integer, RFTrigger> count2RFTrigger)
-
-
Method Details
-
nextId
public int nextId() -
isValid
Checks if an effect can be validly created. The effect should not overlap with another effect on the given performer, and its start and end times should be in different sets.- Parameters:
effect- The effect to check.ledStrip- The ledStrip on which the effect is to be applied.- Returns:
- True if valid, false if invalid.
-
isValid
-
isValid
Checks if an RF trigger can be validly created. The RF trigger should not be placed where an effect over-runs it (i.e., where it is in the middle of an effect). However, it can be placed where an effect begins or ends. Timestamps (mSec) are checked for validation.- Parameters:
rfTrigger- The RF trigger to be validated.
-
getUndoStack
-
undo
public void undo() -
redo
public void redo() -
addEffectToSelectedLEDStrips
-
showAddRFTriggerErrorDialog
-
showAddEffectErrorDialog
-
showNoPerformersSelectedErrorDialog
public void showNoPerformersSelectedErrorDialog() -
removeEffectFromSelectedLEDStrips
-
removeAllEffectsFromSelectedLEDStrips
public void removeAllEffectsFromSelectedLEDStrips() -
removeAllEffectsFromAllLEDStrips
public void removeAllEffectsFromAllLEDStrips() -
replaceEffectForSelectedLEDStrips
-
getEffect
Get the effect based on current count as specified by attribute of FootballFieldPanel.- Parameters:
ledStrip- The ledStrip of interest.- Returns:
- The effect at the current count for the given performer. If there is none, return null.
-
getEffectsFromSelectedLEDStrips
-
getLEDStripsWithEffect
-
getSelectedLEDStrips
-
getNextEffectOrTriggerStartMS
public long getNextEffectOrTriggerStartMS(long currentMS) -
getFootballFieldPanel
-
getTimeManager
-
setCount2RFTrigger
-
getIds
-
setIds
-