hide logger tab when using UI logger, update uilogger, update packetloggerfactory

This commit is contained in:
sirjonasxx 2018-11-05 20:30:57 +01:00
parent b4281dff56
commit 1655ce1d01
3 changed files with 18 additions and 6 deletions

View File

@ -1,5 +1,6 @@
package gearth.ui;
import gearth.ui.logger.loggerdisplays.PacketLoggerFactory;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.layout.Pane;
@ -48,6 +49,10 @@ public class GEarthController {
tabBar.getTabs().remove(tab_Settings);
if (PacketLoggerFactory.usesUIlogger()) {
tabBar.getTabs().remove(loggerController);
}
//custom header bar
// final Point[] startpos = {null};

View File

@ -8,12 +8,19 @@ import gearth.misc.OSValidator;
*/
public class PacketLoggerFactory {
public static boolean usesUIlogger() {
return (!Main.hasFlag("-t"));
}
public static PacketLogger get() {
if (OSValidator.isUnix() && Main.hasFlag("-t")) {
return new LinuxTerminalLogger();
if (usesUIlogger()) {
return new UiLogger();
}
return new UiLogger();
if (OSValidator.isUnix()) {
return new LinuxTerminalLogger();
}
return new SimpleTerminalLogger();
}
}

View File

@ -8,7 +8,7 @@
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.FlowPane?>
<BorderPane fx:id="borderPane" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.121" xmlns:fx="http://javafx.com/fxml/1" fx:controller="gearth.ui.UiLoggerController">
<BorderPane fx:id="borderPane" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="gearth.ui.UiLoggerController">
<top>
<MenuBar BorderPane.alignment="CENTER">
<Menu mnemonicParsing="false" text="View">
@ -23,9 +23,9 @@
</MenuBar>
</top>
<bottom>
<FlowPane fx:id="flowPane" prefHeight="26.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<FlowPane fx:id="flowPane" prefHeight="20.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<padding>
<Insets left="10.0" top="3.0" />
<Insets left="10.0" top="1.0" />
</padding>
<Label fx:id="lblViewIncoming" style="-fx-text-fill: black !important" text="View Incoming: True">
<FlowPane.margin>