mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2025-01-18 16:26:26 +01:00
ontabopened()
This commit is contained in:
parent
5a9eb49465
commit
7d01c11852
@ -1,6 +1,8 @@
|
||||
package gearth.ui;
|
||||
|
||||
import gearth.ui.logger.loggerdisplays.PacketLoggerFactory;
|
||||
import javafx.event.Event;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.TabPane;
|
||||
import javafx.scene.layout.Pane;
|
||||
@ -44,52 +46,35 @@ public class GEarthController {
|
||||
|
||||
public void initialize() {
|
||||
tabs = new ArrayList<>();
|
||||
// must be ordered correctly
|
||||
tabs.add(connectionController);
|
||||
tabs.add(injectionController);
|
||||
tabs.add(loggerController);
|
||||
tabs.add(toolsController);
|
||||
tabs.add(schedulerController);
|
||||
tabs.add(extensionsController);
|
||||
tabs.add(extraController);
|
||||
tabs.add(infoController);
|
||||
tabs.add(extensionsController);
|
||||
|
||||
synchronized (this) {
|
||||
trySetController();
|
||||
}
|
||||
|
||||
List<Tab> uiTabs = tabBar.getTabs();
|
||||
for (int i = 0; i < uiTabs.size(); i++) {
|
||||
Tab tab = uiTabs.get(i);
|
||||
int[] ii = {i};
|
||||
|
||||
tab.setOnSelectionChanged(event -> {
|
||||
if (tab.isSelected()) {
|
||||
tabs.get(ii[0]).onTabOpened();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (PacketLoggerFactory.usesUIlogger()) {
|
||||
tabBar.getTabs().remove(tab_Logger);
|
||||
}
|
||||
|
||||
//custom header bar
|
||||
// final Point[] startpos = {null};
|
||||
// final Double[] xx = {0.0};
|
||||
// final Double[] yy = {0.0};
|
||||
// final Boolean[] isMoving = {false};
|
||||
//
|
||||
// mover.addEventHandler(MouseEvent.MOUSE_PRESSED,
|
||||
// event -> {
|
||||
// startpos[0] = MouseInfo.getPointerInfo().getLocation();
|
||||
// xx[0] = stage.getX();
|
||||
// yy[0] = stage.getY();
|
||||
// isMoving[0] = true;
|
||||
// });
|
||||
//
|
||||
// mover.addEventHandler(MouseEvent.MOUSE_RELEASED,
|
||||
// event -> {
|
||||
// isMoving[0] = false;
|
||||
// });
|
||||
//
|
||||
//
|
||||
// mover.setOnMouseDragged(event -> {
|
||||
// if (isMoving[0]) {
|
||||
// Point now = MouseInfo.getPointerInfo().getLocation();
|
||||
// double diffX = now.getX() - startpos[0].getX();
|
||||
// double diffY = now.getY() - startpos[0].getY();
|
||||
// stage.setX(xx[0] + diffX);
|
||||
// stage.setY(yy[0] + diffY);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
public void setStage(Stage stage) {
|
||||
@ -123,4 +108,38 @@ public class GEarthController {
|
||||
hConnection.abort();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public ConnectionController getConnectionController() {
|
||||
return connectionController;
|
||||
}
|
||||
|
||||
public InjectionController getInjectionController() {
|
||||
return injectionController;
|
||||
}
|
||||
|
||||
public LoggerController getLoggerController() {
|
||||
return loggerController;
|
||||
}
|
||||
|
||||
public ToolsController getToolsController() {
|
||||
return toolsController;
|
||||
}
|
||||
|
||||
public SchedulerController getSchedulerController() {
|
||||
return schedulerController;
|
||||
}
|
||||
|
||||
public ExtraController getExtraController() {
|
||||
return extraController;
|
||||
}
|
||||
|
||||
public InfoController getInfoController() {
|
||||
return infoController;
|
||||
}
|
||||
|
||||
public ExtensionsController getExtensionsController() {
|
||||
return extensionsController;
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,10 @@ public class SubForm {
|
||||
|
||||
}
|
||||
|
||||
protected void onTabOpened() {
|
||||
|
||||
}
|
||||
|
||||
protected HConnection getHConnection() {
|
||||
return parentController.getHConnection();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user