Skip to content

Commit

Permalink
++new layout
Browse files Browse the repository at this point in the history
++runtime search
  • Loading branch information
bopojoe committed Dec 30, 2017
1 parent de1a8d3 commit 533dcbb
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 41 deletions.
22 changes: 12 additions & 10 deletions src/project/Controller/ControllerSearchActor.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;

Expand All @@ -17,8 +18,13 @@ public class ControllerSearchActor {
private Label exit;

@FXML
private Button btn1, btn2, btn3, btn4;

private Button btn1;
@FXML
private Button btn2;
@FXML
private Button btn3;
@FXML
private TextField sName, sAge, sGender, sNationality;

@FXML
private void handleClose(MouseEvent event) {
Expand All @@ -40,19 +46,15 @@ private void handleButtonAction(ActionEvent event) throws IOException {
//get reference to the button's stage
stage=(Stage) btn1.getScene().getWindow();
//load up OTHER FXML document
root = FXMLLoader.load(getClass().getResource("../View/ActorName.fxml"));
root = FXMLLoader.load(getClass().getResource("../View/Name.fxml"));
}
else if(event.getSource()==btn2){
stage=(Stage) btn2.getScene().getWindow();
root = FXMLLoader.load(getClass().getResource("../View/ActorAge.fxml"));
}
else if(event.getSource().equals(btn3)){
stage=(Stage) btn3.getScene().getWindow();
root = FXMLLoader.load(getClass().getResource("../View/ActorGender.fxml"));
root = FXMLLoader.load(getClass().getResource("../View/Gender.fxml"));
}
else{
stage=(Stage) btn4.getScene().getWindow();
root = FXMLLoader.load(getClass().getResource("../View/ActorNationality.fxml"));
stage=(Stage) btn3.getScene().getWindow();
root = FXMLLoader.load(getClass().getResource("../View/Nationality.fxml"));
}
Scene scene = new Scene(root);
stage.setScene(scene);
Expand Down
18 changes: 17 additions & 1 deletion src/project/Controller/ControllerSearchMovie.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.event.ActionEvent;
import javafx.scene.control.TextField;
import javafx.scene.input.MouseEvent;
import javafx.scene.control.Button;
import javafx.stage.Stage;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import project.IODriver;

import java.io.IOException;

public class ControllerSearchMovie {
Expand All @@ -20,7 +23,10 @@ public class ControllerSearchMovie {
@FXML
private Button btn1;
@FXML
private Button btn2;
private Button btn2, btn7, btn8, btn9;
@FXML
private TextField sTitle, sYear, sRuntime;



@FXML
Expand Down Expand Up @@ -52,5 +58,15 @@ private void handleButtonAction(ActionEvent event) throws IOException{
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();

}

@FXML
private void handleButtonNine(ActionEvent event){
if(sRuntime!=null){
int runtime= Integer.parseInt(sRuntime.getText());
IODriver.listm(runtime);
}

}
}
2 changes: 1 addition & 1 deletion src/project/IODriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public void runt(){
listm(hash);

}
public void listm(int runtime){
public static void listm(int runtime){
int hash = runtime%MovieList.hashlist.length;
LinkedList<Movie> test = MovieList.hashlist[hash];
LinkedList.DataLink head = test.header;
Expand Down
24 changes: 12 additions & 12 deletions src/project/View/SearchActor.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@
<Font size="25.0" />
</font>
</Label>
<VBox layoutX="150.0" layoutY="128.0" prefHeight="200.0" prefWidth="140.0">
<VBox layoutX="150.0" layoutY="128.0" prefHeight="200.0" prefWidth="140.0">
<children>
<TextField promptText="Name" />
<TextField id="sName" fx:id="sName"promptText="Name" />
<Separator prefHeight="32.0" prefWidth="100.0" visible="false" />
<TextField prefWidth="100.0" promptText="Age" />
<TextField id="sAge" fx:id="sAge" prefWidth="100.0" promptText="Age" />
<Separator prefHeight="32.0" prefWidth="100.0" visible="false" />
<TextField promptText="Gender" />
<TextField id="sGender" fx:id="sGender" promptText="Gender" />
<Separator prefHeight="32.0" prefWidth="100.0" visible="false" />
<TextField promptText="Nationality" />
</children>
</VBox>
<VBox layoutX="434.0" layoutY="128.0" prefHeight="200.0" prefWidth="100.0">
<children>
<TextField id="sNationality" fx:id="sNationality"promptText="Nationality" />
</children>
</VBox>
<VBox layoutX="434.0" layoutY="128.0" prefHeight="200.0" prefWidth="100.0">
<children>
<Button fx:id="btn1" mnemonicParsing="false" text="Search" />
<Separator prefHeight="32.0" prefWidth="200.0" visible="false" />
<Button fx:id="btn2" prefHeight="25.0" prefWidth="52.0" text="Search" />
<Button fx:id="btn2" prefHeight="25.0" prefWidth="52.0" text="Search" />
<Separator prefHeight="32.0" prefWidth="200.0" visible="false" />
<Button fx:id="btn3" text="Search" />
<Button fx:id="btn3" text="Search" />
<Separator prefHeight="32.0" prefWidth="200.0" visible="false" />
<Button fx:id="btn4" contentDisplay="CENTER" text="Search" />
<Button fx:id="btn4" contentDisplay="CENTER" text="Search" />
</children>
</VBox>
</children>
Expand Down
30 changes: 13 additions & 17 deletions src/project/View/SearchMovie.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,22 @@
<Font size="25.0" />
</font>
</Label>
<VBox layoutX="150.0" layoutY="128.0" prefHeight="200.0" prefWidth="100.0">
<children>
<TextField prefHeight="10.0" prefWidth="48.0" promptText="Title" />
<Separator prefHeight="32.0" prefWidth="200.0" visible="false" />
<TextField promptText="Year" />
<Separator prefHeight="32.0" prefWidth="200.0" visible="false" />
<TextField promptText="Runtime" />
<Separator prefHeight="32.0" prefWidth="200.0" visible="false" />
<TextField promptText="Actor" />
</children>
</VBox>
<VBox layoutX="443.0" layoutY="128.0" prefHeight="200.0" prefWidth="100.0">
<VBox layoutX="150.0" layoutY="128.0" prefHeight="200.0" prefWidth="140.0">
<children>
<Button prefHeight="25.0" prefWidth="115.0" text="Search" />
<Separator prefHeight="32.0" prefWidth="200.0" visible="false" />
<Button prefHeight="25.0" prefWidth="105.0" text="Search" />
<TextField id="sTitle" fx:id="sTitle" promptText="Title" />
<Separator prefHeight="32.0" prefWidth="100.0" visible="false" />
<TextField id="sYear" fx:id="sYear" prefWidth="100.0" promptText="Year" />
<Separator prefHeight="32.0" prefWidth="100.0" visible="false" />
<TextField id="sRuntime" fx:id="sRuntime" promptText="Run Time" />
</children>
</VBox>
<VBox layoutX="434.0" layoutY="128.0" prefHeight="200.0" prefWidth="100.0">
<children>
<Button fx:id="btn7" mnemonicParsing="false" text="Search" />
<Separator prefHeight="32.0" prefWidth="200.0" visible="false" />
<Button prefHeight="25.0" prefWidth="114.0" text="Search" />
<Button fx:id="btn8" prefHeight="25.0" prefWidth="52.0" text="Search" />
<Separator prefHeight="32.0" prefWidth="200.0" visible="false" />
<Button prefHeight="25.0" prefWidth="132.0" text="Search" />
<Button fx:id="btn9" onAction="#handleButtonNine" text="Search" />
</children>
</VBox>
</children>
Expand Down

0 comments on commit 533dcbb

Please sign in to comment.