Skip to content

Commit

Permalink
Updated software
Browse files Browse the repository at this point in the history
  • Loading branch information
ishanashastri committed Jun 9, 2017
1 parent 226e5aa commit 7e72889
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 35 deletions.
27 changes: 10 additions & 17 deletions src/JavaFXGUI/EnterInfoTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,13 @@ public EnterInfoTab(MenuTabPane par, EnterStudentTab prev, String title,
int page = -1;
String stringData = "";
while(file.hasNext()){

stringData = file.nextLine();
System.out.println(stringData);
infoOptionSelect.removeChoiceBox();
System.out.println(stringData+ ", " + v + ", " + version);

if (stringData.equals("+++")){
v ++;
infoOptionSelect.removeChoiceBox();
v++;
}
else if (stringData.equals("++")&& version == v){
else if (stringData.equals("++") && version == v){
page++;
stringData = file.nextLine();
if (stringData.contains("Submit Button")){
Expand All @@ -107,37 +105,32 @@ else if (stringData.equals("++")&& version == v){
else{
infoOptionSelect.addPage(stringData);
}
infoOptionSelect.removeChoiceBox();
}
else if (stringData.equals("++++")){
v++;
stringData=file.nextLine();
if (stringData.contains("Submit Button")){
String[] stringDatas = stringData.split(", ");
infoOptionSelect.addSubmitButton(page);
infoOptionSelect.addPage(stringDatas[1]);

String title1 = stringDatas[1];
ArrayList<String> data1 = new ArrayList<String>();
ArrayList<String> data = new ArrayList<String>();
stringData = file.nextLine();
while(!stringData.equals("Title 2")){
data1.add(stringData);
data.add(stringData);
stringData = file.nextLine();
}
String title2 = file.nextLine();
stringData = file.nextLine();
ArrayList<String> data2 = new ArrayList<String>();
while(!stringData.equals("End")){
data2.add(stringData);
stringData=file.nextLine();
}
infoOptionSelect.splitScreen(page+1, title1, title2, data1, data2, infoOptionSelect);
}
infoOptionSelect.removeChoiceBox();
}
infoOptionSelect.splitScreen(page+1, data);
}//infoOptionSelect.removeChoiceBox();

}
else if (version == v){
infoOptionSelect.addButton(page, stringData, stringData);
infoOptionSelect.removeChoiceBox();
}
}
file.close();
Expand Down
34 changes: 17 additions & 17 deletions src/JavaFXGUI/OptionSelect.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,23 +210,21 @@ else if (buttonList.get(page).size() == 1){
buttonVBox.getChildren().add(optionHBoxArray.get(page));

}
public void splitScreen(int page, String title1, String title2, ArrayList<String> data1, ArrayList<String> data2, OptionSelect o){
public void splitScreen(int page, ArrayList<String> data){
ArrayList<OptionButton> left = new ArrayList<OptionButton>();
for(int i =0;i<data1.size()-1;i++){
OptionButton opt = new OptionButton(data1.get(i), data1.get(i), page);
for(int i =0;i<data.size()-1;i++){
OptionButton opt = new OptionButton(data.get(i), data.get(i), page);
left.add(opt);
}
buttonList.get(page).addAll(left) ;
option.add("");

buttonVBox.getChildren().remove(optionHBoxArray.get(page));

updateState(0);
addChoiceBox(false,o);
addChoiceBox(false);
buttonVBox.getChildren().remove(optionHBoxArray.get(page));

System.out.println("split screen");
}
public void addChoiceBox(boolean rem, OptionSelect o){
public void addChoiceBox(boolean rem){
RadioButton h = new RadioButton("Health Room");
h.getStyleClass().add("RadioButton");
RadioButton p = new RadioButton("Parent");
Expand All @@ -246,25 +244,27 @@ public void addChoiceBox(boolean rem, OptionSelect o){
submitButton.requestFocus();
});

HBox hb = new HBox(70);
HBox hb = new HBox(60);
hb.getChildren().addAll(l,h,p);
hb.setAlignment(Pos.CENTER);

buttonVBox.getChildren().add(hb);
System.out.println("called1");
System.out.println("add choices");
// System.out.println(buttonVBox.getChildren().contains(hb));
submitButton.requestFocus();
if(rem){
removeChoiceBox();
System.out.println(buttonVBox.getChildren().contains(hb));
buttonVBox.getChildren().remove(hb);
System.out.println("removed " + buttonVBox.getChildren().contains(hb));
}
System.out.println(buttonVBox.getChildren().contains(hb));
}
public void removeChoiceBox(){
// if(buttonVBox.getChildren().contains(optionHBoxArray)){
System.out.println("before: " + buttonVBox.getChildren().contains(hb));
if(buttonVBox.getChildren().contains(hb)){
buttonVBox.getChildren().remove(hb);
// }
System.out.println("remove: " +buttonVBox.getChildren().contains(hb));
System.out.println("called");
}
System.out.println("remove choices");
System.out.println("removed: " + buttonVBox.getChildren().contains(hb));
}
/**
* This is called by the ButtonHandler to add information to the Data.
Expand Down
2 changes: 1 addition & 1 deletion src/data/email.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2
[email protected]
[email protected]
[email protected]
1 change: 1 addition & 0 deletions src/data/options.sip
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Unexcused
Religious Reason
Transportation
College Visit
+++
++++
Submit Button, Enter reason for leaving:
Sick
Expand Down

0 comments on commit 7e72889

Please sign in to comment.