Skip to content

Commit 4f41aec

Browse files
authored
Merge pull request #51 from UCSDOalads/addCDEFbykaic
Add Undo Redo UI
2 parents 820f082 + 7498a98 commit 4f41aec

26 files changed

+457
-175
lines changed

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/AddInstanceOperationAction.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ public void performAction() {
4646
cons[desiaredConstructorIndex], panel.getWidth() / 2,
4747
panel.getHeight() / 2);
4848
panel.addPaintComponent(consComp);
49-
// add action to undo redo manager
50-
SharedUndoRedoActionManager.getSharedInstance().pushUndoableAction(new UndoRedoableInterface() {
51-
52-
@Override
53-
public void undoAction() {
54-
consComp.remove(panel);
55-
panel.repaint();
56-
}
57-
58-
@Override
59-
public void redoAction() {
60-
panel.addPaintComponent(consComp);
61-
panel.repaint();
62-
}
63-
});
49+
// // add action to undo redo manager
50+
// SharedUndoRedoActionManager.getSharedInstance().pushUndoableAction(new UndoRedoableInterface() {
51+
//
52+
// @Override
53+
// public void undoAction() {
54+
// consComp.remove(panel);
55+
// panel.repaint();
56+
// }
57+
//
58+
// @Override
59+
// public void redoAction() {
60+
// panel.addPaintComponent(consComp);
61+
// panel.repaint();
62+
// }
63+
// });
6464
panel.repaint();
6565
}
6666

src/actions/AddInteractiveConstructorAction.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@ public void performAction() {
4444
panel.getHeight() / 2);
4545
panel.addPaintComponent(consComp);
4646
// add action to undo redo manager
47-
SharedUndoRedoActionManager.getSharedInstance().pushUndoableAction(new UndoRedoableInterface() {
48-
49-
@Override
50-
public void undoAction() {
51-
consComp.remove(panel);
52-
panel.repaint();
53-
}
54-
55-
@Override
56-
public void redoAction() {
57-
panel.addPaintComponent(consComp);
58-
panel.repaint();
59-
}
60-
});
47+
// SharedUndoRedoActionManager.getSharedInstance().pushUndoableAction(new UndoRedoableInterface() {
48+
//
49+
// @Override
50+
// public void undoAction() {
51+
// consComp.remove(panel);
52+
// panel.repaint();
53+
// }
54+
//
55+
// @Override
56+
// public void redoAction() {
57+
// panel.addPaintComponent(consComp);
58+
// panel.repaint();
59+
// }
60+
// });
6161
panel.repaint();
6262
}
6363

src/actions/AddInteractiveJavaMethodComponentAction.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,20 @@ public void performAction() {
5252
panel.getHeight() / 2);
5353
panel.addPaintComponent(methodComp);
5454
// add action to undo redo manager
55-
SharedUndoRedoActionManager.getSharedInstance().pushUndoableAction(new UndoRedoableInterface() {
56-
57-
@Override
58-
public void undoAction() {
59-
methodComp.remove(panel);
60-
panel.repaint();
61-
}
62-
63-
@Override
64-
public void redoAction() {
65-
panel.addPaintComponent(methodComp);
66-
panel.repaint();
67-
}
68-
});
55+
// SharedUndoRedoActionManager.getSharedInstance().pushUndoableAction(new UndoRedoableInterface() {
56+
//
57+
// @Override
58+
// public void undoAction() {
59+
// methodComp.remove(panel);
60+
// panel.repaint();
61+
// }
62+
//
63+
// @Override
64+
// public void redoAction() {
65+
// panel.addPaintComponent(methodComp);
66+
// panel.repaint();
67+
// }
68+
// });
6969
panel.repaint();
7070
}
7171
public String getMethodsSelectionUI(Method[] methods) {

src/actions/AddLazyJavaClassAction.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void didFinishInput(Class input) {
3636
panel.addPaintComponent(comp);
3737
// add action to undo redo manager
3838
SharedUndoRedoActionManager.getSharedInstance().pushUndoableAction(new UndoRedoableInterface() {
39-
39+
4040
@Override
4141
public void undoAction() {
4242
comp.remove(panel);
@@ -48,6 +48,16 @@ public void redoAction() {
4848
panel.addPaintComponent(comp);
4949
panel.repaint();
5050
}
51+
52+
@Override
53+
protected String commandName() {
54+
return "add lazy javaClass";
55+
}
56+
57+
@Override
58+
protected String commandDescription() {
59+
return "add a java class component";
60+
}
5161
});
5262
panel.repaint();
5363
}

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
}

0 commit comments

Comments
 (0)