當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。