|
@@ -4,10 +4,7 @@ import javafx.event.EventHandler;
|
|
|
import javafx.fxml.FXML;
|
|
|
import javafx.fxml.FXMLLoader;
|
|
|
import javafx.scene.Node;
|
|
|
-import javafx.scene.control.Button;
|
|
|
-import javafx.scene.control.ScrollPane;
|
|
|
-import javafx.scene.control.TextArea;
|
|
|
-import javafx.scene.control.TextField;
|
|
|
+import javafx.scene.control.*;
|
|
|
import javafx.scene.input.MouseEvent;
|
|
|
import javafx.scene.layout.AnchorPane;
|
|
|
import javafx.scene.layout.HBox;
|
|
@@ -61,6 +58,20 @@ public class AddMovieController extends Controller {
|
|
|
@FXML
|
|
|
TextField rateTextBox;
|
|
|
|
|
|
+ @FXML
|
|
|
+ Label actorLabel;
|
|
|
+ @FXML
|
|
|
+ Pane actorUnderline;
|
|
|
+ @FXML
|
|
|
+ Label roleLabel;
|
|
|
+ @FXML
|
|
|
+ Pane roleUnderline;
|
|
|
+ @FXML
|
|
|
+ Label buttonRowAdd;
|
|
|
+ @FXML
|
|
|
+ Label buttonRowRem;
|
|
|
+
|
|
|
+
|
|
|
Object caller;
|
|
|
double xOffset;
|
|
|
double yOffset;
|
|
@@ -153,13 +164,32 @@ public class AddMovieController extends Controller {
|
|
|
//row.setPrefWidth(actorsGrid.getWidth());
|
|
|
actorsGridAncor.getChildren().add(row);
|
|
|
actorsGrid.setMinHeight(actorsGrid.getMinHeight() + 35);
|
|
|
- //actorsGrid.getChildren().add(row);
|
|
|
+ if ((long) actorsGridAncor.getChildren().size() > 1)
|
|
|
+ moveFloatingElements(35);
|
|
|
} catch (IOException ex) {
|
|
|
ex.printStackTrace();
|
|
|
}
|
|
|
- //System.out.println("LoginForm closed");
|
|
|
}
|
|
|
|
|
|
+ public void removeActor() {
|
|
|
+ int count = (actorsGridAncor.getChildren().size());
|
|
|
+ if (count > 1) {
|
|
|
+ actorsGridAncor.getChildren().remove(count - 1);
|
|
|
+ actorsGrid.setMinHeight(actorsGrid.getMinHeight() - 35);
|
|
|
+ moveFloatingElements(-35);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void moveFloatingElements(int space) {
|
|
|
+ AnchorPane.setTopAnchor(actorLabel, actorLabel.getLayoutY() + space);
|
|
|
+ AnchorPane.setTopAnchor(actorUnderline, actorUnderline.getLayoutY() + space);
|
|
|
+ AnchorPane.setTopAnchor(roleLabel, roleLabel.getLayoutY() + space);
|
|
|
+ AnchorPane.setTopAnchor(roleUnderline, roleUnderline.getLayoutY() + space);
|
|
|
+ AnchorPane.setTopAnchor(buttonRowAdd, buttonRowAdd.getLayoutY() + space);
|
|
|
+ AnchorPane.setTopAnchor(buttonRowRem, buttonRowRem.getLayoutY() + space);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
public void executeForm() {
|
|
|
//read all textboxes
|
|
|
Movie NewMovie = new Movie();
|