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

The following examples show how to use javafx.scene.layout.BorderPane#setRight() . 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: 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 2
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 3
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 4
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 5
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 6
Source File: ConsolePane.java    From dm3270 with Apache License 2.0 5 votes vote down vote up
private BorderPane getStatusBar ()
{
  Separator[] div = new Separator[6];
  for (int i = 0; i < div.length; i++)
  {
    div[i] = new Separator ();
    div[i].setOrientation (Orientation.VERTICAL);
  }

  HBox leftBox = getHBox (new Insets (2, GAP, 2, 3), Pos.CENTER_LEFT);
  leftBox.getChildren ().addAll (div[0], fieldLocation, div[1], insertMode, div[2]);

  HBox centerBox = getHBox (new Insets (2, GAP, 2, GAP), Pos.CENTER);
  centerBox.getChildren ().add (status);

  HBox rightBox = getHBox (new Insets (2, 0, 2, GAP), Pos.CENTER_RIGHT);
  rightBox.getChildren ().addAll (div[3], fieldType, div[4], cursorLocation, div[5]);

  setStatusFont ();

  BorderPane statusPane = new BorderPane ();
  statusPane.setLeft (leftBox);
  statusPane.setCenter (centerBox);
  statusPane.setRight (rightBox);

  return statusPane;
}
 
Example 7
Source File: RunPane.java    From constellation with Apache License 2.0 5 votes vote down vote up
public AttributeBox(final String label, final AttributeList attributeList) {
    final BorderPane borderPane = new BorderPane();
    borderPane.setTop(attributeList);

    setMaxHeight(USE_PREF_SIZE);
    setMaxWidth(Double.MAX_VALUE);
    setCenter(borderPane);

    final Label heading = new Label(label);
    heading.setStyle("-fx-font-weight: bold;");

    BorderPane labelPane = new BorderPane();
    labelPane.setPadding(new Insets(1));
    labelPane.setMinWidth(0);
    labelPane.setLeft(heading);

    final Button button = new Button("", new ImageView(ADD_IMAGE));
    button.setOnAction((ActionEvent event) -> {
        Attribute attribute = importController.showNewAttributeDialog(attributeList.getAttributeType().getElementType());
        if (attribute != null) {
            importController.createManualAttribute(attribute);
        }
    });
    button.setTooltip(new Tooltip("Add a new " + attributeList.getAttributeType().getElementType() + " attribute"));
    labelPane.setRight(button);

    setTop(labelPane);
}
 
Example 8
Source File: ScatterPlotWindow.java    From mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
public ScatterPlotWindow(PeakList peakList) {

    setTitle("Scatter plot of " + peakList);

    mainPane = new BorderPane();
    mainScene = new Scene(mainPane);

    // Use main CSS
    mainScene.getStylesheets()
        .addAll(MZmineCore.getDesktop().getMainWindow().getScene().getStylesheets());
    setScene(mainScene);

    // setDefaultCloseOperation(DISPOSE_ON_CLOSE);

    topPanel = new ScatterPlotTopPanel();
    mainPane.setTop(topPanel);

    chart = new ScatterPlotChart(this, topPanel, peakList);
    // Border border = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    // chart.setBorder(border);
    // chart.setBackground(Color.white);
    mainPane.setCenter(chart);

    toolbar = new ToolBar();
    toolbar.setOrientation(Orientation.VERTICAL);

    axesButton = new Button(null, new ImageView(axesIcon));
    axesButton.setTooltip(new Tooltip("Setup ranges for axes"));
    axesButton.setOnAction(e -> {
      AxesSetupDialog dialog = new AxesSetupDialog(this, chart.getPlot());
      dialog.show();
    });
    toolbar.getItems().add(axesButton);

    mainPane.setRight(toolbar);

    // JComponent leftMargin = (JComponent) Box.createRigidArea(new Dimension(10, 10));
    // leftMargin.setOpaque(false);
    // add(leftMargin, BorderLayout.WEST);

    bottomPanel = new ScatterPlotBottomPanel(this, chart, peakList);
    mainPane.setBottom(bottomPanel);

    // Add the Windows menu
    WindowsMenu.addWindowsMenu(mainScene);


    // get the window settings parameter
    ParameterSet paramSet =
        MZmineCore.getConfiguration().getModuleParameters(ScatterPlotVisualizerModule.class);
    WindowSettingsParameter settings = paramSet.getParameter(ScatterPlotParameters.windowSettings);

    // update the window and listen for changes
    // settings.applySettingsToWindow(this);
    // this.addComponentListener(settings);

    setMinWidth(500.0);
    setMinHeight(400.0);

  }
 
Example 9
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 10
Source File: ProjectionPlotWindow.java    From mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
public ProjectionPlotWindow(PeakList peakList, ProjectionPlotDataset dataset,
    ParameterSet parameters) {

  mainPane = new BorderPane();
  mainScene = new Scene(mainPane);

  // Use main CSS
  mainScene.getStylesheets()
      .addAll(MZmineCore.getDesktop().getMainWindow().getScene().getStylesheets());
  setScene(mainScene);

  toolbar = new ToolBar();
  toolbar.setOrientation(Orientation.VERTICAL);
  Button axesButton = new Button(null, new ImageView(axesIcon));
  axesButton.setTooltip(new Tooltip("Setup ranges for axes"));
  Button labelsButton = new Button(null, new ImageView(labelsIcon));
  labelsButton.setTooltip(new Tooltip("Toggle sample names"));
  toolbar.getItems().addAll(axesButton, labelsButton);
  mainPane.setRight(toolbar);

  plot = new ProjectionPlotPanel(this, dataset, parameters);
  mainPane.setCenter(plot);

  axesButton.setOnAction(e -> {
    AxesSetupDialog dialog = new AxesSetupDialog(this, plot.getChart().getXYPlot());
    dialog.showAndWait();
  });

  labelsButton.setOnAction(e -> plot.cycleItemLabelMode());

  String title = peakList.getName();
  title = title.concat(" : ");
  title = title.concat(dataset.toString());
  if (parameters.getParameter(ProjectionPlotParameters.peakMeasurementType)
      .getValue() == PeakMeasurementType.HEIGHT)
    title = title.concat(" (using peak heights)");
  else
    title = title.concat(" (using peak areas)");

  this.setTitle(title);

  // Add the Windows menu
  WindowsMenu.addWindowsMenu(mainScene);

  ParameterSet paramSet =
      MZmineCore.getConfiguration().getModuleParameters(ScatterPlotVisualizerModule.class);
  WindowSettingsParameter settings = paramSet.getParameter(ScatterPlotParameters.windowSettings);

}
 
Example 11
Source File: MainPane.java    From oim-fx with MIT License 4 votes vote down vote up
private void initComponent() {
	Label titleLabel = new Label("", logoImageView);
	titleLabel.setStyle("-fx-text-fill: white;");

	titleHBox.setPadding(new Insets(5, 0, 0, 10));
	titleHBox.setPrefHeight(30);
	titleHBox.getChildren().add(titleLabel);

	topVBox.getChildren().add(titleHBox);
	topVBox.getChildren().add(userDataPane);

	listBaseStackPane.getChildren().add(tabPane);
	listBaseStackPane.getChildren().add(findListPane);

	centerBorderPane.setTop(searchBox);
	centerBorderPane.setCenter(listBaseStackPane);

	findTextField.setPromptText("搜索:联系人、多人聊天、群");
	findTextField.getStyleClass().remove("text-field");
	findTextField.setBackground(Background.EMPTY);
	findTextField.setMinHeight(30);
	findTextField.setStyle("-fx-prompt-text-fill:#ffffff;");

	Image image = ImageBox.getImageClassPath("/classics/images/main/search/search_icon.png");
	ImageView searchImageView = new ImageView();
	searchImageView.setImage(image);

	searchBox.getChildren().add(findTextField);
	searchBox.getChildren().add(searchImageView);
	HBox.setHgrow(findTextField, Priority.ALWAYS);

	searchBox.setAlignment(Pos.CENTER_RIGHT);
	searchBox.setStyle("-fx-background-color:rgba(0, 0, 0, 0.3)");

	tabPane.setStyle("-fx-background-color:rgba(230, 230, 230, 0.8)");

	functionBox.setBackground(Background.EMPTY);
	functionBox.setPadding(new Insets(0, 5, 5, 0));

	VBox separator = new VBox();
	separator.setPrefHeight(1);
	separator.setMinHeight(1);
	separator.setBackground(Background.EMPTY);
	// separator.setStyle("-fx-background-color:rgba(230, 230, 230, 1)");

	BorderPane bottomBorderPane = new BorderPane();
	bottomBorderPane.setCenter(functionBox);
	bottomBorderPane.setRight(rightFunctionBox);

	bottomBox.setPadding(new Insets(5, 2, 1, 2));
	bottomBox.setStyle("-fx-background-color:rgba(230, 230, 230, 0.7)");

	bottomBox.getChildren().add(separator);
	bottomBox.getChildren().add(bottomBorderPane);

	borderPane.setTop(topVBox);
	borderPane.setCenter(centerBorderPane);
	borderPane.setBottom(bottomBox);

	this.setCenter(borderPane);
	tabPane.setVisible(true);
	findListPane.setVisible(false);

	functionBox.setOnMouseEntered(m -> {
		functionBox.setCursor(Cursor.DEFAULT);
	});
}
 
Example 12
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 13
Source File: TimelinePanel.java    From constellation with Apache License 2.0 4 votes vote down vote up
/**
     * Creates organises the TimelinePanel's layers.
     */
    private void doLayout() {
        // Layer that contains the timelinechart component:
        final BorderPane timelinePane = new BorderPane();

        timelinePane.setCenter(timeline);
        // The layer that contains the time extent labels:
        final BorderPane labelsPane = new BorderPane();
        BorderPane.setAlignment(lowerTime, Pos.CENTER);
        BorderPane.setAlignment(upperTime, Pos.CENTER);
        BorderPane.setMargin(lowerTime, new Insets(-32.0, -40.0, 0.0, -60.0));
        BorderPane.setMargin(upperTime, new Insets(-32.0, -60.0, 0.0, -40.0));
        labelsPane.setLeft(lowerTime);
        labelsPane.setRight(upperTime);
        labelsPane.setMouseTransparent(true);

        // Layer that combines the newly constructed time-extents with the timeline layer:
        final StackPane stackPane = new StackPane();
        StackPane.setAlignment(labelsPane, Pos.CENTER);
//        extentLabelPane.maxHeightProperty().bind(stackPane.heightProperty());
        StackPane.setAlignment(timelinePane, Pos.CENTER);
//        timelinePane.prefHeightProperty().bind(stackPane.heightProperty());
        stackPane.setPadding(Insets.EMPTY);
        stackPane.getChildren().addAll(timelinePane, labelsPane);

        // Layout the menu bar and the timeline object:
        final VBox vbox = new VBox();
//        stackPane.prefHeightProperty().bind(vbox.heightProperty());
        VBox.setVgrow(toolbar, Priority.NEVER);
        VBox.setVgrow(stackPane, Priority.ALWAYS);
        vbox.getChildren().addAll(toolbar, stackPane);
        vbox.setAlignment(Pos.TOP_CENTER);
        vbox.setFillWidth(true);

        // Organise the inner pane:
        AnchorPane.setTopAnchor(vbox, 0d);
        AnchorPane.setBottomAnchor(vbox, 0d);
        AnchorPane.setLeftAnchor(vbox, 0d);
        AnchorPane.setRightAnchor(vbox, 0d);
        innerPane.getChildren().add(vbox);
        innerPane.prefHeightProperty().bind(super.heightProperty());
        innerPane.prefWidthProperty().bind(super.widthProperty());

        // Attach the inner pane to the root:
        this.getChildren().add(innerPane);
    }
 
Example 14
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 ());
}
 
Example 15
Source File: GraphApp.java    From big-math with MIT License 4 votes vote down vote up
@Override
public void start(Stage primaryStage) throws Exception {
	Group root = new Group();
	Scene scene = new Scene(root);
	
	BorderPane borderPane = new BorderPane();
	root.getChildren().add(borderPane);
	
	Node toolbar = createToolbar();
	borderPane.setTop(toolbar);

	Node editor = createEditor();
	borderPane.setRight(editor);

	graphCanvas = createGraphCanvas();
	borderPane.setCenter(graphCanvas);
	
	graphCanvas.requestFocus();

	primaryStage.setScene(scene);
	primaryStage.show();
			
	function1Property.addListener((observable, oldValue, newValue) -> {
		updateFunctions();
	});
	function2Property.addListener((observable, oldValue, newValue) -> {
		updateFunctions();
	});
	function3Property.addListener((observable, oldValue, newValue) -> {
		updateFunctions();
	});
	
	ChangeListener<? super Number> graphDrawingListener = (observable, oldValue, newValue) -> drawGraph(graphCanvas);
	xStartProperty.addListener(graphDrawingListener);
	xEndProperty.addListener(graphDrawingListener);
	yStartProperty.addListener(graphDrawingListener);
	yEndProperty.addListener(graphDrawingListener);
	precisionProperty.addListener(graphDrawingListener);
	
	updateFunctions();
}
 
Example 16
Source File: ChatItemPane.java    From oim-fx with MIT License 4 votes vote down vote up
private void initComponent() {

		headImageView.setClip(headImageClip);

		StackPane headStackPane = new StackPane();
		headStackPane.setPadding(new Insets(12, 8, 12, 18));
		headStackPane.getChildren().add(headImageView);

		redLabel.setStyle("-fx-text-fill:rgba(255, 255, 255, 1);");

		StackPane redStackPane = new StackPane();
		redStackPane.getChildren().add(redImageView);
		redStackPane.getChildren().add(redLabel);

		HBox redHBox = new HBox();
		redHBox.setAlignment(Pos.TOP_RIGHT);
		redHBox.getChildren().add(redStackPane);

		VBox redVBox = new VBox();
		redVBox.setAlignment(Pos.TOP_RIGHT);
		redVBox.getChildren().add(redHBox);

		StackPane leftStackPane = new StackPane();

		leftStackPane.getChildren().add(headStackPane);
		leftStackPane.getChildren().add(redVBox);

		nameLabel.setStyle("-fx-text-fill:rgba(255, 255, 255, 1);-fx-font-size: 14px;");

		HBox nameHBox = new HBox();
		nameHBox.getChildren().add(nameLabel);

		timeLabel.setStyle("-fx-text-fill:#666a77;");

		BorderPane nameBorderPane = new BorderPane();

		nameBorderPane.setCenter(nameHBox);
		nameBorderPane.setRight(timeLabel);

		textLabel.setStyle("-fx-text-fill:rgba(152, 152, 152, 1);");

		HBox textHBox = new HBox();
		textHBox.setAlignment(Pos.CENTER_LEFT);
		textHBox.getChildren().add(textLabel);

		VBox centerVBox = new VBox();
		centerVBox.setSpacing(5);
		centerVBox.setPadding(new Insets(10, 0, 0, 0));
		centerVBox.getChildren().add(nameBorderPane);
		centerVBox.getChildren().add(textHBox);

		HBox lineHBox = new HBox();
		lineHBox.setPrefHeight(0.5);
		lineHBox.setStyle("-fx-background-color:#292c33;");

		borderPane.setLeft(leftStackPane);
		borderPane.setCenter(centerVBox);
		borderPane.setBottom(lineHBox);
		// borderPane.getStyleClass().add("selected-button");
		// this.getStyleClass().add("chat-item-pane");
		this.getChildren().add(borderPane);
	}
 
Example 17
Source File: ProductIonFilterVisualizerWindow.java    From mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
public ProductIonFilterVisualizerWindow(RawDataFile dataFile, ParameterSet parameters) {
  borderPane = new BorderPane();
  scene = new Scene(borderPane);
  setScene(scene);

  this.dataFile = dataFile;

  // Retrieve parameter's values
  Range<Double> rtRange =
      parameters.getParameter(ProductIonFilterParameters.retentionTimeRange).getValue();
  Range<Double> mzRange = parameters.getParameter(ProductIonFilterParameters.mzRange).getValue();
  Object xAxisType = parameters.getParameter(ProductIonFilterParameters.xAxisType).getValue();

  mzDifference = parameters.getParameter(ProductIonFilterParameters.mzDifference).getValue();

  targetedMZ_List =
      parameters.getParameter(ProductIonFilterParameters.targetedMZ_List).getValue();
  targetedNF_List =
      parameters.getParameter(ProductIonFilterParameters.targetedNF_List).getValue();

  fileName = parameters.getParameter(ProductIonFilterParameters.fileName).getValue();

  basePeakPercent =
      parameters.getParameter(ProductIonFilterParameters.basePeakPercent).getValue();

  // Set window components
  dataset = new ProductIonFilterDataSet(dataFile, xAxisType, rtRange, mzRange, this, mzDifference,
      targetedMZ_List, targetedNF_List, basePeakPercent, fileName);

  productIonFilterPlot = new ProductIonFilterPlot(this);
  productIonFilterPlot.setAxisTypes(xAxisType);
  productIonFilterPlot.addProductionFilterDataSet(dataset);
  productIonFilterPlot.setMenuItems();
  borderPane.setCenter(productIonFilterPlot);

  toolBar = new ToolBar();
  toolBar.setOrientation(Orientation.VERTICAL);
  Button highlightPrecursorBtn = new Button(null, new ImageView(PRECURSOR_MASS_ICON));
  highlightPrecursorBtn.setTooltip(new Tooltip("Highlight selected precursor mass range"));
  highlightPrecursorBtn.setOnAction(e -> {
    ProductIonFilterSetHighlightDialog dialog =
        new ProductIonFilterSetHighlightDialog(this, productIonFilterPlot, "HIGHLIGHT_PRECURSOR");
    dialog.show();
  });
  toolBar.getItems().add(highlightPrecursorBtn);
  borderPane.setRight(toolBar);

  MZmineCore.getTaskController().addTask(dataset, TaskPriority.HIGH);

  updateTitle();

  // Add the Windows menu
  WindowsMenu.addWindowsMenu(getScene());

  // get the window settings parameter
  ParameterSet paramSet =
      MZmineCore.getConfiguration().getModuleParameters(ProductIonFilterVisualizerModule.class);
  WindowSettingsParameter settings =
      paramSet.getParameter(ProductIonFilterParameters.windowSettings);

  // update the window and listen for changes
  settings.applySettingsToWindow(this);

}
 
Example 18
Source File: HighlightOptions.java    From LogFX with GNU General Public License v3.0 4 votes vote down vote up
public HighlightOptions( SimpleObjectProperty<LogLineColors> standardLogColors,
                         ObservableList<HighlightExpression> observableExpressions,
                         BooleanProperty isFilterEnabled ) {
    this.standardLogColors = standardLogColors;
    this.observableExpressions = observableExpressions;
    this.isFilterEnabled = isFilterEnabled;
    this.expressionsBox = new VBox( 2 );

    expressionsBox.getChildren().addAll( observableExpressions.stream()
            .map( ex -> new HighlightExpressionRow( ex, observableExpressions, expressionsBox ) )
            .toArray( HighlightExpressionRow[]::new ) );

    setSpacing( 5 );
    setPadding( new Insets( 5 ) );
    Label headerLabel = new Label( "Enter highlight expressions:" );
    headerLabel.setFont( Font.font( "Lucida", FontWeight.BOLD, 14 ) );

    CheckBox enableFilter = new CheckBox( "Filter?" );
    enableFilter.selectedProperty().bindBidirectional( isFilterEnabled );
    enableFilter.setTooltip( new Tooltip( "Filter log lines that match selected rules" ) );

    Node helpIcon = createHelpIcon();

    HBox headerRow = new HBox( 10 );
    headerRow.getChildren().addAll( headerLabel, helpIcon );

    BorderPane headerPane = new BorderPane();
    headerPane.setLeft( headerRow );
    headerPane.setRight( enableFilter );

    BorderPane buttonsPane = new BorderPane();

    Button newRow = new Button( "Add rule" );
    newRow.setOnAction( this::addRow );

    Button selectAllFilters = new Button( "All" );
    selectAllFilters.setOnAction( ( event ) -> enableFilters( true ) );
    Button disableAllFilters = new Button( "None" );
    disableAllFilters.setOnAction( ( event ) -> enableFilters( false ) );

    HBox filterButtons = new HBox( 5, new Label( "Select Filters:" ),
            selectAllFilters, disableAllFilters );

    buttonsPane.setLeft( newRow );
    buttonsPane.setRight( filterButtons );

    getChildren().addAll(
            headerPane,
            expressionsBox,
            new StandardLogColorsRow( standardLogColors ),
            buttonsPane );
}
 
Example 19
Source File: ColorPicker.java    From mcaselector with MIT License 4 votes vote down vote up
public ColorPicker(javafx.stage.Window stage, Color color) {
	super(stage);
	cancel.setOnAction(e -> {
		result = null;
		close();
	});
	ok.setOnAction(e -> close());

	red.setValue(color.getRed() * 255);
	green.setValue(color.getGreen() * 255);
	blue.setValue(color.getBlue() * 255);
	opacity.setValue(color.getOpacity() * 255);

	red.valueProperty().addListener((l, o, n) -> onValueChange());
	green.valueProperty().addListener((l, o, n) -> onValueChange());
	blue.valueProperty().addListener((l, o, n) -> onValueChange());
	opacity.valueProperty().addListener((l, o, n) -> onValueChange());

	preview.getStyleClass().add("color-picker-preview");

	GridPane grid = new GridPane();
	grid.getStyleClass().add("color-picker-sliders");
	grid.add(label("R", "color-picker-slider-label"), 0, 0, 1, 1);
	grid.add(label("G", "color-picker-slider-label"), 0, 1, 1, 1);
	grid.add(label("B", "color-picker-slider-label"), 0, 2, 1, 1);
	grid.add(label("A", "color-picker-slider-label"), 0, 3, 1, 1);
	grid.add(red, 1, 0, 1, 1);
	grid.add(green, 1, 1, 1, 1);
	grid.add(blue, 1, 2, 1, 1);
	grid.add(opacity, 1, 3, 1, 1);
	grid.add(UIFactory.attachTextFieldToSlider(red), 2, 0, 1, 1);
	grid.add(UIFactory.attachTextFieldToSlider(green), 2, 1, 1, 1);
	grid.add(UIFactory.attachTextFieldToSlider(blue), 2, 2, 1, 1);
	grid.add(UIFactory.attachTextFieldToSlider(opacity), 2, 3, 1, 1);

	HBox buttonBox = new HBox();
	buttonBox.getChildren().addAll(ok, cancel);
	buttonBox.getStyleClass().add("color-picker-button-box");

	BorderPane borderPane = new BorderPane();
	borderPane.getStyleClass().add("color-picker");
	borderPane.setTop(grid);
	borderPane.setCenter(preview);
	borderPane.setBottom(buttonBox);
	borderPane.setLeft(borderElement("border-element-vertical"));
	borderPane.setRight(borderElement("border-element-vertical"));

	setContent(borderPane);
}
 
Example 20
Source File: TransfersTab.java    From xframium-java with GNU General Public License v3.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);
}