当前位置: 首页>>代码示例>>Java>>正文


Java AnchorPane.setLeftAnchor方法代码示例

本文整理汇总了Java中javafx.scene.layout.AnchorPane.setLeftAnchor方法的典型用法代码示例。如果您正苦于以下问题:Java AnchorPane.setLeftAnchor方法的具体用法?Java AnchorPane.setLeftAnchor怎么用?Java AnchorPane.setLeftAnchor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.layout.AnchorPane的用法示例。


在下文中一共展示了AnchorPane.setLeftAnchor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: show

import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
public void show() {
	textArea = new JFXTextArea(bodyText);
	
	JFXDialogLayout content = new JFXDialogLayout();
	content.setHeading(new Text(headingText));
	content.setBody(textArea);
	content.setPrefSize(dialogWidth, dialogHeight);
	StackPane stackPane = new StackPane();
	stackPane.autosize();
	JFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true);
	JFXButton button = new JFXButton("Okay");
	button.setOnAction(new EventHandler<ActionEvent>() {
		@Override
		public void handle(ActionEvent event) {
			dialog.close();
		}
	});
	button.setButtonType(com.jfoenix.controls.JFXButton.ButtonType.RAISED);
	button.setPrefHeight(32);
	button.setStyle(dialogBtnStyle);
	content.setActions(button);
	pane.getChildren().add(stackPane);
	AnchorPane.setTopAnchor(stackPane, (pane.getHeight() - content.getPrefHeight()) / 2);
	AnchorPane.setLeftAnchor(stackPane, (pane.getWidth() - content.getPrefWidth()) / 2);
	dialog.show();
}
 
开发者ID:Seil0,项目名称:cemu_UI,代码行数:27,代码来源:JFXTextAreaInfoDialog.java

示例2: initialize

import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
@Override
public void initialize(URL location, ResourceBundle resources) {
    
    if (topsoilPlot.getPlot() instanceof JavaScriptPlot) {
        
        vboxMaster.prefWidthProperty().bind(primaryStageWindow.getScene().widthProperty());
        vboxMaster.prefHeightProperty().bind(primaryStageWindow.getScene().heightProperty().subtract(PIXEL_OFFSET_FOR_MENU));
        
        Node topsoilPlotNode = topsoilPlot.getPlot().displayAsNode();
        
        plotAndConfig.getChildren().setAll(topsoilPlotNode);
        AnchorPane.setLeftAnchor(topsoilPlotNode, 0.0);
        AnchorPane.setRightAnchor(topsoilPlotNode, 0.0);
        AnchorPane.setTopAnchor(topsoilPlotNode, 0.0);
        AnchorPane.setBottomAnchor(topsoilPlotNode, 0.0);
        
        VBox.setVgrow(plotAndConfig, Priority.ALWAYS);

        plotToolBar.getItems().addAll(topsoilPlot.toolbarControlsFactory());
        plotToolBar.setPadding(Insets.EMPTY);
        
    }
}
 
开发者ID:CIRDLES,项目名称:Squid,代码行数:24,代码来源:TopsoilPlotController.java

示例3: AnchorPaneSample

import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
public AnchorPaneSample() {

    AnchorPane anchorPane = new AnchorPane();

    Label label1 = new Label("We are all in an AnchorPane.");        
    ImageView imageView = new ImageView(ICON_48);
    Button button1 = new Button("Submit");

    anchorPane.getChildren().addAll(label1, imageView, button1);

    AnchorPane.setTopAnchor(label1, Double.valueOf(2));
    AnchorPane.setLeftAnchor(label1, Double.valueOf(20));
    AnchorPane.setTopAnchor(button1, Double.valueOf(40));
    AnchorPane.setLeftAnchor(button1, Double.valueOf(20));
    AnchorPane.setTopAnchor(imageView, Double.valueOf(75));
    AnchorPane.setLeftAnchor(imageView, Double.valueOf(20));

    getChildren().add(anchorPane);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:20,代码来源:AnchorPaneSample.java

示例4: 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);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:24,代码来源:AnchorPaneSample.java

示例5: start

import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
    AnchorPane pane = new AnchorPane(xAxisLog, yAxisLog, gridLog);

    AnchorPane.setTopAnchor(yAxisLog, 0d);
    AnchorPane.setBottomAnchor(yAxisLog, 25d);
    AnchorPane.setLeftAnchor(yAxisLog, 0d);

    AnchorPane.setLeftAnchor(xAxisLog, 25d);
    AnchorPane.setRightAnchor(xAxisLog, 0d);
    AnchorPane.setBottomAnchor(xAxisLog, 0d);

    AnchorPane.setTopAnchor(gridLog, 0d);
    AnchorPane.setRightAnchor(gridLog, 0d);
    AnchorPane.setBottomAnchor(gridLog, 25d);
    AnchorPane.setLeftAnchor(gridLog, 25d);

    Scene scene = new Scene(pane);

    stage.setTitle("LogGridTest");
    stage.setScene(scene);
    stage.show();
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:23,代码来源:LogGridTest.java

示例6: 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;
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:14,代码来源:ChartTest.java

示例7: createLeftYAxis

import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
private Axis createLeftYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
    Axis axis = new Axis(Orientation.VERTICAL, Position.LEFT);
    axis.setMinValue(MIN);
    axis.setMaxValue(MAX);
    axis.setPrefWidth(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

    AnchorPane.setTopAnchor(axis, 0d);
    AnchorPane.setBottomAnchor(axis, 25d);
    AnchorPane.setLeftAnchor(axis, 0d);

    return axis;
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:14,代码来源:ChartTest.java

示例8: setChildNode

import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
@Override
public void setChildNode(Node node) {
    containerContent.clear();
    AnchorPane.setTopAnchor(node, 0.0);
    AnchorPane.setLeftAnchor(node, 0.0);
    AnchorPane.setRightAnchor(node, 0.0);
    AnchorPane.setBottomAnchor(node, 0.0);
    containerContent.setAll(node);
}
 
开发者ID:stechy1,项目名称:drd,代码行数:10,代码来源:RootController.java

示例9: adjustGridAnchors

import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
private void adjustGridAnchors() {
    if (null == grid) return;
    AnchorPane.setLeftAnchor(grid, hasLeftYAxis ? leftAxisWidth : 0d);
    AnchorPane.setRightAnchor(grid, hasRightYAxis ? rightAxisWidth : 0d);
    AnchorPane.setTopAnchor(grid, hasTopXAxis ? topAxisHeight : 0d);
    AnchorPane.setBottomAnchor(grid, hasBottomXAxis ? bottomAxisHeight : 0d);
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:8,代码来源:XYChart.java

示例10: 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);
}
 
开发者ID:PtitNoony,项目名称:FxTreeMap,代码行数:13,代码来源:SampleViewController.java

示例11: createCenterYAxis

import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
private Axis createCenterYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
    Axis axis = new Axis(Orientation.VERTICAL, Position.CENTER);
    axis.setMinValue(MIN);
    axis.setMaxValue(MAX);
    axis.setPrefWidth(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

    AnchorPane.setTopAnchor(axis, 0d);
    AnchorPane.setBottomAnchor(axis, 25d);
    AnchorPane.setLeftAnchor(axis, axis.getZeroPosition());

    return axis;
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:14,代码来源:ChartTest.java

示例12: createLeftYAxis

import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
private Axis createLeftYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE, final double AXIS_WIDTH) {
    Axis axis = new Axis(Orientation.VERTICAL, Position.LEFT);
    axis.setMinValue(MIN);
    axis.setMaxValue(MAX);
    axis.setPrefWidth(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

    AnchorPane.setTopAnchor(axis, 0d);
    AnchorPane.setBottomAnchor(axis, AXIS_WIDTH);
    AnchorPane.setLeftAnchor(axis, 0d);

    return axis;
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:14,代码来源:LineChartTest.java

示例13: VerticalResizeContainerView

import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
/**
 * Creates an instance of this container class.
 */
public VerticalResizeContainerView() {
  this.getChildren().add(container);
  container.getChildren().addAll(contentContainer);
  contentContainer.getChildren().addAll(content, dragLine);
  AnchorPane.setLeftAnchor(container, 0.0);
  AnchorPane.setRightAnchor(container, 0.0);
  AnchorPane.setTopAnchor(container, 0.0);
  dragLine.widthProperty().bind(container.widthProperty());
  // AnchorPane.setBottomAnchor(dragLine, 0.0);
  ViewUtils.setupView(this, "resizeContainer.css");

  this.getStyleClass().add("resizeContainer");
  dragLine.getStyleClass().add("dragLine");
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:18,代码来源:VerticalResizeContainerView.java

示例14: 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();
    }
 
开发者ID:jmueller95,项目名称:CORNETTO,代码行数:37,代码来源:ViewPane.java

示例15: createHeader

import javafx.scene.layout.AnchorPane; //导入方法依赖的package包/类
private AnchorPane createHeader() {
  AnchorPane header = new AnchorPane();
  header.getStyleClass().add("header");
  header.getChildren().addAll(titleLabel, pageNumberLabel);
  titleLabel.getStyleClass().add("title");
  AnchorPane.setLeftAnchor(titleLabel, 10.0);
  AnchorPane.setTopAnchor(titleLabel, 10.0);
  AnchorPane.setRightAnchor(pageNumberLabel, 10.0);
  AnchorPane.setTopAnchor(pageNumberLabel, 10.0);
  return header;
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:12,代码来源:WizardView.java


注:本文中的javafx.scene.layout.AnchorPane.setLeftAnchor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。