javafx.scene.image.ImageView.setId()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(95)

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

ImageView.setId介绍

暂无

代码示例

代码示例来源:origin: com.bitplan.gui/com.bitplan.javafx

iconImage.setFitHeight(fontSize);
 iconImage.setFitWidth(fontSize);
 iconImage.setId(name);
 icon = iconImage;
} else {

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

private void updateMissingWare() {
  threadExecution.execute(() -> {
    ObjectBinding<IWare> missingWareeBinding = cityState.longestMissingWaresBinding();
    for (Iterator<Node> iterator = getChildren().iterator(); iterator.hasNext(); ) {
      Node child = iterator.next();
      if (child.getId().equals(MISSING_WARE_ID)) {
        iterator.remove();
        break;
      }
    }
    if (missingWareeBinding.get() != null) {
      if (cityState.famineBinding().get()) {
        // display famine icon
        Image famine = imageLoader.getImage("icons/32/icon_famine");
        ImageView famineView = new ImageView(famine);
        famineView.setId(MISSING_WARE_ID);
        getChildren().add(0, famineView);
      } else {
        // display missing ware icon
        String wareIconName = "icons/32/" + getIconName(missingWareeBinding.get());
        Image missingWare = imageLoader.getImage(wareIconName);
        ImageView missingWareView = new ImageView(missingWare);
        missingWareView.setId(MISSING_WARE_ID);
        getChildren().add(0, missingWareView);
      }
    }
  });
}

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

@PostConstruct
  private void initializeDialog() {
    setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.GuildMediterraneanMapDialog.title",
        new Object[]{}, locale.getCurrentLocal()));
    IMediterreanMap map = guildSettings.getMediterreanMap();
    Image image = imageUtilities.createMediterraneanMap(city.getPlayer(), map);
    ImageView imgView = new ImageView(image);
    imgView.setId("mediterraneanMap");
    imgView.setFitWidth(WRAPPING_WIDTH);
    imgView.setPreserveRatio(true);
    VBox box = new VBox(imgView);
    box.setLayoutX(2 * FRAME_BORDER);
    box.setLayoutY(CLOSE_BTN_Y_POS - 500);
    getContent().add(box);
  }
}

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

imgView.setId("minusIcon");
imgView.setOnMouseReleased((e) -> {
  int value = Integer.parseInt(input.getText());
imgView.setId("plusIcon");

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

Image img = imageLoader.getImage("icons/plusIcon");
ImageView plusIcon = new ImageView(img);
plusIcon.setId("plusIcon");
plusIcon.setOnMouseReleased((e) -> {
  int newValue = Math.min(cityWall.getRequiredBricks(), numberOfBricks.get() + 1);
img = imageLoader.getImage("icons/minusIcon");
ImageView minusIcon = new ImageView(img);
minusIcon.setId("minusIcon");
minusIcon.setOnMouseReleased((e) -> {
  int newValue = Math.max(0, numberOfBricks.get() - 1);

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

Image img = imageLoader.getImage("icons/minusIcon");
ImageView imgView = new ImageView(img);
imgView.setId("minusIcon");
final Label input = new Label();
input.setId("headTaxLabel");
img = imageLoader.getImage("icons/plusIcon");
imgView = new ImageView(img);
imgView.setId("plusIcon");
imgView.setOnMouseReleased((e) -> {
  double value = Double.parseDouble(input.getText());
Image img = imageLoader.getImage("icons/minusIcon");
ImageView imgView = new ImageView(img);
imgView.setId("minusIcon");
final Label input = new Label();
input.setId("specialTaxLabel");
img = imageLoader.getImage("icons/plusIcon");
imgView = new ImageView(img);
imgView.setId("plusIcon");
imgView.setOnMouseReleased((e) -> {
  int value = Integer.parseInt(input.getText());

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

knotIconView.setId("knotIcon");
shipSelectionPane.add(knotIconView, 0, 1);
GridPane.setHalignment(knotIconView, HPos.CENTER);
weaponIconView.setId("weaponIcon");
shipSelectionPane.add(weaponIconView, 1, 1);
GridPane.setHalignment(weaponIconView, HPos.CENTER);
healthIconView.setId("healthIcon");
shipSelectionPane.add(healthIconView, 2, 1);
GridPane.setHalignment(healthIconView, HPos.CENTER);
sailorIconView.setId("sailorIcon");
shipSelectionPane.add(sailorIconView, 3, 1);
GridPane.setHalignment(sailorIconView, HPos.CENTER);
if (currentShip.get().getCaptian().isPresent()) {
  final ImageView imageView = new ImageView(compassIcon);
  imageView.setId("captainIcon");
  imageView.layoutXProperty().bind(sailorsOnShip2.widthProperty().add(3));
  g.getChildren().addAll(sailorsOnShip2, imageView);

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

weaponIconView.setId("weaponIcon");
shipSelectionPane.add(weaponIconView, 1, 1);
GridPane.setHalignment(weaponIconView, HPos.CENTER);
healthIconView.setId("healthIcon");
shipSelectionPane.add(healthIconView, 2, 1);
GridPane.setHalignment(healthIconView, HPos.CENTER);
sailorIconView.setId("sailorIcon");
shipSelectionPane.add(sailorIconView, 3, 1);
GridPane.setHalignment(sailorIconView, HPos.CENTER);

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

prioView.setId("priority"+weapon);
setPriorityImage(unchecked, checked, weapon, prioView);
prioView.setOnMouseReleased(evt -> {

相关文章