Skip to content

Commit 64f2a5f

Browse files
author
Yidong Luo
authored
Merge pull request #131 from UCSDOalads/funcGroup
Func group
2 parents 59cf778 + 587db3c commit 64f2a5f

41 files changed

Lines changed: 215 additions & 187 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/actions/AddDataDisplayBoxAction.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ public boolean canPerformAction() {
2727
@Override
2828
public void performAction() {
2929

30-
AddDataDisplayBoxGlobalAction assiciatedAction = (AddDataDisplayBoxGlobalAction) ActionName.ADD_DATA_DISPLAY_BOX
31-
.getAssiciatedAction();
32-
assiciatedAction.setDisplayString("Data Display");
33-
assiciatedAction.setX(panel.getWidth() / 2);
34-
assiciatedAction.setY(panel.getHeight() / 2);
35-
GlobalPaintActionExecuter.getSharedInstance().execute(assiciatedAction,
30+
AddDataDisplayBoxGlobalAction associatedAction = (AddDataDisplayBoxGlobalAction) ActionName.ADD_DATA_DISPLAY_BOX
31+
.getAssociatedAction();
32+
associatedAction.setDisplayString("Data Display");
33+
associatedAction.setX(panel.getWidth() / 2);
34+
associatedAction.setY(panel.getHeight() / 2);
35+
GlobalPaintActionExecuter.getSharedInstance().execute(associatedAction,
3636
panel);
3737

3838
}

src/actions/AddHaskellComponent.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ public boolean canPerformAction() {
2222
@Override
2323
public void performAction() {
2424
String expr = JOptionPane.showInputDialog("Please enter the haskell expression");
25-
AddHaskellComponentGlobalAction assiciatedAction = (AddHaskellComponentGlobalAction) ActionName.ADD_HASKELL_EXPRESSION_COMPONENT
26-
.getAssiciatedAction();
27-
assiciatedAction.setHaskellExpression(expr);
28-
GlobalPaintActionExecuter.getSharedInstance().execute(assiciatedAction, panel);
25+
AddHaskellComponentGlobalAction associatedAction = (AddHaskellComponentGlobalAction) ActionName.ADD_HASKELL_EXPRESSION_COMPONENT
26+
.getAssociatedAction();
27+
associatedAction.setHaskellExpression(expr);
28+
GlobalPaintActionExecuter.getSharedInstance().execute(associatedAction, panel);
2929

3030
}
3131

src/actions/AddHaskellEvaluatorComponentAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public boolean canPerformAction() {
1919

2020
@Override
2121
public void performAction() {
22-
AddHaskellEvaluatorComponentGlobalAction assiciatedAction = (AddHaskellEvaluatorComponentGlobalAction) ActionName.ADD_HASKELL_EVALUATOR_COMPONENT
23-
.getAssiciatedAction();
24-
GlobalPaintActionExecuter.getSharedInstance().execute(assiciatedAction,
22+
AddHaskellEvaluatorComponentGlobalAction associatedAction = (AddHaskellEvaluatorComponentGlobalAction) ActionName.ADD_HASKELL_EVALUATOR_COMPONENT
23+
.getAssociatedAction();
24+
GlobalPaintActionExecuter.getSharedInstance().execute(associatedAction,
2525
panel);
2626
}
2727

src/actions/AddInstanceMethodAction.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ public void performAction() {
4949
//call DialogInputChecker to check input
5050
DialogInputChecker inputChecker = new DialogInputChecker();
5151
if(inputChecker.isValidNumber(desiaredConstructorIndex, 0, methods.length -1)){
52-
AddInstanceMethodGlobalAction assiciatedAction =
52+
AddInstanceMethodGlobalAction associatedAction =
5353
(AddInstanceMethodGlobalAction) ActionName.ADD_INSTANCE_METHOD_ACTION
54-
.getAssiciatedAction();
55-
assiciatedAction.setInsComp(insComp);
56-
assiciatedAction.setMethodToSet(methods[Integer.parseInt(desiaredConstructorIndex)]);
57-
GlobalPaintActionExecuter.getSharedInstance().execute(assiciatedAction, panel);
54+
.getAssociatedAction();
55+
associatedAction.setInsComp(insComp);
56+
associatedAction.setMethodToSet(methods[Integer.parseInt(desiaredConstructorIndex)]);
57+
GlobalPaintActionExecuter.getSharedInstance().execute(associatedAction, panel);
5858
}
5959
}
6060

src/actions/AddInstanceOperationAction.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ public void performAction() {
4343
//call inputChecker to check if input is valid
4444
DialogInputChecker inputChecker = new DialogInputChecker();
4545
if(inputChecker.isValidNumber(desiaredConstructorIndex, 0, cons.length -1)){
46-
AddInstanceOperationGlobalAction assiciatedAction =
46+
AddInstanceOperationGlobalAction associatedAction =
4747
(AddInstanceOperationGlobalAction) ActionName.ADD_INSTANCE_OPERATION_ACTION
48-
.getAssiciatedAction();
49-
assiciatedAction.setConstructorToSet(cons[Integer.parseInt(desiaredConstructorIndex)]);
50-
GlobalPaintActionExecuter.getSharedInstance().execute(assiciatedAction, panel);
48+
.getAssociatedAction();
49+
associatedAction.setConstructorToSet(cons[Integer.parseInt(desiaredConstructorIndex)]);
50+
GlobalPaintActionExecuter.getSharedInstance().execute(associatedAction, panel);
5151
}
5252

5353
}

src/actions/AddLazyJavaClassAction.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ public void performAction() {
2626

2727
@Override
2828
public void didFinishInput(Class input) {
29-
AddLazyJavaClassGlobalAction assiciatedAction = (AddLazyJavaClassGlobalAction) ActionName.ADD_LAZY_JAVA_CLASS_ACTION
30-
.getAssiciatedAction();
31-
assiciatedAction.setClassToCreate(input);
32-
assiciatedAction.setCoord(panel.getWidth() / 2,
29+
AddLazyJavaClassGlobalAction associatedAction = (AddLazyJavaClassGlobalAction) ActionName.ADD_LAZY_JAVA_CLASS_ACTION
30+
.getAssociatedAction();
31+
associatedAction.setClassToCreate(input);
32+
associatedAction.setCoord(panel.getWidth() / 2,
3333
panel.getHeight() / 2);
3434
GlobalPaintActionExecuter.getSharedInstance().execute(
35-
assiciatedAction, panel);
35+
associatedAction, panel);
3636

3737
}
3838
});

src/actions/AddLazyJavaConstructorAction.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ public void performAction() {
3333
ClassPaintComponent comp = (ClassPaintComponent) panel.getSelectTool()
3434
.getSelectedComponents().get(0);
3535

36-
AddLazyJavaConstructorGlobalAction assiciatedAction = (AddLazyJavaConstructorGlobalAction) ActionName.ADD_LAZY_JAVA_CONSTRUCTOR_ACTION
37-
.getAssiciatedAction();
38-
assiciatedAction.setComponent(comp);
36+
AddLazyJavaConstructorGlobalAction associatedAction = (AddLazyJavaConstructorGlobalAction) ActionName.ADD_LAZY_JAVA_CONSTRUCTOR_ACTION
37+
.getAssociatedAction();
38+
associatedAction.setComponent(comp);
3939
String desiaredConstructorIndex = JOptionPane
4040
.showInputDialog("Please enter the index of the constructor you would like to use: \n\n\n"
41-
+ getConstructorsSelectionUI(assiciatedAction
41+
+ getConstructorsSelectionUI(associatedAction
4242
.getConstructor()));
4343
//call DialogInputChecker to check input
4444
DialogInputChecker inputChecker = new DialogInputChecker();
4545
if(inputChecker.isValidNumber(desiaredConstructorIndex)){
46-
assiciatedAction.setConstructorIndex(Integer.parseInt(desiaredConstructorIndex));
47-
assiciatedAction.setCoord(panel.getWidth() / 2, panel.getHeight() / 2);
48-
GlobalPaintActionExecuter.getSharedInstance().execute(assiciatedAction,
46+
associatedAction.setConstructorIndex(Integer.parseInt(desiaredConstructorIndex));
47+
associatedAction.setCoord(panel.getWidth() / 2, panel.getHeight() / 2);
48+
GlobalPaintActionExecuter.getSharedInstance().execute(associatedAction,
4949
panel);
5050
}
5151
}

src/actions/AddLazyJavaFieldsComponentAction.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ public void performAction() {
3131
ClassPaintComponent comp = (ClassPaintComponent) panel.getSelectTool()
3232
.getSelectedComponents().get(0);
3333

34-
AddLazyJavaFieldsComponentGlobalAction assiciatedAction = (AddLazyJavaFieldsComponentGlobalAction) ActionName.ADD_LAZY_JAVA_FIELDS_ACTION
35-
.getAssiciatedAction();
36-
assiciatedAction.setComponent(comp);
37-
assiciatedAction.setCoord(panel.getWidth() / 2, panel.getHeight() / 2);
38-
GlobalPaintActionExecuter.getSharedInstance().execute(assiciatedAction,
34+
AddLazyJavaFieldsComponentGlobalAction associatedAction = (AddLazyJavaFieldsComponentGlobalAction) ActionName.ADD_LAZY_JAVA_FIELDS_ACTION
35+
.getAssociatedAction();
36+
associatedAction.setComponent(comp);
37+
associatedAction.setCoord(panel.getWidth() / 2, panel.getHeight() / 2);
38+
GlobalPaintActionExecuter.getSharedInstance().execute(associatedAction,
3939
panel);
4040
}
4141

src/actions/AddLazyJavaMethodComponentAction.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ public void performAction() {
5151
//call DialogInputChecker to check input
5252
DialogInputChecker inputChecker = new DialogInputChecker();
5353
if(inputChecker.isValidNumber(desiaredConstructorIndex, 0, methods.length -1)){
54-
AddLazyJavaMethodComponentGlobalAction assiciatedAction
55-
= (AddLazyJavaMethodComponentGlobalAction) ActionName.ADD_LAZY_JAVA_METHOD_ACTION.getAssiciatedAction();
56-
assiciatedAction.setMethodComponent(comp);
57-
assiciatedAction.setMethod(comp.getDisplayingClass().getMethods()[Integer.parseInt(desiaredConstructorIndex)]);
58-
GlobalPaintActionExecuter.getSharedInstance().execute(assiciatedAction, panel);
54+
AddLazyJavaMethodComponentGlobalAction associatedAction
55+
= (AddLazyJavaMethodComponentGlobalAction) ActionName.ADD_LAZY_JAVA_METHOD_ACTION.getAssociatedAction();
56+
associatedAction.setMethodComponent(comp);
57+
associatedAction.setMethod(comp.getDisplayingClass().getMethods()[Integer.parseInt(desiaredConstructorIndex)]);
58+
GlobalPaintActionExecuter.getSharedInstance().execute(associatedAction, panel);
5959
}
6060
}
6161

src/actions/AddTextBoxAction.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ public void performAction() {
4848
//call DialogInputChecker to check input
4949
DialogInputChecker inputChecker = new DialogInputChecker();
5050
if(!inputChecker.isEmpty(s)){
51-
AddTextBoxGlobalAction assiciatedAction = (AddTextBoxGlobalAction) ActionName.ADD_TEXT_BOX_ACTION
52-
.getAssiciatedAction();
53-
assiciatedAction.setDisplayString(s);
54-
assiciatedAction.setX(panel.getWidth() / 2);
55-
assiciatedAction.setY(panel.getHeight() / 2);
56-
GlobalPaintActionExecuter.getSharedInstance().execute(assiciatedAction,
51+
AddTextBoxGlobalAction associatedAction = (AddTextBoxGlobalAction) ActionName.ADD_TEXT_BOX_ACTION
52+
.getAssociatedAction();
53+
associatedAction.setDisplayString(s);
54+
associatedAction.setX(panel.getWidth() / 2);
55+
associatedAction.setY(panel.getHeight() / 2);
56+
GlobalPaintActionExecuter.getSharedInstance().execute(associatedAction,
5757
panel);
5858
}
5959
}

0 commit comments

Comments
 (0)