public ReceiptDisplay() {
    mScrollPane = new ScrollPane();
    mScrollPane.setStyle(
        "-fx-border-color:gray;-fx-border-width:25;" + "-fx-background-color:gray;");
    mScrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
    mScrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);

    mImage = new Image("foggitops/resources/DefaultPic.jpg");
    mImageView = new ImageView();
    fitToScreen();
    mScrollPane.setContent(mImageView);
  }
  /** Creates the album playback view. */
  private void display() {
    scrollPos = 0;

    songScroller = new ScrollPane();
    songScroller.setMinWidth(PaneUtil.WIDTH - GoogleUINaviController.COVER_SIZE - 10);
    songScroller.setStyle("-fx-background-color:transparent;");
    songScroller.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);

    songBox = new VBox(6);
    songBox.setPadding(new Insets(3, 2, 2, 2));
    int track = 1;
    for (Song song : album.getSongs()) {
      HBox trackBox = new HBox();

      trackBox.setId(String.valueOf(song.getMID()));
      trackBox.setAlignment(Pos.BASELINE_LEFT);
      trackBox.setPadding(new Insets(2, 5, 2, 5));
      if (track == 1) {
        trackBox.setStyle(STYLE_ACTIVE);
        lastSongSelection = trackBox;
      } else {
        trackBox.setStyle(STYLE_INACTIVE);
      }

      BorderPane innerTrackBox = new BorderPane();
      HBox posBox = new HBox(5);
      posBox.setMinWidth(40);
      posBox.getChildren().add(createTrackText(track + "."));
      innerTrackBox.setLeft(posBox);
      HBox nameBox = new HBox(5);
      nameBox.setMinWidth(385);

      String name = song.getName();
      if (name.endsWith(".mp3")) {
        name = name.substring(0, name.length() - 4);
      }
      nameBox.getChildren().add(createTrackText(" " + name));
      innerTrackBox.setCenter(nameBox);
      innerTrackBox.setRight(createTrackText(song.getDuration()));

      trackBox.getChildren().add(innerTrackBox);
      songBox.getChildren().add(trackBox);

      track++;
    }

    songScroller.setOpacity(0);
    songScroller.setContent(songBox);
    albumNode.getChildren().add(songScroller);
  }
Ejemplo n.º 3
0
 public ScrollPane mache() {
   ScrollPane roller = new ScrollPane(elter);
   roller.setStyle(CssExtras.hintergrund11());
   return roller;
 }