本文整理汇总了Java中javafx.geometry.NodeOrientation类的典型用法代码示例。如果您正苦于以下问题:Java NodeOrientation类的具体用法?Java NodeOrientation怎么用?Java NodeOrientation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NodeOrientation类属于javafx.geometry包,在下文中一共展示了NodeOrientation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initUi
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
private void initUi() {
timeLabel.setValue(model.getTime());
// Use weak listener here so view can be garbage collected when key frame is deleted, because model instance will hang around in command stack.
ChangeListener<Number> timeChangeListener = (v, o, n) -> timeLabel.setValue(n.doubleValue());
timeLabel.getProperties().put(TIME_CHANGE_LISTENER_KEY, timeChangeListener);
model.timeProperty().addListener(new WeakChangeListener<>(timeChangeListener));
incrementButton.setGraphic(createArrowGraphic(NodeOrientation.LEFT_TO_RIGHT));
decrementButton.setGraphic(createArrowGraphic(NodeOrientation.RIGHT_TO_LEFT));
deleteButton.setGraphic(Svg.MINUS_TINY.node());
leftButtonBox.visibleProperty().bind(model.timeProperty().greaterThan(0));
rightButtonBox.visibleProperty().bind(model.timeProperty().greaterThan(0));
plusLabel.visibleProperty().bind(model.timeProperty().greaterThan(0));
plusLabel.managedProperty().bind(plusLabel.visibleProperty());
highlight.visibleProperty().bind(model.selectedProperty());
}
示例2: setDataNode
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
private void setDataNode(SVNLogEntry entry, Data<String, String> data) {
Group group = new Group();
group.setManaged(false);
Text value = new Text(entry.getRevision() + "");
value.setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);
value.translateYProperty().set(-15);
Circle circle = new Circle(4, Color.WHITE);
circle.setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);
circle.setStroke(Color.web("#f3622d"));
StackPane stackPane = new StackPane(value, circle);
stackPane.setPrefSize(30, 60);
group.getChildren().add(stackPane);
data.setNode(group);
}
示例3: initialize
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
/**
* Will be called as soon as FXML file is loaded.
*/
@FXML
private void initialize() {
setTitle("Settings");
getIcons().add(new Image(getClass().getResourceAsStream("/image/icon.png")));
setScene(new Scene(root));
centerOnScreen();
// orientation
orientation.selectedProperty().addListener((observable , oldValue , newValue) -> {
if (newValue) { // selected
mainWindowController.getRoot().setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);
orientation.setText("Current : LEFT -> TO -> RIGHT");
} else {
mainWindowController.getRoot().setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT);
orientation.setText("Current : RIGHT -> TO -> LEFT");
}
});
}
示例4: GeneratorAppView
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
/**
* Instantiates a new Generator app view.
*
* @param action the action
*/
public GeneratorAppView(Action action)
{
// AeroFX.style();
// AquaFx.style();
tabLookup = new HashMap<>();
this.action = action;
ToolBar mainBar = new ToolBar();
Label appLabel = new Label("BURST Address Generator");
mainBar.getItems().add(appLabel);
tabPane = new TabPane();
ToolBar statusBar = new ToolBar();
statusBar.setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT);
statusBar.getItems().add(new Label("Version: 0.2.3-SNAPSHOT"));
setTop(mainBar);
setCenter(tabPane);
setBottom(statusBar);
}
示例5: MetroIndetermineSpinner
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
private MetroIndetermineSpinner(boolean spinEnabled, Paint fillOverride)
{
// does not need to be a weak listener since it only listens to its
// own property
// this.impl_treeVisibleProperty().addListener(
// MetroProgressIndicatorSkin.this.parentTreeVisibleChangedListener);
this.spinEnabled = spinEnabled;
this.fillOverride = fillOverride;
this.setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);
this.getStyleClass().setAll("spinner");
this.pathsG = new IndicatorPaths();
this.getChildren().add(this.pathsG);
this.rebuild();
this.rebuildTimeline();
}
示例6: initToolBar
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
private void initToolBar() {
toolBar.setId("toolBar");
toolBar.getItems().addAll(clearButton, showMessageButton);
toolBar.setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT);
resultPaneLayout.setTop(toolBar);
if (failuresList.isEmpty()) {
clearButton.setDisable(true);
}
clearButton.setOnAction(e -> clear());
showMessageButton.setDisable(true);
showMessageButton.setOnAction(e -> showMessage());
}
示例7: initComponents
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
private void initComponents() {
toolBar.setId("toolBar");
toolBar.setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT);
toolBar.getItems().addAll(clearButton, exportButton, wordWrapButton);
clearButton.setDisable(true);
exportButton.setDisable(true);
clearButton.setOnAction((e) -> clear());
exportButton.setOnAction(e -> onExport());
wordWrapButton.setOnAction((e) -> textArea.setWrapText(wordWrapButton.isSelected()));
content.setTop(toolBar);
content.setCenter(textArea);
}
示例8: Tile
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
public Tile(final SkinType SKIN_TYPE) {
setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);
skinType = SKIN_TYPE;
getStyleClass().add("tile");
init();
registerListeners();
}
示例9: callAction
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
@Override
protected void callAction(String name) {
boolean rtl = (getControl().getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT);
if (("TraverseLeft".equals(name) && !rtl) || ("TraverseRight".equals(name) && rtl) || "TraverseUp".equals(name)) {
if (getControl().isFocused()) {
selectPreviousTab();
}
} else if (("TraverseRight".equals(name) && !rtl) || ("TraverseLeft".equals(name) && rtl) || "TraverseDown".equals(name)) {
if (getControl().isFocused()) {
selectNextTab();
}
} else if (CTRL_TAB.equals(name) || CTRL_PAGE_DOWN.equals(name)) {
selectNextTab();
} else if (CTRL_SHIFT_TAB.equals(name) || CTRL_PAGE_UP.equals(name)) {
selectPreviousTab();
} else if (HOME.equals(name)) {
if (getControl().isFocused()) {
moveSelection(0, 1);
}
} else if (END.equals(name)) {
if (getControl().isFocused()) {
moveSelection(getControl().getTabs().size() - 1, -1);
}
} else {
super.callAction(name);
}
}
示例10: Clock
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
public Clock(final ClockSkinType SKIN, final ZonedDateTime TIME) {
setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);
skinType = SKIN;
getStyleClass().add("clock");
init(TIME);
registerListeners();
}
示例11: Gauge
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
public Gauge(final SkinType SKIN) {
setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);
skinType = SKIN;
getStyleClass().add("gauge");
init();
registerListeners();
}
示例12: FilteredColumnHeader
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
public FilteredColumnHeader(TableColumn<?, ?> column) {
super();
// init nodes
this.prefWidthProperty().bind(column.widthProperty());
if (column.isSortable()) {
setPadding(new Insets(0, 30, 0, 0));
}
this.setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);
this.setAlignment(Pos.CENTER_LEFT);
this.getStyleClass().add("filteredColumnHeader");
this.label = new Label();
label.textProperty().bind(column.textProperty());
this.label.setMaxWidth(Double.MAX_VALUE);
HBox.setHgrow(this.label, Priority.ALWAYS);
this.filterButton = buildFilterButton();
this.getChildren().addAll(this.label, filterButton);
// handle button icon
buttonIcon.setImage(isNotFilteredIcon);
isFiltered.addListener((ChangeListener<Boolean>) (observable, oldValue, newValue) -> {
if (newValue) {
buttonIcon.setImage(isFilteredIcon);
} else {
buttonIcon.setImage(isNotFilteredIcon);
}
});
}
示例13: start
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
@Override public void start(Stage stage) {
StackPane pane = new StackPane(gauge);
pane.setPadding(new Insets(20));
pane.setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT);
LinearGradient gradient = new LinearGradient(0, 0, 0, pane.getLayoutBounds().getHeight(),
false, CycleMethod.NO_CYCLE,
new Stop(0.0, Color.rgb(38, 38, 38)),
new Stop(1.0, Color.rgb(15, 15, 15)));
//pane.setBackground(new Background(new BackgroundFill(gradient, CornerRadii.EMPTY, Insets.EMPTY)));
//pane.setBackground(new Background(new BackgroundFill(Color.rgb(39,44,50), CornerRadii.EMPTY, Insets.EMPTY)));
//pane.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY)));
//pane.setBackground(new Background(new BackgroundFill(Gauge.DARK_COLOR, CornerRadii.EMPTY, Insets.EMPTY)));
Scene scene = new Scene(pane);
scene.setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT);
stage.setTitle("mars-sim");
stage.setScene(scene);
stage.show();
//gauge.setValue(50);
// Calculate number of nodes
calcNoOfNodes(pane);
System.out.println(noOfNodes + " Nodes in SceneGraph");
timer.start();
//gauge.getSections().get(0).setStart(10);
//gauge.getSections().get(0).setStop(90);
}
示例14: setFocusedSquare
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
private void setFocusedSquare(ColorSquare square) {
hoverSquare.setVisible(square != null);
if (square == focusedSquare) {
return;
}
focusedSquare = square;
hoverSquare.setVisible(focusedSquare != null);
if (focusedSquare == null) {
return;
}
if (!focusedSquare.isFocused()) {
focusedSquare.requestFocus();
}
hoverSquare.rectangle.setFill(focusedSquare.rectangle.getFill());
Bounds b = square.localToScene(square.getLayoutBounds());
double x = b.getMinX();
double y = b.getMinY();
double xAdjust;
double scaleAdjust = hoverSquare.getScaleX() == 1.0 ? 0 : hoverSquare.getWidth() / 4.0;
if (colorPicker.getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT) {
x = focusedSquare.getLayoutX();
xAdjust = -focusedSquare.getWidth() + scaleAdjust;
} else {
xAdjust = focusedSquare.getWidth() / 2.0 + scaleAdjust;
}
hoverSquare.setLayoutX(snapPosition(x) - xAdjust);
hoverSquare.setLayoutY(snapPosition(y) - focusedSquare.getHeight() / 2.0 + (hoverSquare.getScaleY() == 1.0 ? 0 : focusedSquare
.getHeight() / 4.0));
}
示例15: IndeterminateSpinner
import javafx.geometry.NodeOrientation; //导入依赖的package包/类
private IndeterminateSpinner(boolean spinEnabled, Paint fillOverride) {
this.spinEnabled = spinEnabled;
this.fillOverride = fillOverride;
setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);
getStyleClass().setAll("spinner");
pathsG = new IndicatorPaths();
getChildren().add(pathsG);
rebuild();
rebuildTimeline();
}