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

x33g5p2x  于2022-01-23 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(125)

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

Label.setOnMouseReleased介绍

暂无

代码示例

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

private void setupConvoyJoinLeaveLabel(Image leaveConvoyImg, Image joinConvoyImg, ImageView convoyJoinLeaveGraphic, Label convoyJoinLeaveLbl, Boolean newValue) {
  ICityPlayerProxyJFX proxy = viewState.getCurrentCityProxy().get();
  INavigableVessel vessel = proxy.getActiveShip();
  if (newValue) { // part of convoy
    convoyJoinLeaveGraphic.setImage(leaveConvoyImg);
    IShip ship;
    if (vessel instanceof IShip) {  // Leave convoy
      ship = (IShip) vessel;
      IConvoy convoy = (IConvoy) ship.parentShipProperty().get();
      WrappedDialogType wrapper = new WrappedDialogType(EDialogType.LEAVE_CONVOY, convoy, ship);
      final Runnable run = (Runnable) context.getBean("viewChangeWrappedRunnable", wrapper);
      convoyJoinLeaveLbl.setOnMouseReleased(evt -> {
        proxy.activateShip(vessel);
        run.run();
      });
    } else { // Disolve convoy
      convoyJoinLeaveLbl.setOnMouseReleased(evt -> openConvoyDialog(proxy, vessel));
    }
  } else { // Not part of convoy
    convoyJoinLeaveGraphic.setImage(joinConvoyImg);
    convoyJoinLeaveLbl.setOnMouseReleased(evt -> openConvoyDialog(proxy, vessel));
  }
}

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

reduceInterestLbl.setOnMouseReleased(mouseEvent1 -> {
  final int selectedIndex = selectedInterestLevel.get();
  if (selectedIndex > 0) {
increaseInterestLbl.setOnMouseReleased(mouseEvent1 -> {
  final int selectedIndex = selectedInterestLevel.get();
  if (selectedIndex < interestLevels.size() - 1) {

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

action.setText(template);
  label.setOnMouseReleased((evt) -> {
    if (selectionBox != null) {
      innerBox.getChildren().remove(selectionBox);
  action.setText(template);
  label.setOnMouseReleased((evt) -> {
    if (selectionBox != null) {
      innerBox.getChildren().remove(selectionBox);
label = textFactory.createLabel(template);
label.setAlignment(Pos.CENTER);
label.setOnMouseReleased((evt) -> {
  if (selectionBox != null) {
    innerBox.getChildren().remove(selectionBox);
label = textFactory.createLabel(template);
label.setAlignment(Pos.CENTER);
label.setOnMouseReleased((evt) -> {
  if (selectionBox != null) {
    innerBox.getChildren().remove(selectionBox);

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

label.textProperty().bind(button.textProperty());
label.getStyleClass().addAll("OpenPatricianSmallWaxButtonLabeled", "toggledOn");
label.setOnMouseReleased(evt -> button.setToggled(!button.getToggled()));
label.onMouseClickedProperty().bind(button.onActionProperty());

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

shipSelection.setScaleX(IMAGE_SCALE);
shipSelection.setScaleY(IMAGE_SCALE);
shipSelection.setOnMouseReleased(mouseEvent -> {
  ViewChangeCityPlayerProxyJFX proxy = new ViewChangeCityPlayerProxyJFX(viewState.getCurrentCityProxy().get(), EViewChangeEvent.NOTICE_SHIP_SELECTION);
  clientEventBus.post(new NoticeBoardUpdate(proxy));
messages.setScaleX(IMAGE_SCALE);
messages.setScaleY(IMAGE_SCALE);
messages.setOnMouseReleased(mouseEvent -> {
  if (!navigationDisabled) {
    ViewChangeCityPlayerProxyJFX proxy = new ViewChangeCityPlayerProxyJFX(viewState.getCurrentCityProxy().get(), EViewChangeEvent.MESSAGES);
options.setScaleX(IMAGE_SCALE);
options.setScaleY(IMAGE_SCALE);
options.setOnMouseReleased(mouseEvent -> {
  if (!navigationDisabled) {
    soundPlayer.stop();

代码示例来源:origin: com.github.vatbub/common.view.tagarea

iconLabel.setOnMouseReleased(r -> this.getChildren().remove(this));

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

icon.imageProperty().bind(iconBinding);
Label tradeTypeLbl = new Label("", icon);
tradeTypeLbl.setOnMouseReleased(mouseEvent -> {
  try {
    ETradeType nextTradeType = tradeType.get();
reduceAmountLbl.setOnMouseReleased(mouseEvent -> {
  try {
    autoTrading.updateAmount(ware, -1);
increaseAmountLbl.setOnMouseReleased(mouseEvent ->  {
  try {
    autoTrading.updateAmount(ware, 1);
checkedLbl.setOnMouseReleased(mouseEvent ->  {
  try {
    autoTrading.setMovableToShip(ware, !autoTrading.isMovableToShip(ware));
row.add(new ControlTableCell(priceTypeText));
Label decreasePriceLbl = new Label("", new ImageView(minus));
decreasePriceLbl.setOnMouseReleased(mouseEvent -> autoTrading.updatePrice(ware, -1));
decreasePriceLbl.visibleProperty().bind(new VisibleTradeTypeBinding(autoTrading.tradingTypeProperty(ware)));
row.add(new ControlTableCell(decreasePriceLbl));
increasePriceLbl.setOnMouseReleased(mouseEvent -> autoTrading.updatePrice(ware, 1));
increasePriceLbl.visibleProperty().bind(new VisibleTradeTypeBinding(autoTrading.tradingTypeProperty(ware)));
row.add(new ControlTableCell(increasePriceLbl));

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

weaponLbl.setOnMouseReleased(evt -> {
  ICityPlayerProxyJFX proxy = viewState.getCurrentCityProxy().get();
  if (proxy.getActiveShip() instanceof IShip) {

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

ImageView minusView = new ImageView(minus);
Label minusLbl = new Label("", minusView);
minusLbl.setOnMouseReleased(arg0 -> storage.updateGuardsNumber(-1));
row.add(new ControlTableCell(minusLbl));
Text nbGuardsTxt = new Text();
ImageView plusView = new ImageView(plus);
Label plusLbl = new Label("", plusView);
plusLbl.setOnMouseReleased(arg0 -> storage.updateGuardsNumber(1));

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

time.setScaleX(0.5);
time.setScaleY(0.5);
time.setOnMouseReleased(event -> {
    IGame game = gameFactory.getGame();
    game.fastForward();

相关文章