Browse Source

Minor changes

GUI stuff
master
Sogomn 9 years ago
parent
commit
46d5f57a4f
  1. 3
      Ratty/res/language/language_de.properties
  2. 3
      Ratty/res/language/language_en.properties
  3. 11
      Ratty/res/main_gui.css
  4. 5
      Ratty/res/main_gui.fxml
  5. 2
      Ratty/src/de/sogomn/rat/server/gui/RattyGui.java
  6. 21
      Ratty/src/de/sogomn/rat/server/gui/RattyGuiFx.java

3
Ratty/res/language/language_de.properties

@ -4,4 +4,5 @@ column.os=OS
column.version=Version
column.desktop=Desktopstream
column.voice=Mikrofonstream
button.build=Clientbuilder
button.build=Clientbuilder
table.empty=Keine Clients :(

3
Ratty/res/language/language_en.properties

@ -4,4 +4,5 @@ column.os=OS
column.version=Version
column.desktop=Streaming desktop
column.voice=Streaming voice
button.build=Client builder
button.build=Client builder
table.empty=No clients :(

11
Ratty/res/main_gui.css

@ -1,6 +1,11 @@
* {
-fx-base: #aaaaaa;
-fx-background-insets: 0px;
-fx-font-family: "Calibri";
}
.table-view .column-header {
-fx-font-size: 10pt;
}
.table-view .column-header:hover {
@ -11,6 +16,12 @@
-fx-effect: innershadow(gaussian, #000000, 5, 0, 0, 0);
}
.table-view .placeholder .label {
-fx-font-size: 15pt;
-fx-text-fill: #fcfcfc;
-fx-effect: dropshadow(gaussian, #000000, 3, 0.5, 0, 0);
}
.button {
-fx-background-radius: 0px;
}

5
Ratty/res/main_gui.fxml

@ -5,7 +5,7 @@
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<BorderPane fx:id="pane" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.sogomn.rat.server.gui.RattyGuiFx">
<BorderPane fx:id="pane" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.sogomn.rat.server.gui.RattyGuiFx" prefWidth="950" prefHeight="500">
<bottom>
<HBox fx:id="bottom" BorderPane.alignment="CENTER">
<children>
@ -23,6 +23,9 @@
<TableColumn fx:id="desktop" editable="false" prefWidth="75.0" text="%column.desktop" />
<TableColumn fx:id="voice" editable="false" prefWidth="75.0" text="%column.voice" />
</columns>
<placeholder>
<Label text="%table.empty" />
</placeholder>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>

2
Ratty/src/de/sogomn/rat/server/gui/RattyGui.java

@ -43,8 +43,8 @@ public final class RattyGui {
private static final BufferedImage GUI_ICON_SMALL = ImageUtils.loadImage("/gui_icon.png");
private static final BufferedImage GUI_ICON_MEDIUM = ImageUtils.scaleImage(ImageUtils.loadImage("/gui_icon.png"), 64, 64);
private static final BufferedImage GUI_ICON_LARGE = ImageUtils.scaleImage(ImageUtils.loadImage("/gui_icon.png"), 128, 128);
private static final BufferedImage[] MENU_ICONS = new SpriteSheet("/menu_icons.png", 32, 32).getSprites();
private static final List<BufferedImage> GUI_ICONS = Arrays.asList(GUI_ICON_SMALL, GUI_ICON_MEDIUM, GUI_ICON_LARGE);
private static final BufferedImage[] MENU_ICONS = new SpriteSheet("/menu_icons.png", 32, 32).getSprites();
public static final String POPUP = "Open popup";
public static final String SCREENSHOT = "Take screenshot";

21
Ratty/src/de/sogomn/rat/server/gui/RattyGuiFx.java

@ -11,9 +11,12 @@ import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.image.Image;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
import de.sogomn.rat.Ratty;
@ -35,14 +38,18 @@ public final class RattyGuiFx extends Application {
private TableColumn<ServerClient, Boolean> desktop;
@FXML
private TableColumn<ServerClient, Boolean> voice;
@FXML
private HBox bottom;
@FXML
private Button builder;
private static final int WIDTH = 800;
private static final int HEIGHT = 600;
private static final String TITLE = "Ratty";
private static final String FXML_PATH = "/main_gui.fxml";
private static final String CSS_PATH = "/main_gui.css";
private static final String LANGUAGE_BASE = "language.language";
private static final Image ICON = new Image("/gui_icon.png");
private static final String NAME = "name";
private static final String ADDRESS = "address";
private static final String OS = "os";
@ -91,11 +98,11 @@ public final class RattyGuiFx extends Application {
final Parent root = loadContent(FXML_PATH, Locale.ENGLISH);
final Scene scene = new Scene(root);
final ObservableList<String> styleSheets = scene.getStylesheets();
final ObservableList<Image> icons = primaryStage.getIcons();
icons.addAll(ICON);
styleSheets.add(CSS_PATH);
primaryStage.setWidth(WIDTH);
primaryStage.setHeight(HEIGHT);
primaryStage.setTitle(TITLE);
primaryStage.setScene(scene);
primaryStage.show();
@ -120,6 +127,12 @@ public final class RattyGuiFx extends Application {
items.add(serverClient);
}
public void removeRow(final ServerClient serverClient) {
final ObservableList<ServerClient> items = table.getItems();
items.remove(serverClient);
}
public static void main(final String[] args) {
RattyGuiFx.launch(args);
}

Loading…
Cancel
Save