package pro.simpleproject.core.primary;

import javafx.event.ActionEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
import pro.simpleproject.core.entry.EntryPaneBuilder;
import pro.simpleproject.core.extra.ExtraContactPaneBuilder;
import pro.simpleproject.core.intra.IntraContactPaneBuilder;

public class PrimaryController {

	public BorderPane pane_base;
	public Pane pane_top;
	public final double[] d = new double[2];
	public Pane pane_system;

	public void initial(MouseEvent e) {
		d[0] = e.getScreenX() - pane_top.getScene().getWindow().getX();
		d[1] = e.getScreenY() - pane_top.getScene().getWindow().getY();
	}

	public void reposition(MouseEvent e) {
		pane_top.getScene().getWindow().setX(e.getScreenX() - d[0]);
		pane_top.getScene().getWindow().setY(e.getScreenY() - d[1]);
		Stage stage = (Stage) pane_top.getScene().getWindow();
		if (stage.isMaximized()) {
			stage.setMaximized(false);
		}
	}

	public void close(ActionEvent e) {
		PrimaryService.close();
	}

	public void maximize(ActionEvent e) {
		Stage stage = (Stage) pane_system.getScene().getWindow();
		if (stage.isMaximized()) {
			stage.setMaximized(false);
		} else {
			stage.setMaximized(true);
		}
	}

	public void minimize(ActionEvent e) {
		((Stage) pane_system.getScene().getWindow()).setIconified(true);
	}

	public void minimize2(ActionEvent e) {
		pane_system.getScene().getWindow().hide();
	}

	public void open1() {
		pane_base.setLeft(IntraContactPaneBuilder.get());
		pane_base.setCenter(null);
		pane_base.setRight(null);
	}

	public void open2() {
		if (PrimaryService.entry()) {
			pane_base.setCenter(EntryPaneBuilder.get());
			pane_base.setLeft(null);
		} else {
			pane_base.setLeft(ExtraContactPaneBuilder.get());
			pane_base.setCenter(null);
		}
	}

}

@@ -52,63 +52,28 @@
 afx.
-event.ActionEvent;%0Aimport javafx.scene.input.MouseEvent
+scene.control.Button
 ;%0Aim
@@ -146,35 +146,8 @@
 ne;%0A
-import javafx.stage.Stage;%0A
 impo
@@ -200,69 +200,8 @@
 er;%0A
-import pro.simpleproject.core.extra.ExtraContactPaneBuilder;%0A
 impo
@@ -233,31 +233,24 @@
 .intra.Intra
-Contact
 PaneBuilder;
@@ -350,1001 +350,57 @@
 lic 
-final double%5B%5D d = new double%5B2%5D;%0A%09public Pane pane_system;%0A%0A%09public void initial(MouseEvent e) %7B%0A%09%09d%5B0%5D = e.getScreenX() - pane_top.getScene().getWindow().getX();%0A%09%09d%5B1%5D = e.getScreenY() - pane_top.getScene().getWindow().getY();%0A%09%7D%0A%0A%09public void reposition(MouseEvent e) %7B%0A%09%09pane_top.getScene().getWindow().setX(e.getScreenX() - d%5B0%5D);%0A%09%09pane_top.getScene().getWindow().setY(e.getScreenY() - d%5B1%5D);%0A%09%09Stage stage = (Stage) pane_top.getScene().getWindow();%0A%09%09if (stage.isMaximized()) %7B%0A%09%09%09stage.setMaximized(false);%0A%09%09%7D%0A%09%7D%0A%0A%09public void close(ActionEvent e) %7B%0A%09%09PrimaryService.close();%0A%09%7D%0A%0A%09public void maximize(ActionEvent e) %7B%0A%09%09Stage stage = (Stage) pane_system.getScene().getWindow();%0A%09%09if (stage.isMaximized()) %7B%0A%09%09%09stage.setMaximized(false);%0A%09%09%7D else %7B%0A%09%09%09stage.setMaximized(true);%0A%09%09%7D%0A%09%7D%0A%0A%09public void minimize(ActionEvent e) %7B%0A%09%09((Stage) pane_system.getScene().getWindow()).setIconified(true);%0A%09%7D%0A%0A%09public void minimize2(ActionEvent e) %7B%0A%09%09pane_system.getScene().getWindow().hide();%0A%09%7D
+Button button_open1;%0A%09public Button button_open2;
 %0A%0A%09p
@@ -445,23 +445,16 @@
 ft(Intra
-Contact
 PaneBuil
@@ -456,24 +456,31 @@
 eBuilder.get
+Contact
 ());%0A%09%09pane_
@@ -700,37 +700,12 @@
 eft(
-ExtraContactPaneBuilder.get()
+null
 );%0A%09

Update PrimaryController.java