コード例 #1
0
  public void updateView(Map<String, FrameRange> frameRangeMap) {
    createNewAnimationTable();
    animationsList.clear();

    for (Map.Entry<String, FrameRange> entry : frameRangeMap.entrySet()) {
      String animationName = entry.getKey();
      FrameRange range = entry.getValue();

      VisTable row = new VisTable();

      VisImageButton trashBtn = new VisImageButton("trash-button");

      row.add(StandardWidgetsFactory.createLabel(animationName)).width(120).left();
      row.add(StandardWidgetsFactory.createLabel(range.startFrame + "")).width(50).left();
      row.add(StandardWidgetsFactory.createLabel(range.endFrame + "")).width(50).left();
      row.add(trashBtn).padLeft(10);
      row.row();

      animationsList.add(row).left();
      animationsList.row();

      trashBtn.addListener(
          new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
              facade.sendNotification(DELETE_BUTTON_PRESSED, animationName);
            }
          });
    }

    invalidateHeight();
  }
コード例 #2
0
  private void createNewAnimationTable() {
    newAnimationTable.clear();
    nameField = StandardWidgetsFactory.createTextField();
    fromFrameField = StandardWidgetsFactory.createNumberSelector(0, 100);
    toFrameField = StandardWidgetsFactory.createNumberSelector(0, 100);
    addButton = new VisTextButton("Add");

    newAnimationTable.add(nameField).width(120);
    newAnimationTable.add(fromFrameField).padLeft(5);
    newAnimationTable.add(toFrameField).padLeft(5);
    newAnimationTable.add(addButton).padLeft(7).padRight(3);
    newAnimationTable.row();
    initListeners();
  }
コード例 #3
0
 public void setEmpty(String text) {
   animationsList.clear();
   VisLabel label = StandardWidgetsFactory.createLabel(text);
   label.setAlignment(Align.center);
   animationsList.add(label).pad(10).width(269).center();
   newAnimationTable.clear();
   invalidateHeight();
 }