本文整理汇总了Java中javafx.scene.layout.AnchorPane.setRightAnchor方法的典型用法代码示例。如果您正苦于以下问题:Java AnchorPane.setRightAnchor方法的具体用法?Java AnchorPane.setRightAnchor怎么用?Java AnchorPane.setRightAnchor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.AnchorPane
的用法示例。
在下文中一共展示了AnchorPane.setRightAnchor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createIconContent
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
public static Node createIconContent() {
StackPane sp = new StackPane();
AnchorPane anchorPane = new AnchorPane();
Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY);
rectangle.setStroke(Color.BLACK);
anchorPane.setPrefSize(rectangle.getWidth(), rectangle.getHeight());
Rectangle r1 = new Rectangle(14, 14, Color.web("#1c89f4"));
Rectangle r2 = new Rectangle(45, 10, Color.web("#349b00"));
Rectangle r3 = new Rectangle(35, 14, Color.web("#349b00"));
anchorPane.getChildren().addAll(r1, r2, r3);
AnchorPane.setTopAnchor(r1, Double.valueOf(1));
AnchorPane.setLeftAnchor(r1, Double.valueOf(1));
AnchorPane.setTopAnchor(r2, Double.valueOf(20));
AnchorPane.setLeftAnchor(r2, Double.valueOf(1));
AnchorPane.setBottomAnchor(r3, Double.valueOf(1));
AnchorPane.setRightAnchor(r3, Double.valueOf(5));
sp.getChildren().addAll(rectangle, anchorPane);
return new Group(sp);
}
示例2: createBottomXAxis
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
private Axis createBottomXAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
Axis axis = new Axis(Orientation.HORIZONTAL, Position.BOTTOM);
axis.setMinValue(MIN);
axis.setMaxValue(MAX);
axis.setPrefHeight(AXIS_WIDTH);
axis.setAutoScale(AUTO_SCALE);
AnchorPane.setBottomAnchor(axis, 0d);
AnchorPane.setLeftAnchor(axis, 25d);
AnchorPane.setRightAnchor(axis, 25d);
return axis;
}
示例3: start
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
@Override
public void start(final Stage stage) throws Exception {
fonts = Font.getFamilies().toArray(fonts);
pagination = new Pagination(fonts.length/itemsPerPage(), 0);
pagination.getStyleClass().add(Pagination.STYLE_CLASS_BULLET);
pagination.setPageFactory((Integer pageIndex) -> createPage(pageIndex));
AnchorPane anchor = new AnchorPane();
AnchorPane.setTopAnchor(pagination, 10.0);
AnchorPane.setRightAnchor(pagination, 10.0);
AnchorPane.setBottomAnchor(pagination, 10.0);
AnchorPane.setLeftAnchor(pagination, 10.0);
anchor.getChildren().addAll(pagination);
Scene scene = new Scene(anchor);
stage.setScene(scene);
stage.setTitle("PaginationSample");
scene.getStylesheets().add("paginationsample/ControlStyle.css");
stage.show();
}
示例4: SpecificationsPane
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
/**
* Creates an empty instance.
*/
public SpecificationsPane() {
this.tabPane = new TabPane();
this.addButton = new Button("+");
ViewUtils.setupClass(this);
AnchorPane.setTopAnchor(tabPane, 0.0);
AnchorPane.setLeftAnchor(tabPane, 0.0);
AnchorPane.setRightAnchor(tabPane, 0.0);
AnchorPane.setBottomAnchor(tabPane, 0.0);
AnchorPane.setTopAnchor(addButton, 5.0);
AnchorPane.setRightAnchor(addButton, 5.0);
this.getChildren().addAll(tabPane, addButton);
}
示例5: createTopXAxis
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
private Axis createTopXAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
Axis axis = new Axis(MIN, MAX, Orientation.HORIZONTAL, AxisType.LOGARITHMIC, Position.TOP);
axis.setPrefHeight(AXIS_WIDTH);
axis.setAutoScale(AUTO_SCALE);
AnchorPane.setTopAnchor(axis, 25d);
AnchorPane.setLeftAnchor(axis, 25d);
AnchorPane.setRightAnchor(axis, 25d);
return axis;
}
示例6: ViewPane
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
public ViewPane(MyGraphView graphView) {
// Setup Main Pane
AnchorPane.setBottomAnchor(this, 0.0);
AnchorPane.setTopAnchor(this, 0.0);
AnchorPane.setLeftAnchor(this, 0.0);
AnchorPane.setRightAnchor(this, 0.0);
this.setStyle("-fx-background-color : whitesmoke");
// Create new scene with graphView
this.myGraphView = graphView;
bottomPane = new Pane();
topPane = new Pane();
topPane.setPickOnBounds(false);
stackPane = new StackPane(bottomPane, myGraphView, topPane);
viewScene = new SubScene(stackPane, this.getWidth(), this.getHeight());
viewScene.widthProperty().bind(this.widthProperty());
viewScene.heightProperty().bind(this.heightProperty());
viewScene.setPickOnBounds(false);
// Add StackPane in SubScene and add content.
getChildren().addAll(viewScene);
// Bind LayoutWidth to this here
myGraphView.animationService.widthProperty.bind(this.widthProperty());
myGraphView.animationService.heightProperty.bind(this.heightProperty());
hoverInfo = new SimpleStringProperty("");
this.groupNodeInitLocation = new HashMap<>();
// Setup interactions and view elements
setupTransforms();
initRectangle();
addMouseInteractions();
}
示例7: setAnchorBounds
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
/**
* Sets the bounds for the contents of the anchor pane.
* @param contents
*/
private void setAnchorBounds(Node contents) {
AnchorPane.setTopAnchor(contents, 0.0);
AnchorPane.setRightAnchor(contents, 0.0);
AnchorPane.setBottomAnchor(contents, 0.0);
AnchorPane.setLeftAnchor(contents, 0.0);
}
示例8: createTopXAxis
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
private Axis createTopXAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
Axis axis = new Axis(Orientation.HORIZONTAL, Position.TOP);
axis.setMinValue(MIN);
axis.setMaxValue(MAX);
axis.setPrefHeight(AXIS_WIDTH);
axis.setAutoScale(AUTO_SCALE);
AnchorPane.setTopAnchor(axis, 25d);
AnchorPane.setLeftAnchor(axis, 25d);
AnchorPane.setRightAnchor(axis, 25d);
return axis;
}
示例9: addSeparator
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
/**
* Adds a separator on the list of tasks as the next element.
*/
private void addSeparator() {
Separator separator = new Separator();
AnchorPane.setLeftAnchor(separator, 17.0);
AnchorPane.setRightAnchor(separator, 17.0);
separator.setLayoutY(lastLayoutYLists + DISTANCE_BETWEEN_SEPARATOR);
separator.setPrefWidth(200.0);
taskListsAnchorPane.getChildren().add(separator);
lastLayoutYLists += 15;
}
示例10: createCenterXAxis
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
private Axis createCenterXAxis(final double MIN, final double MAX, final boolean AUTO_SCALE, final double AXIS_WIDTH) {
Axis axis = new Axis(Orientation.HORIZONTAL, Position.CENTER);
axis.setMinValue(MIN);
axis.setMaxValue(MAX);
axis.setPrefHeight(AXIS_WIDTH);
axis.setAutoScale(AUTO_SCALE);
AnchorPane.setBottomAnchor(axis, axis.getZeroPosition());
AnchorPane.setLeftAnchor(axis, AXIS_WIDTH);
AnchorPane.setRightAnchor(axis, AXIS_WIDTH);
return axis;
}
示例11: addTab
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
private void addTab(TreeMap treeMap) {
AnchorPane treeMapContainer = new AnchorPane();
treeMapContainer.setPrefSize(0, 0);
Tab tab = new Tab(treeMap.getData().getName(), treeMapContainer);
Node treeMapNode = treeMap.getNode();
treeMapContainer.getChildren().add(treeMapNode);
AnchorPane.setBottomAnchor(treeMapNode, 0.0);
AnchorPane.setLeftAnchor(treeMapNode, 0.0);
AnchorPane.setRightAnchor(treeMapNode, 0.0);
AnchorPane.setTopAnchor(treeMapNode, 0.0);
tabPane.getTabs().add(tab);
}
示例12: createCenterXAxis
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
private Axis createCenterXAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
Axis axis = new Axis(Orientation.HORIZONTAL, Position.CENTER);
axis.setMinValue(MIN);
axis.setMaxValue(MAX);
axis.setPrefHeight(AXIS_WIDTH);
axis.setAutoScale(AUTO_SCALE);
AnchorPane.setBottomAnchor(axis, axis.getZeroPosition());
AnchorPane.setLeftAnchor(axis, 25d);
AnchorPane.setRightAnchor(axis, 25d);
return axis;
}
示例13: createBottomTimeAxis
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
private Axis createBottomTimeAxis(final LocalDateTime START, final LocalDateTime END, final String PATTERN, final boolean AUTO_SCALE) {
Axis axis = new Axis(START, END, Orientation.HORIZONTAL, Position.BOTTOM);
axis.setDateTimeFormatPattern(PATTERN);
axis.setPrefHeight(AXIS_WIDTH);
AnchorPane.setBottomAnchor(axis, 0d);
AnchorPane.setLeftAnchor(axis, 25d);
AnchorPane.setRightAnchor(axis, 25d);
return axis;
}
示例14: createRightYAxis
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
private Axis createRightYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
Axis axis = new Axis(Orientation.VERTICAL, Position.RIGHT);
axis.setMinValue(MIN);
axis.setMaxValue(MAX);
axis.setPrefWidth(AXIS_WIDTH);
axis.setAutoScale(AUTO_SCALE);
AnchorPane.setRightAnchor(axis, 0d);
AnchorPane.setTopAnchor(axis, 0d);
AnchorPane.setBottomAnchor(axis, 25d);
return axis;
}
示例15: TimeIndicator
import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
public TimeIndicator(DayPane dayPane, Node indicator) {
AnchorPane.setLeftAnchor(dayPane, 0.0);
AnchorPane.setTopAnchor(dayPane, 0.0);
AnchorPane.setRightAnchor(dayPane, 0.0);
AnchorPane.setBottomAnchor(dayPane, 0.0);
this.getChildren().add(dayPane);
this.startTime = dayPane.dayStartTimeProperty();
this.endTime = dayPane.dayEndTimeProperty();
this.date = dayPane.getDayDate();
this.indicator = indicator;
AnchorPane.setLeftAnchor(indicator, 0.0);
AnchorPane.setRightAnchor(indicator, 0.0);
// update position if the DayPane's time window changes
startTime.addListener(observable -> setIndicatorPosition(indicator));
endTime.addListener(observable -> setIndicatorPosition(indicator));
// updates the position every minute
Timeline indicatorupdate = new Timeline(new KeyFrame(javafx.util.Duration.minutes(1), actionEvent -> setIndicatorPosition(indicator)));
indicatorupdate.setCycleCount(Animation.INDEFINITE);
indicatorupdate.play();
// initial position
setIndicatorPosition(indicator);
}