Java Code Examples for javafx.scene.layout.BorderPane#setLeft()

The following examples show how to use javafx.scene.layout.BorderPane#setLeft() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CoursesTreeView.java    From iliasDownloaderTool with GNU General Public License v2.0 6 votes vote down vote up
private void redraw() {
	if (node == null) {
		setGraphic(null);
		return;
	}

	final BorderPane pane = new BorderPane();
	final Label box = new Label();
	box.setAlignment(Pos.TOP_LEFT);

	if (node instanceof IliasFolder) {
		IliasFolder folder = (IliasFolder) node;
		box.setGraphic(folder.getGraphic());
	} else if (node instanceof IliasFile) {
		IliasFile file = (IliasFile) node;
		box.setGraphic(file.getGraphic());
	} else if (node instanceof IliasForum) {
		box.setGraphic(new ImageView("img/forum.png"));
	}

	box.setText(node.toString());
	pane.setLeft(box);
	createAndAddActions(pane);
	setGraphic(pane);
	createToolTip();
}
 
Example 2
Source File: EditAnnotationDialog.java    From phoebus with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void updateItem(AnnotationItem item, boolean empty)
{
	super.updateItem(item, empty);
	if (item == null)
		return;
	String text = item.annotation.getTrace().getLabel() + ": " + item.annotation.getText().replaceAll("\n", "\\\\n");
	if (text.length() > MAX_LENGTH)
		text = text.substring(0, MAX_LENGTH) + "...";
	final CheckBox selector = new CheckBox(text);
	selector.setTextFill(item.annotation.getTrace().getColor());
	selector.setSelected(true);
	final Button edit = new Button(Messages.AnnotationEditBtn);
	final BorderPane line = new BorderPane();
	line.setLeft(selector);
	line.setRight(edit);
	setGraphic(line); // 'Graphic' == any Node that represents the cell

	selector.setOnAction(event -> item.selected = selector.isSelected());
	edit.setOnAction(event -> editAnnotation(item.annotation));
}
 
Example 3
Source File: DemoDragTabs.java    From jfxutils with Apache License 2.0 5 votes vote down vote up
@Override
public void start(Stage primaryStage) {

	Tab f = makeTab("Files", "File system view here");
	Tab t = makeTab("Type Hierarchy","Type hierarchy view here");
	Tab d = makeTab("Debug","Debug view here");

	Tab p = makeTab("Properties","Ah, the ubiquitous 'properties' panel");
	Tab c = makeTab("Console","Console output here");
	Tab o = makeTab("Outline","Outline of fields/methods view here");

	TabPane left = new TabPane(f,t,d);
	TabUtil.makeDroppable(left); //////////////// see

	TabPane right = new TabPane(p,c,o);
	TabUtil.makeDroppable(right); /////////////// see

	left.setStyle("-fx-border-color: black;");
	right.setStyle("-fx-border-color: black;");

	BorderPane main = new BorderPane();
	main.setPadding(new Insets(0, 20, 0, 20));
	main.setTop(new Label("Menubar and toolbars"));
	main.setLeft(left);
	main.setCenter(new Label("Central work area here"));
	main.setRight(right);
	main.setBottom(new Label("Statusbar"));

	primaryStage.setScene(new Scene(main, 800, 600));
	primaryStage.show();
}
 
Example 4
Source File: DemoWindow.java    From FxDock with Apache License 2.0 5 votes vote down vote up
protected Node createStatusBar()
{
	BorderPane p = new BorderPane();
	p.setLeft(statusField);
	p.setRight(FX.label(DockDemoApp.COPYRIGHT, new Insets(1, 20, 1, 10)));
	return p;
}
 
Example 5
Source File: BookMarks.java    From JFX-Browser with MIT License 5 votes vote down vote up
public Tab getBookmarkView(Tab bookmarkTab) {
	BorderPane borderPaneBookmark = new BorderPane();
	treeView.setMinWidth(150);
	treeView.setMaxWidth(150);
	borderPaneBookmark.setLeft(treeView);
	borderPaneBookmark.setCenter(table);
	bookmarkTab.setContent(borderPaneBookmark);
	return bookmarkTab;
}
 
Example 6
Source File: HistoryPane.java    From Recaf with MIT License 5 votes vote down vote up
@Override
public void updateItem(History item, boolean empty) {
	super.updateItem(item, empty);
	if(!empty) {
		Node g = null;
		String text = item.name;
		// Create graphic based on history content
		// - (only way to differ between class/file)
		int count = item.size() - 1;
		byte[] data = item.peek();
		if (ClassUtil.isClass(data)) {
			g = UiUtil.createClassGraphic(ClassUtil.getAccess(data));
		} else {
			g = UiUtil.createFileGraphic(text);
		}
		getStyleClass().add("hist-cell");
		BorderPane wrap = new BorderPane();
		String sub = count > 0 ? "[" + count + " states]" : "[Initial state]";
		wrap.setLeft(g);
		wrap.setLeft(new BorderPane(wrap.getLeft()));
		wrap.getLeft().getStyleClass().add("hist-icon");
		wrap.setCenter(new SubLabeled(text, sub, "bold"));
		setGraphic(wrap);
	} else {
		setGraphic(null);
		setText(null);
	}
}
 
Example 7
Source File: App.java    From java-ml-projects with Apache License 2.0 5 votes vote down vote up
private Parent buildUI() {
	BorderPane root = new BorderPane();
	Insets margin = new Insets(10);
	Node leftPane = buildLeftPane();
	Node bottomPane = buildBottomPane();
	Node centerPane = buildCenterPane();
	root.setLeft(leftPane);
	root.setBottom(bottomPane);
	root.setCenter(centerPane);
	BorderPane.setMargin(bottomPane, margin);
	BorderPane.setMargin(centerPane, margin);
	return root;
}
 
Example 8
Source File: BorderPaneSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public static Node createIconContent() {
    StackPane sp = new StackPane();
    BorderPane borderPane = new BorderPane();

    Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY);
    rectangle.setStroke(Color.BLACK);
    borderPane.setPrefSize(rectangle.getWidth(), rectangle.getHeight());
 
    Rectangle recTop = new Rectangle(62, 5, Color.web("#349b00"));
    recTop.setStroke(Color.BLACK);
    Rectangle recBottom = new Rectangle(62, 14, Color.web("#349b00"));
    recBottom.setStroke(Color.BLACK);
    Rectangle recLeft = new Rectangle(20, 41, Color.TRANSPARENT);
    recLeft.setStroke(Color.BLACK);
    Rectangle recRight = new Rectangle(20, 41, Color.TRANSPARENT);
    recRight.setStroke(Color.BLACK);
    Rectangle centerRight = new Rectangle(20, 41, Color.TRANSPARENT);
    centerRight.setStroke(Color.BLACK);
    borderPane.setRight(recRight);
    borderPane.setTop(recTop);
    borderPane.setLeft(recLeft);
    borderPane.setBottom(recBottom);
    borderPane.setCenter(centerRight);
 
    sp.getChildren().addAll(rectangle, borderPane);
    return new Group(sp);
}
 
Example 9
Source File: CoursesTreeView.java    From iliasDownloaderTool with GNU General Public License v2.0 5 votes vote down vote up
private BorderPane buildCell() {
	final BorderPane pane = new BorderPane();
	box = new Label();
	box.setAlignment(Pos.TOP_LEFT);

	pane.setLeft(box);
	createAndAddActions(pane);
	// setGraphic(pane);
	createToolTip();
	return pane;
}
 
Example 10
Source File: SettingsView.java    From Maus with GNU General Public License v3.0 5 votes vote down vote up
BorderPane getSettingsView() {
    BorderPane borderPane = new BorderPane();
    borderPane.getStylesheets().add(getClass().getResource("/css/global.css").toExternalForm());
    borderPane.setTop(new TopBar().getTopBar(Maus.getPrimaryStage()));
    borderPane.setLeft(settingsViewLeft());
    borderPane.setCenter(settingsViewCenter());
    borderPane.setBottom(new BottomBar().getBottomBar());
    return borderPane;
}
 
Example 11
Source File: Pin.java    From BlockMap with MIT License 5 votes vote down vote up
@Override
protected PopOver initInfo() {
	PopOver info = super.initInfo();
	GridPane content = new GridPane();
	content.getStyleClass().add("grid");

	int rowCount = 0;

	if (maps.size() > 1) {
		content.add(new Label("Map count:"), 0, rowCount);
		content.add(new Label(Integer.toString(maps.size())), 1, rowCount++);
	}

	for (de.piegames.blockmap.world.LevelMetadata.MapPin map : maps) {
		BorderPane mapPane = new BorderPane();
		mapPane.setLeft(new Label("Scale:"));
		mapPane.setRight(new Label("1:" + (1 << map.getScale())));

		if (map.getColors().isPresent()) {
			byte[] data = map.getColors().get();
			WritableImage image = new WritableImage(128, 128);
			for (int x = 0; x < 128; x++)
				for (int y = 0; y < 128; y++)
					image.getPixelWriter().setColor(x, y, COLOR_IDS[0xFF & data[y << 7 | x]]);
			mapPane.setBottom(new ImageView(image));
		}
		content.add(mapPane, 0, rowCount++, 1, 2);
	}
	info.setContentNode(content);
	return info;
}
 
Example 12
Source File: DefaultConversationSenderProvider.java    From constellation with Apache License 2.0 5 votes vote down vote up
@Override
public Region createContent() {
    Region region = null;
    try {
        if (senderLabels.size() == 1) {
            region = new SelectableLabel(senderLabels.get(0), false, "-fx-text-fill: #cccccc;", null, null);
        } else {
            final VBox content = new VBox(-5.0);
            content.setAlignment(Pos.CENTER_LEFT);
            for (final String senderLabel : senderLabels) {
                content.getChildren().add(new SelectableLabel(senderLabel, false, "-fx-text-fill: #cccccc;", null, null));
            }
            region = content;
        }

        if (iconImage != null) {
            final BorderPane borderPane = new BorderPane();
            borderPane.setCenter(region);

            final ImageView iconView = new ImageView(iconImage);
            iconView.setFitHeight(32);
            iconView.setPreserveRatio(true);
            borderPane.setLeft(iconView);

            region = borderPane;
        }
    } catch (Exception ex) {
        LOGGER.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
    }

    return region;
}
 
Example 13
Source File: TransfersTab.java    From dm3270 with Apache License 2.0 4 votes vote down vote up
public TransfersTab (Screen screen, TSOCommand tsoCommand)
{
  super ("Transfers", screen, tsoCommand);

  btnTracks.setSelected (true);
  btnFiles.setSelected (true);
  btnFB.setSelected (true);

  grpFileName.getToggles ().addAll (btnDatasets, btnFiles, btnJobs, btnSpecify);
  grpSpaceUnits.getToggles ().addAll (btnTracks, btnCylinders, btnBlocks);

  grpFileName.selectedToggleProperty ()
      .addListener ( (ov, oldToggle, newToggle) -> toggleSelected (newToggle));

  grpSpaceUnits.selectedToggleProperty ()
      .addListener ( (ov, oldToggle, newToggle) -> toggleSelected (newToggle));

  VBox datasetBlock = new VBox (10);
  datasetBlock.setPadding (new Insets (10, 10, 10, 10));

  HBox line1 = getLine (btnDatasets, txtDatasets);
  HBox line2 = getLine (btnJobs, txtJobs);
  HBox line3 = getLine (btnFiles, txtFiles);
  HBox line4 = getLine (btnSpecify, txtSpecify);

  txtDatasets.setPromptText ("no dataset selected");
  txtJobs.setPromptText ("no batch job selected");
  txtFiles.setPromptText ("no file selected");

  txtSpecify.setEditable (true);
  txtBlksize.setText ("0");
  txtLrecl.setText ("80");

  datasetBlock.getChildren ().addAll (line1, line2, line3, line4);

  VBox spaceBlock = new VBox (10);
  spaceBlock.setPadding (new Insets (10, 10, 10, 10));

  HBox line5 = getLine (lblLrecl, txtLrecl);
  HBox line6 = getLine (lblBlksize, txtBlksize);
  HBox line7 = getLine (btnTracks, btnCylinders, btnBlocks);
  HBox line8 = getLine (lblSpace, txtSpace, line7);
  HBox line9 = getLine (btnFB, btnPS);
  HBox line10 = getLine (lblDisposition, line9);

  spaceBlock.getChildren ().addAll (line10, line5, line6, line8);

  datasetBlock.setStyle ("-fx-border-color: grey; -fx-border-width: 1;"
      + " -fx-border-insets: 10");
  spaceBlock.setStyle ("-fx-border-color: grey; -fx-border-width: 1;"
      + " -fx-border-insets: 10");

  txtDescription.setText ("Not finished yet");

  VBox columnLeft = new VBox ();
  columnLeft.setPadding (new Insets (10, 10, 10, 10));
  columnLeft.getChildren ().addAll (datasetBlock, spaceBlock);

  VBox columnRight = new VBox ();
  columnRight.setPadding (new Insets (10, 10, 10, 10));
  columnRight.getChildren ().addAll (txtDescription);

  BorderPane borderPane = new BorderPane ();
  borderPane.setLeft (columnLeft);
  borderPane.setRight (columnRight);

  setContent (borderPane);
}
 
Example 14
Source File: ParsedViewerPane.java    From classpy with MIT License 4 votes vote down vote up
private BorderPane buildStatusBar() {
    BorderPane statusBar = new BorderPane();
    statusBar.setLeft(statusLabel);
    statusBar.setRight(bytesBar);
    return statusBar;
}
 
Example 15
Source File: NodeView.java    From PreferencesFX with Apache License 2.0 4 votes vote down vote up
private void layoutParts() {
  // VBox with values
  VBox valueBox = new VBox(
      welcomeLbl,
      brightnessLbl,
      nightModeLbl,
      scalingLbl,
      screenNameLbl,
      resolutionLbl,
      orientationLbl,
      favoritesLbl,
      fontSizeLbl,
      lineSpacingLbl,
      favoriteNumberLbl
  );
  valueBox.setSpacing(20);
  valueBox.setPadding(new Insets(20, 0, 0, 20));
  Button saveSettingsButton = new Button("Save Settings");
  saveSettingsButton.setOnAction(event -> preferencesFx.saveSettings());
  Button discardChangesButton = new Button("Discard Changes");
  discardChangesButton.setOnAction(event -> preferencesFx.discardChanges());
  // VBox with descriptions
  VBox descriptionBox = new VBox(
      new Label("Welcome Text:"),
      new Label("Brightness:"),
      new Label("Night mode:"),
      new Label("Scaling:"),
      new Label("Screen name:"),
      new Label("Resolution:"),
      new Label("Orientation:"),
      new Label("Favorites:"),
      new Label("Font Size:"),
      new Label("Line Spacing:"),
      new Label("Favorite Number:"),
      saveSettingsButton,
      discardChangesButton
  );
  descriptionBox.setSpacing(20);
  descriptionBox.setPadding(new Insets(20, 0, 0, 20));

  PreferencesFxView preferencesFxView = preferencesFx.getView();
  // Put everything together
  BorderPane pane = new BorderPane();
  HBox hBox = new HBox(descriptionBox, valueBox);
  pane.setLeft(hBox);
  hBox.setPadding(new Insets(0, 20, 0, 0));
  pane.setCenter(preferencesFxView);
  VBox.setVgrow(pane, Priority.ALWAYS);
  getChildren().addAll(
      pane
  );

  // Styling
  getStyleClass().add("demo-view");
  if (rootPane.nightMode.get()) {
    getStylesheets().add(AppStarter.class.getResource("darkTheme.css").toExternalForm());
  }
}
 
Example 16
Source File: MainPane.java    From oim-fx with MIT License 4 votes vote down vote up
public MainPane() {

		findTextField.getStyleClass().clear();
		findTextField.setBackground(Background.EMPTY);
		findTextField.setStyle("-fx-text-fill: #ffffff;-fx-prompt-text-fill: #a9a9a9;-fx-text-font-size: 14px;");
		
		HBox findHBox = new HBox();
		findHBox.setAlignment(Pos.CENTER_LEFT);
		findHBox.getChildren().add(findImageView);
		
		BorderPane findBorderPane=new BorderPane();
		findBorderPane.setStyle("-fx-background-color:#26292e");
		findBorderPane.setPrefSize(245, 30);
		findBorderPane.setLeft(findHBox);
		findBorderPane.setCenter(findTextField);
		
		VBox findVBox = new VBox();
		findVBox.setAlignment(Pos.CENTER);
		findVBox.setPadding(new Insets(5, 10, 5, 10));
		findVBox.getChildren().add(findBorderPane);
		
		topVBox.getChildren().add(personalPane);
		topVBox.getChildren().add(findVBox);
		
		final StackPane centerStackPane = new StackPane();

		centerStackPane.getChildren().add(tabPanel);
		centerStackPane.getChildren().add(findListPane);

		leftBorderPane.setPrefWidth(280);
		leftBorderPane.setTop(topVBox);
		leftBorderPane.setCenter(centerStackPane);

		leftBorderPane.setStyle("-fx-background-color:#2e3238;");

		this.setPrefHeight(600);
		this.setLeft(leftBorderPane);
		
		tabPanel.setVisible(true);
		findListPane.setVisible(false);
		
		initEvent();
		initTest();
		
		//tabPanel.setSide(Side.RIGHT);
		tabPanel.setTabSize(45);
	}
 
Example 17
Source File: ChatClient.java    From grpc-by-example-java with Apache License 2.0 4 votes vote down vote up
@Override
public void start(Stage primaryStage) {
  messagesView.setItems(messages);

  send.setText("Send");

  BorderPane pane = new BorderPane();
  pane.setLeft(name);
  pane.setCenter(message);
  pane.setRight(send);

  BorderPane root = new BorderPane();
  root.setCenter(messagesView);
  root.setBottom(pane);

  primaryStage.setTitle("gRPC Chat");
  primaryStage.setScene(new Scene(root, 480, 320));

  primaryStage.show();

  ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 9090).usePlaintext(true).build();
  ChatServiceGrpc.ChatServiceStub chatService = ChatServiceGrpc.newStub(channel);
  StreamObserver<Chat.ChatMessage> chat = chatService.chat(new StreamObserver<Chat.ChatMessageFromServer>() {
    @Override
    public void onNext(Chat.ChatMessageFromServer value) {
      Platform.runLater(() -> {
        messages.add(value.getMessage().getFrom() + ": " + value.getMessage().getMessage());
        messagesView.scrollTo(messages.size());
      });
    }

    @Override
    public void onError(Throwable t) {
      t.printStackTrace();
      System.out.println("Disconnected");
    }

    @Override
    public void onCompleted() {
      System.out.println("Disconnected");
    }
  });

  send.setOnAction(e -> {
    chat.onNext(Chat.ChatMessage.newBuilder().setFrom(name.getText()).setMessage(message.getText()).build());
    message.setText("");
  });
  primaryStage.setOnCloseRequest(e -> {chat.onCompleted(); channel.shutdown(); });
}
 
Example 18
Source File: ReplayStage.java    From dm3270 with Apache License 2.0 4 votes vote down vote up
public ReplayStage (Session session, Path path, Preferences prefs, Screen screen)
{
  this.prefs = prefs;

  final Label label = session.getHeaderLabel ();
  label.setFont (new Font ("Arial", 20));
  label.setPadding (new Insets (10, 10, 10, 10));                 // trbl

  boolean showTelnet = prefs.getBoolean ("ShowTelnet", false);
  boolean showExtended = prefs.getBoolean ("ShowExtended", false);

  final HBox checkBoxes = new HBox ();
  checkBoxes.setSpacing (15);
  checkBoxes.setPadding (new Insets (10, 10, 10, 10));            // trbl
  checkBoxes.getChildren ().addAll (showTelnetCB, show3270ECB);

  SessionTable sessionTable = new SessionTable ();
  CommandPane commandPane =
      new CommandPane (sessionTable, CommandPane.ProcessInstruction.DoProcess);

  //    commandPane.setScreen (session.getScreen ());
  commandPane.setScreen (screen);

  setTitle ("Replay Commands - " + path.getFileName ());

  ObservableList<SessionRecord> masterData = session.getDataRecords ();
  FilteredList<SessionRecord> filteredData = new FilteredList<> (masterData, p -> true);

  ChangeListener<? super Boolean> changeListener =
      (observable, oldValue, newValue) -> change (sessionTable, filteredData);

  showTelnetCB.selectedProperty ().addListener (changeListener);
  show3270ECB.selectedProperty ().addListener (changeListener);

  if (true)         // this sucks - remove it when java works properly
  {
    showTelnetCB.setSelected (true);          // must be a bug
    show3270ECB.setSelected (true);
  }

  showTelnetCB.setSelected (showTelnet);
  show3270ECB.setSelected (showExtended);

  SortedList<SessionRecord> sortedData = new SortedList<> (filteredData);
  sortedData.comparatorProperty ().bind (sessionTable.comparatorProperty ());
  sessionTable.setItems (sortedData);

  displayFirstScreen (session, sessionTable);

  setOnCloseRequest (e -> Platform.exit ());

  windowSaver = new WindowSaver (prefs, this, "Replay");
  if (!windowSaver.restoreWindow ())
  {
    primaryScreenBounds = javafx.stage.Screen.getPrimary ().getVisualBounds ();
    setX (800);
    setY (primaryScreenBounds.getMinY ());
    double height = primaryScreenBounds.getHeight ();
    setHeight (Math.min (height, 1200));
  }

  BorderPane borderPane = new BorderPane ();
  borderPane.setLeft (sessionTable);      // fixed size
  borderPane.setCenter (commandPane);     // expands to fill window
  borderPane.setTop (label);
  borderPane.setBottom (checkBoxes);

  Scene scene = new Scene (borderPane);
  setScene (scene);
}
 
Example 19
Source File: ReplayStage.java    From xframium-java with GNU General Public License v3.0 4 votes vote down vote up
public ReplayStage (Session session, Path path, Preferences prefs, Screen screen)
{
  this.prefs = prefs;

  final Label label = session.getHeaderLabel ();
  label.setFont (new Font ("Arial", 20));
  label.setPadding (new Insets (10, 10, 10, 10));                 // trbl

  boolean showTelnet = prefs.getBoolean ("ShowTelnet", false);
  boolean showExtended = prefs.getBoolean ("ShowExtended", false);

  final HBox checkBoxes = new HBox ();
  checkBoxes.setSpacing (15);
  checkBoxes.setPadding (new Insets (10, 10, 10, 10));            // trbl
  checkBoxes.getChildren ().addAll (showTelnetCB, show3270ECB);

  SessionTable sessionTable = new SessionTable ();
  CommandPane commandPane =
      new CommandPane (sessionTable, CommandPane.ProcessInstruction.DoProcess);

  //    commandPane.setScreen (session.getScreen ());
  commandPane.setScreen (screen);

  setTitle ("Replay Commands - " + path.getFileName ());

  ObservableList<SessionRecord> masterData = session.getDataRecords ();
  FilteredList<SessionRecord> filteredData = new FilteredList<> (masterData, p -> true);

  ChangeListener<? super Boolean> changeListener =
      (observable, oldValue, newValue) -> change (sessionTable, filteredData);

  showTelnetCB.selectedProperty ().addListener (changeListener);
  show3270ECB.selectedProperty ().addListener (changeListener);

  if (true)         // this sucks - remove it when java works properly
  {
    showTelnetCB.setSelected (true);          // must be a bug
    show3270ECB.setSelected (true);
  }

  showTelnetCB.setSelected (showTelnet);
  show3270ECB.setSelected (showExtended);

  SortedList<SessionRecord> sortedData = new SortedList<> (filteredData);
  sortedData.comparatorProperty ().bind (sessionTable.comparatorProperty ());
  sessionTable.setItems (sortedData);

  displayFirstScreen (session, sessionTable);

  setOnCloseRequest (e -> Platform.exit ());

  windowSaver = new WindowSaver (prefs, this, "Replay");
  if (!windowSaver.restoreWindow ())
  {
    primaryScreenBounds = javafx.stage.Screen.getPrimary ().getVisualBounds ();
    setX (800);
    setY (primaryScreenBounds.getMinY ());
    double height = primaryScreenBounds.getHeight ();
    setHeight (Math.min (height, 1200));
  }

  BorderPane borderPane = new BorderPane ();
  borderPane.setLeft (sessionTable);      // fixed size
  borderPane.setCenter (commandPane);     // expands to fill window
  borderPane.setTop (label);
  borderPane.setBottom (checkBoxes);

  Scene scene = new Scene (borderPane);
  setScene (scene);
}
 
Example 20
Source File: MainframeStage.java    From xframium-java with GNU General Public License v3.0 4 votes vote down vote up
public MainframeStage (TelnetState telnetState, int mainframePort)     // usually 5555
{
  this.telnetState = telnetState;

  mainframeServer = new MainframeServer (mainframePort);
  mainframeServer.setStage (this);

  GuiFactory gui = new GuiFactory ();
  final VBox vbox1 = gui.getVBox ();

  for (int i = 0; i < 10; i++)
    buttons.add (gui.getButton ("Empty", vbox1, BUTTON_WIDTH));

  Separator separator = new Separator ();
  separator.setOrientation (Orientation.HORIZONTAL);

  final VBox vbox2 = gui.getVBox ();
  btnReadBuffer = gui.getButton ("Read Buffer", vbox2, BUTTON_WIDTH);
  btnReadModified = gui.getButton ("Read Modified", vbox2, BUTTON_WIDTH);
  btnReadModifiedAll = gui.getButton ("Read Mod All", vbox2, BUTTON_WIDTH);
  btnEraseAllUnprotected = gui.getButton ("Erase All Unpr", vbox2, BUTTON_WIDTH);
  btnProgramTab1 = gui.getButton ("PT 1", vbox2, BUTTON_WIDTH);
  btnProgramTab2 = gui.getButton ("PT 2", vbox2, BUTTON_WIDTH);
  btnProgramTab3 = gui.getButton ("PT 3", vbox2, BUTTON_WIDTH);

  final ToggleGroup modeGroup = new ToggleGroup ();

  btnFieldMode = gui.getRadioButton ("Field Mode", vbox2, modeGroup);
  btnExtendedFieldMode = gui.getRadioButton ("Extended Field Mode", vbox2, modeGroup);
  btnCharacterMode = gui.getRadioButton ("Character Mode", vbox2, modeGroup);
  btnFieldMode.setSelected (true);                    // match the default setting

  modeGroup.selectedToggleProperty ().addListener (new OnToggleHandler ());

  BorderPane borderPane = new BorderPane ();
  borderPane.setLeft (vbox1);
  borderPane.setRight (vbox2);

  Scene scene = new Scene (borderPane);
  setTitle ("Mainframe: " + mainframePort);
  setScene (scene);

  setX (1000);
  setY (100);

  prepareButtons ();

  setOnCloseRequest (e -> Platform.exit ());
}