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

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

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

ImageView.setLayoutX介绍

暂无

代码示例

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

private void resetClipXPosition(double x) {
  if (x < 0) {
    x = 0;
  }
  if (x > imgView.getImage().getWidth()) {
    x = imgView.getImage().getWidth();
  }
  imgView.setLayoutX(-x);
  shipCanvas.setLayoutX(-x);
  clip.setX(x);
  logger.trace("Set clip position={}, view and ship canvas layout: {}", x, -x);
}

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

title.setLayoutX(569);
title.setLayoutY(146);
title.fitHeightProperty().add(100);

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

/**
 * Set the image view at the right position.
 * @param width of the parent control
 * @param height of the parent control
 * @param imgView ImageView to be added.
 */
void setImageView(double width, double height, ImageView imgView, ImageScaleState state) {
  getChildren().clear();
  double x = Math.max((width - imgView.getBoundsInLocal().getWidth())/2,0);
  double y = Math.max((height - imgView.getBoundsInLocal().getHeight())/2,0);
  if (x > 0) {
    state.border();
    state.setBorderDirection(EScaleDirection.HORIZONTAL);
    state.setBordered((int) x);
  } else if (y > 0) {
    state.border();
    state.setBorderDirection(EScaleDirection.VERTICAL);
    state.setBordered((int) y);
  }
  imgView.setLayoutX(x);
  imgView.setLayoutY(y);
  getChildren().add(imgView);
}

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

private ImageView createShield(INavigableVessel vessel) {
  Image shieldImg = imageLoader.getImage("icons/Shield_" + getShieldColorName(vessel));
  ImageView imgView = new ImageView(shieldImg);
  imgView.setLayoutX(shipIconView.getLayoutX());
  DoubleBinding relYOrigin = shieldYOffsetBinding();
  imgView.layoutYProperty().bind(relYOrigin);
  imgView.layoutXProperty().bind(shipIconView.layoutXProperty());
  return imgView;
}

代码示例来源:origin: PhoenicisOrg/phoenicis

/**
 * Draw the header at the top of the window
 */
private void drawHeader() {
  Pane header = new Pane();
  header.setId("header");
  header.setPrefSize(722, 65);
  header.setLayoutX(-1);
  header.setLayoutY(-1);
  header.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY)));
  ImageView topImage = new ImageView(this.createTopImage());
  topImage.setLayoutX(626);
  header.getChildren().add(topImage);
  getParent().getRoot().setTop(header);
}

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

double y = Math.max((height - mapImage.getHeight())/2,0);
if (!heightChange) {
  imgView.setLayoutX(x);
  shipCanvas.setLayoutX(x);

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

barrel.setLayoutX(200 - 26);
barrel.setLayoutY(-12);

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

barrel.setLayoutX(200 - 26);
barrel.setLayoutY(-12);

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

barrel.setLayoutX(200 - 26);
barrel.setLayoutY(-12);

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

imgView.setLayoutX(offsetX);
imgView.setLayoutY(offsetY);
g.getChildren().addAll(imgView);
  imgView = createScaledView(top, scale);
  width = top.getWidth() * scale;
  imgView.setLayoutX(offsetX);
  imgView.setLayoutY(offsetY);
  g.getChildren().addAll(imgView);
imgView = createScaledView(tr, scale);
width = tr.getWidth() * scale;
imgView.setLayoutX(offsetX);
imgView.setLayoutY(offsetY);
g.getChildren().addAll(imgView);
  imgView = createScaledView(left, scale);
  height = left.getHeight() * scale;
  imgView.setLayoutX(0);
  imgView.setLayoutY(offsetY);
  g.getChildren().addAll(imgView);
  imgView = createScaledView(right, scale);
  imgView.setLayoutX(offsetRightBorder);
  imgView.setLayoutY(offsetY);
  g.getChildren().addAll(imgView);
imgView = createScaledView(bl, scale);
width = bl.getWidth() * scale;
imgView.setLayoutX(offsetX);

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

barrel.setLayoutX(200 - 26);
barrel.setLayoutY(-12);

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

imgView.setLayoutX(slot.getX() + offset.getX());
imgView.setLayoutY(slot.getY() + offset.getY());
pane.getChildren().add(imgView);
int id = weaponSlot.getId();
BasicSlot slot = getSlotModel(id);
placeHolder.setLayoutX(slot.getX());
placeHolder.setLayoutY(slot.getY());
pane.getChildren().add(placeHolder);

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

sideView.imageProperty().bind(shipSideImageBinding());
sideView.setLayoutY(70);
sideView.setLayoutX(30);
final EventHandler<? super MouseEvent> historyDisplayHandler = createHistoryDisplayHandler();
sideView.setOnMouseReleased(historyDisplayHandler);
frontView.imageProperty().bind(shipFrontImageBinding());
frontView.setLayoutY(70);
frontView.setLayoutX(289);
frontView.setOnMouseReleased(historyDisplayHandler);
getContent().addAll(sideView, frontView);

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

final double titleWidth = titleImg.getWidth();
ImageView titleBackground = new ImageView(titleImg);
titleBackground.setLayoutX((frame.getWidth() - titleWidth)/2);
titleBackground.setLayoutY(35);
title.setLayoutY(47);
  Dimension2D titleDim = textSize.calculate(control.getTitle(), openPatrician24);
  title.setLayoutX((newValue.getWidth() - titleDim.getWidth())/2 + frame.getInsetBackground().getX());
  titleBackground.setLayoutX((newValue.getWidth() - titleWidth)/2 + frame.getInsetBackground().getX() + 20);
  titleBackground.setLayoutX((frame.getBackgroundDimension().getWidth() - titleWidth)/2 + newValue.getX() + 20);
});
frame.innerDimensionProperty().addListener((observable, oldValue, newValue) -> {

代码示例来源:origin: com.github.almasb/fxgl-effects

imageView.setLayoutX(x);
imageView.setLayoutY(y);
imageView.setOpacity(alpha);

代码示例来源:origin: com.github.almasb/fxgl-base

imageView.setLayoutX(x);
imageView.setLayoutY(y);
imageView.setOpacity(alpha);

相关文章