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();
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations