-
-
Notifications
You must be signed in to change notification settings - Fork 769
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Now only does one pass if the start and target depth are the same * Added undoable actions for the shape settings
- Loading branch information
Showing
19 changed files
with
477 additions
and
59 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...ugin-designer/src/main/java/com/willwinder/ugs/nbp/designer/actions/ChangeFontAction.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,49 @@ | ||
/* | ||
Copyright 2024 Will Winder | ||
This file is part of Universal Gcode Sender (UGS). | ||
UGS is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
UGS is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with UGS. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.willwinder.ugs.nbp.designer.actions; | ||
|
||
import com.willwinder.ugs.nbp.designer.entities.cuttable.Text; | ||
|
||
public class ChangeFontAction implements UndoableAction { | ||
|
||
private final Text entity; | ||
private final String newFont; | ||
private final String oldFont; | ||
|
||
public ChangeFontAction(Text entity, String font) { | ||
this.entity = entity; | ||
this.newFont = font; | ||
this.oldFont = entity.getFontFamily(); | ||
} | ||
|
||
@Override | ||
public void redo() { | ||
entity.setFontFamily(newFont); | ||
} | ||
|
||
@Override | ||
public void undo() { | ||
entity.setFontFamily(oldFont); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "changed font"; | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...ugin-designer/src/main/java/com/willwinder/ugs/nbp/designer/actions/ChangeTextAction.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,49 @@ | ||
/* | ||
Copyright 2024 Will Winder | ||
This file is part of Universal Gcode Sender (UGS). | ||
UGS is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
UGS is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with UGS. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.willwinder.ugs.nbp.designer.actions; | ||
|
||
import com.willwinder.ugs.nbp.designer.entities.cuttable.Text; | ||
|
||
public class ChangeTextAction implements UndoableAction { | ||
|
||
private final Text entity; | ||
private final String newText; | ||
private final String oldText; | ||
|
||
public ChangeTextAction(Text entity, String text) { | ||
this.entity = entity; | ||
this.newText = text; | ||
this.oldText = entity.getText(); | ||
} | ||
|
||
@Override | ||
public void redo() { | ||
entity.setText(newText); | ||
} | ||
|
||
@Override | ||
public void undo() { | ||
entity.setText(oldText); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "changed text"; | ||
} | ||
} |
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
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.