當前位置: 首頁>>代碼示例>>Java>>正文


Java AnchorPane.setTopAnchor方法代碼示例

本文整理匯總了Java中javafx.scene.layout.AnchorPane.setTopAnchor方法的典型用法代碼示例。如果您正苦於以下問題:Java AnchorPane.setTopAnchor方法的具體用法?Java AnchorPane.setTopAnchor怎麽用?Java AnchorPane.setTopAnchor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.layout.AnchorPane的用法示例。


在下文中一共展示了AnchorPane.setTopAnchor方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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

示例2: start

import javafx.scene.layout.AnchorPane; //導入方法依賴的package包/類
@Override public void start(Stage stage) {
    AnchorPane pane = new AnchorPane(xAxis, yAxis, grid);

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

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

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

    Scene scene = new Scene(pane);

    stage.setTitle("GridTest");
    stage.setScene(scene);
    stage.show();

    //Helper.saveAsPng(pane, "/Users/hansolo/Desktop/grid.png");
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:25,代碼來源:GridTest.java

示例3: createFooter

import javafx.scene.layout.AnchorPane; //導入方法依賴的package包/類
private AnchorPane createFooter() {
  AnchorPane footer = new AnchorPane();
  footer.getStyleClass().add("footer");
  HBox bottonBox = new HBox(20);
  bottonBox.getChildren().addAll(previous, next);
  footer.getChildren().add(bottonBox);
  AnchorPane.setRightAnchor(bottonBox, 20.0);
  AnchorPane.setTopAnchor(bottonBox, 10.0);
  AnchorPane.setBottomAnchor(bottonBox, 10.0);
  return footer;
}
 
開發者ID:VerifAPS,項目名稱:stvs,代碼行數:12,代碼來源:WizardView.java

示例4: 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

示例5: 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;
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:14,代碼來源:LogGridTest.java

示例6: 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

示例7: 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

示例8: BasePane

import javafx.scene.layout.AnchorPane; //導入方法依賴的package包/類
public BasePane() {
  final String fxmlFile = this.getClass().getSimpleName() + ".fxml";
  FXMLLoader loader = createFXMLLoader(fxmlFile);
  controller = loader.getController();

  AnchorPane.setBottomAnchor(this , 0.0);
  AnchorPane.setTopAnchor(this , 0.0);
  AnchorPane.setLeftAnchor(this , 0.0);
  AnchorPane.setRightAnchor(this , 0.0);
}
 
開發者ID:Java-Publications,項目名稱:javamagazin-009-microkernel,代碼行數:11,代碼來源:BasePane.java

示例9: displayView

import javafx.scene.layout.AnchorPane; //導入方法依賴的package包/類
default void displayView(final AnchorPane anchorPane, final Node view)
{
    // Remove anything already there.
    anchorPane.getChildren().removeAll(anchorPane.getChildren());

    // Make the view fill the anchor pane.
    AnchorPane.setTopAnchor(view, 0.0);
    AnchorPane.setLeftAnchor(view, 0.0);
    AnchorPane.setRightAnchor(view, 0.0);
    AnchorPane.setBottomAnchor(view, 0.0);

    // Add the view into the anchor pane.
    anchorPane.getChildren().add(view);
}
 
開發者ID:apache,項目名稱:cayenne-modeler,代碼行數:15,代碼來源:LayoutSupport.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: 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

示例12: loadView

import javafx.scene.layout.AnchorPane; //導入方法依賴的package包/類
@Override
public void loadView() {
    try {
        parent = loader.load();
        this.getChildren().add(parent);
        this.setStyle("-fx-background-color: #FFFFFF");
        AnchorPane.setTopAnchor(this, 0d);
        AnchorPane.setBottomAnchor(this, 0d);
        this.setPrefSize(((AnchorPane)parent).getPrefWidth(), ((AnchorPane)parent).getPrefHeight());
    } catch (IOException ex) {
        Logger.getLogger(RegisterView.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 
開發者ID:Obsidiam,項目名稱:amelia,代碼行數:14,代碼來源:RegisterView.java

示例13: 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,代碼來源:GridTest.java

示例14: initComponents

import javafx.scene.layout.AnchorPane; //導入方法依賴的package包/類
protected void initComponents(String title, Region content) {

        // Border style
        this.setStyle("-fx-border-width: 1; -fx-border-color: silver");

        // TitleBar with Add / Remove Buttons
        AnchorPane titleBar = new AnchorPane();
        // TitleBar border style
        titleBar.setStyle("-fx-border-width: 0 0 1 0; -fx-border-color: silver;");
        // Button group
        HBox buttons = new HBox();
        buttons.setPadding(new Insets(10));
        buttons.setSpacing(10);

        Button buttonAdd = Utils.createPlusButton();
        buttonAdd.setOnAction(this::setOnAddAction);
        Button buttonRemove = Utils.createMinusButton();
        buttonRemove.setOnAction(this::setOnRemoveAction);

        /*Font fontButton = Font.font("sans-serif", FontWeight.EXTRA_BOLD, 12);
        buttonAdd.setFont(fontButton);
        buttonRemove.setFont(fontButton);*/

        buttons.getChildren().addAll(buttonAdd, buttonRemove);

        // Title
        Label titleText = new Label(title);

        titleBar.getChildren().addAll(titleText, buttons);
        AnchorPane.setLeftAnchor(titleText, 10.0);
        AnchorPane.setTopAnchor(titleText, 10.0);
        AnchorPane.setRightAnchor(buttons, 0.0);

        // Content
        this.setTop(titleBar);
        this.setCenter(content);

    }
 
開發者ID:dbisUnibas,項目名稱:ReqMan,代碼行數:39,代碼來源:ModifiableListView.java

示例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);
}
 
開發者ID:Jibbow,項目名稱:FastisFX,代碼行數:28,代碼來源:TimeIndicator.java


注:本文中的javafx.scene.layout.AnchorPane.setTopAnchor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。