Skip to content

Commit 768a50b

Browse files
committed
Update to develop and finally fixed the String class problem
2 parents f97217a + 08602ca commit 768a50b

41 files changed

Lines changed: 901 additions & 433 deletions

Some content is hidden

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

.classpath

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
33
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="src" path="images"/>
45
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
56
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
67
<classpathentry kind="output" path="bin"/>

?/.java/fonts/1.8.0_121/fcinfo-1-its-cseb260-18.ucsd.edu-null-null-en.properties renamed to ?/.java/fonts/1.8.0_121/fcinfo-1-its-cseb260-26.ucsd.edu-null-null-en.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#JDK Font Configuration Generated File: *Do Not Edit*
2-
#Sat Apr 15 14:11:13 PDT 2017
2+
#Sat May 20 13:42:34 PDT 2017
33
sansserif.0.27.family=Jomolhari
44
sansserif.1.11.file=/usr/share/fonts/lohit-gujarati/Lohit-Gujarati.ttf
55
sansserif.2.11.family=Lohit Punjabi
@@ -593,7 +593,7 @@ serif.0.26.file=/usr/share/fonts/un-core/UnDotum.ttf
593593
serif.2.10.file=/usr/share/fonts/lohit-kannada/Lohit-Kannada.ttf
594594
sansserif.3.30.file=/usr/share/fonts/tibetan-machine-uni/TibMachUni-1.901b.ttf
595595
sansserif.3.5.family=Waree
596-
cachedir.1=/home/linux/ieng6/cs30x/cs30xsd/.fontconfig
596+
cachedir.1=/home/linux/ieng6/cs30x/cs30xjk/.fontconfig
597597
monospaced.3.34.family=Jomolhari
598598
cachedir.0=/var/cache/fontconfig
599599
monospaced.2.25.family=PakTypeNaqsh

images/arrow.png

20 KB
Loading

images/arrowselected.png

20.2 KB
Loading

images/dot.png

20.2 KB
Loading

images/dotselected.png

20.4 KB
Loading

images/line.png

19.3 KB
Loading

images/lineselected.png

19.8 KB
Loading

src/actions/AddInstanceMethodAction.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,20 @@ public void performAction() {
4242
getSelectedComponents().get(0);
4343
Method[] methods = insComp.getDisplayingClass().getMethods();
4444

45-
int desiaredConstructorIndex = Integer
46-
.parseInt(JOptionPane.showInputDialog(
45+
String desiaredConstructorIndex = JOptionPane.showInputDialog(
4746
"Please enter the index of the constructor you would like to use: \n\n\n"
48-
+ getMethodsSelectionUI(methods)));
49-
AddInstanceMethodGlobalAction assiciatedAction =
50-
(AddInstanceMethodGlobalAction) ActionName.ADD_INSTANCE_METHOD_ACTION
51-
.getAssiciatedAction();
52-
assiciatedAction.setInsComp(insComp);
53-
assiciatedAction.setMethodToSet(methods[desiaredConstructorIndex]);
54-
GlobalPaintActionExecuter.getSharedInstance().execute(assiciatedAction, panel);
47+
+ getMethodsSelectionUI(methods));
48+
49+
//call DialogInputChecker to check input
50+
DialogInputChecker inputChecker = new DialogInputChecker();
51+
if(inputChecker.isValidNumber(desiaredConstructorIndex, 0, methods.length -1)){
52+
AddInstanceMethodGlobalAction assiciatedAction =
53+
(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);
58+
}
5559
}
5660

5761
@Override

src/actions/AddInstanceOperationAction.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,18 @@ public void performAction() {
3737
.getSelectedComponents().get(0);
3838
Constructor[] cons = comp.getDisplayingClass().getConstructors();
3939

40-
int desiaredConstructorIndex = Integer
41-
.parseInt(JOptionPane.showInputDialog(
40+
String desiaredConstructorIndex = JOptionPane.showInputDialog(
4241
"Please enter the index of the constructor you would like to use: \n\n\n"
43-
+ getConstructorsSelectionUI(cons)));
44-
45-
AddInstanceOperationGlobalAction assiciatedAction =
46-
(AddInstanceOperationGlobalAction) ActionName.ADD_INSTANCE_OPERATION_ACTION
47-
.getAssiciatedAction();
48-
assiciatedAction.setConstructorToSet(cons[desiaredConstructorIndex]);
49-
GlobalPaintActionExecuter.getSharedInstance().execute(assiciatedAction, panel);
42+
+ getConstructorsSelectionUI(cons));
43+
//call inputChecker to check if input is valid
44+
DialogInputChecker inputChecker = new DialogInputChecker();
45+
if(inputChecker.isValidNumber(desiaredConstructorIndex, 0, cons.length -1)){
46+
AddInstanceOperationGlobalAction assiciatedAction =
47+
(AddInstanceOperationGlobalAction) ActionName.ADD_INSTANCE_OPERATION_ACTION
48+
.getAssiciatedAction();
49+
assiciatedAction.setConstructorToSet(cons[Integer.parseInt(desiaredConstructorIndex)]);
50+
GlobalPaintActionExecuter.getSharedInstance().execute(assiciatedAction, panel);
51+
}
5052

5153
}
5254

0 commit comments

Comments
 (0)