コード例 #1
0
  /** Initializes the controller class. */
  @Override
  public void initialize(URL url, ResourceBundle rb) {
    handeller = new hang();
    switch (hang.lang) {
      case "AR":
        handeller.loadWords(hang.wordpathAR);
        break;
      case "FR":
        handeller.loadWords(hang.wordpathFR);
        break;
      case "EN":
        handeller.loadWords(hang.wordpathEN);
        break;
      case "ES":
        handeller.loadWords(hang.wordpathES);
        break;
      default:
        handeller.loadWords(hang.wordpathEN);
    }
    handeller.loadWords(hang.wordpathEN);

    Breload.setDisable(true);
    Btest.setDisable(true);
    Rword.setDisable(true);
    LHisto.setItems(data);
    Toption.setText("............");
    Image image = new Image("/resource/original.gif");
    img.setImage(image);

    // Set languag Menu
    imglang.setImage(new Image("/resource/en.png"));
  }
コード例 #2
0
ファイル: Landmark.java プロジェクト: jrhackett/cs3733-team9
 public ImageView getIcon() {
   Image image = FileFetch.getImageFromFile("pin56_small.svg", 22, 22, true, true);
   ImageView imageView = new ImageView(image);
   imageView.setFitHeight(22);
   imageView.setFitWidth(22);
   return imageView;
 }
コード例 #3
0
  public AlertHandler(String message, EventHandler<ActionEvent> confirmHandler) {
    super(14);

    // add controls to the popup.
    final Label promptMessage = new Label(message);
    final ImageView alertImage = new ImageView(ResourceUtil.getImage("alert_48.png"));
    alertImage.setFitHeight(32);
    alertImage.setPreserveRatio(true);
    promptMessage.setGraphic(alertImage);
    promptMessage.setWrapText(true);
    promptMessage.setPrefWidth(350);

    // action button text setup.
    HBox buttonBar = new HBox(20);
    final Button confirmButton = new Button(getString("dialog.continue"));
    confirmButton.setDefaultButton(true);

    buttonBar.getChildren().addAll(confirmButton);

    // layout the popup.
    setPadding(new Insets(10));
    getStyleClass().add("alert-dialog");
    getChildren().addAll(promptMessage, buttonBar);

    final DropShadow dropShadow = new DropShadow();
    setEffect(dropShadow);

    // confirm and close the popup.
    confirmButton.setOnAction(confirmHandler);
  }
コード例 #4
0
ファイル: Main.java プロジェクト: Naelitz/Jeopardy
  @Override
  public void start(Stage primaryStage) throws Exception {
    top = new Top(this);
    tWindow = new TeacherWindow();
    sWindow = new StudentWindow();
    // Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
    primaryStage.setTitle("Jeopardy");
    background.setImage(jeopardy);
    stack.getChildren().add(background);
    stack.getChildren().add(border);
    border.setTop(top);
    Scene scene = new Scene(stack, 800, 800);
    primaryStage.setScene(scene);
    background.fitWidthProperty().bind(scene.widthProperty());
    background.fitHeightProperty().bind(scene.heightProperty());
    primaryStage.show();

    top.tButton.setOnAction(
        e -> {
          System.out.println("clicked");
          displayTeacherWindow();
        });

    top.sButton.setOnAction(
        e -> {
          displayStudentWindow();
        });
  }
コード例 #5
0
ファイル: Notification.java プロジェクト: bluearth/orca
  public Notification(Stage stage, int type, String message) {
    try {
      FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("Notification.fxml"));
      fxmlLoader.setController(this);
      vbox = (VBox) fxmlLoader.load();
    } catch (IOException e) {
      e.printStackTrace();
    }

    if (type == INFO) {
      fxLabelTitle.setText("Information");
      fxImageViewLogo.setImage(
          new Image(vbox.getClass().getResource(IMAGE_DIRECTORY + "info.png").toExternalForm()));
    } else if (type == SUCCESS) {
      fxLabelTitle.setText("Success");
      fxImageViewLogo.setImage(
          new Image(vbox.getClass().getResource(IMAGE_DIRECTORY + "success.png").toExternalForm()));
    } else if (type == WARNING) {
      fxLabelTitle.setText("Warning");
      fxImageViewLogo.setImage(
          new Image(vbox.getClass().getResource(IMAGE_DIRECTORY + "warning.png").toExternalForm()));
    } else if (type == ERROR) {
      fxLabelTitle.setText("Error");
      fxImageViewLogo.setImage(
          new Image(vbox.getClass().getResource(IMAGE_DIRECTORY + "error.png").toExternalForm()));
    }

    if (!message.equals("")) {
      fxLabelMessage.setText(message);
    }

    show(stage);
  }
コード例 #6
0
ファイル: StarGVAdapter.java プロジェクト: Potentii/Altai
  @Override
  public void bindData(Star data) throws NullPointerException {
    titleOut.setText(data.getTitle());
    ratingOut.setText(new DecimalFormat("#.#").format(data.getRating()));

    new Thread(
            () -> {
              Image image =
                  new Image(
                      "file:"
                          + PersistenceManager.getInstance().getRootPath()
                          + EAltaiPersistence.STAR_MAIN_IMG_RELATIVE_PATH.getValue()
                          + data.getMainImage());
              double imgH = image.getHeight();
              double imgW = image.getWidth();

              Rectangle2D viewPort;
              if (imgH > imgW) {
                viewPort = new Rectangle2D(0, (imgH / 2) - (imgW / 2), imgW, imgW);
              } else if (imgH < imgW) {
                viewPort = new Rectangle2D((imgW / 2) - (imgH / 2), 0, imgH, imgH);
              } else {
                viewPort = new Rectangle2D(0, 0, imgH, imgW);
              }

              Platform.runLater(
                  () -> {
                    mainImg.setViewport(viewPort);
                    mainImg.setImage(image);
                  });
            })
        .start();
  }
コード例 #7
0
ファイル: MapEditor.java プロジェクト: Alpha2k10/ZGame
  public void loadMapEditor(Group root) {
    Logic.Images.LoadImagesEditor li = new LoadImagesEditor();
    li.loadMapEditor();

    Group meGroup = new Group();
    ivHover = new ImageView(Objekte.getImgMapEditor().getSingleBorderHover());
    ivHover.setVisible(true);

    Gui.Listener.EditorHoverListener eHoverL = new Gui.Listener.EditorHoverListener(ivHover);

    for (int y = 0; y < Objekte.getMapData().getMapSizeY(); y++) {
      for (int x = 0; x < Objekte.getMapData().getMapSizeX(); x++) {

        ImageView iv = new ImageView(Objekte.getImgMapEditor().getSingleBorder());
        iv.setLayoutX(x * 25);
        iv.setLayoutY(y * 25);
        eHoverL.addImageView(iv);
        iv.hoverProperty().addListener(eHoverL);
        meGroup.getChildren().add(iv);
      }
    }

    root.getChildren().add(meGroup);
    root.getChildren().add(ivHover);

    loadEditorPalette(root);
    loadMapUI(root);
    loadEditorButtons(root);
    loadMapNumbers(root);
  }
コード例 #8
0
ファイル: GUIController.java プロジェクト: woekun/MediaPlayer
  @FXML
  private void Play(MouseEvent event) {
    if (event.getButton() == MouseButton.PRIMARY) {
      if (j == 0) {
        listView.getSelectionModel().select(j);
        listView.getFocusModel().focus(j);
      }

      if (mp != null) {
        MediaPlayer.Status status = mp.getStatus();
        if (status == MediaPlayer.Status.UNKNOWN || status == MediaPlayer.Status.HALTED) {
          return;
        }
        if (status == MediaPlayer.Status.PAUSED
            || status == MediaPlayer.Status.READY
            || status == MediaPlayer.Status.STOPPED) {
          if (atEndOfMedia) {
            atEndOfMedia = false;
          }
          onPlay();
          mp.play();
          statusDisplay.toBack();
          play = true;

        } else {
          mp.pause();
          statusDisplay.toFront();
          play = false;
        }
      }
    }
  }
コード例 #9
0
  // wyœwietla wszystkie playlisty
  private void drawPlaylists() {
    for (int i = 0; i < playlistList.size(); i++) {
      VBox vBox = new VBox(5);

      ImageView playlistCover =
          new ImageView(new Image(new File("temp_cover.png").toURI().toString()));
      playlistCover.setFitWidth(130);
      playlistCover.setPreserveRatio(true);
      playlistCover.setSmooth(true);

      int ext = playlistList.get(i).getName().lastIndexOf('.');
      Text playlistTitle = new Text(playlistList.get(i).getName().substring(0, ext));
      playlistTitle.getStyleClass().add("text");
      vBox.getChildren().addAll(playlistCover, playlistTitle);
      vBox.setAlignment(Pos.CENTER);

      vBox.setOnMouseClicked(
          e -> {
            Text tempText = (Text) vBox.getChildren().get(1);
            showCurrentPlaylist(new File("Playlists/" + tempText.getText() + ".fpl"));
          });

      flowPane.getChildren().add(vBox);
    }
  }
コード例 #10
0
ファイル: MainController.java プロジェクト: cjwest13/Capstone
 /** Sets the events for each label in the grid. */
 private void setEvents() {
   for (Label label : labels) {
     label.setOnMouseClicked(
         event -> {
           int index = gridPane.getRowIndex(label);
           chosenPlugin[0] = plugins.get(index).get(0);
           curIndex = index;
           chosenPlugin[1] = plugins.get(index).get(1);
           chosenPreview = preview.get(index).get(0);
           description = appData.get(index).get(1);
           goToNextScreen("/fxml/PluginInfo.fxml");
         });
   }
   for (ImageView image : iconsView) {
     image.setOnMouseClicked(
         event -> {
           int index = gridPane.getRowIndex(image);
           chosenPlugin[0] = plugins.get(index).get(0);
           curIndex = index;
           chosenPlugin[1] = plugins.get(index).get(1);
           chosenPreview = preview.get(index).get(0);
           description = appData.get(index).get(1);
           goToNextScreen("/fxml/PluginInfo.fxml");
         });
   }
 }
コード例 #11
0
  @FXML
  private void onOkButtonClicked() {

    if (!headerTextField.getText().isEmpty() || picturePreview.getImage() != null) {
      HTMLHeader header;
      if (!headerTextField.getText().isEmpty() && picturePreview.getImage() == null) {
        header = new HTMLHeader(headerTextField.getText());
        System.out.println("Header only has text.");
      } else if (headerTextField.getText().isEmpty() && picturePreview.getImage() != null) {
        header = new HTMLHeader(picturePreview.getImage());
        System.out.println("Header only has image.");
      } else {
        header = new HTMLHeader(headerTextField.getText(), picturePreview.getImage());
        System.out.println("Header has both image and text.");
      }

      ApplicationManager.getInstance().setWebPageHeader(header);
      System.out.println("Attempting to set header to webpage.");
      // --------------------Added By James------------------------------------------------
      // JavaToHTML HTML = new JavaToHTML();
      // ApplicationManager.getInstance().getHtmlGenerator().setHeaderFromGUI(headerTextField.getText(),picturePath.getText());
      // writeAndRefresh();
      // --------------------End Added By James------------------------------------------------
    } else {
      System.out.println("Header has nothing. Not creating an object.");
    }
    Stage stage = (Stage) okButton.getScene().getWindow();

    stage.close();
  }
コード例 #12
0
  private Scene createMainTetrisScene() {
    mainPane = new BorderPane();

    VBox mainBox = new VBox();
    mainBox.setPadding(new Insets(200, 0, 0, 20));
    mainBox.getChildren().add(mainGrid);
    mainGrid.setOnKeyPressed(new KeyboardHandler());

    mainPane.setBottom(mainBox);
    mainPane.setTop(createActionPane());
    mainPane.setRight(createStatePane());

    Group group = new Group();
    for (int i = 19; i >= 0; i--) {
      for (int j = 0; j < 10; j++) {
        Image img;
        if (mainGrid.getColor(i, j) != Color.DARKGRAY) {
          img = new Image(getClass().getResourceAsStream("RED.png"));
        } else {
          img = new Image(getClass().getResourceAsStream("EMPTY.png"));
        }
        ImageView iView = new ImageView(img);
        iView.setX(j * 17);
        iView.setY(i * 16);
        iView.setOpacity(1);
        iView.setPreserveRatio(true);
        group.getChildren().addAll(iView);
      }
    }
    Scene scene = new Scene(group, 600, 600);
    mainPane.setCenter(group);

    return new Scene(mainPane, 380, 540); // 540
  }
コード例 #13
0
ファイル: LcdSkin.java プロジェクト: jforge/Medusa
 // ******************** Methods *******************************************
 protected void handleEvents(final String EVENT_TYPE) {
   if ("REDRAW".equals(EVENT_TYPE)) {
     pane.setEffect(getSkinnable().isShadowsEnabled() ? mainInnerShadow1 : null);
     shadowGroup.setEffect(getSkinnable().isShadowsEnabled() ? FOREGROUND_SHADOW : null);
     updateLcdDesign(height);
     redraw();
   } else if ("RESIZE".equals(EVENT_TYPE)) {
     aspectRatio = getSkinnable().getPrefHeight() / getSkinnable().getPrefWidth();
     resize();
     redraw();
   } else if ("LCD".equals(EVENT_TYPE)) {
     updateLcdDesign(height);
   } else if ("VISIBILITY".equals(EVENT_TYPE)) {
     crystalOverlay.setManaged(getSkinnable().isLcdCrystalEnabled());
     crystalOverlay.setVisible(getSkinnable().isLcdCrystalEnabled());
     unitText.setManaged(!getSkinnable().getUnit().isEmpty());
     unitText.setVisible(!getSkinnable().getUnit().isEmpty());
     upperLeftText.setManaged(getSkinnable().isMinMeasuredValueVisible());
     upperLeftText.setVisible(getSkinnable().isMinMeasuredValueVisible());
     upperRightText.setManaged(getSkinnable().isMaxMeasuredValueVisible());
     upperRightText.setVisible(getSkinnable().isMaxMeasuredValueVisible());
     lowerRightText.setManaged(!getSkinnable().getSubTitle().isEmpty());
     lowerRightText.setVisible(!getSkinnable().getSubTitle().isEmpty());
     lowerCenterText.setManaged(getSkinnable().isOldValueVisible());
     lowerCenterText.setVisible(getSkinnable().isOldValueVisible());
     resize();
     redraw();
   } else if ("SECTION".equals(EVENT_TYPE)) {
     sections = getSkinnable().getSections();
     updateSectionColors();
     resize();
     redraw();
   }
 }
コード例 #14
0
  // wyœwietla wszystkie albumy
  private void drawAlbums() {
    for (int i = 0; i < albumList.size(); i++) {
      VBox vBox = new VBox(5);

      // ok³adka albumu
      Song tempSong = new Song(albumList.get(i).albumSongList.get(0));
      ImageView albumCover = new ImageView(tempSong.getAlbumCover());
      albumCover.setFitWidth(130);
      albumCover.setPreserveRatio(true);
      albumCover.setSmooth(true);
      albumCover.imageProperty().bind(tempSong.albumCoverProperty());

      // tytu³ albumu
      Text albumTitle = new Text(albumList.get(i).getAlbumTitle());
      albumTitle.getStyleClass().add("text");
      vBox.getChildren().addAll(albumCover, albumTitle);
      vBox.setAlignment(Pos.CENTER);

      // dodaje do ka¿dego albumu listener którym otwiera listê z piosenkami
      vBox.setOnMouseClicked(
          e -> {
            Text tempText = (Text) vBox.getChildren().get(1);
            for (int j = 0; j < albumList.size(); j++) {
              if (albumList.get(j).getAlbumTitle().equals(tempText.getText())) {
                showCurrentAlbum(albumList.get(j));
                break;
              }
            }
          });

      flowPane.getChildren().add(vBox);
    }
  }
コード例 #15
0
ファイル: EditorTabManager.java プロジェクト: finanzer/epubfx
  public void openImageFile(Resource resource) {
    Tab tab = new Tab();
    tab.setClosable(true);
    if (resource == null) {
      Dialogs.create()
          .owner(tabPane)
          .title("Datei nicht vorhanden")
          .message(
              "Die angeforderte Datei ist nicht vorhanden und kann deshalb nicht geöffnet werden.")
          .showError();
      return;
    }
    tab.setText(resource.getFileName());

    ImageResource imageResource = (ImageResource) resource;
    ImageViewerPane pane = new ImageViewerPane();
    pane.setImageResource(imageResource);

    ImageView imageView = pane.getImageView();
    imageView.setImage(imageResource.asNativeFormat());
    imageView.setFitHeight(-1);
    imageView.setFitWidth(-1);

    Label imagePropertiesLabel = pane.getImagePropertiesLabel();
    imagePropertiesLabel.setText(imageResource.getImageDescription());

    tab.setContent(pane);
    tab.setUserData(resource);
    tabPane.getTabs().add(tab);
    tabPane.getSelectionModel().select(tab);
  }
コード例 #16
0
 public ArrayList<Location> displayRange(
     ArrayList<ImageView> tiles, BattleMem player, Location[][] map, ArrayList<BattleMem> people) {
   ArrayList<Location> ans = new ArrayList<Location>();
   int range = player.member.getMove();
   int xLimit = map[0].length;
   int yLimit = map.length;
   for (int i = player.mapLoc.x - range; i <= player.mapLoc.x + range; i++) {
     for (int j = player.mapLoc.y - range; j <= player.mapLoc.y + range; j++) {
       if (j >= 0 && j < yLimit) {
         if (i >= 0 && i < xLimit) {
           if (Math.abs(j - player.mapLoc.y) + Math.abs(i - player.mapLoc.x) <= range) {
             Image t = new Image("fantasytactics/images/tile.png", 66, 98, false, false);
             boolean nonaccess = false;
             for (BattleMem k : people) {
               if (k.mapLoc.equals(new Location(i, j))) {
                 nonaccess = true;
                 break;
               }
             }
             if (!nonaccess) {
               if (map[j][i] != null) {
                 ans.add(map[j][i]);
                 ImageView tile = new ImageView(t);
                 tile.setX(map[j][i].x);
                 tile.setY(map[j][i].y);
                 tiles.add(tile);
               }
             }
           }
         }
       }
     }
   }
   return ans;
 }
コード例 #17
0
  @SuppressWarnings("JavadocMethod")
  public ProjectSettingsEditor(
      Parent root, ProjectSettings projectSettings, AppSettings appSettings) {
    super();

    VBox content =
        new VBox(
            new CustomPropertySheet(BeanPropertyUtils.getProperties(projectSettings)),
            new Separator(),
            new CustomPropertySheet(BeanPropertyUtils.getProperties(appSettings)));
    content.setSpacing(5.0);

    DialogPane pane = getDialogPane();
    pane.getButtonTypes().setAll(ButtonType.OK, ButtonType.CANCEL);
    pane.setContent(content);
    pane.styleProperty().bind(root.styleProperty());
    pane.getStylesheets().addAll(root.getStylesheets());
    pane.setPrefSize(DPIUtility.SETTINGS_DIALOG_SIZE, DPIUtility.SETTINGS_DIALOG_SIZE);

    ImageView graphic =
        new ImageView(new Image(getClass().getResourceAsStream("icons/settings.png")));
    graphic.setFitWidth(DPIUtility.SMALL_ICON_SIZE);
    graphic.setFitHeight(DPIUtility.SMALL_ICON_SIZE);

    setTitle("Settings");
    setHeaderText("Settings");
    setGraphic(graphic);
    setResizable(true);
  }
コード例 #18
0
  private void createImageViews() {
    for (int visibleX = 0; visibleX < getViewModel().getNbVisibleTilesX(); visibleX++) {
      for (int visibleY = 0; visibleY < getViewModel().getNbVisibleTilesY(); visibleY++) {
        ImageView node = spritesheet.createImageView(0);
        node.setLayoutX(getViewModel().visibleTileToScreenX(visibleX));
        node.setLayoutY(getViewModel().visibleTileToScreenY(visibleY));
        /*
        final int vX = visibleX;
        final int vY = visibleY;
        node.setOnMouseClicked(e -> {
        	double screenX = getViewModel().visibleTileToScreenX(vX) + e.getX();
        	double screenY = getViewModel().visibleTileToScreenY(vY) + e.getY();
        	double worldX = getViewModel().screenToWorldX(screenX);
        	double worldY = getViewModel().screenToWorldY(screenY);
        	double worldZ = getViewModel().getCurrentZLevel();
        	//double worldZ = getViewModel().getLowestVisibleZ(vX, vY);
        	//getUserInputHandler().worldPointClicked(worldX, worldY, worldZ, e);
        	//e.consume();
        });
        */
        visibleImageViews[getIndexForView(visibleX, visibleY)] = node;
        tilePanels[0].getChildren().add(node);

        showAsAnchored(
            visibleX, visibleY, getViewModel().getAnchorMatrix().getValueAt(visibleX, visibleY));
      }
    }
  }
コード例 #19
0
ファイル: GUIController.java プロジェクト: woekun/MediaPlayer
  @Override
  public void initialize(URL url, ResourceBundle rb) {

    listView
        .getSelectionModel()
        .selectedItemProperty()
        .addListener(
            (ObservableValue<? extends String> ov, String oldValue, String newValue) -> {
              j = listView.getSelectionModel().getSelectedIndex();
              if (!fileList.isEmpty()) {
                statusDisplay.toBack();
                file = new File(fileList.get(j).getPath());
                String MEDIA_URL = file.toURI().toString();
                Media media = new Media(MEDIA_URL);
                albumCover.setImage(DEFAULT_ALBUM_COVER);

                media
                    .getMetadata()
                    .addListener(
                        (Change<? extends String, ? extends Object> ch) -> {
                          if (ch.wasAdded()) {
                            handleMetadata(ch.getKey(), ch.getValueAdded());
                          }
                        });

                if (MEDIA_URL.endsWith(".mp3") || MEDIA_URL.endsWith(".MP3")) {
                  playAudio(media);
                }
                if (MEDIA_URL.endsWith(".mp4") || MEDIA_URL.endsWith(".MP4")) {
                  playVideo(media);
                }
                onPlay();
              }
            });
  }
コード例 #20
0
 private void configureButton(final ImageView imageView) {
   imageView.setFitHeight(32);
   imageView.setFitWidth(32);
   imageView.setPreserveRatio(true);
   imageView.setSmooth(true);
   imageView.getStyleClass().add("launcherIcon");
 }
コード例 #21
0
ファイル: PannelloDado.java プロジェクト: ogavb/progettoIGPE
  public PannelloDado(Integer i1, GameManagerAstratta gm) {

    media = new Media(new File(path).toURI().toString());

    this.gm = gm;

    if (i1 != 0) primo = i1.toString();
    else primo = "roll";

    setMinWidth(GridPane.USE_COMPUTED_SIZE);
    setMinHeight(GridPane.USE_COMPUTED_SIZE);
    setPrefWidth(GridPane.USE_COMPUTED_SIZE);
    setPrefHeight(GridPane.USE_COMPUTED_SIZE);
    setMaxWidth(GridPane.USE_COMPUTED_SIZE);
    setMaxHeight(GridPane.USE_COMPUTED_SIZE);

    imgDadoUno = new Image("file:dadi/" + primo + ".gif");
    imageViewUno = new ImageView(imgDadoUno);

    ColumnConstraints column1 = new ColumnConstraints();
    column1.setPercentWidth(25);
    getColumnConstraints().addAll(column1);

    add(imageViewUno, 1, 0);
    imageViewUno.setTranslateZ(-1);
    eventoDado = new DadiListener();
    imageViewUno.addEventHandler(MouseEvent.MOUSE_RELEASED, eventoDado);
  }
コード例 #22
0
ファイル: GUIController.java プロジェクト: woekun/MediaPlayer
 @FXML
 private void gotoNP(MouseEvent event) {
   if (event.getButton() == MouseButton.PRIMARY) {
     if (go == false) {
       npView.setVisible(true);
       mView.toBack();
       timeProgress.setTextFill(Color.WHITE);
       Stage stage = (Stage) root.getScene().getWindow();
       stage.setResizable(true);
       btnPaFull.setImage(new Image("icon/Full_button/full.png"));
       go = true;
     } else {
       if (play == true) {
         Stage stage = (Stage) root.getScene().getWindow();
         if (full == false) {
           stage.setFullScreen(true);
           btnPaFull.setImage(new Image("icon/Full_button/full_off.png"));
           full = true;
         } else {
           stage.setFullScreen(false);
           btnPaFull.setImage(new Image("icon/Full_button/full.png"));
           full = false;
         }
       }
     }
   }
 }
コード例 #23
0
 private void setCountry(String country) {
   if (StringUtils.isEmpty(country)) {
     countryImageView.setVisible(false);
   } else {
     countryImageView.setImage(countryFlagService.loadCountryFlag(country));
     countryImageView.setVisible(true);
   }
 }
コード例 #24
0
 private void updateDepth(int visibleX, int visibleY, int newDepth) {
   if (newDepth < tilePanels.length) {
     int index = getIndexForView(visibleX, visibleY);
     ImageView view = visibleImageViews[index];
     ((Pane) view.getParent()).getChildren().remove(view);
     tilePanels[newDepth].getChildren().add(view);
   }
 }
コード例 #25
0
 private void gamePicture() throws FileNotFoundException {
   ImageView coloredBoxImg =
       new ImageView(new Image(new FileInputStream("lib/" + selectedGame + ".png")));
   coloredBoxImg.setFitHeight(gamePicture.getPrefHeight() - 25);
   coloredBoxImg.setFitWidth(gamePicture.getPrefWidth() - 25);
   gamePicture.setGraphic(coloredBoxImg);
   gamePicture.setStyle(buttonStyle);
 }
コード例 #26
0
 private void setAvatarUrl(String avatarUrl) {
   if (StringUtils.isEmpty(avatarUrl)) {
     avatarImageView.setVisible(false);
   } else {
     avatarImageView.setImage(avatarService.loadAvatar(avatarUrl));
     avatarImageView.setVisible(true);
   }
 }
コード例 #27
0
ファイル: GUIController.java プロジェクト: woekun/MediaPlayer
 @FXML
 private void btvolumeChange1(MouseEvent event) {
   if (volumeSlider.getValue() != 0) {
     volumeButton.setImage(new Image("icon/Volume_button/volume_hover.png"));
   } else {
     volumeButton.setImage(new Image("icon/Volume_button/mute_hover.png"));
   }
 }
コード例 #28
0
 public void drawBarUp() {
   barUpR = new Rectangle(0, 0, 1000, 50);
   barUpR.setFill(new ImagePattern(barUp, 0, 0, barUp.getWidth(), barUp.getHeight(), false));
   i = new ImageView();
   i.setImage(barUpRight);
   i.setX(1000);
   i.setY(0);
 }
コード例 #29
0
ファイル: PannelloDado.java プロジェクト: ogavb/progettoIGPE
 void setPrimo(int risultato) {
   imgDadoUno = new Image("file:dadi/" + risultato + ".gif");
   imageViewUno = new ImageView(imgDadoUno);
   imageViewUno.addEventHandler(MouseEvent.MOUSE_RELEASED, eventoDado);
   imageViewUno.setTranslateZ(-1);
   this.getChildren().clear();
   add(imageViewUno, 1, 0);
 }
コード例 #30
0
ファイル: GUIController.java プロジェクト: woekun/MediaPlayer
 @FXML
 private void btplayChange2(MouseEvent event) {
   if (play == false) {
     playButton.setImage(new Image("icon/PlayPause_button/play.png"));
   } else {
     playButton.setImage(new Image("icon/PlayPause_button/pause.png"));
   }
 }