mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2025-01-19 00:26:27 +01:00
change gearthcontroller
This commit is contained in:
parent
2e323c30f9
commit
e093297ed2
@ -15,13 +15,16 @@ import gearth.ui.scheduler.Scheduler;
|
|||||||
import gearth.ui.extra.Extra;
|
import gearth.ui.extra.Extra;
|
||||||
import gearth.ui.tools.Tools;
|
import gearth.ui.tools.Tools;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class GEarthController {
|
public class GEarthController {
|
||||||
|
|
||||||
public Tab tab_Logger;
|
public Tab tab_Logger;
|
||||||
public TabPane tabBar;
|
public TabPane tabBar;
|
||||||
private Stage stage = null;
|
private Stage stage = null;
|
||||||
private volatile HConnection hConnection;
|
private volatile HConnection hConnection;
|
||||||
|
|
||||||
private volatile int initcount = 0;
|
private volatile int initcount = 0;
|
||||||
|
|
||||||
public Connection connectionController;
|
public Connection connectionController;
|
||||||
@ -33,13 +36,24 @@ public class GEarthController {
|
|||||||
public Info infoController;
|
public Info infoController;
|
||||||
public Extensions extensionsController;
|
public Extensions extensionsController;
|
||||||
|
|
||||||
public Pane mover;
|
private List<SubForm> tabs = null;
|
||||||
|
|
||||||
|
public Pane mover;
|
||||||
public GEarthController() {
|
public GEarthController() {
|
||||||
hConnection = new HConnection();
|
hConnection = new HConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
tabs = new ArrayList<>();
|
||||||
|
tabs.add(connectionController);
|
||||||
|
tabs.add(injectionController);
|
||||||
|
tabs.add(loggerController);
|
||||||
|
tabs.add(toolsController);
|
||||||
|
tabs.add(schedulerController);
|
||||||
|
tabs.add(extraController);
|
||||||
|
tabs.add(infoController);
|
||||||
|
tabs.add(extensionsController);
|
||||||
|
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
trySetController();
|
trySetController();
|
||||||
}
|
}
|
||||||
@ -88,14 +102,8 @@ public class GEarthController {
|
|||||||
|
|
||||||
private void trySetController() {
|
private void trySetController() {
|
||||||
if (++initcount == 2) {
|
if (++initcount == 2) {
|
||||||
connectionController.setParentController(this);
|
GEarthController self = this;
|
||||||
injectionController.setParentController(this);
|
tabs.forEach(subForm -> subForm.setParentController(self));
|
||||||
loggerController.setParentController(this);
|
|
||||||
toolsController.setParentController(this);
|
|
||||||
schedulerController.setParentController(this);
|
|
||||||
extraController.setParentController(this);
|
|
||||||
infoController.setParentController(this);
|
|
||||||
extensionsController.setParentController(this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,15 +120,7 @@ public class GEarthController {
|
|||||||
|
|
||||||
|
|
||||||
public void exit() {
|
public void exit() {
|
||||||
connectionController.exit();
|
tabs.forEach(SubForm::exit);
|
||||||
injectionController.exit();
|
|
||||||
loggerController.exit();
|
|
||||||
toolsController.exit();
|
|
||||||
schedulerController.exit();
|
|
||||||
extraController.exit();
|
|
||||||
infoController.exit();
|
|
||||||
extensionsController.exit();
|
|
||||||
|
|
||||||
hConnection.abort();
|
hConnection.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user