Java Code Examples for javafx.geometry.Orientation#VERTICAL

The following examples show how to use javafx.geometry.Orientation#VERTICAL . 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: LogGridTest.java    From charts with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 2
Source File: LogChartTest.java    From charts with Apache License 2.0 5 votes vote down vote up
private Axis createLeftYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
    Axis axis = new Axis(MIN, MAX, Orientation.VERTICAL, AxisType.LOGARITHMIC, Position.LEFT);
    axis.setPrefWidth(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

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

    return axis;
}
 
Example 3
Source File: LineChartTest.java    From charts with Apache License 2.0 5 votes vote down vote up
private Axis createCenterYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE, final double AXIS_WIDTH) {
    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, AXIS_WIDTH);
    AnchorPane.setLeftAnchor(axis, axis.getZeroPosition());

    return axis;
}
 
Example 4
Source File: LineChartTest.java    From charts with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 5
Source File: PlayfairTest.java    From charts with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 6
Source File: PlayfairTest.java    From charts with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 7
Source File: PlayfairTest.java    From charts with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 8
Source File: GridTest.java    From charts with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 9
Source File: SingleChartTest.java    From charts with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 10
Source File: LogAxisTest.java    From charts with Apache License 2.0 5 votes vote down vote up
@Override public void init() {
    xAxisBottom = new Axis(0, 1000, Orientation.HORIZONTAL, AxisType.LOGARITHMIC, Position.BOTTOM);
    xAxisBottom.setPrefHeight(20);
    AnchorPane.setLeftAnchor(xAxisBottom, 20d);
    AnchorPane.setRightAnchor(xAxisBottom, 20d);
    AnchorPane.setBottomAnchor(xAxisBottom, 0d);

    yAxisLeft = new Axis(0, 1000, Orientation.VERTICAL, AxisType.LOGARITHMIC, Position.LEFT);
    yAxisLeft.setPrefWidth(20);
    AnchorPane.setLeftAnchor(yAxisLeft, 0d);
    AnchorPane.setTopAnchor(yAxisLeft, 20d);
    AnchorPane.setBottomAnchor(yAxisLeft, 20d);
}
 
Example 11
Source File: LogGridTest.java    From charts with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 12
Source File: TimeAxisTest.java    From charts with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 13
Source File: TimeAxisTest.java    From charts with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 14
Source File: World.java    From charts with Apache License 2.0 5 votes vote down vote up
private void zoomToArea(final double[] BOUNDS) {
    group.setTranslateX(0);
    group.setTranslateY(0);
    double      areaWidth   = BOUNDS[2] - BOUNDS[0];
    double      areaHeight  = BOUNDS[3] - BOUNDS[1];
    double      areaCenterX = BOUNDS[0] + areaWidth * 0.5;
    double      areaCenterY = BOUNDS[1] + areaHeight * 0.5;
    Orientation orientation = areaWidth < areaHeight ? Orientation.VERTICAL : Orientation.HORIZONTAL;
    double sf = 1.0;
    switch(orientation) {
        case VERTICAL  : sf = clamp(1.0, 10.0, 1 / (areaHeight / height)); break;
        case HORIZONTAL: sf = clamp(1.0, 10.0, 1 / (areaWidth / width)); break;
    }

    /*
    Rectangle bounds = new Rectangle(BOUNDS[0], BOUNDS[1], areaWidth, areaHeight);
    bounds.setFill(Color.TRANSPARENT);
    bounds.setStroke(Color.RED);
    bounds.setStrokeWidth(0.5);
    bounds.setMouseTransparent(true);
    group.getChildren().add(bounds);
    */

    setScaleFactor(sf);
    group.setTranslateX(width * 0.5 - (areaCenterX));
    group.setTranslateY(height * 0.5 - (areaCenterY));
}
 
Example 15
Source File: ChartController.java    From TAcharting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Update the ToolBar
 * Called every time an ChartIndicator has been added or removed to the
 * {@link BaseIndicatorBox chartIndicatorBox} colorOf the underlying {@link TaChart org.sjwimmer.tacharting.chart}
 *
 * @param change Change<? extends String, ? extends ChartIndicator>
 */
@Override
public void onChanged(Change<? extends String, ? extends ChartIndicator> change) {
    String key = change.getKey();

    if(change.wasRemoved()){
        toolBarIndicators.getItems().remove(keyButton.get(key));
        toolBarIndicators.getItems().remove(keySeperator.get(key));
        if(!change.wasAdded()) {
            CheckMenuItem item = itemMap.get(key);
            if(item!=null){
                item.setSelected(false);
            }
        }
    }
    // it is possible that wasRemoved = wasAdded = true, e.g ObservableMap.put(existingKey, indicator)
    if(change.wasAdded()) {
        ChartIndicator indicator = change.getValueAdded();
        Button btnSetup = new Button(indicator.getGeneralName());
        btnSetup.setOnAction((event)->{
            IndicatorPopUpWindow in = IndicatorPopUpWindow.getPopUpWindow(key, chart.getChartIndicatorBox());
            in.show(btnSetup, MouseInfo.getPointerInfo().getLocation().x, MouseInfo.getPointerInfo().getLocation().y);
        });

        keyButton.put(key,btnSetup);
        Separator sep1 = new Separator(Orientation.VERTICAL);
        keySeperator.put(key, sep1);
        toolBarIndicators.getItems().add(btnSetup);
        toolBarIndicators.getItems().add(sep1);
    }
}
 
Example 16
Source File: SingleChartTest.java    From charts with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 17
Source File: LogChartTest.java    From charts with Apache License 2.0 5 votes vote down vote up
private Axis createRightYAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
    Axis axis = new Axis(MIN, MAX, Orientation.VERTICAL, AxisType.LOGARITHMIC, Position.RIGHT);
    axis.setPrefWidth(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

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

    return axis;
}
 
Example 18
Source File: ParameterSetupDialogWithChromatogramPreview.java    From mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
public ParameterSetupDialogWithChromatogramPreview(boolean valueCheckRequired,
    ParameterSet parameters) {
  super(valueCheckRequired, parameters);

  dataFiles = MZmineCore.getProjectManager().getCurrentProject().getDataFiles();

  if (dataFiles.length > 0) {

    RawDataFile selectedFiles[] = MZmineCore.getDesktop().getSelectedDataFiles();

    if (selectedFiles.length > 0)
      previewDataFile = selectedFiles[0];
    else
      previewDataFile = dataFiles[0];
  }

  previewCheckBox.setOnAction(e -> {
    if (previewCheckBox.isSelected()) {
      showPreview();
    } else {
      hidePreview();
    }
  });
  // previewCheckBox.setHorizontalAlignment(SwingConstants.CENTER);

  paramsPane.add(new Separator(), 0, getNumberOfParameters() + 1);
  paramsPane.add(previewCheckBox, 0, getNumberOfParameters() + 2);

  // Elements of pnlLab
  FlowPane pnlLab = new FlowPane(Orientation.VERTICAL);
  // pnlLab.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

  // pnlLab.getChildren().add(Box.createVerticalStrut(5));
  pnlLab.getChildren().add(new Label("Data file "));
  // pnlLab.add(Box.createVerticalStrut(20));
  pnlLab.getChildren().add(new Label("Plot Type "));
  // pnlLab.add(Box.createVerticalStrut(25));
  pnlLab.getChildren().add(new Label("RT range "));
  // pnlLab.add(Box.createVerticalStrut(15));
  pnlLab.getChildren().add(new Label("m/z range "));

  // Elements of pnlFlds
  FlowPane pnlFlds = new FlowPane(Orientation.VERTICAL);

  // pnlFlds.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

  comboDataFileName.getSelectionModel().select(previewDataFile);
  comboDataFileName.setOnAction(e -> {
    int ind = comboDataFileName.getSelectionModel().getSelectedIndex();
    if (ind >= 0) {
      previewDataFile = dataFiles[ind];
      parametersChanged();
    }
  });

  ticViewComboBox.getSelectionModel().select(TICPlotType.TIC);
  ticViewComboBox.setOnAction(e -> parametersChanged());

  rtRangeBox.setValue(previewDataFile.getDataRTRange(1));
  mzRangeBox.setValue(previewDataFile.getDataMZRange(1));

  pnlFlds.getChildren().add(comboDataFileName);
  // pnlFlds.add(Box.createVerticalStrut(10));
  pnlFlds.getChildren().add(ticViewComboBox);
  // pnlFlds.add(Box.createVerticalStrut(20));
  pnlFlds.getChildren().add(rtRangeBox);
  // pnlFlds.add(Box.createVerticalStrut(5));
  pnlFlds.getChildren().add(mzRangeBox);

  // Put all together
  pnlPreviewFields.setLeft(pnlLab);
  pnlPreviewFields.setCenter(pnlFlds);
  pnlPreviewFields.setVisible(false);

  ticPlot = new TICPlot();
  // ticPlot.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
  // ticPlot.setMinimumSize(new Dimension(400, 300));

  paramsPane.add(pnlPreviewFields, 0, getNumberOfParameters() + 3);



}
 
Example 19
Source File: SliderDemo.java    From phoebus with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void start(final Stage stage)
{
    final Slider slider = new Slider();
    slider.setOrientation(Orientation.HORIZONTAL);
    slider.setShowTickLabels(true);
    slider.setShowTickMarks(true);
    slider.setMajorTickUnit(20.0);
    slider.setMin(-100.0);
    slider.setMax(100.0);
    slider.setValue(10.0);

    slider.valueProperty().addListener((observable, old, value)->
    {
        System.out.println("Value: " + value);
    });

    final SliderMarkers markers = new SliderMarkers(slider);
    markers.setAlarmMarkers(-100, -10, 70, 90);

    final String font = "-fx-font-size: 30px";
    slider.setStyle(font);
    markers.setStyle(font);

    final GridPane layout = new GridPane();
    layout.add(markers, 0, 0);
    layout.getChildren().add(slider);
    if (slider.getOrientation() == Orientation.VERTICAL)
    {
        GridPane.setConstraints(slider, 1, 0);
        GridPane.setVgrow(slider, Priority.ALWAYS);
    }
    else
    {
        GridPane.setConstraints(slider, 0, 1);
        GridPane.setHgrow(slider, Priority.ALWAYS);
    }
    final Scene scene = new Scene(layout, 800, 700);
    stage.setScene(scene);
    stage.setTitle("Slider Demo");

    stage.show();
    markers.update();
}
 
Example 20
Source File: StatusBar.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
private Separator createSeparator() {
    Separator separator = new Separator(Orientation.VERTICAL);
    separator.setPadding(new Insets(3, 0, 3, 0));
    return separator;
}