Search in sources :

Example 26 with Pane

use of javafx.scene.layout.Pane in project Gargoyle by callakrsos.

the class PolygonEx method start.

@Override
public void start(Stage stage) {
    Pane g = new Pane();
    ScrollPane convert = XY.convert(g);
    {
        //한 점의 좌표가 주어진경우
        double x = 150;
        double y = 150;
        //빗변의 길이
        double r = 100;
        double degree = Math.atan2(y, x);
        double x1 = x + (r / Math.tan(degree));
        double y1 = y;
        double x2 = x1;
        double y2 = y + y - r;
        Polygon polygon = new Polygon();
        polygon.setLayoutX(x);
        polygon.setLayoutY(x);
        polygon.getPoints().addAll(new Double[] { x, y, x1, y1, x2, y2 });
        g.getChildren().add(polygon);
        g.getChildren().add(new Line(1, 1, 10, 10));
    }
    {
        //한 점의 좌표가 주어진경우
        double x = 150;
        double y = 150;
        //빗변의 길이
        double r = 100;
        double degree = Math.atan2(y, x);
        double x1 = x + (r / Math.tan(degree));
        double y1 = y;
        double x2 = x1;
        double y2 = y + r;
        Polygon polygon = new Polygon();
        polygon.getPoints().addAll(new Double[] { x, y, x1, y1, x2, y2 });
        g.getChildren().add(polygon);
    }
    //		Line line = new Line();
    //		line.setStartX(x);
    //		line.setStartY(y);
    //		line.setEndX(x2);
    //		line.setEndY(y2);
    //
    //		Text text = new Text("x : " + x + " y : " + y);
    //		text.setX(x);
    //		text.setY(y - 20);
    //
    //		Text text1 = new Text("x1 : " + x1 + " y1 : " + y1);
    //		text1.setX(x1);
    //		text1.setY(y1 - 20);
    //
    //		Text text2 = new Text("x2 : " + x2 + " y2 : " + y2);
    //		text2.setX(x2);
    //		text2.setY(y2 - 20);
    //		g.getChildren().addAll(polygon, text, text1, text2);
    Scene scene = new Scene(convert, 1800, 900);
    stage.setScene(scene);
    stage.show();
}
Also used : Line(javafx.scene.shape.Line) ScrollPane(javafx.scene.control.ScrollPane) Polygon(javafx.scene.shape.Polygon) Scene(javafx.scene.Scene) ScrollPane(javafx.scene.control.ScrollPane) Pane(javafx.scene.layout.Pane)

Example 27 with Pane

use of javafx.scene.layout.Pane in project jgnash by ccavanaugh.

the class InvestmentSlipManager method buildDividendTab.

private SlipControllerContainer buildDividendTab(final String name) {
    try {
        final FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("DividendSlip.fxml"), resources);
        final Pane pane = fxmlLoader.load();
        final DividendSlipController slipController = fxmlLoader.getController();
        slipController.accountProperty().bind(accountProperty());
        return new SlipControllerContainer(name, slipController, pane);
    } catch (final IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane)

Example 28 with Pane

use of javafx.scene.layout.Pane in project jgnash by ccavanaugh.

the class InvestmentSlipManager method buildSplitMergeTab.

private SlipControllerContainer buildSplitMergeTab(final String name, final TransactionType transactionType) {
    try {
        final FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("SplitMergeSharesSlip.fxml"), resources);
        final Pane pane = fxmlLoader.load();
        final SplitMergeSharesSlipController slipController = fxmlLoader.getController();
        slipController.setTransactionType(transactionType);
        slipController.accountProperty().bind(accountProperty());
        return new SlipControllerContainer(name, slipController, pane);
    } catch (final IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane)

Example 29 with Pane

use of javafx.scene.layout.Pane in project jgnash by ccavanaugh.

the class InvestmentSlipManager method buildBuyShareTab.

private SlipControllerContainer buildBuyShareTab(final String name) {
    try {
        final FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("BuyShareSlip.fxml"), resources);
        final Pane pane = fxmlLoader.load();
        final BuyShareSlipController slipController = fxmlLoader.getController();
        slipController.accountProperty().bind(accountProperty());
        return new SlipControllerContainer(name, slipController, pane);
    } catch (final IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane)

Example 30 with Pane

use of javafx.scene.layout.Pane in project jgnash by ccavanaugh.

the class InvestmentSlipManager method buildCashTransferTab.

private SlipControllerContainer buildCashTransferTab(final String name, final SlipType slipType) {
    try {
        final FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("InvestmentTransactionPane.fxml"), resources);
        final Pane pane = fxmlLoader.load();
        final SlipController slipController = fxmlLoader.getController();
        slipController.setSlipType(slipType);
        slipController.accountProperty().bind(accountProperty());
        return new SlipControllerContainer(name, slipController, pane);
    } catch (final IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane)

Aggregations

Pane (javafx.scene.layout.Pane)34 StackPane (javafx.scene.layout.StackPane)13 IOException (java.io.IOException)12 FXMLLoader (javafx.fxml.FXMLLoader)12 Node (javafx.scene.Node)7 BorderPane (javafx.scene.layout.BorderPane)6 Scene (javafx.scene.Scene)5 Label (javafx.scene.control.Label)5 ArrayList (java.util.ArrayList)4 AnchorPane (javafx.scene.layout.AnchorPane)4 Stage (javafx.stage.Stage)4 HashMap (java.util.HashMap)3 List (java.util.List)3 FXML (javafx.fxml.FXML)3 ScrollPane (javafx.scene.control.ScrollPane)3 UserThread (io.bitsquare.common.UserThread)2 Insets (javafx.geometry.Insets)2 Parent (javafx.scene.Parent)2 Button (javafx.scene.control.Button)2 TabPane (javafx.scene.control.TabPane)2