Java Code Examples for javafx.geometry.HPos#LEFT

The following examples show how to use javafx.geometry.HPos#LEFT . 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: SpectralMatchPanelFX.java    From mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
private GridPane createTitlePane() {
  pnTitle = new GridPane();
  pnTitle.setAlignment(Pos.CENTER);

  // create Top panel
  double simScore = hit.getSimilarity().getScore();
  Color gradientCol = FxColorUtil.awtColorToFX(ColorScaleUtil
      .getColor(FxColorUtil.fxColorToAWT(MIN_COS_COLOR), FxColorUtil.fxColorToAWT(MAX_COS_COLOR),
          MIN_COS_COLOR_VALUE, MAX_COS_COLOR_VALUE, simScore));
  pnTitle.setBackground(
      new Background(new BackgroundFill(gradientCol, CornerRadii.EMPTY, Insets.EMPTY)));

  lblHit = new Label(hit.getName());
  lblHit.getStyleClass().add("white-larger-label");

  lblScore = new Label(COS_FORM.format(simScore));
  lblScore.getStyleClass().add("white-score-label");
  lblScore
      .setTooltip(new Tooltip("Cosine similarity of raw data scan (top, blue) and database scan: "
          + COS_FORM.format(simScore)));

  pnTitle.add(lblHit, 0, 0);
  pnTitle.add(lblScore, 1, 0);
  ColumnConstraints ccTitle0 = new ColumnConstraints(150, -1, -1, Priority.ALWAYS, HPos.LEFT,
      true);
  ColumnConstraints ccTitle1 = new ColumnConstraints(150, 150, 150, Priority.NEVER, HPos.LEFT,
      false);
  pnTitle.getColumnConstraints().add(0, ccTitle0);
  pnTitle.getColumnConstraints().add(1, ccTitle1);

  return pnTitle;
}
 
Example 2
Source File: Toast.java    From DevToolBox with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void show(Node anchor, Side side, double offsetX, double offsetY) {
    if (anchor == null) {
        return;
    }
    autoCenter = false;

    HPos hpos = side == Side.LEFT ? HPos.LEFT : side == Side.RIGHT ? HPos.RIGHT : HPos.CENTER;
    VPos vpos = side == Side.TOP ? VPos.TOP : side == Side.BOTTOM ? VPos.BOTTOM : VPos.CENTER;
    // translate from anchor/hpos/vpos/offsetX/offsetY into screenX/screenY
    Point2D point = Utils.pointRelativeTo(anchor, content.prefWidth(-1), content.prefHeight(-1), hpos, vpos, offsetX, offsetY, true);
    this.show(anchor, point.getX(), point.getY());
}
 
Example 3
Source File: SpectralMatchPanelFX.java    From mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
public SpectralMatchPanelFX(SpectralDBPeakIdentity hit) {
  super();

  this.hit = hit;

  setMinSize(950, 500);

  theme = MZmineCore.getConfiguration().getDefaultChartTheme();
  SimpleColorPalette palette = MZmineCore.getConfiguration().getDefaultColorPalette();

  MAX_COS_COLOR = palette.getPositiveColor();
  MIN_COS_COLOR = palette.getNegativeColor();

  pnTitle = createTitlePane();

  metaDataScroll = createMetaDataPane();

  mirrorChart = MirrorChartFactory.createMirrorPlotFromSpectralDBPeakIdentity(hit);
  MZmineCore.getConfiguration().getDefaultChartTheme().apply(mirrorChart.getChart());
  mirrorChartWrapper = new BorderPane();
  mirrorChartWrapper.setCenter(mirrorChart);

  coupleZoomYListener();

  // put into main
  ColumnConstraints ccSpectrum = new ColumnConstraints(400, -1, Region.USE_COMPUTED_SIZE,
      Priority.ALWAYS, HPos.CENTER,
      true);
  ColumnConstraints ccMetadata = new ColumnConstraints(META_WIDTH + 30, META_WIDTH + 30,
      Region.USE_COMPUTED_SIZE, Priority.NEVER, HPos.LEFT, false);

  add(pnTitle, 0, 0, 2, 1);
  add(mirrorChartWrapper, 0, 1);
  add(metaDataScroll, 1, 1);

  getColumnConstraints().add(0, ccSpectrum);
  getColumnConstraints().add(1, ccMetadata);

  setBorder(new Border(new BorderStroke(Color.BLACK, BorderStrokeStyle.SOLID, CornerRadii.EMPTY,
      BorderWidths.DEFAULT)));
}
 
Example 4
Source File: JFXChipViewSkin.java    From JFoenix with Apache License 2.0 4 votes vote down vote up
private HPos getColumnHAlignmentInternal() {
    HPos localPos = getColumnHalignment();
    return localPos == null ? HPos.LEFT : localPos;
}