@Override
  public GLElement createParameters(GLElement elem) {
    final SingleAxisElement axis = (SingleAxisElement) elem;

    GLButton b = new GLButton(EButtonMode.CHECKBOX);
    b.setSelected(axis.isInvertOrder());
    b.setCallback(
        new ISelectionCallback() {
          @Override
          public void onSelectionChanged(GLButton button, boolean selected) {
            axis.setInvertOrder(selected);
          }
        });
    b.setRenderer(GLRenderers.drawText("min->max", VAlign.CENTER, new GLPadding(1, 2, 1, 6)));
    b.setSelectedRenderer(
        GLRenderers.drawText("max->min", VAlign.CENTER, new GLPadding(1, 2, 1, 6)));
    b.setSize(100, -1);
    return b;
  }
Example #2
0
  /**
   * initializes this visualization with the given data
   *
   * @param table the model to use
   * @param config the ui config to use
   * @param layouts one or more {@link IRowHeightLayout} to provide to the user
   */
  public void init(
      final RankTableModel table, IRankTableUIConfig config, IRowHeightLayout... layouts) {
    setLayout(GLLayouts.flowVertical(0));
    ButtonBar buttons = new ButtonBar();
    buttons.setzDelta(0.5f);

    if (layouts.length > 1) { // more than one row height layout to choose
      RadioController radio = new RadioController(this);
      for (int i = 0; i < layouts.length; ++i) {
        GLButton b = new GLButton();
        b.setLayoutData(layouts[i]);
        b.setRenderer(renderer);
        radio.add(b);
        buttons.addButton(b);
      }
    }
    buttons.add(new SimpleRankTableStatsElement(table));
    buttons.addSpacer();
    {
      GLButton b = new GLButton();
      b.setCallback(
          new ISelectionCallback() {
            @Override
            public void onSelectionChanged(GLButton button, boolean selected) {
              StackedRankColumnModel m = new StackedRankColumnModel();
              m.setWidth(100);
              table.add(m);
            }
          });
      buttons.addButton(
          b,
          "Create an empty Stacked Combined Column",
          RenderStyle.ICON_ADD_STACKED,
          RenderStyle.ICON_ADD_STACKED);
    }
    {
      GLButton b = new GLButton();
      b.setCallback(
          new ISelectionCallback() {
            @Override
            public void onSelectionChanged(GLButton button, boolean selected) {
              NestedRankColumnModel m = new NestedRankColumnModel();
              m.setWidth(100);
              table.add(m);
            }
          });
      buttons.addButton(
          b,
          "Create an empty Nested Combined Column",
          RenderStyle.ICON_ADD_NESTED,
          RenderStyle.ICON_ADD_NESTED);
    }
    {
      GLButton b = new GLButton();
      b.setCallback(
          new ISelectionCallback() {
            @Override
            public void onSelectionChanged(GLButton button, boolean selected) {
              ScriptedRankColumnModel m = new ScriptedRankColumnModel();
              m.setWidth(100);
              table.add(m);
            }
          });
      buttons.addButton(
          b,
          "Create an empty Scripted Combined Column",
          RenderStyle.ICON_ADD_SCRIPTED,
          RenderStyle.ICON_ADD_SCRIPTED);
    }
    {
      GLButton b = new GLButton();
      b.setCallback(
          new ISelectionCallback() {
            @Override
            public void onSelectionChanged(GLButton button, boolean selected) {
              table.addSnapshot(null);
            }
          });
      buttons.addButton(
          b,
          "Create a new Separator Column",
          RenderStyle.ICON_ADD_SEPARATOR,
          RenderStyle.ICON_ADD_SEPARATOR);
    }

    this.add(buttons);

    TableUI tableui = new TableUI(table, config, layouts);
    ScrollingDecorator sc =
        new ScrollingDecorator(tableui, new ScrollBar(true), null, RenderStyle.SCROLLBAR_WIDTH);
    this.add(sc);
    if (config.isInteractive() && config.isShowColumnPool())
      this.add(new ColumnPoolUI(table, config));
  }
Example #3
0
 /** change the {@link IRowHeightLayout} to the selected one */
 @Override
 public void onSelectionChanged(GLButton button, boolean selected) {
   IRowHeightLayout l = button.getLayoutDataAs(IRowHeightLayout.class, null);
   TableBodyUI body = findBody();
   body.setRowLayout(l);
 }