Package tripleplay.ui

Examples of tripleplay.ui.Tabs$Tab


        final int yPosStartDrowdown = p5GuiYOffset+36;

        cp5.getWindow().setPositionOfTabs(GENERIC_X_OFS, this.getHeight()-20);

        //there a default tab which is present all the time. rename this tab
        Tab generatorTab = cp5.getTab("default"); //$NON-NLS-1$
        allTabs.add(generatorTab);
        generatorTab.setLabel(messages.getString("GeneratorGui.TAB_GENERATOR_EFFECT"));     //$NON-NLS-1$
        Tab outputTab = cp5.addTab(messages.getString("GeneratorGui.TAB_SINGLE_OUTPUT_MAPPING")); //$NON-NLS-1$
        allTabs.add(outputTab);
        Tab allOutputTab = null;
       
        //add all output mapping only if multiple output panels exist
        if (nrOfVisuals>2) {
            allOutputTab = cp5.addTab(messages.getString("GeneratorGui.TAB_ALL_OUTPUT_MAPPING"));     //$NON-NLS-1$
            allOutputTab.setColorForeground(0xffff0000);
            allTabs.add(allOutputTab);
        }

        Tab randomTab = cp5.addTab(messages.getString("GeneratorGui.TAB_RANDOMIZE"));     //$NON-NLS-1$
        allTabs.add(randomTab);
        Tab presetTab = cp5.addTab(messages.getString("GeneratorGui.TAB_PRESETS")); //$NON-NLS-1$
        allTabs.add(presetTab);
        Tab infoTab = cp5.addTab(messages.getString("GeneratorGui.TAB_INFO")); //$NON-NLS-1$
        allTabs.add(infoTab);
        Tab helpTab = cp5.addTab(messages.getString("GeneratorGui.TAB_HELP")); //$NON-NLS-1$
        allTabs.add(helpTab);
       
        generatorTab.setColorForeground(0xffff0000);
        outputTab.setColorForeground(0xffff0000);
        randomTab.setColorForeground(0xffff0000);
        presetTab.setColorForeground(0xffff0000);
        helpTab.setColorForeground(0xffff0000);
       
        generatorTab.bringToFront();
       
        //-------------
        //Generic Options
View Full Code Here


      return textGenerator.isFocus() || presetName.isFocus();
    }


  public void selectPreviousTab() {
    Tab currentTab = cp5.getWindow().getCurrentTab();
    Tab lastTab=null;
    for (Tab t: allTabs) {
      if (t==currentTab && lastTab!=null) {
        lastTab.bringToFront();
        return;
      }
      lastTab = t;
    }
    //activate the last tab
View Full Code Here

  }
 

  public void selectNextTab() {
    boolean activateNextTab = false;   
    Tab currentTab = cp5.getWindow().getCurrentTab();   
   
    for (Tab t: allTabs) {
      if (activateNextTab) {
        //active next tab and return
        t.bringToFront();
View Full Code Here

        return "UI: Tabs";
    }

    @Override protected Group createIface () {
        final int [] lastTab = {0};
        final Tabs tabs = new Tabs().addStyles(Style.BACKGROUND.is(
            Background.bordered(Colors.WHITE, Colors.BLACK, 1).inset(1)));
        final Button moveRight = new Button("Move Right").onClick(new UnitSlot() {
            @Override public void onEmit () {
                Tabs.Tab tab = tabs.selected.get();
                if (movable(tab)) {
                    tabs.repositionTab(tab, tab.index() + 1);
                }
            }
        }).setEnabled(false);
        final Button hide = new Button("Hide").onClick(new UnitSlot() {
            @Override public void onEmit () {
                Tabs.Tab tab = tabs.selected.get();
                if (tab != null) {
                    tab.setVisible(false);
                }
            }
        }).setEnabled(false);
        tabs.selected.connect(new Slot<Tabs.Tab>() {
            @Override public void onEmit (Tabs.Tab tab) {
                moveRight.setEnabled(movable(tab));
                hide.setEnabled(tab != null);
            }
        });
        return new Group(AxisLayout.vertical().offStretch()).add(
            new Group(AxisLayout.horizontal()).add(
                new Button("Add").onClick(new UnitSlot() {
                    @Override public void onEmit () {
                        String label = _prefix + ++lastTab[0];
                        tabs.add(label, tabContent(label));
                    }
                }),
                new Button("Remove...").onClick(new TabSelector(tabs) {
                    @Override public void handle (Tabs.Tab tab) {
                        tabs.destroyTab(tab);
                    }
                }),
                new Button("Highlight...").onClick(new TabSelector(tabs) {
                    @Override public void handle (Tabs.Tab tab) {
                        tabs.highlighter().highlight(tab, true);
                    }
                }), moveRight, hide, new Button("Show All").onClick(new UnitSlot() {
                    @Override public void onEmit () {
                        for (int ii = 0; ii < tabs.tabCount(); ii++) {
                            tabs.tabAt(ii).setVisible(true);
                        }
                    }
                })),
            tabs.setConstraint(AxisLayout.stretched()));
    }
View Full Code Here

TOP

Related Classes of tripleplay.ui.Tabs$Tab

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.