Permalink
Browse files

update for rename of project

  • Loading branch information...
1 parent 4055621 commit 128ab9ee081fd1ca7f9ebe8e9b189fcc322d34e2 @ruckc ruckc committed Dec 28, 2015
View
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>com.anchorage</groupId>
- <artifactId>anchoragefx</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>com.anchorfx</groupId>
+ <artifactId>anchorfx</artifactId>
+ <version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
-</project>
+</project>
@@ -253,7 +253,9 @@ public void makeNodeActiveOnFloatableStage() {
stackPanelContainer.getChildren().add(node);
- setupMouseEvents();
+ if (node.resizableProperty().get()) {
+ setupMouseEvents();
+ }
}
public void closeStage() {
@@ -97,7 +97,7 @@ public BooleanProperty closeableProperty() {
}
public BooleanProperty resizableProperty() {
- return closeableProperty;
+ return resizableProperty;
}
public BooleanProperty maximizableProperty() {
@@ -212,7 +212,7 @@ public void makeNodeActiveOnFloatableStage(Window owner, double x, double y) {
}
else {
- restore();
+ closeFloatingStage();
}
}
@@ -30,9 +30,8 @@ public DockCommandsBox(DockNode node) {
setSpacing(0);
setStyle("-fx-background-color:transparent;");
}
-
- private void createCloseButton()
- {
+
+ private void createCloseButton() {
Image closeImage = new Image("resources/close.png");
closeButton = new Button() {
@Override
@@ -43,24 +42,42 @@ public void requestFocus() {
closeButton.setGraphic(new ImageView(closeImage));
closeButton.getStyleClass().add("docknode-command-button-close");
closeButton.setOnAction(e -> node.undock());
-
- node.containerProperty().addListener((observer, oldValue, newValue) -> {
- DockContainer container = (DockContainer) newValue;
+ if (!(node instanceof DockSubStation)) {
+ node.closeableProperty().addListener((observer, oldValue, newValue) -> {
- closeButton.setOpacity((container == null || !(container instanceof SingleDockContainer)) ? 1 : 0.4);
- closeButton.setMouseTransparent((container == null || !(container instanceof SingleDockContainer)) ? false : true);
+ if (newValue) {
+ closeButton.setMouseTransparent(false);
+ closeButton.setOpacity(1);
+ }
+ else {
+ closeButton.setMouseTransparent(true);
+ closeButton.setOpacity(0.4);
+ }
+ });
+
+ node.containerProperty().addListener((observer, oldValue, newValue) -> {
+
+ DockContainer container = (DockContainer) newValue;
+
+ closeButton.setOpacity((container == null || !(container instanceof SingleDockContainer)) ? 1 : 0.4);
+ closeButton.setMouseTransparent((container == null || !(container instanceof SingleDockContainer)) ? false : true);
+
+ });
+
+ }
+ else {
+ closeButton.setMouseTransparent(true);
+ closeButton.setOpacity(0.4);
+ }
- });
-
getChildren().add(closeButton);
}
-
- private void createMaxRestoreButton()
- {
+
+ private void createMaxRestoreButton() {
Image maximizeImage = new Image("resources/maximize.png");
Image restoreImage = new Image("resources/restore.png");
-
+
maximizeRestoreButton = new Button() {
@Override
public void requestFocus() {
@@ -69,7 +86,7 @@ public void requestFocus() {
maximizeRestoreButton.setGraphic(new ImageView(maximizeImage));
maximizeRestoreButton.getStyleClass().add("docknode-command-button");
-
+
node.maximizingProperty().addListener((observer, oldValue, newValue) -> {
if (newValue) {
@@ -79,17 +96,28 @@ public void requestFocus() {
maximizeRestoreButton.setGraphic(new ImageView(maximizeImage));
}
});
-
- maximizeRestoreButton.setOnAction(e->node.maximizeOrRestore());
-
+
+ maximizeRestoreButton.setOnAction(e -> node.maximizeOrRestore());
+
getChildren().add(maximizeRestoreButton);
+
+ node.maximizableProperty().addListener((observer, oldValue, newValue) -> {
+
+ if (newValue) {
+ maximizeRestoreButton.setMouseTransparent(false);
+ maximizeRestoreButton.setOpacity(1);
+ }
+ else {
+ maximizeRestoreButton.setMouseTransparent(true);
+ maximizeRestoreButton.setOpacity(0.4);
+ }
+ });
}
private void buildUI() {
-
+
createMaxRestoreButton();
- if (!(node instanceof DockSubStation))
- createCloseButton();
-
+ createCloseButton();
+
}
}
@@ -13,9 +13,7 @@
import javafx.geometry.Point2D;
import javafx.scene.Parent;
import javafx.scene.control.Label;
-import javafx.scene.image.Image;
import javafx.scene.input.MouseEvent;
-import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
@@ -1,89 +1,89 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.anchorage.test;
-
-import com.anchorage.docks.node.DockNode;
-import com.anchorage.docks.stations.DockStation;
-import com.anchorage.system.AnchorageSystem;
-import java.util.Random;
-import javafx.application.Application;
-import javafx.scene.Scene;
-import javafx.scene.control.TableView;
-import javafx.scene.control.TreeItem;
-import javafx.scene.control.TreeView;
-import javafx.scene.web.HTMLEditor;
-import javafx.scene.web.WebEngine;
-import javafx.scene.web.WebView;
-import javafx.stage.Stage;
-
-/**
- *
- * @author Alessio
- */
-public class AnchorageFX_settings extends Application {
-
- @Override
- public void start(Stage primaryStage) {
-
- AnchorageSystem.installDefaultStyle();
-
- DockStation station = AnchorageSystem.createStation();
-
- Scene scene = new Scene(station, 800, 500);
-
- DockNode node1 = AnchorageSystem.createDock("Not floatable", generateRandomTree());
- node1.dock(station, DockNode.DOCK_POSITION.LEFT);
- node1.floatableProperty().set(false);
-
- DockNode node2 = AnchorageSystem.createDock("Not resizable", generateRandomTree());
- node2.dock(station, DockNode.DOCK_POSITION.RIGHT);
- node2.resizableProperty().set(false);
-
- DockNode node3 = AnchorageSystem.createDock("Not maximizable", generateRandomTree());
- node3.dock(station, DockNode.DOCK_POSITION.TOP);
- node3.maximizableProperty().set(false);
-
- DockNode node4 = AnchorageSystem.createDock("Not closeable", generateRandomTree());
- node4.dock(station, DockNode.DOCK_POSITION.BOTTOM);
- node4.closeableProperty().set(false);
-
- primaryStage.setTitle("Anchorage FX");
- primaryStage.setScene(scene);
- primaryStage.show();
-
-
-
- //node4.makeNodeActiveOnFloatableStage();
- }
-
- private TreeView<String> generateRandomTree() {
- // create a demonstration tree view to use as the contents for a dock node
- TreeItem<String> root = new TreeItem<String>("Root");
- TreeView<String> treeView = new TreeView<String>(root);
- treeView.setShowRoot(false);
-
- // populate the prototype tree with some random nodes
- Random rand = new Random();
- for (int i = 4 + rand.nextInt(8); i > 0; i--) {
- TreeItem<String> treeItem = new TreeItem<String>("Item " + i);
- root.getChildren().add(treeItem);
- for (int j = 2 + rand.nextInt(4); j > 0; j--) {
- TreeItem<String> childItem = new TreeItem<String>("Child " + j);
- treeItem.getChildren().add(childItem);
- }
- }
-
- return treeView;
- }
-
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- launch(args);
- }
-
-}
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.anchorage.test;
+
+import com.anchorage.docks.node.DockNode;
+import com.anchorage.docks.stations.DockStation;
+import com.anchorage.system.AnchorageSystem;
+import java.util.Random;
+import javafx.application.Application;
+import javafx.scene.Scene;
+import javafx.scene.control.TableView;
+import javafx.scene.control.TreeItem;
+import javafx.scene.control.TreeView;
+import javafx.scene.web.HTMLEditor;
+import javafx.scene.web.WebEngine;
+import javafx.scene.web.WebView;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author Alessio
+ */
+public class AnchorageFX_settings extends Application {
+
+ @Override
+ public void start(Stage primaryStage) {
+
+ AnchorageSystem.installDefaultStyle();
+
+ DockStation station = AnchorageSystem.createStation();
+
+ Scene scene = new Scene(station, 800, 500);
+
+ DockNode node1 = AnchorageSystem.createDock("Not floatable", generateRandomTree());
+ node1.dock(station, DockNode.DOCK_POSITION.LEFT);
+ node1.floatableProperty().set(false);
+
+ DockNode node2 = AnchorageSystem.createDock("Not resizable", generateRandomTree());
+ node2.dock(station, DockNode.DOCK_POSITION.RIGHT);
+ node2.resizableProperty().set(false);
+
+ DockNode node3 = AnchorageSystem.createDock("Not maximizable", generateRandomTree());
+ node3.dock(station, DockNode.DOCK_POSITION.TOP);
+ node3.maximizableProperty().set(false);
+
+ DockNode node4 = AnchorageSystem.createDock("Not closeable", generateRandomTree());
+ node4.dock(station, DockNode.DOCK_POSITION.BOTTOM);
+ node4.closeableProperty().set(false);
+
+ primaryStage.setTitle("Anchorage FX");
+ primaryStage.setScene(scene);
+ primaryStage.show();
+
+
+
+ //node4.makeNodeActiveOnFloatableStage();
+ }
+
+ private TreeView<String> generateRandomTree() {
+ // create a demonstration tree view to use as the contents for a dock node
+ TreeItem<String> root = new TreeItem<String>("Root");
+ TreeView<String> treeView = new TreeView<String>(root);
+ treeView.setShowRoot(false);
+
+ // populate the prototype tree with some random nodes
+ Random rand = new Random();
+ for (int i = 4 + rand.nextInt(8); i > 0; i--) {
+ TreeItem<String> treeItem = new TreeItem<String>("Item " + i);
+ root.getChildren().add(treeItem);
+ for (int j = 2 + rand.nextInt(4); j > 0; j--) {
+ TreeItem<String> childItem = new TreeItem<String>("Child " + j);
+ treeItem.getChildren().add(childItem);
+ }
+ }
+
+ return treeView;
+ }
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) {
+ launch(args);
+ }
+
+}
@@ -31,6 +31,8 @@ public void start(Stage primaryStage) {
DockStation station = AnchorageSystem.createStation();
Scene scene = new Scene(station, 800, 500);
+
+ scene.getStylesheets().add("resources/AnchorageFX.css");
DockNode node1 = AnchorageSystem.createDock("Tree", generateRandomTree());
node1.dock(station, DockNode.DOCK_POSITION.CENTER);

0 comments on commit 128ab9e

Please sign in to comment.