-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Retera
committed
Aug 13, 2022
1 parent
e792998
commit cfd5d4a
Showing
8 changed files
with
178 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...workshop/wc3/gui/modeledit/actions/componenttree/timeline/SetFloat3StaticValueAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.hiveworkshop.wc3.gui.modeledit.actions.componenttree.timeline; | ||
|
||
import com.hiveworkshop.wc3.gui.modeledit.UndoAction; | ||
import com.hiveworkshop.wc3.mdl.Vertex; | ||
import com.hiveworkshop.wc3.util.Callback; | ||
|
||
public class SetFloat3StaticValueAction implements UndoAction { | ||
private final String valueTypeName; | ||
private final Vertex oldValue; | ||
private final Vertex newValue; | ||
private final Callback<Vertex> setter; | ||
|
||
public SetFloat3StaticValueAction(final String valueTypeName, final Vertex oldValue, final Vertex newValue, | ||
final Callback<Vertex> setter) { | ||
this.valueTypeName = valueTypeName; | ||
this.oldValue = oldValue; | ||
this.newValue = newValue; | ||
this.setter = setter; | ||
} | ||
|
||
@Override | ||
public void undo() { | ||
setter.run(oldValue); | ||
} | ||
|
||
@Override | ||
public void redo() { | ||
setter.run(newValue); | ||
} | ||
|
||
@Override | ||
public String actionName() { | ||
return "set " + valueTypeName; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...eworkshop/wc3/gui/modeledit/actions/componenttree/timeline/SetFloatStaticValueAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.hiveworkshop.wc3.gui.modeledit.actions.componenttree.timeline; | ||
|
||
import com.hiveworkshop.wc3.gui.modeledit.UndoAction; | ||
import com.hiveworkshop.wc3.util.Callback; | ||
|
||
public class SetFloatStaticValueAction implements UndoAction { | ||
private final String valueTypeName; | ||
private final float oldValue; | ||
private final float newValue; | ||
private final Callback<Float> setter; | ||
|
||
public SetFloatStaticValueAction(final String valueTypeName, final float oldValue, final float newValue, | ||
final Callback<Float> setter) { | ||
this.valueTypeName = valueTypeName; | ||
this.oldValue = oldValue; | ||
this.newValue = newValue; | ||
this.setter = setter; | ||
} | ||
|
||
@Override | ||
public void undo() { | ||
setter.run(oldValue); | ||
} | ||
|
||
@Override | ||
public void redo() { | ||
setter.run(newValue); | ||
} | ||
|
||
@Override | ||
public String actionName() { | ||
return "set " + valueTypeName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters