Skip to content

Commit

Permalink
Merge pull request #19 from Marcoral/master
Browse files Browse the repository at this point in the history
Big Fixes
  • Loading branch information
goxr3plus authored May 3, 2019
2 parents a2fb177 + e95e36a commit e6bb13b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import java.io.IOException;

import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.layout.AnchorPane;

Expand All @@ -26,26 +25,13 @@
* @version 1.0
*/
public class BorderlessPane extends AnchorPane {



public BorderlessPane () throws IOException {
public BorderlessPane (BorderlessController controller) throws IOException {

// ------------------------------------FXMLLOADER ----------------------------------------

FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/Borderless.fxml"));
loader.setController(this);
loader.setController(controller);
loader.setRoot(this);
loader.load();

}


/**
* Called as soon as .fxml is initialised
*/
@FXML
private void initialize() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ public class BorderlessScene extends Scene {
public BorderlessScene(Stage stage, StageStyle stageStyle, Parent sceneRoot) {
super(new Pane());
try {
this.controller = new BorderlessController();
// Load the FXML
this.root = new BorderlessPane();
this.root = new BorderlessPane(this.controller);

// Set Scene root
setRoot(this.root);
setContent(sceneRoot);

// Initialize the Controller
this.controller = new BorderlessController();
this.controller.setStage(stage);
this.controller.createTransparentWindow(stage);

Expand Down Expand Up @@ -233,9 +233,7 @@ public Delta getWindowedPositon() {
* Removes the default css style of the corners
*/
public void removeDefaultCSS() {

((Parent) this.root.getChildren().get(0)).getStylesheets().remove(0);

this.root.getStylesheets().remove(0);
}

/**
Expand Down
89 changes: 42 additions & 47 deletions src/main/resources/fxml/Borderless.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,48 @@
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.Region?>


<fx:root maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" type="Pane" xmlns="http://javafx.com/javafx/8.0.181" xmlns:fx="http://javafx.com/fxml/1">
<fx:root maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" style="-fx-background-color: transparent;" stylesheets="@../css/application.css" type="Pane" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1">
<children>
<AnchorPane prefHeight="391.0" prefWidth="565.0" style="-fx-background-color: transparent;" stylesheets="@../css/application.css">
<children>
<Region />
<Pane fx:id="topLeftPane" prefHeight="10.0" prefWidth="10.0" styleClass="topLeftPane" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0">
<cursor>
<Cursor fx:constant="NW_RESIZE" />
</cursor>
</Pane>
<Pane fx:id="topRightPane" prefHeight="10.0" prefWidth="10.0" styleClass="topRightPane" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<cursor>
<Cursor fx:constant="NE_RESIZE" />
</cursor>
</Pane>
<Pane fx:id="bottomRightPane" prefHeight="10.0" prefWidth="10.0" styleClass="bottomRightPane" AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0">
<cursor>
<Cursor fx:constant="SE_RESIZE" />
</cursor>
</Pane>
<Pane fx:id="bottomLeftPane" prefHeight="10.0" prefWidth="10.0" styleClass="bottomLeftPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0">
<cursor>
<Cursor fx:constant="SW_RESIZE" />
</cursor>
</Pane>
<Pane fx:id="leftPane" prefWidth="8.0" styleClass="leftPane" AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="10.0">
<cursor>
<Cursor fx:constant="W_RESIZE" />
</cursor>
</Pane>
<Pane fx:id="rightPane" prefWidth="8.0" styleClass="rightPane" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="10.0">
<cursor>
<Cursor fx:constant="E_RESIZE" />
</cursor>
</Pane>
<Pane fx:id="topPane" prefHeight="8.0" styleClass="topPane" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="0.0">
<cursor>
<Cursor fx:constant="N_RESIZE" />
</cursor>
</Pane>
<Pane fx:id="bottomPane" prefHeight="8.0" styleClass="bottomPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0">
<cursor>
<Cursor fx:constant="S_RESIZE" />
</cursor>
</Pane>
</children>
</AnchorPane>
<Region />
<Pane fx:id="topLeftPane" prefHeight="10.0" prefWidth="10.0" styleClass="topLeftPane" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0">
<cursor>
<Cursor fx:constant="NW_RESIZE" />
</cursor>
</Pane>
<Pane fx:id="topRightPane" prefHeight="10.0" prefWidth="10.0" styleClass="topRightPane" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<cursor>
<Cursor fx:constant="NE_RESIZE" />
</cursor>
</Pane>
<Pane fx:id="bottomRightPane" prefHeight="10.0" prefWidth="10.0" styleClass="bottomRightPane" AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0">
<cursor>
<Cursor fx:constant="SE_RESIZE" />
</cursor>
</Pane>
<Pane fx:id="bottomLeftPane" prefHeight="10.0" prefWidth="10.0" styleClass="bottomLeftPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0">
<cursor>
<Cursor fx:constant="SW_RESIZE" />
</cursor>
</Pane>
<Pane fx:id="leftPane" prefWidth="8.0" styleClass="leftPane" AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="10.0">
<cursor>
<Cursor fx:constant="W_RESIZE" />
</cursor>
</Pane>
<Pane fx:id="rightPane" prefWidth="8.0" styleClass="rightPane" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="10.0">
<cursor>
<Cursor fx:constant="E_RESIZE" />
</cursor>
</Pane>
<Pane fx:id="topPane" prefHeight="8.0" styleClass="topPane" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="0.0">
<cursor>
<Cursor fx:constant="N_RESIZE" />
</cursor>
</Pane>
<Pane fx:id="bottomPane" prefHeight="8.0" styleClass="bottomPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0">
<cursor>
<Cursor fx:constant="S_RESIZE" />
</cursor>
</Pane>
</children>
</fx:root>
2 changes: 1 addition & 1 deletion src/main/resources/fxml/TransparentWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<?import javafx.scene.layout.StackPane?>


<fx:root fx:id="stackPane" prefHeight="415.0" prefWidth="620.0" style="-fx-background-color: rgb(0,0,0,0.3); -fx-border-color: orange; -fx-border-width: 2;" type="StackPane" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.181">
<fx:root fx:id="stackPane" style="-fx-background-color: rgb(0,0,0,0.3); -fx-border-color: orange; -fx-border-width: 2;" type="StackPane" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.181">
<!-- TODO Add Nodes -->
</fx:root>

0 comments on commit e6bb13b

Please sign in to comment.