use of javafx.scene.layout.AnchorPane in project Gargoyle by callakrsos.
the class PropertyChangeExam method start.
@Override
public void start(Stage primaryStage) throws Exception {
TextArea textArea = new TextArea("");
Button button = new Button("ssss");
button.setStyle("-fx-base: red;");
button.setFont(new Font(55));
Button button2 = new Button("ssss2");
// button2.textProperty().bind(button.textProperty());
// button2.styleProperty().bind(button.styleProperty());
// button2.getStyleClass().addAll(button.getStyleClass());
propertyCopy2(button, button2);
//
// button.setVisible(false);
// propertyCopy(button, button2);
// List<CssMetaData<? extends Styleable, ?>> cssMetaData =
// button.getCssMetaData();
// cssMetaData.forEach(cssMeta -> {
// String property = cssMeta.getProperty();
// System.out.print(property);
// try {
// String ss = String.valueOf(cssMeta.getInitialValue(null));
//
// System.out.println(" : " + ss);
// } catch (NullPointerException e) {
//
// }
//
// });
// button.setStyle(button.getStyle());
// button2.styleProperty().set(button.getStyle());
// button2.setSkin(button.getSkin());
// button2.getCssMetaData().clear();
// button2.getCssMetaData().addAll(button.getControlCssMetaData());
// button2.fire();
//
// ExpressionHelper.fireValueChangedEvent(helper);
// button2.getCssMetaData().addAll(button.getControlCssMetaData());
// button2.textProperty().bind(button.textProperty());
// button2.styleProperty().bind(button.styleProperty());
// button2.visibleProperty().bind(button.visibleProperty());
// button2.disableProperty().bind(button.disableProperty());
// button2.fontProperty().bind(button.fontProperty());
textArea.textProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> oba, String oldval, String newval) {
button.setStyle(newval);
button2.setStyle(newval);
}
});
AnchorPane root = new AnchorPane(new HBox(textArea, button, button2));
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.show();
}
use of javafx.scene.layout.AnchorPane in project Gargoyle by callakrsos.
the class CaptureScreenController method initialize.
@FXML
public void initialize() {
itemHandler = new CaptureItemHandler(this);
flowItems.getChildren().addAll(itemHandler.getItems());
anchorBoard = new AnchorPane();
//아이템 카운트 수를 핸들링하는 이벤트 리스너
anchorBoard.getChildren().addListener((ListChangeListener) c -> {
if (c.next()) {
if (c.wasAdded()) {
int addedSize = c.getAddedSize();
itemCount.add(addedSize);
} else if (c.wasRemoved()) {
itemCount.subtract(c.getRemovedSize());
}
}
});
spPic.setContent(anchorBoard);
anchorBoard.setOnScroll(ev -> {
if (ev.isControlDown()) {
if (ev.getDeltaY() > 0) {
scaleDeltaX.set(scaleDeltaX.get() + 0.1);
scaleDeltaY.set(scaleDeltaY.get() + 0.1);
scale.setX(scaleDeltaX.get());
scale.setY(scaleDeltaY.get());
scale.setPivotX(ev.getX());
scale.setPivotY(ev.getY());
} else {
double value = scaleDeltaX.get() - 0.1;
double value2 = scaleDeltaY.get() - 0.1;
if (value < 0)
return;
if (value2 < 0)
return;
scaleDeltaX.set(value);
scaleDeltaY.set(value2);
scale.setX(scaleDeltaX.get());
scale.setY(scaleDeltaY.get());
scale.setPivotX(ev.getX());
scale.setPivotY(ev.getY());
}
lblStatus.setText(String.format(STATUS_FORMAT, scaleDeltaX.get(), ev.getX(), ev.getY(), itemCount.get()));
}
});
anchorBoard.setOnMouseMoved(ev -> {
lblStatus.setText(String.format(STATUS_FORMAT, scaleDeltaX.get(), ev.getX(), ev.getY(), itemCount.get()));
});
}
use of javafx.scene.layout.AnchorPane in project trex-stateless-gui by cisco-system-traffic-generator.
the class TrexApp method start.
@Override
public void start(Stage stage) throws Exception {
speedupTooltip();
primaryStage = stage;
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/MainView.fxml"));
AnchorPane page = fxmlLoader.load();
MainViewController mainviewcontroller = fxmlLoader.getController();
Scene scene = new Scene(page);
scene.getStylesheets().add(TrexApp.class.getResource("/styles/mainStyle.css").toExternalForm());
stage.setScene(scene);
stage.setTitle("TRex");
stage.setResizable(true);
stage.setMinWidth(780);
stage.setMinHeight(700);
stage.getIcons().add(new Image("/icons/trex.png"));
packetBuilderAppController = injector.getInstance(AppController.class);
PreferencesManager.getInstance().setPacketEditorConfigurations(packetBuilderAppController.getConfigurations());
packetBuilderAppController.registerEventBusHandler(mainviewcontroller);
stage.show();
}
Aggregations