Exemplo n.º 1
0
  public DeleteMultipleFilesTab(ModuleInjector injector, Array<FileItem> items) {
    super(false, true);
    this.injector = injector;
    this.items = items;
    injector.injectModules(this);

    table = new VisTable();
    table.setBackground(VisUI.getSkin().getDrawable("window-bg"));
    table.defaults().left();

    usagesTable = new VisTable(true);
    rebuildUsagesTable();

    VisScrollPane scrollPane = new VisScrollPane(usagesTable);
    scrollPane.setFadeScrollBars(false);

    table.add(scrollPane).expandX().fillX().pad(3).row();
    table.add().expand().fill().row();
    table.addSeparator();
    table.add(createButtonPane()).pad(3);
  }
Exemplo n.º 2
0
  public void buildNodeController() {
    List<VisTextButton> actionBtns = getButtons(AActionNode.class);
    List<VisTextButton> dataBtns = getButtons(ADataNode.class);
    List<VisTextButton> utilBtns = getButtons(AUtilNode.class);

    VisTextButton actionTableToggle = new VisTextButton("Action nodes");
    VisTextButton dataTableToggle = new VisTextButton("Data nodes");
    VisTextButton utilTableToggle = new VisTextButton("Util nodes");
    VisTable actionTable = new VisTable(true);
    VisTable dataTable = new VisTable(true);
    VisTable utilTable = new VisTable(true);

    CollapsibleWidget actionWidget = new CollapsibleWidget(actionTable);
    CollapsibleWidget dataWidget = new CollapsibleWidget(dataTable);
    CollapsibleWidget utilWidget = new CollapsibleWidget(utilTable);
    actionWidget.setCollapsed(true, false);
    dataWidget.setCollapsed(true, false);
    utilWidget.setCollapsed(true, false);

    for (VisTextButton actBtn : actionBtns) {
      actionTable.add(actBtn).fillX();
      actionTable.row();
    }
    for (VisTextButton dataBtn : dataBtns) {
      dataTable.add(dataBtn).fillX();
      dataTable.row();
    }
    for (VisTextButton utilBtn : utilBtns) {
      utilTable.add(utilBtn).fillX();
      utilTable.row();
    }

    actionTableToggle.addListener(
        new ClickListener() {
          @Override
          public void clicked(InputEvent event, float x, float y) {
            actionWidget.setCollapsed(!actionWidget.isCollapsed(), true);
          }
        });
    dataTableToggle.addListener(
        new ClickListener() {
          @Override
          public void clicked(InputEvent event, float x, float y) {
            dataWidget.setCollapsed(!dataWidget.isCollapsed(), true);
          }
        });
    utilTableToggle.addListener(
        new ClickListener() {
          @Override
          public void clicked(InputEvent event, float x, float y) {
            utilWidget.setCollapsed(!utilWidget.isCollapsed(), true);
          }
        });

    addNodeTable.add(actionTableToggle).fillX();
    addNodeTable.row();
    addNodeTable.add(actionWidget).fillX();
    addNodeTable.row();
    addNodeTable.add(dataTableToggle).fillX();
    addNodeTable.row();
    addNodeTable.add(dataWidget).fillX();
    addNodeTable.row();
    addNodeTable.add(utilTableToggle).fillX();
    addNodeTable.row();
    addNodeTable.add(utilWidget).fillX();
    addNodeTable.row();
    addNodeTable.addSeparator();
    addNodeTable.row();
    addNodeTable.add(compileGraph).fillX();

    compileGraph.addListener(
        new ClickListener() {
          @Override
          public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            //                graphBase.targetComponent =
            // Launcher.instance().editorScreen.getComponentAtLocation(0, 0, 0);
            if (graphBase.getTargetComponent() == null) {
              Dialogs.showErrorDialog(getStage(), "No component selected");
              return;
            }
            graphBase
                .getTargetComponent()
                .setActionGraph(graphBase.compiler.compileGraph(graphBase));
            graphBase.getTargetComponent().setActionGraphData(graphBase.compileToData());
          }
        });
  }