javafx.scene.layout.BorderPane.setLeft()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(176)

本文整理了Java中javafx.scene.layout.BorderPane.setLeft()方法的一些代码示例,展示了BorderPane.setLeft()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BorderPane.setLeft()方法的具体详情如下:
包路径:javafx.scene.layout.BorderPane
类名称:BorderPane
方法名:setLeft

BorderPane.setLeft介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

layout.setLeft(optionPane);
layout.setCenter(editorBox);
stage.setScene(new Scene(layout));

代码示例来源:origin: jfoenixadmin/JFoenix

arrowsContainer.setLeft(backMonthButton);
arrowsContainer.setRight(forwardMonthButton);
arrowsContainer.setPadding(new Insets(4, 12, 2, 12));

代码示例来源:origin: PhoenicisOrg/phoenicis

/**
 * sets the Sidebar
 * @param sidebar
 */
protected void setSidebar(S sidebar) {
  this.sidebar = sidebar;
  this.content.setLeft(this.sidebar);
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.dialogs

@Override
protected Node createDialogContent() {
  BorderPane p = new BorderPane();
  p.setLeft(new Label(this.message));
  return p;
}

代码示例来源:origin: stackoverflow.com

public void start(Stage stage) throws Exception {
  BorderPane root = new BorderPane();
  root.setCenter(new Rectangle(100,100, Color.RED));
  root.setLeft(new Rectangle(10,10, Color.BLUE));
  root.setRight(new Rectangle(10,10, Color.CYAN));

  stage.setScene(new Scene(root,300,300));

  stage.show();
}

代码示例来源:origin: stackoverflow.com

GridPane overlay = new GridPane();
BorderPane pane = new BorderPane();
pane.setLeft(overlay);
StackPane background = new StackPane(pane);

// ... 
ImageView imageView = ... ;
background.getChildren().add(0, imageView);

// ...
scene.setRoot(background);

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

private void updateLeftTrim(ObservableValue<? extends Node> o, Node oldValue, Node newValue) {
  if (oldValue != null) {
    Pane pane = (Pane) lookup("#left-trim-area"); //$NON-NLS-1$
    if (pane == null) {
      this.trimPane.setLeft(null);
    } else {
      pane.getChildren().remove(oldValue);
    }
  }
  if (newValue != null) {
    Pane pane = (Pane) lookup("#left-trim-area"); //$NON-NLS-1$
    if (pane == null) {
      this.trimPane.setLeft(newValue);
    } else {
      pane.getChildren().add(newValue);
    }
  }
}

代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls

private void updateLeftTrim(ObservableValue<? extends Node> o, Node oldValue, Node newValue) {
  if (oldValue != null) {
    Pane pane = (Pane) lookup("#left-trim-area"); //$NON-NLS-1$
    if (pane == null) {
      this.trimPane.setLeft(null);
    } else {
      pane.getChildren().remove(oldValue);
    }
  }
  if (newValue != null) {
    Pane pane = (Pane) lookup("#left-trim-area"); //$NON-NLS-1$
    if (pane == null) {
      this.trimPane.setLeft(newValue);
    } else {
      pane.getChildren().add(newValue);
    }
  }
}

代码示例来源:origin: stackoverflow.com

public class Test extends Application {

 @Override
 public void start(Stage stage) {
   final SwingNode swingNode1 = new SwingNode();
   final SwingNode swingNode2 = new SwingNode();

   SwingUtilities.invokeLater(() -> {
     swingNode2.setContent(new JButton("Click me!"+2));
     swingNode1.setContent(new JButton("Click me!"+1));
   });

   BorderPane pane = new BorderPane();
   pane.setLeft(swingNode1);
   pane.setRight(swingNode2);

   stage.setScene(new Scene(pane, 200, 50));
   stage.show();
 }

 public static void main(String[] args) {
   launch(args);
 }
}

代码示例来源:origin: stackoverflow.com

});
root.setLeft(new VBox(btn));

代码示例来源:origin: com.intuit.karate/karate-core

public AppSession(BorderPane rootPane, File workingDir, Feature feature, String env, CallContext callContext) {
  this.rootPane = rootPane;
  this.workingDir = workingDir;
  FeatureContext featureContext = FeatureContext.forFeatureAndWorkingDir(env, feature, workingDir);
  exec = new ExecutionContext(System.currentTimeMillis(), featureContext, callContext, null, null, null);
  featureUnit = new FeatureExecutionUnit(exec);
  featureUnit.init();
  featureOutlinePanel = new FeatureOutlinePanel(this);
  DragResizer.makeResizable(featureOutlinePanel, false, false, false, true);
  List<ScenarioExecutionUnit> units = featureUnit.getScenarioExecutionUnits();
  scenarioPanels = new ArrayList(units.size());
  units.forEach(unit -> scenarioPanels.add(new ScenarioPanel(this, unit)));
  rootPane.setLeft(featureOutlinePanel);        
  logPanel = new LogPanel(logger);
  DragResizer.makeResizable(logPanel, false, false, true, false);
  rootPane.setBottom(logPanel);
}

代码示例来源:origin: stackoverflow.com

public class JFXScroll extends Application {

  @Override
  public void start(Stage stage) throws Exception {

    BorderPane main = new BorderPane();

    ScrollPane scroll = new ScrollPane();
    VBox box = new VBox();

    // Demo purposes; Wouldn't normally do this - just let the box automatically fit the content
    box.setPrefSize(1000, 500);
    box.setEffect(new ColorInput(0,0,1000,500,Color.LIME));

    scroll.setContent(box);

    main.setLeft(new Label("Left Content"));
    main.setCenter(scroll);

    Scene scene = new Scene(main, 300, 250);
    stage.setScene(scene);
    stage.show();

  }
  public static void main(String[] args) {
    launch(args);
  }
}

代码示例来源:origin: stackoverflow.com

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;

public class VerticalButtonBarExample extends Application {

  @Override
  public void start(Stage primaryStage) {
    VerticalButtonBar bar = new VerticalButtonBar();
    bar.addButton(new Button("A"));
    bar.addButton(new Button("Button"));

    BorderPane root = new BorderPane();
    root.setLeft(bar);
    primaryStage.setScene(new Scene(root, 400, 400));
    primaryStage.show();
  }


  public static void main(String[] args) {
    launch(args);
  }
}

代码示例来源:origin: stackoverflow.com

private InternalWindow constructWindow() {
  // content
  ImageView imageView = new ImageView("https://upload.wikimedia.org/wikipedia/commons/thumb/a/a9/Cheetah4.jpg/250px-Cheetah4.jpg");
  // title bar
  BorderPane titleBar = new BorderPane();
  titleBar.setStyle("-fx-background-color: green; -fx-padding: 3");
  Label label = new Label("header");
  titleBar.setLeft(label);
  Button closeButton = new Button("x");
  titleBar.setRight(closeButton);
  // title bat + content
  BorderPane windowPane = new BorderPane();
  windowPane.setStyle("-fx-border-width: 1; -fx-border-color: black");
  windowPane.setTop(titleBar);
  windowPane.setCenter(imageView);

  //apply layout to InternalWindow
  InternalWindow interalWindow = new InternalWindow();
  InternalWindow.setRoot(windowPane);
  //drag only by title
  interalWindow.makeDragable(titleBar);
  interalWindow.makeDragable(label);
  interalWindow.makeResizable(20);
  interalWindow.makeFocusable();
  return interalWindow;
}

代码示例来源:origin: org.controlsfx/controlsfx

private void updateLayout(Orientation orientation) {
  borderPane.getChildren().clear();
  switch (orientation) {
  case HORIZONTAL:
    borderPane.setLeft(minusRegion);
    borderPane.setCenter(slider);
    borderPane.setRight(plusRegion);
    break;
  case VERTICAL:
    borderPane.setTop(plusRegion);
    borderPane.setCenter(slider);
    borderPane.setBottom(minusRegion);
    break;
  }
}

代码示例来源:origin: org.jrebirth.af/component

void reloadButtonBar() {
  node().setTop(null);
  node().setBottom(null);
  node().setLeft(null);
  node().setRight(null);
  initButtonBar();
}

代码示例来源:origin: stackoverflow.com

borderPane.setLeft(listView);
borderPane.setStyle("-fx-background-color: palegreen;");

代码示例来源:origin: stackoverflow.com

borderPane.setLeft( toolbar );
borderPane.setTop( hbox );

代码示例来源:origin: org.jrebirth.af/component

private void initButtonBar() {
  switch (model().object().orientation()) {
    case top:
      node().setTop(buildButtonBar(true));
      break;
    case bottom:
      node().setBottom(buildButtonBar(true));
      break;
    case left:
      node().setLeft(buildButtonBar(false));
      break;
    case right:
      node().setRight(buildButtonBar(false));
      break;
  }
}

代码示例来源:origin: PhoenicisOrg/phoenicis

protected void drawLeftImage() {
  AnchorPane pane = new AnchorPane();
  pane.setPrefWidth(187);
  Stop[] stops = new Stop[] { new Stop(0, Color.web("#3c79b2")), new Stop(1, Color.web("#2d5d8b")) };
  RadialGradient gradient = new RadialGradient(0, 0, 0.5, 0.5, 1, true, CycleMethod.NO_CYCLE, stops);
  Background background = new Background(new BackgroundFill(gradient, null, null));
  pane.setBackground(background);
  Text text = new Text(this.parent.getLeftImageText());
  text.setFill(Color.WHITE);
  text.setFont(Font.font("Maven Pro", 50));
  text.setRotate(-90);
  pane.setPadding(new Insets(-50));
  pane.getChildren().add(text);
  AnchorPane.setBottomAnchor(text, 160.0);
  AnchorPane.setRightAnchor(text, -40.0);
  getParent().getRoot().setLeft(pane);
}

相关文章