From db437c879b68c3116f35f3cc3742635ce24a248e Mon Sep 17 00:00:00 2001 From: Timothy Leatherbarrow Date: Wed, 31 Oct 2018 20:16:10 +0000 Subject: [PATCH] Added Export window, tweaks and bug fixes --- .../prima/primaplay/core/FileManager.java | 7 +- .../prima/primaplay/graphics/ColorTools.java | 19 +- .../node/implemented/io/ColorEditNode.java | 55 ++++++ .../node/implemented/io/ColorMaskNode.java | 2 +- .../node/implemented/io/ImageConvertNode.java | 28 ++- .../node/implemented/io/NoiseNode.java | 59 ++++++ .../node/implemented/output/ColorNode.java | 11 +- .../link/type/defaults/MapGenDefaultLink.java | 15 ++ .../utils/calculation/SimplexNoise.java | 174 ++++++++++++++++++ .../main/java/sample/ExportController.java | 117 ++++++++++++ .../src/main/java/sample/MainController.java | 105 ++++++++--- PrimaView/src/main/java/sample/ViewMain.java | 25 ++- PrimaView/src/main/resources/default.css | 154 +++++++++++++--- .../src/main/resources/exportWindow.fxml | 109 +++++++++++ PrimaView/src/main/resources/mainWindow.fxml | 96 ++++++++++ PrimaView/src/main/resources/sample.fxml | 95 ---------- 16 files changed, 895 insertions(+), 176 deletions(-) create mode 100644 PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/node/implemented/io/ColorEditNode.java create mode 100644 PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/node/implemented/io/NoiseNode.java create mode 100644 PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/node/link/type/defaults/MapGenDefaultLink.java create mode 100644 PrimaUtils/src/main/java/com/tiggerbiggo/utils/calculation/SimplexNoise.java create mode 100644 PrimaView/src/main/java/sample/ExportController.java create mode 100644 PrimaView/src/main/resources/exportWindow.fxml create mode 100644 PrimaView/src/main/resources/mainWindow.fxml delete mode 100644 PrimaView/src/main/resources/sample.fxml diff --git a/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/core/FileManager.java b/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/core/FileManager.java index 2caf31c..baa7875 100644 --- a/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/core/FileManager.java +++ b/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/core/FileManager.java @@ -79,6 +79,10 @@ public static byte[] writeByteArray(BufferedImage[] imgSequence) { return writeByteArray(imgSequence, BufferedImage.TYPE_INT_RGB, 0, true); } + public static void writeImage(BufferedImage img, File out) throws IOException { + ImageIO.write(img, out.getName().substring(out.getName().lastIndexOf('.')+1), out); + } + /** * Reads in all images from a directory in an arbitrary order. * @@ -266,7 +270,8 @@ public static File fromRelative(String rel){ new ExtensionFilter("PNG file", "*.png"), new ExtensionFilter("JPEG file", "*.jpeg, *.jpg"), new ExtensionFilter("TIFF file", "*.tiff, *.tif"), - new ExtensionFilter("BMP file", "*.bmp") + new ExtensionFilter("BMP file", "*.bmp"), + new ExtensionFilter("All files", "*.*") }; } diff --git a/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/graphics/ColorTools.java b/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/graphics/ColorTools.java index 42991a6..9903fa7 100644 --- a/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/graphics/ColorTools.java +++ b/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/graphics/ColorTools.java @@ -136,17 +136,16 @@ public static int getMin(Color in) { return Math.min(in.getRed(), Math.min(in.getGreen(), in.getBlue())); } - /** - * Given a Color, multiplies all components by the multiplier. Clamps result between 0 and 255. - * @param in The color to multiply - * @param toMul The number to multiply each component by - * @return The result color, or null if in was null - */ - public static Color multiply(Color in, double toMul){ + public static Color multiply(Color A, Color B){ + double r, g, b; + r = (B.getRed() / 255d); + g = (B.getGreen() / 255d); + b = (B.getBlue() / 255d); + return new Color( - Math.min(255, Math.max((int)(in.getRed() * toMul), 0)), - Math.min(255, Math.max((int)(in.getGreen() * toMul), 0)), - Math.min(255, Math.max((int)(in.getBlue() * toMul), 0)) + Math.min(255, Math.max((int)(A.getRed() * r), 0)), + Math.min(255, Math.max((int)(A.getGreen() * g), 0)), + Math.min(255, Math.max((int)(A.getBlue() * b), 0)) ); } diff --git a/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/node/implemented/io/ColorEditNode.java b/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/node/implemented/io/ColorEditNode.java new file mode 100644 index 0000000..10e6c36 --- /dev/null +++ b/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/node/implemented/io/ColorEditNode.java @@ -0,0 +1,55 @@ +//Unfinished class, do not use. + +package com.tiggerbiggo.prima.primaplay.node.implemented.io; + +import com.tiggerbiggo.prima.primaplay.graphics.ColorTools; +import com.tiggerbiggo.prima.primaplay.node.core.NodeInOut; +import java.awt.Color; +import java.util.function.BiFunction; +import java.util.function.Function; + +public class ColorEditNode{//} extends NodeInOut { + + + //@Override + public String getName() { + return null; + } + + //@Override + public String getDescription() { + return null; + } +} + +/*enum ColorAction{ + ADD("Add", new BiFunction() { + @Override + public Color apply(Color color, Color color2) { + + return ColorTools.; + } + }), + SUB, + MUL, + DIV; + + String name; + BiFunction func; + + ColorAction(String _name, BiFunction _func){ + func = _func; + name = _name; + } + + public Color transform(Color A, Color B){ + return func.apply(A, B); + } + + + @Override + public String toString() { + return name; + } +} +*/ \ No newline at end of file diff --git a/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/node/implemented/io/ColorMaskNode.java b/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/node/implemented/io/ColorMaskNode.java index 44e0abc..4acbccf 100644 --- a/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/node/implemented/io/ColorMaskNode.java +++ b/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/node/implemented/io/ColorMaskNode.java @@ -40,7 +40,7 @@ public Color[] get(RenderParams p) { } for(int i=0; i() { @@ -81,9 +82,11 @@ public void handle(ActionEvent event) { GUITools.setAllAnchors(picker, 0); - AnchorPane pane = new AnchorPane(picker); - pane.setMinWidth(200); - pane.setMinHeight(40); - return pane; + AnchorPane p = new AnchorPane(picker); + + p.setMinWidth(50); + p.setMinHeight(50); + + return p; } } diff --git a/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/node/link/type/defaults/MapGenDefaultLink.java b/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/node/link/type/defaults/MapGenDefaultLink.java new file mode 100644 index 0000000..34ea3b9 --- /dev/null +++ b/PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/node/link/type/defaults/MapGenDefaultLink.java @@ -0,0 +1,15 @@ +package com.tiggerbiggo.prima.primaplay.node.link.type.defaults; + +import com.tiggerbiggo.prima.primaplay.core.RenderParams; +import com.tiggerbiggo.prima.primaplay.node.link.type.VectorInputLink; +import com.tiggerbiggo.utils.calculation.Vector2; + +public class MapGenDefaultLink extends VectorInputLink { + @Override + public Vector2 defaultValue(RenderParams p) { + return new Vector2( + p.x() * (1d / p.width()), + p.y() * (1d / p.height()) + ); + } +} diff --git a/PrimaUtils/src/main/java/com/tiggerbiggo/utils/calculation/SimplexNoise.java b/PrimaUtils/src/main/java/com/tiggerbiggo/utils/calculation/SimplexNoise.java new file mode 100644 index 0000000..be81709 --- /dev/null +++ b/PrimaUtils/src/main/java/com/tiggerbiggo/utils/calculation/SimplexNoise.java @@ -0,0 +1,174 @@ +package com.tiggerbiggo.utils.calculation; + +public class SimplexNoise { // Simplex noise in 2D, 3D and 4D + + private static int grad3[][] = {{1, 1, 0}, {-1, 1, 0}, {1, -1, 0}, {-1, -1, 0}, + {1, 0, 1}, {-1, 0, 1}, {1, 0, -1}, {-1, 0, -1}, + {0, 1, 1}, {0, -1, 1}, {0, 1, -1}, {0, -1, -1}}; + private static int p[] = {151, 160, 137, 91, 90, 15, + 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69, 142, 8, 99, 37, 240, 21, 10, + 23, + 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, 11, 32, 57, 177, + 33, + 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, 134, 139, 48, 27, + 166, + 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, 245, 40, + 244, + 102, 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, 169, 200, 196, + 135, 130, 116, 188, 159, 86, 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, + 5, 202, 38, 147, 118, 126, 255, 82, 85, 212, 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, 28, + 42, + 223, 183, 170, 213, 119, 248, 152, 2, 44, 154, 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, + 129, 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104, 218, 246, 97, 228, + 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51, 145, 235, 249, 14, 239, 107, + 49, 192, 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, 50, 45, 127, 4, 150, 254, + 138, 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156, 180}; + // To remove the need for index wrapping, double the permutation table length + private static int perm[] = new int[512]; + + static { + for (int i = 0; i < 512; i++) { + perm[i] = p[i & 255]; + } + } + + // This method is a *lot* faster than using (int)Math.floor(x) + private static int fastfloor(double x) { + return x > 0 ? (int) x : (int) x - 1; + } + + private static double dot(int g[], double x, double y, double z) { + return g[0] * x + g[1] * y + g[2] * z; + } + + public static double noise(Vector2 xy, double z){ + return noise(xy.X(), xy.Y(), z); + } + + // 3D simplex noise + public static double noise(double xin, double yin, double zin) { + double n0, n1, n2, n3; // Noise contributions from the four corners + // Skew the input space to determine which simplex cell we're in + final double F3 = 1.0 / 3.0; + double s = (xin + yin + zin) * F3; // Very nice and simple skew factor for 3D + int i = fastfloor(xin + s); + int j = fastfloor(yin + s); + int k = fastfloor(zin + s); + final double G3 = 1.0 / 6.0; // Very nice and simple unskew factor, too + double t = (i + j + k) * G3; + double X0 = i - t; // Unskew the cell origin back to (x,y,z) space + double Y0 = j - t; + double Z0 = k - t; + double x0 = xin - X0; // The x,y,z distances from the cell origin + double y0 = yin - Y0; + double z0 = zin - Z0; + // For the 3D case, the simplex shape is a slightly irregular tetrahedron. + // Determine which simplex we are in. + int i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords + int i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords + if (x0 >= y0) { + if (y0 >= z0) { + i1 = 1; + j1 = 0; + k1 = 0; + i2 = 1; + j2 = 1; + k2 = 0; + } // X Y Z order + else if (x0 >= z0) { + i1 = 1; + j1 = 0; + k1 = 0; + i2 = 1; + j2 = 0; + k2 = 1; + } // X Z Y order + else { + i1 = 0; + j1 = 0; + k1 = 1; + i2 = 1; + j2 = 0; + k2 = 1; + } // Z X Y order + } else { // x0 widthSpinner, heightSpinner; + + BasicRenderNode currentRender; + + File currentFile; + + int lastSelected = 0; + + @Override + public void initialize(URL location, ResourceBundle resources) { + thisController = this; + exportButton.setDisable(true); + + frameNumSlider.valueProperty().addListener( + o -> frameNumLabel.setText((int)frameNumSlider.getValue() + "") + ); + + fpsSlider.valueProperty().addListener( + o -> fpsLabel.setText((int)fpsSlider.getValue() + "") + ); + + GIF.setOnMouseClicked(event -> { + if(lastSelected != 0){ + //We have been newly selected, clear file box + filename.setText(""); + } + lastSelected = 0; + exportButton.setDisable(true); + }); + + IMG.setOnMouseClicked(event -> { + if(lastSelected != 1){ + //We have been newly selected, clear file box + filename.setText(""); + } + lastSelected = 1; + exportButton.setDisable(true); + }); + + widthSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 8000, 100, 100)); + heightSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 8000, 100, 100)); + } + + public void doFileOpen(ExtensionFilter ... filters){ + try { + currentFile = FileManager.showSaveDialogue(ViewMain.getExportStage(), "exports/", filters); + + filename.setText(currentFile.toString()); + exportButton.setDisable(false); + } + catch(IOException e){ + + exportButton.setDisable(true); + } + } + + @FXML + public void onFileOpen(){ + if (GIF.isSelected()) + doFileOpen(FileManager.GIF); + else + doFileOpen(FileManager.IMGS); + } + + public void onExport(){ + currentRender = MainController.thisController.getNodePane().renderNode; + if(currentRender == null){ + //Error + return; + } + if(GIF.isSelected()){ + //export as GIF + FileManager.writeGif(currentRender.render(widthSpinner.getValue(), heightSpinner.getValue(), (int)frameNumSlider.getValue()), currentFile); + } + } +} diff --git a/PrimaView/src/main/java/sample/MainController.java b/PrimaView/src/main/java/sample/MainController.java index 0927454..80a1643 100644 --- a/PrimaView/src/main/java/sample/MainController.java +++ b/PrimaView/src/main/java/sample/MainController.java @@ -6,9 +6,6 @@ import com.tiggerbiggo.prima.primaplay.graphics.ImageTools; import com.tiggerbiggo.prima.primaplay.node.core.INode; import guinode.GUILink; -import java.awt.Toolkit; -import java.awt.datatransfer.Clipboard; -import java.awt.datatransfer.StringSelection; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; @@ -21,10 +18,14 @@ import javafx.animation.KeyFrame; import javafx.animation.Timeline; import javafx.event.ActionEvent; +import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.control.ComboBox; +import javafx.scene.control.Menu; +import javafx.scene.control.MenuBar; +import javafx.scene.control.MenuItem; import javafx.scene.control.ScrollPane; import javafx.scene.control.Spinner; import javafx.scene.control.SpinnerValueFactory; @@ -32,10 +33,15 @@ import javafx.scene.control.TextField; import javafx.scene.image.Image; import javafx.scene.image.ImageView; +import javafx.scene.input.KeyCode; +import javafx.scene.input.KeyCodeCombination; +import javafx.scene.input.KeyCombination; import javafx.scene.input.TransferMode; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.BorderPane; import javafx.scene.layout.Pane; +import javafx.stage.Modality; +import javafx.stage.Stage; import javafx.util.Duration; import javafx.util.StringConverter; @@ -43,6 +49,8 @@ public class MainController implements Initializable, ChangeListener { public NodePane nodePane; + public static MainController thisController; + @FXML public Pane nodeContainer; @FXML @@ -63,6 +71,8 @@ public class MainController implements Initializable, ChangeListener { private BorderPane pannableContainer; @FXML private ScrollPane scrollPane; + @FXML + private MenuBar menuBar; private String DEFAULT = "0@com.tiggerbiggo.prima.primaplay.node.implemented.MapGenNode@{\"aX\":0.0,\"aY\":0.0,\"dx\":1.0,\"dy\":1.0}@35@29\n" + "1@com.tiggerbiggo.prima.primaplay.node.implemented.io.TransformNode@{\"function\":\"SINSIN\"}@326@99\n" @@ -86,8 +96,12 @@ public class MainController implements Initializable, ChangeListener { private Future renderTask; + File currentFile = null; + @Override public void initialize(URL url, ResourceBundle rb) { + thisController = this; + timer = new Timeline(new KeyFrame(Duration.seconds(1.0 / 60), e -> { imgArray = pollRenderer(); @@ -147,6 +161,8 @@ public Class fromString(String string) { comboNodeList.setItems(new ObservableListWrapper<>(NodeReflection.getAllImplementedNodes())); //imgView.fitWidthProperty().bind(anchImageHolder.widthProperty()); //imgView.fitHeightProperty().bind(anchImageHolder.heightProperty()); + + setupMenuBar(); } private Image[] pollRenderer(){ @@ -170,6 +186,11 @@ public void startPreviewRender(){ renderTask = nodePane.renderAsync(100, 100, 60); } + private void setCurrentFile(File f){ + currentFile = f; + ViewMain.setTitleToFile(f); + } + @FXML private void onBtnPreview(ActionEvent e) { if (btnPreview.getText().equals("Preview")) { @@ -185,6 +206,8 @@ private void onBtnPreview(ActionEvent e) { @FXML private void onBtnSave(ActionEvent e) { try { + + FileManager.writeGif( nodePane.render( spnWidth.getValue(), @@ -199,27 +222,24 @@ private void onBtnSave(ActionEvent e) { } } - @FXML - private void onBtnSaveLayout(ActionEvent e){ - String ser; - + private void saveLayout(){ try{ - File chosen = FileManager.showSaveDialogue(); + File chosen = null; + + if(currentFile == null) + chosen = FileManager.showSaveDialogue(); + else + chosen = currentFile; - ser = NodeSerializer.saveToFile(nodePane, chosen); + NodeSerializer.saveToFile(nodePane, chosen); - ViewMain.setTitleToFile(chosen); + setCurrentFile(chosen); }catch(IOException ex){ - return; + ex.printStackTrace(); } - - StringSelection stringSelection = new StringSelection(ser); - Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); - clipboard.setContents(stringSelection, null); } - @FXML - private void onBtnLoadLayout(ActionEvent e){ + private void loadLayout(){ try{ File chosen = FileManager.showOpenDialogue(); @@ -238,17 +258,14 @@ private void onBtnLoadLayout(ActionEvent e){ nodeContainer.getChildren().add(nodePane); - ViewMain.setTitleToFile(chosen); + setCurrentFile(chosen); startPreviewRender(); timer.stop(); timer.play(); } - catch(NodeParseException ex){ - System.out.println("oh dear: " + ex.getMessage()); - //oh dear, display error message - } catch (IOException e1) { - // nothing + catch(NodeParseException | IOException ex){ + ex.printStackTrace(); } } @@ -270,4 +287,46 @@ public void onObjectValueChanged(Field field, Object oldValue, Object newValue, System.out.println("-----------------------------------"); startPreviewRender(); } + + private void setupMenuBar(){ + Menu file = new Menu("File"); + + MenuItem save, saveAs, open, export; + + save = new MenuItem("Save"); + save.setAccelerator(new KeyCodeCombination(KeyCode.S, KeyCombination.SHORTCUT_DOWN)); + save.setOnAction(event -> saveLayout()); + + saveAs = new MenuItem("Save As..."); + saveAs.setAccelerator( + new KeyCodeCombination( + KeyCode.S, + KeyCombination.SHORTCUT_DOWN, + KeyCombination.SHIFT_DOWN)); + saveAs.setOnAction(event -> { + currentFile = null; + saveLayout(); + }); + + open = new MenuItem("Open..."); + open.setAccelerator(new KeyCodeCombination(KeyCode.O, KeyCombination.SHORTCUT_DOWN)); + open.setOnAction(event -> loadLayout()); + + export = new MenuItem("Export..."); + export.setOnAction(new EventHandler() { + @Override + public void handle(ActionEvent event) { + ViewMain.getExportStage().showAndWait(); + } + }); + //open export window + + file.getItems().addAll(save, saveAs, open, export); + + menuBar.getMenus().addAll(file); + } + + public NodePane getNodePane() { + return nodePane; + } } diff --git a/PrimaView/src/main/java/sample/ViewMain.java b/PrimaView/src/main/java/sample/ViewMain.java index e5a5bfd..575550d 100644 --- a/PrimaView/src/main/java/sample/ViewMain.java +++ b/PrimaView/src/main/java/sample/ViewMain.java @@ -1,29 +1,37 @@ package sample; import java.io.File; -import java.net.URLDecoder; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; +import javafx.stage.Modality; import javafx.stage.Stage; public class ViewMain extends Application { private static Stage mainStage; + private static Stage exportStage; @Override public void start(Stage primaryStage) throws Exception { - Parent root = FXMLLoader.load(getClass().getResource("/sample.fxml")); - primaryStage.setTitle("Prima: No file Loaded"); + Parent root = FXMLLoader.load(getClass().getResource("/mainWindow.fxml")); mainStage = primaryStage; + setTitleToFile(null); + Scene s = new Scene(root, 600, 500); s.getStylesheets().add(getClass().getResource("/default.css").toString()); - primaryStage.setOnCloseRequest(event -> System.exit(0)); - primaryStage.setScene(s); + + root = FXMLLoader.load(getClass().getResource("/exportWindow.fxml")); + exportStage = new Stage(); + s = new Scene(root, 500, 500); + s.getStylesheets().add(getClass().getResource("/default.css").toString()); + exportStage.setScene(s); + exportStage.initModality(Modality.APPLICATION_MODAL); + primaryStage.show(); } @@ -31,13 +39,16 @@ public static void main(String[] args) { launch(args); } - public static void setTitleToFile(File f){ - if(f != null){ + public static void setTitleToFile(File f) { + if (f != null) { mainStage.setTitle("Prima: " + f.getName()); + } else{ + mainStage.setTitle("Prima: No File Loaded"); } } public static Stage getMainStage(){ return mainStage; } + public static Stage getExportStage(){return exportStage;} } diff --git a/PrimaView/src/main/resources/default.css b/PrimaView/src/main/resources/default.css index 1788b35..4689898 100644 --- a/PrimaView/src/main/resources/default.css +++ b/PrimaView/src/main/resources/default.css @@ -1,33 +1,41 @@ +* { + -my-outline: '#f4b700'; + -my-nodebg: '#777777'; + -my-darkbg: '#333333'; + -my-accent: '#825636'; + -my-lightaccent: '#9b7357'; +} + .LinkLine{ - -fx-stroke: '#f4b700'; + -fx-stroke: -my-outline; -fx-fill:transparent; } .NodePane{ - -fx-background-color:'#333333'; -} -.label{ - -fx-text-fill: '#eeeeee'; + -fx-background-color: -my-darkbg; } + .GUINode{ - -fx-border-color: '#f4b700'; + -fx-border-color: -my-outline; -fx-border-radius: 10; - -fx-background-color:'#777777'; + -fx-background-color: -my-nodebg; -fx-background-radius: 10; -fx-padding: 10; } -.textArea{ - -fx-background-color: '#825636'; - -fx-text-fill: '#ffd700'; - -fx-border-color: '#f4b700'; - -fx-border-radius: 60; - -fx-background-radius: 60; +.label{ + -fx-text-fill: -my-outline; +} + +.text-field{ + -fx-background-color: -my-lightaccent; + -fx-text-fill: -my-outline; + -fx-border-color: -my-outline; } .button{ - -fx-background-color: '#825636'; - -fx-text-fill: '#ffd700'; - -fx-border-color: '#f4b700'; + -fx-background-color: -my-accent; + -fx-text-fill: -my-outline; + -fx-border-color: -my-outline; -fx-border-radius: 60; -fx-background-radius: 60; } @@ -51,18 +59,15 @@ -fx-border-radius: 0 0 60 60; -fx-background-radius: 0 0 60 60; } - .buttonMid{ -fx-border-radius: 0; -fx-background-radius: 0; } - .split-pane-divider { - -fx-background-color: '#f4b700'; + -fx-background-color: -my-outline; } - .GUILink{ - -fx-stroke: '#f4b700'; + -fx-stroke: -my-outline; -fx-stroke-width: 2; } .ColorArrayLink{ @@ -78,15 +83,112 @@ -fx-fill: aqua; } .ImageLink{ - -fx-fill: green; + -fx-fill: '#00aa00'; } .ImageArrayLink{ -fx-fill: '#00ff00'; } .ColorLink{ - -fx-fill: '#ffffff'; + -fx-fill: white; +} +.slider .track{ + -fx-background-color: -my-outline; +} +.slider .thumb{ + -fx-background-color: -my-accent; + -fx-border-color: -my-outline; + -fx-border-radius: 100; +} + +.color-picker{ + -fx-color-label-visible: false; + -fx-color-rect-width: 30; + -fx-color-rect-height: 30; +} + +.picker-color{ + -fx-width: 100; +} + +.color-picker .arrow{ + -fx-background-color:transparent; +} + +.no-border{ + -fx-border-color:transparent; + -fx-background-color:transparent; +} + +* { + -fx-my-menu-color: -my-outline; + -fx-my-menu-color-highlighted: -my-darkbg; + -fx-my-menu-font-color: black; + -fx-my-menu-font-color-highlighted: #ffffff; } -.CommentPane{ - -fx-width : 300; - -fx-height: 300; + +/* MENU BAR + Top-level MENU BUTTONS */ +/*** The menu bar itself ***/ +.menu-bar { + -fx-background-color: -fx-my-menu-color; +} + +/*** Top-level menu itself (not selected / hovered) ***/ +.menu-bar > .container > .menu-button { + -fx-background-color: -fx-my-menu-color; +} + +/*** Top-level menu's label (not selected / hovered) ***/ +.menu-bar > .container > .menu-button > .label { + -fx-text-fill: -fx-my-menu-font-color; +} + +/*** Top-level menu's label (disabled) ***/ +.menu-bar > .container > .menu-button > .label:disabled { + -fx-opacity: 1.0; +} + +/*** Top-level menu itself (selected / hovered) ***/ +.menu-bar > .container > .menu-button:hover, +.menu-bar > .container > .menu-button:focused, +.menu-bar > .container > .menu-button:showing { + -fx-background-color: -fx-my-menu-color-highlighted; +} + +/*** Top-level menu's label (selected / hovered) ***/ +.menu-bar > .container > .menu-button:hover > .label, +.menu-bar > .container > .menu-button:focused > .label, +.menu-bar > .container > .menu-button:showing > .label { + -fx-text-fill: -fx-my-menu-font-color-highlighted; +} + +/* MENU ITEM (children of a MENU BUTTON) */ +/*** The item itself (not hovered / focused) ***/ +.menu-item { + -fx-background-color: -fx-my-menu-color; +} + +/*** The item's label (not hovered / focused) ***/ +.menu-item .label { + -fx-text-fill: -fx-my-menu-font-color; +} + +/*** The item's label (disabled) ***/ +.menu-item .label:disabled { + -fx-opacity: 1.0; +} + +/*** The item itself (hovered / focused) ***/ +.menu-item:focused, .menu-item:hovered { + -fx-background-color: -fx-my-menu-color-highlighted; +} + +/*** The item's label (hovered / focused) ***/ +.menu-item:focused .label, .menu-item:hovered .label { + -fx-text-fill: -fx-my-menu-font-color-highlighted; +} + +/* CONTEXT MENU */ +/*** The context menu that contains a menu's menu items ***/ +.context-menu { + -fx-background-color: -fx-my-menu-color; } \ No newline at end of file diff --git a/PrimaView/src/main/resources/exportWindow.fxml b/PrimaView/src/main/resources/exportWindow.fxml new file mode 100644 index 0000000..a157654 --- /dev/null +++ b/PrimaView/src/main/resources/exportWindow.fxml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +