javafx.geometry.Insets Java Examples

The following examples show how to use javafx.geometry.Insets. 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: SuitStack.java    From Solitaire with GNU General Public License v2.0 7 votes vote down vote up
SuitStack(FoundationPile pIndex)
{
	aIndex = pIndex;
	setPadding(new Insets(PADDING));
	setStyle(BORDER_STYLE);
	final ImageView image = new ImageView(CardImages.getBack());
   	image.setVisible(false);
      	getChildren().add(image);
   	aDragHandler = new CardDragHandler(image);
   	image.setOnDragDetected(aDragHandler);
   	setOnDragOver(createOnDragOverHandler(image));
   	setOnDragEntered(createOnDragEnteredHandler());
   	setOnDragExited(createOnDragExitedHandler());
   	setOnDragDropped(createOnDragDroppedHandler());
   	GameModel.instance().addListener(this);
}
 
Example #2
Source File: OverlayPane.java    From paintera with GNU General Public License v2.0 6 votes vote down vote up
/**
 */
public OverlayPane()
{
	super();
	super.getChildren().add(canvasPane);
	setBackground(new Background(new BackgroundFill(Color.BLACK.deriveColor(0.0, 1.0, 1.0, 0.0), CornerRadii.EMPTY, Insets.EMPTY)));

	this.overlayRenderers = new CopyOnWriteArrayList<>();

	final ChangeListener<Number> sizeChangeListener = (observable, oldValue, newValue)
			-> {
		final double wd = widthProperty().get();
		final double hd = heightProperty().get();
		final int    w  = (int) wd;
		final int    h  = (int) hd;
		if (w <= 0 || h <= 0)
			return;
		overlayRenderers.forEach(or -> or.setCanvasSize(w, h));
		layout();
		drawOverlays();
	};

	widthProperty().addListener(sizeChangeListener);
	heightProperty().addListener(sizeChangeListener);

}
 
Example #3
Source File: ImageFrame.java    From oim-fx with MIT License 6 votes vote down vote up
private void init() {
	this.setCenter(rootPane);
	this.setTitle("组件测试");
	this.setWidth(380);
	this.setHeight(600);
	this.setRadius(10);
	
	Image image=new Image("com/javafx/demo/only/wallpaper1.jpg");
	ImageView iv=new ImageView(image);
	
	
	rootPane.setPadding(new Insets(30, 0, 0, 0));
	rootPane.getChildren().add(rootVBox);
	
	Button button=new Button("",iv);
	rootVBox.getChildren().add(button);
}
 
Example #4
Source File: Example1.java    From chuidiang-ejemplos with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void buildAndShowMainWindow(Stage primaryStage) {
    primaryStage.setTitle("Hello World!!");
    GridPane gridPane = new GridPane();
    gridPane.setAlignment(Pos.CENTER);
    gridPane.setHgap(10);
    gridPane.setVgap(10);
    gridPane.setPadding(new Insets(25, 25, 25, 25));

    button = new Button("Click me!");
    gridPane.add(button,1,1);

    text = new TextField();
    gridPane.add(text, 2, 1);

    clockLabel = new Label();
    gridPane.add(clockLabel, 1,2, 2, 1);

    Scene scene = new Scene(gridPane);
    primaryStage.setScene(scene);
    primaryStage.show();
}
 
Example #5
Source File: FormBuilder.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
public static Tuple2<Label, Label> addConfirmationLabelLabel(GridPane gridPane,
                                                             int rowIndex,
                                                             String title1,
                                                             String title2,
                                                             double top) {
    Label label1 = addLabel(gridPane, rowIndex, title1);
    label1.getStyleClass().add("confirmation-label");
    Label label2 = addLabel(gridPane, rowIndex, title2);
    label2.getStyleClass().add("confirmation-value");
    GridPane.setColumnIndex(label2, 1);
    GridPane.setMargin(label1, new Insets(top, 0, 0, 0));
    GridPane.setHalignment(label1, HPos.LEFT);
    GridPane.setMargin(label2, new Insets(top, 0, 0, 0));

    return new Tuple2<>(label1, label2);
}
 
Example #6
Source File: CanvasViewColorsPopup.java    From arma-dialog-creator with MIT License 6 votes vote down vote up
public CanvasViewColorsPopup() {
	super(ArmaDialogCreator.getPrimaryStage(), new VBox(10), null, false, true, false);

	ResourceBundle bundle = Lang.ApplicationBundle();

	setTitle(bundle.getString("Popups.Colors.popup_title"));

	myStage.initStyle(StageStyle.UTILITY);
	setupColorPickers();
	myStage.setMinWidth(400);
	myRootElement.setPadding(new Insets(5, 5, 5, 5));
	myRootElement.setAlignment(Pos.TOP_LEFT);
	myRootElement.getChildren().addAll(
			colorOption(bundle.getString("Popups.Colors.selection"), cpSelection),
			colorOption(bundle.getString("Popups.Colors.abs_region"), cpAbsRegion),
			colorOption(bundle.getString("Popups.Colors.grid"), cpGrid),
			colorOption(bundle.getString("Popups.Colors.background"), cpEditorBg)
	);
}
 
Example #7
Source File: EmojiDisplayer.java    From ChatRoom-JavaFX with Apache License 2.0 6 votes vote down vote up
/**
 * 创建emoji图片节点
 *
 * @param emoji
 *            emoji
 * @param size
 *            图片显示大小
 * @param pad
 *            图片间距
 * @param isCursor
 *            是否需要图片光标及鼠标处理事件
 * @return
 */
public static Node createEmojiNode(Emoji emoji, int size, int pad) {
	// 将表情放到stackpane中
	StackPane stackPane = new StackPane();
	stackPane.setMaxSize(size, size);
	stackPane.setPrefSize(size, size);
	stackPane.setMinSize(size, size);
	stackPane.setPadding(new Insets(pad));
	ImageView imageView = new ImageView();
	imageView.setFitWidth(size);
	imageView.setFitHeight(size);
	imageView.setImage(ImageCache.getInstance().getImage(getEmojiImagePath(emoji.getHex())));
	stackPane.getChildren().add(imageView);

	return stackPane;
}
 
Example #8
Source File: OptionStage.java    From xframium-java with GNU General Public License v3.0 6 votes vote down vote up
private HBox buttons ()
{
  HBox hbox = new HBox (10);
  hbox.setAlignment (Pos.CENTER);

  okButton.setDefaultButton (true);
  okButton.setPrefWidth (80);

  cancelButton.setCancelButton (true);
  cancelButton.setPrefWidth (80);

  hbox.getChildren ().addAll (cancelButton, okButton);
  hbox.setPadding (new Insets (10, 10, 10, 10));

  return hbox;
}
 
Example #9
Source File: GetDataDialog.java    From examples-javafx-repos1 with Apache License 2.0 6 votes vote down vote up
public void init() {
    vbox = new VBox();
    vbox.setSpacing(20.0d);
    vbox.setPadding(new Insets(10.0d));

    TextField tf = new TextField();

    Button btn = new Button("Submit");
    btn.setOnAction( (evt) -> {
        data = tf.getText();
        ((Button)evt.getSource()).getScene().getWindow().hide();
    } );

    vbox.getChildren().add(new Label("Enter Data"));
    vbox.getChildren().add(tf);
    vbox.getChildren().add(btn);
}
 
Example #10
Source File: DirectionsPane.java    From FXMaps with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Adds a notification located at the top of the vertical pane, which 
 * displays warning or other information about the current API state.
 * (i.e. if its in Beta etc.)
 * 
 * @param message   the message to display
 */
public void addDirectionsBulletinPane(String message) {
    Label l = new Label(message);
    l.setBackground(new Background(
        new BackgroundFill(
            Color.color(
                Color.YELLOW.getRed(), 
                Color.YELLOW.getGreen(), 
                Color.YELLOW.getBlue(), 0.4d),
            new CornerRadii(5), 
            null)));
    l.setWrapText(true);
    l.setPrefWidth(200);
    l.setPadding(new Insets(5,5,5,5));
    directionsBox.getChildren().add(l);
}
 
Example #11
Source File: ControlPropertiesEditorPane.java    From arma-dialog-creator with MIT License 6 votes vote down vote up
/** @return a titled pane for the accordion that holds all properties of a certain {@link ConfigPropertyCategory} */
@NotNull
private PlaceholderTitledPane getPropertiesTitledPane(@NotNull String title, @NotNull ConfigPropertyCategory category) {
	final VBox vb = new VBox(10);
	vb.setFillWidth(true);
	vb.setPadding(new Insets(5));
	final Label lblNoProps = new Label(bundle.getString("ControlPropertiesConfig.no_properties_available"));
	final PlaceholderTitledPane tp = new PlaceholderTitledPane(title, lblNoProps, vb, true);
	final ScrollPane scrollPane = tp.getScrollPane();
	if (scrollPane != null) {
		scrollPane.setFitToWidth(true);
		scrollPane.setStyle("-fx-background-color:transparent");
	}
	tp.setAnimated(false);

	return tp;
}
 
Example #12
Source File: FormBuilder.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
public static <T> Tuple3<Label, ComboBox<T>, TextField> addLabelComboBoxLabel(GridPane gridPane,
                                                                              int rowIndex,
                                                                              String title,
                                                                              String textFieldText,
                                                                              double top) {
    Label label = addLabel(gridPane, rowIndex, title, top);

    HBox hBox = new HBox();
    hBox.setSpacing(10);

    ComboBox<T> comboBox = new JFXComboBox<>();
    TextField textField = new TextField(textFieldText);
    textField.setEditable(false);
    textField.setMouseTransparent(true);
    textField.setFocusTraversable(false);

    hBox.getChildren().addAll(comboBox, textField);
    GridPane.setRowIndex(hBox, rowIndex);
    GridPane.setColumnIndex(hBox, 1);
    GridPane.setMargin(hBox, new Insets(top, 0, 0, 0));
    gridPane.getChildren().add(hBox);

    return new Tuple3<>(label, comboBox, textField);
}
 
Example #13
Source File: TextSymbolRepresentation.java    From phoebus with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected Label createJFXNode ( ) throws Exception {

    Label symbol = new Label();

    symbol.setAlignment(JFXUtil.computePos(model_widget.propHorizontalAlignment().getValue(), model_widget.propVerticalAlignment().getValue()));
    symbol.setBackground(model_widget.propTransparent().getValue()
        ? null
        : new Background(new BackgroundFill(JFXUtil.convert(model_widget.propBackgroundColor().getValue()), CornerRadii.EMPTY, Insets.EMPTY))
    );
    symbol.setFont(JFXUtil.convert(model_widget.propFont().getValue()));
    symbol.setTextFill(JFXUtil.convert(model_widget.propForegroundColor().getValue()));
    symbol.setText("\u263A");

    enabled = model_widget.propEnabled().getValue();

    Styles.update(symbol, Styles.NOT_ENABLED, !enabled);

    return symbol;

}
 
Example #14
Source File: AutoCompleteItem.java    From BlockMap with MIT License 6 votes vote down vote up
public AutoCompleteItem() {
	name = new Label();
	name.setAlignment(Pos.CENTER_LEFT);
	name.setStyle("-fx-font-weight: bold;");

	path = new Label();
	path.setMaxWidth(Double.POSITIVE_INFINITY);
	HBox.setHgrow(path, Priority.ALWAYS);
	HBox.setMargin(path, new Insets(0, 8, 0, 0));
	path.setAlignment(Pos.CENTER_RIGHT);
	path.setTextOverrun(OverrunStyle.CENTER_ELLIPSIS);

	graphic = new ImageView();
	graphic.setPreserveRatio(true);
	graphic.fitHeightProperty().bind(Bindings.createDoubleBinding(() -> name.getFont().getSize() * 1.2, name.fontProperty()));

	setText(null);
	setGraphic(new HBox(2, graphic, name, path));
	setPrefWidth(0);
}
 
Example #15
Source File: ProgressIndicatorTest.java    From mars-sim with GNU General Public License v3.0 6 votes vote down vote up
private Parent createRoot() {
	StackPane stackPane = new StackPane();

	BorderPane controlsPane = new BorderPane();
	controlsPane.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
	stackPane.getChildren().add(controlsPane);
	controlsPane.setCenter(new TableView<Void>());

	ProgressIndicator indicator = new ProgressIndicator();
	indicator.setMaxSize(120, 120);
	stackPane.getChildren().add(indicator);
	StackPane.setAlignment(indicator, Pos.BOTTOM_RIGHT);
	StackPane.setMargin(indicator, new Insets(20));

	return stackPane;
}
 
Example #16
Source File: SlimSkin.java    From Medusa with Apache License 2.0 6 votes vote down vote up
@Override protected void redraw() {
    pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(gauge.getBorderWidth() / PREFERRED_WIDTH * size))));
    pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));
    colorGradientEnabled = gauge.isGradientBarEnabled();
    noOfGradientStops    = gauge.getGradientBarStops().size();
    sectionsVisible      = gauge.getSectionsVisible();

    titleText.setText(gauge.getTitle());
    unitText.setText(gauge.getUnit());
    resizeStaticText();

    barBackground.setStroke(gauge.getBarBackgroundColor());
    setBarColor(gauge.getCurrentValue());
    titleText.setFill(gauge.getTitleColor());
    valueText.setFill(gauge.getValueColor());
    unitText.setFill(gauge.getUnitColor());
}
 
Example #17
Source File: DesignClockSkin.java    From Medusa with Apache License 2.0 6 votes vote down vote up
@Override protected void redraw() {
    pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth() / PREFERRED_WIDTH * size))));
    pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));

    shadowGroup.setEffect(clock.getShadowsEnabled() ? dropShadow : null);

    // Tick Marks
    tickCanvas.setCache(false);
    drawTicks();
    tickCanvas.setCache(true);
    tickCanvas.setCacheHint(CacheHint.QUALITY);

    needle.setStroke(clock.getHourColor());

    ZonedDateTime time = clock.getTime();

    updateTime(time);
}
 
Example #18
Source File: DyIOchannelWidget.java    From BowlerStudio with GNU General Public License v3.0 5 votes vote down vote up
@FXML public void onListenerButtonClicked(ActionEvent event) {
	new Thread(){
		public void run(){
			setName("compiling listener");
			try{
				if(myLocalListener==null){
					Platform.runLater(()->{
						sn.setDisable(true);
						textArea.setEditable(false);
					});
					myLocalListener=(IChannelEventListener) ScriptingEngine.inlineScriptStringRun(textArea.getText(), null, "Groovy");
					channel.addChannelEventListener(myLocalListener);
					Platform.runLater(()->{
						setListenerButton.setText("Kill Listener");
						setListenerButton.setBackground(new Background(new BackgroundFill(Color.RED, CornerRadii.EMPTY, Insets.EMPTY)));
					});
				}else{
					channel.removeChannelEventListener(myLocalListener);
					Platform.runLater(()->{
						sn.setDisable(false);
						textArea.setEditable(true);
						myLocalListener=null;
						setListenerButton.setBackground(new Background(new BackgroundFill(Color.GREEN, CornerRadii.EMPTY, Insets.EMPTY)));
						setListenerButton.setText("Set Listener");
					});
				}
			}catch(Exception e){
				BowlerStudioController.highlightException(null, e);
			}
		}
	}.start();

	
}
 
Example #19
Source File: SmoothedChartTileSkin.java    From OEE-Designer with MIT License 5 votes vote down vote up
@Override protected void resize() {
    super.resize();

    chart.setMinSize(contentBounds.getWidth(), contentBounds.getHeight());
    chart.setPrefSize(contentBounds.getWidth(), contentBounds.getHeight());
    chart.setMaxSize(contentBounds.getWidth(), contentBounds.getHeight());
    if (titleText.isVisible()) { chart.setPadding(new Insets(titleText.getLayoutBounds().getHeight() + contentBounds.getX(), 0, 0, 0)); }
    chart.relocate(contentBounds.getX(), contentBounds.getY());
}
 
Example #20
Source File: DaoLaunchWindow.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected void createGridPane() {
    super.createGridPane();

    gridPane.setVgap(0);
    gridPane.getColumnConstraints().get(0).setHalignment(HPos.CENTER);
    gridPane.setPadding(new Insets(74, 64, 74, 64));
}
 
Example #21
Source File: HighLowTileSkin.java    From tilesfx with Apache License 2.0 5 votes vote down vote up
@Override protected void resize() {
    super.resize();

    description.setPrefSize(width - size * 0.1, size * 0.43);
    description.relocate(size * 0.05, titleText.isVisible() ? height * 0.42 : height * 0.32);

    drawTriangle();
    indicatorPane.setPadding(new Insets(0, size * 0.035, 0, 0));

    resizeStaticText();
    resizeDynamicText();
    referenceUnitFlow.setPrefWidth(width - size * 0.1);
    referenceUnitFlow.relocate(size * 0.05, height * 0.595);

    valueUnitFlow.setPrefWidth(width - size * 0.1);
    valueUnitFlow.relocate(size * 0.05, contentBounds.getY());
    valueUnitFlow.setMaxHeight(valueText.getFont().getSize());

    fractionLine.setStartX(width - 0.17 * size);
    fractionLine.setStartY(tile.getTitle().isEmpty() ? size * 0.2 : size * 0.3);
    fractionLine.setEndX(width - 0.05 * size);
    fractionLine.setEndY(tile.getTitle().isEmpty() ? size * 0.2 : size * 0.3);
    fractionLine.setStroke(tile.getUnitColor());
    fractionLine.setStrokeWidth(size * 0.005);

    unitFlow.setTranslateY(-size * 0.005);
}
 
Example #22
Source File: TakeTwoInputsDialog.java    From Lipi with MIT License 5 votes vote down vote up
public void setupDialog(String firstInputLabel, String firstInputPrompt,
                        String secondInputLabel, String secondInputPrompt) {

    dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);

    GridPane grid = new GridPane();
    grid.setHgap(10);
    grid.setVgap(10);
    grid.setPadding(new Insets(20, 20, 10, 10));

    grid.add(new Label(firstInputLabel), 0, 0);
    firstInputField = new TextField();
    firstInputField.setPromptText(firstInputPrompt);
    firstInputField.setPrefColumnCount(35);
    grid.add(firstInputField, 1, 0);

    grid.add(new Label(secondInputLabel), 0, 1);
    secondInputField = new TextArea();
    secondInputField.setPrefColumnCount(35);
    secondInputField.setPrefRowCount(1);
    secondInputField.setPromptText(secondInputPrompt);
    grid.add(secondInputField, 1, 1);

    // Enable/Disable login button depending on whether a username was entered.
    Node okButton = dialog.getDialogPane().lookupButton(ButtonType.OK);
    okButton.setDisable(true);

    // Do some validation (using the Java 8 lambda syntax).
    firstInputField.textProperty().addListener((observable, oldValue, newValue) -> {
        okButton.setDisable(newValue.trim().isEmpty());
    });

    dialog.getDialogPane().setContent(grid);
}
 
Example #23
Source File: SettingsView.java    From Maus with GNU General Public License v3.0 5 votes vote down vote up
private HBox settingsViewLeft() {
    HBox hBox = Styler.hContainer(20);
    hBox.getStylesheets().add(getClass().getResource("/css/global.css").toExternalForm());
    hBox.setId("clientBuilder");
    hBox.setPadding(new Insets(20, 20, 20, 20));
    Label title = (Label) Styler.styleAdd(new Label("Settings"), "title");
    hBox.getChildren().add(Styler.vContainer(20, title));
    return hBox;
}
 
Example #24
Source File: BatterySkin.java    From Medusa with Apache License 2.0 5 votes vote down vote up
@Override protected void redraw() {
    // Background stroke and fill
    pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(1))));
    pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));

    locale = gauge.getLocale();

    Color barBackgroundColor = gauge.getBarBackgroundColor();
    batteryBackground.setFill(Color.color(barBackgroundColor.getRed(), barBackgroundColor.getGreen(), barBackgroundColor.getBlue(), 0.3));

    valueText.setFill(gauge.getValueColor());

    setBar(gauge.getCurrentValue());
}
 
Example #25
Source File: Demo.java    From Enzo with Apache License 2.0 5 votes vote down vote up
@Override public void start(Stage stage) {
    StackPane pane = new StackPane();
    pane.setPadding(new Insets(5, 5, 5, 5));
    pane.getChildren().addAll(clock);

    Scene scene = new Scene(pane);
    //scene.setFullScreen(true);

    stage.setTitle("RoundLcdClock");
    stage.setScene(scene);
    stage.show();
}
 
Example #26
Source File: IndicatorSkin.java    From Medusa with Apache License 2.0 5 votes vote down vote up
@Override protected void redraw() {
    pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(gauge.getBorderWidth() / PREFERRED_HEIGHT * height))));
    pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY)));

    barColor             = gauge.getBarColor();

    locale               = gauge.getLocale();
    formatString         = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f").toString();
    colorGradientEnabled = gauge.isGradientBarEnabled();
    noOfGradientStops    = gauge.getGradientBarStops().size();
    sectionsVisible      = gauge.getSectionsVisible();

    minValueText.setText(String.format(locale, "%." + gauge.getTickLabelDecimals() + "f", gauge.getMinValue()));
    maxValueText.setText(String.format(locale, "%." + gauge.getTickLabelDecimals() + "f", gauge.getMaxValue()));
    resizeStaticText();

    barBackground.setStroke(gauge.getBarBackgroundColor());
    bar.setStroke(gauge.getBarColor());
    needle.setFill(gauge.getNeedleColor());

    minValueText.setVisible(gauge.getTickLabelsVisible());
    maxValueText.setVisible(gauge.getTickLabelsVisible());

    minValueText.setFill(gauge.getTitleColor());
    maxValueText.setFill(gauge.getTitleColor());
    titleText.setFill(gauge.getTitleColor());
}
 
Example #27
Source File: InfoPopup.java    From charts with Apache License 2.0 5 votes vote down vote up
private void initGraphics() {
    regularFont = Fonts.latoRegular(10);
    lightFont   = Fonts.latoLight(10);

    itemText = new Text("NAME");
    itemText.setFill(_textColor);
    itemText.setFont(regularFont);

    itemNameText = new Text("-");
    itemNameText.setFill(_textColor);
    itemNameText.setFont(regularFont);

    line = new Line(0, 0, 0, 56);
    line.setStroke(_textColor);

    vBoxTitles = new VBox(2, itemText);
    vBoxTitles.setAlignment(Pos.CENTER_LEFT);
    VBox.setMargin(itemText, new Insets(3, 0, 0, 0));

    vBoxValues = new VBox(2, itemNameText);

    vBoxValues.setAlignment(Pos.CENTER_RIGHT);
    VBox.setMargin(itemNameText, new Insets(3, 0, 0, 0));
    HBox.setHgrow(vBoxValues, Priority.ALWAYS);

    hBox = new HBox(5, vBoxTitles, line, vBoxValues);
    hBox.setPrefSize(120, 69);
    hBox.setPadding(new Insets(5));
    hBox.setBackground(new Background(new BackgroundFill(_backgroundColor, new CornerRadii(3), Insets.EMPTY)));
    hBox.setMouseTransparent(true);

    getContent().addAll(hBox);
}
 
Example #28
Source File: VoteResultView.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void initialize() {
    gridRow = phasesView.addGroup(root, gridRow);

    selectedVoteResultListItemListener = (observable, oldValue, newValue) -> onResultsListItemSelected(newValue);

    createCyclesTable();
    exportButton = addButton(root, ++gridRow, Res.get("shared.exportJSON"));
    exportButton.getStyleClass().add("text-button");
    GridPane.setMargin(exportButton, new Insets(10, -10, -50, 0));
    GridPane.setColumnSpan(exportButton, 2);
    GridPane.setHalignment(exportButton, HPos.RIGHT);

    proposalResultsWindow.onClose(() -> proposalsTableView.getSelectionModel().clearSelection());
}
 
Example #29
Source File: SimpleListItemPane.java    From oim-fx with MIT License 5 votes vote down vote up
private void initComponent() {

		headImageView.setClip(headImageClip);

		StackPane headStackPane = new StackPane();
		headStackPane.setPadding(new Insets(10, 8, 10, 20));
		headStackPane.getChildren().add(headImageView);

		StackPane leftStackPane = new StackPane();
		leftStackPane.getChildren().add(headStackPane);

		nameLabel.setStyle("-fx-font-size: 14px;");

		HBox nameHBox = new HBox();
		nameHBox.setAlignment(Pos.CENTER_LEFT);
		nameHBox.getChildren().add(nameLabel);

		VBox centerVBox = new VBox();
		centerVBox.setAlignment(Pos.CENTER_LEFT);
		centerVBox.getChildren().add(nameHBox);


		borderPane.setLeft(leftStackPane);
		borderPane.setCenter(centerVBox);
		//this.getStyleClass().add("chat-item-pane");
		this.getChildren().add(borderPane);
	}
 
Example #30
Source File: LoginDialog.java    From HubTurbo with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Configures the central grid pane before it's used.
 */
private static void setupGridPane(GridPane grid) {
    grid.setAlignment(Pos.CENTER);
    grid.setHgap(7);
    grid.setVgap(10);
    grid.setPadding(new Insets(25));
    grid.setPrefSize(390, 100);
    grid.setMaxSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE);
    applyColumnConstraints(grid, 20, 16, 33, 2, 29);
}