-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
15 changed files
with
295 additions
and
10 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
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
28 changes: 28 additions & 0 deletions
28
src/main/java/components/schemaTree/Cell/appCommands/ChangeColorMomentTypesCommand.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,28 @@ | ||
package components.schemaTree.Cell.appCommands; | ||
|
||
import application.history.HistoryManager; | ||
import components.schemaTree.Cell.modelCommands.ChangeColorSchemaMomentType; | ||
import components.schemaTree.Cell.modelCommands.ChangeColorTreePluggable; | ||
import models.SchemaCategory; | ||
import models.SchemaMomentType; | ||
import utils.command.Executable; | ||
|
||
public class ChangeColorMomentTypesCommand implements Executable { | ||
|
||
private SchemaMomentType momentType; | ||
private String newColor; | ||
private boolean userCommand; | ||
|
||
public ChangeColorMomentTypesCommand(SchemaMomentType mt, String newColor) { | ||
this.momentType = mt; | ||
this.newColor = newColor; | ||
this.userCommand = true; | ||
} | ||
|
||
@Override | ||
public Object execute() { | ||
String oldColor = momentType.getColor(); | ||
HistoryManager.addCommand(new ChangeColorSchemaMomentType(momentType, newColor, oldColor), userCommand); | ||
return null; | ||
} | ||
} |
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
31 changes: 31 additions & 0 deletions
31
src/main/java/components/schemaTree/Cell/modelCommands/ChangeColorSchemaMomentType.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,31 @@ | ||
package components.schemaTree.Cell.modelCommands; | ||
|
||
import application.history.ModelUserActionCommand; | ||
import models.SchemaCategory; | ||
import models.SchemaMomentType; | ||
|
||
public class ChangeColorSchemaMomentType extends ModelUserActionCommand{ | ||
|
||
private SchemaMomentType momentType; | ||
private String oldColor; | ||
private String newColor; | ||
|
||
public ChangeColorSchemaMomentType(SchemaMomentType momentType, String newColor, String oldColor) { | ||
this.momentType = momentType; | ||
this.newColor = newColor; | ||
this.oldColor = oldColor; | ||
} | ||
|
||
@Override | ||
public Object execute() { | ||
momentType.setColor(newColor); | ||
return null; | ||
} | ||
|
||
@Override | ||
public Object undo() { | ||
momentType.setColor(oldColor); | ||
return null; | ||
} | ||
|
||
} |
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
Oops, something went wrong.