Skip to content

Commit 3b4cb1c

Browse files
committed
update undo and redos add string description
1 parent 13c40aa commit 3b4cb1c

13 files changed

Lines changed: 144 additions & 9 deletions

src/actions/AddDataDisplayBoxAction.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ public void redoAction() {
3636
panel.addPaintComponent(comp);
3737
panel.repaint();
3838
}
39+
40+
@Override
41+
protected String commandName() {
42+
return "add data displayBox";
43+
}
44+
45+
@Override
46+
protected String commandDescription() {
47+
return "add a string display";
48+
}
49+
50+
3951
});
4052
panel.repaint();
4153
}

src/actions/AddDataInputBoxAction.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ public void redoAction() {
3838
panel.repaint();
3939

4040
}
41+
42+
@Override
43+
protected String commandName() {
44+
return "add data inputBox";
45+
}
46+
47+
@Override
48+
protected String commandDescription() {
49+
// TODO Auto-generated method stub
50+
return "add a string input";
51+
}
4152
});
4253
panel.repaint();
4354
}

src/actions/AddLazyJavaClassAction.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ public void redoAction() {
5151
panel.addPaintComponent(comp);
5252
panel.repaint();
5353
}
54+
55+
@Override
56+
protected String commandName() {
57+
return "add lazy javaClass";
58+
}
59+
60+
@Override
61+
protected String commandDescription() {
62+
return "add a java class component";
63+
}
5464
});
5565
panel.repaint();
5666
} catch (ClassNotFoundException e) {

src/actions/AddLazyJavaConstructorAction.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ public void redoAction() {
5757
panel.addPaintComponent(consComp);
5858
panel.repaint();
5959
}
60+
61+
@Override
62+
protected String commandName() {
63+
return "add lazy javaConstructor";
64+
}
65+
66+
@Override
67+
protected String commandDescription() {
68+
return "add a lazily evaludated java constructor";
69+
}
6070
});
6171
panel.repaint();
6272
}

src/actions/AddLazyJavaFieldsComponentAction.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ public void redoAction() {
4848
panel.addPaintComponent(fieldsComp);
4949

5050
}
51+
52+
@Override
53+
protected String commandName() {
54+
return "add lazy javaFieldsComponent";
55+
}
56+
57+
@Override
58+
protected String commandDescription() {
59+
return "add a java fields component";
60+
}
5161
});
5262
panel.repaint();
5363
}

src/actions/AddLazyJavaMethodComponentAction.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ public void redoAction() {
6060
panel.addPaintComponent(methodComp);
6161
panel.repaint();
6262
}
63+
64+
@Override
65+
protected String commandName() {
66+
return "add lazy javaMethodComponent";
67+
}
68+
69+
@Override
70+
protected String commandDescription() {
71+
return "add a lazily evaluated java method component";
72+
}
6373
});
6474
panel.repaint();
6575
}

src/actions/AddTextBoxAction.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ public void redoAction() {
3838
panel.addPaintComponent(comp);
3939
panel.repaint();
4040
}
41+
42+
@Override
43+
protected String commandName() {
44+
return "add textBox";
45+
}
46+
47+
@Override
48+
protected String commandDescription() {
49+
return "[Deprecated] add a generic textbox";
50+
}
4151
});
4252
panel.repaint();
4353
}

src/actions/ConstructDataLineSegmentAction.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ public void redoAction() {
8080
panel.addPaintComponent(seg);
8181
panel.repaint();
8282
}
83+
84+
@Override
85+
protected String commandName() {
86+
return "construct dataLineSegment";
87+
}
88+
89+
@Override
90+
protected String commandDescription() {
91+
return "construct a line segment that flows data";
92+
}
93+
8394
});
8495
}
8596

src/actions/ConstructLineSegmentAction.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ public void redoAction() {
9494
panel.addPaintComponent(lineSegment);
9595
panel.repaint();
9696
}
97+
98+
@Override
99+
protected String commandName() {
100+
return "construct lineSegment";
101+
}
102+
103+
@Override
104+
protected String commandDescription() {
105+
return "[Deprecated] construct a generic line segment";
106+
}
97107
});
98108
panel.repaint();
99109
}

src/actions/InputDataForDataInputBoxAction.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,32 @@ public boolean canPerformAction() {
3131
public void performAction() {
3232
DataInputTextfieldPaintComponent inputComp = (DataInputTextfieldPaintComponent) panel.getSelectTool().getSelectedComponents().get(0);
3333
String s = JOptionPane.showInputDialog("Please specify the message to push to the data input");
34+
String original = inputComp.getDisplayingText();
3435
inputComp.inputData(s);
3536
// add action to undo redo manager
3637
SharedUndoRedoActionManager.getSharedInstance().pushUndoableAction(new UndoRedoableInterface() {
3738

3839
@Override
3940
public void undoAction() {
40-
inputComp.remove(panel);
41+
inputComp.inputData(original);
4142
panel.repaint();
4243
}
4344

4445
@Override
4546
public void redoAction() {
46-
panel.addPaintComponent(inputComp);
47+
inputComp.inputData(s);
4748
panel.repaint();
4849
}
50+
51+
@Override
52+
protected String commandName() {
53+
return "update inputBox";
54+
}
55+
56+
@Override
57+
protected String commandDescription() {
58+
return "Input a string into the text input box";
59+
}
4960
});
5061
panel.repaint();
5162
}

0 commit comments

Comments
 (0)