javafx.scene.control.Button.setContentDisplay()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(232)

本文整理了Java中javafx.scene.control.Button.setContentDisplay()方法的一些代码示例,展示了Button.setContentDisplay()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setContentDisplay()方法的具体详情如下:
包路径:javafx.scene.control.Button
类名称:Button
方法名:setContentDisplay

Button.setContentDisplay介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

final Button button = new Button("I love you", imageView);
button.setStyle("-fx-base: coral;");
button.setContentDisplay(ContentDisplay.TOP);
button.setOnAction(new EventHandler<ActionEvent>() {
 @Override public void handle(ActionEvent event) {

代码示例来源:origin: stackoverflow.com

Button b = new Button("text", graphics);
 b.setContentDisplay(ContentDisplay.TOP);

代码示例来源:origin: de.jensd/fontawesomefx-common

public Button createIconButton(GlyphIcons icon, String text, String iconSize, String fontSize, ContentDisplay contentDisplay) {
  Text label = createIcon(icon, iconSize);
  Button button = new Button(text);
  button.setStyle("-fx-font-size: " + fontSize);
  button.setGraphic(label);
  button.setContentDisplay(contentDisplay);
  return button;
}

代码示例来源:origin: stackoverflow.com

btBuscaOrdem.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
btBuscaLote.setStyle("-fx-content-display: graphic-only;");

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * @{inheritedDoc}
 */
@Override
public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) {
 super.buildFrom(controller, configuration);
 button.setDefaultButton(configuration.booleanPropertyValueOf(XMLConstants.DEFAULT).orElse(false));
 ComponentToLabeledHelper.setTooltip(configuration, button, (AbstractViewController) controller);
 IconUtils.setIcon(button, configuration);
 NodeHelper.styleClassAddAll(button, configuration);
 button.getStyleClass().add("ep-button");
 // content display
 final String upperCase = configuration.getPropertyValue("upperCase");
 ComponentToLabeledHelper.setText(configuration, button, "true".equalsIgnoreCase(upperCase), (AbstractViewController) controller);
 if(AbstractApplicationRunner.isDesktop()) {
  final String displayMode = configuration.getPropertyValue(XMLConstants.HYPERLINK_DISPLAY_MODE, "LEFT");
  button.setContentDisplay(ContentDisplay.valueOf(displayMode));
 }
 else {
  final String displayMode = configuration.getPropertyValue(XMLConstants.HYPERLINK_DISPLAY_MODE);
  if(StringUtils.isNotBlank(displayMode)) {
   button.setContentDisplay(ContentDisplay.valueOf(displayMode));
  }
 }
}

代码示例来源:origin: stackoverflow.com

final Button button = new Button("I love you", imageView);
button.setStyle("-fx-base: coral;");
button.setContentDisplay(ContentDisplay.TOP);
button.setOnAction(new EventHandler<ActionEvent>() {
 @Override public void handle(ActionEvent event) {

代码示例来源:origin: stackoverflow.com

Button result = new Button(tag,closeImg);
result.setPrefHeight(20);
result.setContentDisplay(ContentDisplay.RIGHT);

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

((Button) e.getDisplay()).setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
((Button) e.getDisplay()).disableProperty().bind(Bindings.not(tableView.hasSelectedRowProperty()));
e.getDisplay().getStyleClass().add("flat-action-button");

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * @{inheritedDoc}
 */
@Override
public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) {
 this.controller = (AbstractViewController) controller;
 backIcon = new Button();
 backIcon.setOnAction(e -> goBack());
 IconUtils.setHeaderNavigationBack(backIcon);
 backIcon.getStyleClass().addAll("ep-headerless-app-header-button", "hand-hover");
 backIcon.setDisable(true);
 backIcon.setVisible(true);
 backIcon.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
 backIcon.setAlignment(Pos.CENTER);
 getChildren().addAll(backIcon);
 getStyleClass().addAll("hand-hover");
 //getStyleClass().add("ep-primary-menu-with-navbar-top-toolbar");
 //getStyleClass().add("ep-primary-menu-with-navbar-toolbar");
 setAlignment(Pos.CENTER);
 setMinHeight(54);
 addEventFilter(MouseEvent.MOUSE_CLICKED, e->{
 });
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

protected ButtonBase build(VLViewComponentXML configuration) {
 if ("button".equals(type)) {
  Button buttonAction = new JFXButton();
  buttonAction.getStyleClass().remove(0);
  buttonAction.getStyleClass().removeAll("jfx-button", "button");
  buttonAction.managedProperty().bind(buttonAction.visibleProperty());
  NodeHelper.setTitle(buttonAction, configuration, controller);
  IconUtils.setIcon(buttonAction, configuration);
  NodeHelper.setStyleClass(buttonAction, configuration, "styleClass", true);
  buttonAction.getStyleClass().add("ep-button");
  String displayMode = configuration.getPropertyValue(XMLConstants.HYPERLINK_DISPLAY_MODE, "LEFT");
  buttonAction.setContentDisplay(ContentDisplay.valueOf(displayMode));
  boolean readOnly = configuration.getBooleanProperty("readOnly", false);
  buttonAction.setDisable(readOnly);
  buttonAction.addEventFilter(ActionEvent.ACTION, e -> onAction(buttonAction));
  return buttonAction;
 } else {
  Hyperlink hyperlinkAction = new Hyperlink();
  hyperlinkAction.managedProperty().bind(hyperlinkAction.visibleProperty());
  NodeHelper.setTitle(hyperlinkAction, configuration, controller);
  NodeHelper.setStyleClass(hyperlinkAction, configuration, "styleClass", true);
  IconUtils.setIcon(hyperlinkAction, configuration);
  boolean readOnly = configuration.getBooleanProperty("readOnly", false);
  hyperlinkAction.setDisable(readOnly);
  hyperlinkAction.addEventFilter(ActionEvent.ACTION, e -> onAction(hyperlinkAction));
  return hyperlinkAction;
 }
}

相关文章