Package org.pushingpixels.flamingo.api.ribbon

Examples of org.pushingpixels.flamingo.api.ribbon.JRibbonBand


      public void contribute(RibbonBuildContext context, ARibbonContributor parent) {
        if (parent == null) {
          return;
        }
        band = new JRibbonBand(TextUtils.removeTranslateComment(TextUtils.getText("ribbon.band." + attributes.getProperty("name"))), null);
        // read policies and sub-contributions
        context.processChildren(context.getCurrentPath(), this);
        setResizePolicies(attributes.getProperty("resize_policies"));
        band.setFocusable(false);
        if (valid) {
View Full Code Here


      public void contribute(RibbonBuildContext context, ARibbonContributor parent) {
        if (parent == null) {
          return;
        }

        JRibbonBand band = new JRibbonBand(TextUtils.removeTranslateComment(TextUtils.getText("ribbon.band.edgeStyles")), null, null);
        band.setExpandButtonKeyTip("ES");
        band.setCollapsedStateKeyTip("ZE");

        JCommandButton styleGroupButton = new JCommandButton(TextUtils.removeTranslateComment(TextUtils.getText("edgeStyleGroupAction.text")));       
        styleGroupButton.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
        AFreeplaneAction action = context.getBuilder().getMode().getAction("EdgeStyleAsParentAction");
        final JCommandToggleMenuButton styleAsParent = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, styleAsParent);
        action = context.getBuilder().getMode().getAction("EdgeStyleAction.linear");
        final JCommandToggleMenuButton styleLinear = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, styleLinear);
        action = context.getBuilder().getMode().getAction("EdgeStyleAction.bezier");
        final JCommandToggleMenuButton styleBezier = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, styleBezier);
        action = context.getBuilder().getMode().getAction("EdgeStyleAction.sharp_linear");
        final JCommandToggleMenuButton styleSharpLinear = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, styleSharpLinear);
        action = context.getBuilder().getMode().getAction("EdgeStyleAction.sharp_bezier");
        final JCommandToggleMenuButton styleSharpBezier = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, styleSharpBezier);
        action = context.getBuilder().getMode().getAction("EdgeStyleAction.horizontal");
        final JCommandToggleMenuButton styleHorizontal = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, styleHorizontal);
        action = context.getBuilder().getMode().getAction("EdgeStyleAction.hide_edge");
        final JCommandToggleMenuButton styleHideEdge = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, styleHideEdge);

        ButtonGroup group = new ButtonGroup();
        styleAsParent.getActionModel().setGroup(group);
        styleLinear.getActionModel().setGroup(group);
        styleAsParent.getActionModel().setGroup(group);
        styleBezier.getActionModel().setGroup(group);
        styleAsParent.getActionModel().setGroup(group);
        styleSharpLinear.getActionModel().setGroup(group);
        styleAsParent.getActionModel().setGroup(group);
        styleSharpBezier.getActionModel().setGroup(group);
        styleAsParent.getActionModel().setGroup(group);
        styleHorizontal.getActionModel().setGroup(group);
        styleAsParent.getActionModel().setGroup(group);
        styleHideEdge.getActionModel().setGroup(group);
        styleAsParent.getActionModel().setGroup(group);

        styleGroupButton.setPopupCallback(new PopupPanelCallback() {
          public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            JCommandPopupMenu popupmenu = new JCommandPopupMenu();
            popupmenu.addMenuButton(styleAsParent);
            popupmenu.addMenuButton(styleLinear);
            popupmenu.addMenuButton(styleBezier);
            popupmenu.addMenuButton(styleSharpLinear);
            popupmenu.addMenuButton(styleSharpBezier);
            popupmenu.addMenuButton(styleHorizontal);
            popupmenu.addMenuButton(styleHideEdge);
            return popupmenu;
          }
        });

        band.addCommandButton(styleGroupButton, RibbonElementPriority.MEDIUM);

        JCommandButton lineWidthGroupButton = new JCommandButton(TextUtils.removeTranslateComment(TextUtils.getText("edgeLineWidthGroupAction.text")));
        lineWidthGroupButton.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);       
        action = context.getBuilder().getMode().getAction("EdgeWidthAction_width_parent");
        final JCommandToggleMenuButton widthParent = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, widthParent);
        action = context.getBuilder().getMode().getAction("EdgeWidthAction_width_thin");
        final JCommandToggleMenuButton widthThin = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, widthThin);
        action = context.getBuilder().getMode().getAction("EdgeWidthAction_1");
        final JCommandToggleMenuButton width1 = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, width1);
        action = context.getBuilder().getMode().getAction("EdgeWidthAction_2");
        final JCommandToggleMenuButton width2 = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, width2);
        action = context.getBuilder().getMode().getAction("EdgeWidthAction_4");
        final JCommandToggleMenuButton width4 = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, width4);
        action = context.getBuilder().getMode().getAction("EdgeWidthAction_8");
        final JCommandToggleMenuButton width8 = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, width8);

        lineWidthGroupButton.setPopupCallback(new PopupPanelCallback() {
          public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            JCommandPopupMenu popupmenu = new JCommandPopupMenu();
            popupmenu.addMenuButton(widthParent);
            popupmenu.addMenuButton(widthThin);
            popupmenu.addMenuButton(width1);
            popupmenu.addMenuButton(width2);
            popupmenu.addMenuButton(width4);
            popupmenu.addMenuButton(width8);
            return popupmenu;
          }
        });

        band.addCommandButton(lineWidthGroupButton, RibbonElementPriority.MEDIUM);

        action = context.getBuilder().getMode().getAction("EdgeColorAction");
        final JCommandButton edgeColorButton = RibbonActionContributorFactory.createCommandButton(action);
        band.addCommandButton(edgeColorButton, RibbonElementPriority.MEDIUM);

        action = context.getBuilder().getMode().getAction("AutomaticEdgeColorHookAction");
        //RIBBONS
//        KeyStroke ks =RibbonAcceleratorManager.parseKeyStroke("j2ef2");
//        context.getBuilder().getAcceleratorManager().setAccelerator(action, ks);
//        RibbonActionContributorFactory.updateRichTooltip(button, action, ks);
        final JCommandButton automaticColorButton = RibbonActionContributorFactory.createCommandButton(action);
        band.addCommandButton(automaticColorButton, RibbonElementPriority.MEDIUM);

        List<RibbonBandResizePolicy> policies = new ArrayList<RibbonBandResizePolicy>();
        policies.add(new CoreRibbonResizePolicies.Mirror(band.getControlPanel()));
        policies.add(new CoreRibbonResizePolicies.High2Mid(band.getControlPanel()));
        band.setResizePolicies(policies);
        parent.addChild(band, new ChildProperties(parseOrderSettings(attributes.getProperty("orderPriority", ""))));

      }

      public void addChild(Object child, ChildProperties properties) {
View Full Code Here

      public void contribute(final RibbonBuildContext context, ARibbonContributor parent) {
        if (parent == null) {
          return;
        }       
        JRibbonBand band = new JRibbonBand(TextUtils.removeTranslateComment(TextUtils.getText("ribbon.band.viewsettings")), null, null);
               
        createAttributeViewMenu(context, band);
        createNoteViewMenu(context, band);
        createToolTipMenu(context, band);
        createToolbarsMenu(context, band);
       
        List<RibbonBandResizePolicy> policies = new ArrayList<RibbonBandResizePolicy>();       
        policies.add(new CoreRibbonResizePolicies.Mirror(band.getControlPanel()));       
        policies.add(new CoreRibbonResizePolicies.High2Low(band.getControlPanel()));
        band.setResizePolicies(policies);     
       
        parent.addChild(band, new ChildProperties(parseOrderSettings(attributes.getProperty("orderPriority", ""))));         
      }

      private void createToolbarsMenu(final RibbonBuildContext context, JRibbonBand band) {
        JCommandButton button = new JCommandButton(TextUtils.removeTranslateComment(TextUtils.getText("menu_toolbars")));
        button.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
        button.setPopupCallback(new PopupPanelCallback() {
          public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            JCommandPopupMenu popupmenu = new JCommandPopupMenu();         
             
              final AFreeplaneAction toggleFBarAction = context.getBuilder().getMode().getAction("ToggleFBarAction");
              final JCommandToggleMenuButton toggleFBarButton = RibbonActionContributorFactory.createCommandToggleMenuButton(toggleFBarAction);
              toggleFBarAction.setSelected();
              toggleFBarButton.getActionModel().setSelected(toggleFBarAction.isSelected());
              popupmenu.addMenuButton(toggleFBarButton);
             
              final AFreeplaneAction toggleLeftToolbarAction = context.getBuilder().getMode().getAction("ToggleLeftToolbarAction");
              final JCommandToggleMenuButton toggleLeftToolbarButton = RibbonActionContributorFactory.createCommandToggleMenuButton(toggleLeftToolbarAction);
              toggleLeftToolbarAction.setSelected();
              toggleLeftToolbarButton.getActionModel().setSelected(toggleLeftToolbarAction.isSelected());
              popupmenu.addMenuButton(toggleLeftToolbarButton);
             
              final AFreeplaneAction toggleStatusAction = context.getBuilder().getMode().getAction("ToggleStatusAction");
              final JCommandToggleMenuButton toggleStatusButton = RibbonActionContributorFactory.createCommandToggleMenuButton(toggleStatusAction);
              toggleStatusAction.setSelected();
              toggleStatusButton.getActionModel().setSelected(toggleStatusAction.isSelected());
              popupmenu.addMenuButton(toggleStatusButton);
             
              final AFreeplaneAction toggleScrollbarsAction = context.getBuilder().getMode().getAction("ToggleScrollbarsAction");
              final JCommandToggleMenuButton toggleScrollbarsButton = RibbonActionContributorFactory.createCommandToggleMenuButton(toggleScrollbarsAction);
              toggleScrollbarsAction.setSelected();
              toggleScrollbarsButton.getActionModel().setSelected(toggleScrollbarsAction.isSelected());
              popupmenu.addMenuButton(toggleScrollbarsButton);
             
            return popupmenu;
          }
        });
        band.addCommandButton(button, RibbonElementPriority.MEDIUM);
       
        AFreeplaneAction action = context.getBuilder().getMode().getAction("SetShortenerStateAction");
        button = RibbonActionContributorFactory.createCommandButton(action);
        band.addCommandButton(button, RibbonElementPriority.MEDIUM);
       
        action = context.getBuilder().getMode().getAction("ToggleDetailsAction");       
        button = RibbonActionContributorFactory.createCommandButton(action);
        band.addCommandButton(button, RibbonElementPriority.MEDIUM);       
      }


      private void createToolTipMenu(final RibbonBuildContext context, final JRibbonBand band) {
        JCommandButton button = new JCommandButton(TextUtils.removeTranslateComment(TextUtils.getText("menu_hoverView")));
        button.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
        button.setPopupCallback(new PopupPanelCallback() {
          public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            JCommandPopupMenu popupmenu = new JCommandPopupMenu();
           
            final SetBooleanPropertyAction showAction = (SetBooleanPropertyAction) context.getBuilder().getMode().getAction("SetBooleanPropertyAction.show_node_tooltips");
              final JCommandToggleMenuButton showButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showAction);
              showAction.setSelected();
              showButton.getActionModel().setSelected(showAction.isSelected());
              popupmenu.addMenuButton(showButton);
             
              final SetBooleanPropertyAction showStylesAction = (SetBooleanPropertyAction) context.getBuilder().getMode().getAction("SetBooleanPropertyAction.show_styles_in_tooltip");
              final JCommandToggleMenuButton showStylesButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showStylesAction);
              showStylesAction.setSelected();
              showStylesButton.getActionModel().setSelected(showStylesAction.isSelected());
              popupmenu.addMenuButton(showStylesButton);
             
              final AFreeplaneAction modificationAction = context.getBuilder().getMode().getAction("CreationModificationPluginAction");
              final JCommandToggleMenuButton modificationButton = RibbonActionContributorFactory.createCommandToggleMenuButton(modificationAction);
              modificationAction.setSelected();
              modificationButton.getActionModel().setSelected(modificationAction.isSelected());
              popupmenu.addMenuButton(modificationButton);
             
            return popupmenu;
          }
        });
        band.addCommandButton(button, RibbonElementPriority.MEDIUM);
      }


      private void createNoteViewMenu(final RibbonBuildContext context, final JRibbonBand band) {       
        JCommandButton displayNotesButton = new JCommandButton(TextUtils.removeTranslateComment(TextUtils.getText("menu_noteView")));
        displayNotesButton.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
        displayNotesButton.setPopupCallback(new PopupPanelCallback() {
          public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            JCommandPopupMenu popupmenu = new JCommandPopupMenu();
           
            final ShowNotesInMapAction showNotesInMapAction = (ShowNotesInMapAction) context.getBuilder().getMode().getAction("ShowNotesInMapAction");
            final JCommandToggleMenuButton showNotedsInMapButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showNotesInMapAction);
            showNotesInMapAction.setSelected();
            showNotedsInMapButton.getActionModel().setSelected(showNotesInMapAction.isSelected());
              popupmenu.addMenuButton(showNotedsInMapButton);
             
            final SetBooleanMapPropertyAction showIconAction = (SetBooleanMapPropertyAction) context.getBuilder().getMode().getAction("SetBooleanMapPropertyAction.show_note_icons");
              final JCommandToggleMenuButton toggleButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showIconAction);
              showIconAction.setSelected();
              toggleButton.getActionModel().setSelected(showIconAction.isSelected());
              popupmenu.addMenuButton(toggleButton);
             
              JCommandMenuButton button = new JCommandMenuButton(TextUtils.removeTranslateComment(TextUtils.getText("note_window_location")), null);
              button.setDisplayState(CommandButtonDisplayState.MEDIUM);
              button.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
              button.setPopupCallback(new PopupPanelCallback() {
                public JPopupPanel getPopupPanel(JCommandButton commandButton) {
                  JCommandPopupMenu popupmenu = new JCommandPopupMenu();
               
                  final SetNoteWindowPosition posTopAction = (SetNoteWindowPosition) context.getBuilder().getMode().getAction("SetNoteWindowPosition.top");
                  final JCommandToggleMenuButton posTopButton = RibbonActionContributorFactory.createCommandToggleMenuButton(posTopAction);             
                  popupmenu.addMenuButton(posTopButton);
                  posTopAction.setSelected();
                  posTopButton.getActionModel().setSelected(posTopAction.isSelected());
                 
                  final SetNoteWindowPosition posLeftAction = (SetNoteWindowPosition) context.getBuilder().getMode().getAction("SetNoteWindowPosition.left");
                  final JCommandToggleMenuButton posLeftButton = RibbonActionContributorFactory.createCommandToggleMenuButton(posLeftAction);             
                  popupmenu.addMenuButton(posLeftButton);
                  posLeftAction.setSelected();
                  posLeftButton.getActionModel().setSelected(posLeftAction.isSelected());
                 
                  final SetNoteWindowPosition posRightAction = (SetNoteWindowPosition) context.getBuilder().getMode().getAction("SetNoteWindowPosition.right");
                  final JCommandToggleMenuButton posRightButton = RibbonActionContributorFactory.createCommandToggleMenuButton(posRightAction);             
                  popupmenu.addMenuButton(posRightButton);
                  posRightAction.setSelected();
                  posRightButton.getActionModel().setSelected(posRightAction.isSelected());
                 
                  final SetNoteWindowPosition posBottomAction = (SetNoteWindowPosition) context.getBuilder().getMode().getAction("SetNoteWindowPosition.bottom");
                  final JCommandToggleMenuButton posBottomButton = RibbonActionContributorFactory.createCommandToggleMenuButton(posBottomAction);             
                  popupmenu.addMenuButton(posBottomButton);
                  posBottomAction.setSelected();
                  posBottomButton.getActionModel().setSelected(posBottomAction.isSelected());
                 
                  return popupmenu;
                }
              });             
              popupmenu.addMenuButton(button);
             
            return popupmenu;
          }
        });
        band.addCommandButton(displayNotesButton, RibbonElementPriority.MEDIUM);
      }

      private void createAttributeViewMenu(final RibbonBuildContext context, JRibbonBand band) {
        JCommandButton button = new JCommandButton(TextUtils.removeTranslateComment(TextUtils.getText("menu_displayAttributes")));
        button.setDisplayState(CommandButtonDisplayState.MEDIUM);
        button.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
        button.setPopupCallback(new PopupPanelCallback() {
          public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            JCommandPopupMenu popupmenu = new JCommandPopupMenu();
           
            final AttributeViewTypeAction showSelectedAttributesAction = (AttributeViewTypeAction) context.getBuilder().getMode().getAction("ShowSelectedAttributesAction");
            final JCommandToggleMenuButton showSelectedAttributesButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showSelectedAttributesAction);             
            popupmenu.addMenuButton(showSelectedAttributesButton);
            showSelectedAttributesAction.setSelected();
            showSelectedAttributesButton.getActionModel().setSelected(showSelectedAttributesAction.isSelected());
           
            final AttributeViewTypeAction showAllAttributesAction = (AttributeViewTypeAction) context.getBuilder().getMode().getAction("ShowAllAttributesAction");
            final JCommandToggleMenuButton showAllAttributesButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showAllAttributesAction);           
            popupmenu.addMenuButton(showAllAttributesButton);
            showAllAttributesAction.setSelected();
            showAllAttributesButton.getActionModel().setSelected(showAllAttributesAction.isSelected());
           
            final AttributeViewTypeAction hideAllAttributesAction = (AttributeViewTypeAction) context.getBuilder().getMode().getAction("HideAllAttributesAction");           
            final JCommandToggleMenuButton hideAllAttributesButton = RibbonActionContributorFactory.createCommandToggleMenuButton(hideAllAttributesAction);           
            popupmenu.addMenuButton(hideAllAttributesButton);
            hideAllAttributesAction.setSelected();
            hideAllAttributesButton.getActionModel().setSelected(hideAllAttributesAction.isSelected());
                       
              final SetBooleanMapPropertyAction showIconAction = (SetBooleanMapPropertyAction) context.getBuilder().getMode().getAction("SetBooleanMapPropertyAction.show_icon_for_attributes");
              final JCommandToggleMenuButton toggleButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showIconAction);
              showIconAction.setSelected();
              toggleButton.getActionModel().setSelected(showIconAction.isSelected());
              popupmenu.addMenuButton(toggleButton);
           
            context.getBuilder().getMapChangeAdapter().addListener(new IChangeObserver() {             
              public void updateState(CurrentState state) {
                showSelectedAttributesAction.setSelected();
                showSelectedAttributesButton.getActionModel().setSelected(showSelectedAttributesAction.isSelected());
                showAllAttributesAction.setSelected();
                showAllAttributesButton.getActionModel().setSelected(showAllAttributesAction.isSelected());
                hideAllAttributesAction.setSelected();
                hideAllAttributesButton.getActionModel().setSelected(hideAllAttributesAction.isSelected());
                showIconAction.setSelected();
                toggleButton.getActionModel().setSelected(showIconAction.isSelected());
              }
            });
           
            JCommandMenuButton button = RibbonActionContributorFactory.createCommandMenuButton(context.getBuilder().getMode().getAction("ShowAttributeDialogAction"));
            popupmenu.addMenuButton(button);
           
            return popupmenu;
          }
        });
        band.addCommandButton(button, RibbonElementPriority.MEDIUM);
      }

      public void addChild(Object child, ChildProperties properties) {
      }
    };
View Full Code Here

        }
    }

    private void createToolbar() {

        JRibbonBand projetoBand = new JRibbonBand("Projeto", getResizableIconFromResource("exit.png"));

        projetoBand.setResizePolicies((List) Arrays.asList(
                new CoreRibbonResizePolicies.None(projetoBand.getControlPanel()),
                new CoreRibbonResizePolicies.None(projetoBand.getControlPanel()),
                new CoreRibbonResizePolicies.None(projetoBand.getControlPanel()),
                new IconRibbonBandResizePolicy(projetoBand.getControlPanel())));

        btnNovoProjeto = new JCommandButton(null, getResizableIconFromResource("new.png"));
        btnNovoProjeto.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                novoProjeto();
            }
        });
        btnAbrirProjeto = new JCommandButton(null, getResizableIconFromResource("open.png"));

        btnAbrirProjeto.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                AbreProjetoPresenter abreProjeto = new AbreProjetoPresenter();
                if (abreProjeto.getProjeto() != null) {
                    abreProjeto(abreProjeto.getProjeto());
                }
            }
        });

        btnFecharProjeto = new JCommandButton(null, getResizableIconFromResource("close.png"));
        btnFecharProjeto.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                projeto = null;
                state.fecharProjeto();
            }
        });

        JCommandButton btnArvores = new JCommandButton(null, getResizableIconFromResource("arvores.png"));

        projetoBand.addCommandButton(btnNovoProjeto, RibbonElementPriority.TOP);
        projetoBand.addCommandButton(btnAbrirProjeto, RibbonElementPriority.TOP);
        projetoBand.addCommandButton(btnFecharProjeto, RibbonElementPriority.TOP);
        projetoBand.addCommandButton(btnArvores, RibbonElementPriority.TOP);

        // Volume Band
        JRibbonBand volumeBand = new JRibbonBand("Volume", getResizableIconFromResource("exit.png"));

        volumeBand.setResizePolicies((List) Arrays.asList(
                new CoreRibbonResizePolicies.None(projetoBand.getControlPanel()),
                new CoreRibbonResizePolicies.None(projetoBand.getControlPanel()),
                new IconRibbonBandResizePolicy(projetoBand.getControlPanel())));

        btnVolumeNovoCenario = new JCommandButton(null, getResizableIconFromResource("newvolscenario.png"));
        btnVolumeNovoCenario.setActionRichTooltip(new RichTooltip("Cenário", "Cria um novo cenário"));
        btnVolumeNovoCenario.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                novoCenarioVolume();
            }
        });

        btnVolumeDuplicarCenario = new JCommandButton(null, getResizableIconFromResource("dupCenarioVolume.png"));
        btnVolumeDuplicarCenario.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                DuplicarCenarioPresenter dpCenario = new DuplicarCenarioPresenter(Main.this);

            }
        });


        volumeBand.addCommandButton(btnVolumeNovoCenario, RibbonElementPriority.TOP);
        volumeBand.addCommandButton(btnVolumeDuplicarCenario, RibbonElementPriority.TOP);


        JRibbonBand indLocalBand = new JRibbonBand("Índice de Local", getResizableIconFromResource("exit.png"));

        btnIndLocalNovoCenario = new JCommandButton(null, getResizableIconFromResource("newilscenario.png"));


        btnIndLocalNovoCenario.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                iLocal++;
                IconNode node = new IconNode("Cenário " + iLocal, true, new ImageIcon(Configuracao.getPath() + "images/cenario4.png"), IconNode.CENARIO_INDICELOCAL);
                addNode("Índice de Local", node);
            }
        });

        indLocalBand.addCommandButton(btnIndLocalNovoCenario, RibbonElementPriority.LOW);

        indLocalBand.setPreferredSize(new Dimension(100, 100));

        indLocalBand.setResizePolicies((List) Arrays.asList(
                new CoreRibbonResizePolicies.None(projetoBand.getControlPanel()),
                new IconRibbonBandResizePolicy(projetoBand.getControlPanel())));

        JRibbonBand dadosBand = new JRibbonBand("world!", null);
        dadosBand.setResizePolicies((List) Arrays.asList(new IconRibbonBandResizePolicy(dadosBand.getControlPanel())));

        JRibbonBand configuracoesBand = new JRibbonBand("Configurações", null);
        configuracoesBand.setResizePolicies((List) Arrays.asList(
                new CoreRibbonResizePolicies.None(configuracoesBand.getControlPanel())));

        JCommandButton btnConfiguracoes = new JCommandButton(null, getResizableIconFromResource("settings.png"));
        btnConfiguracoes.setActionRichTooltip(new RichTooltip("Configurações", "Permite alterar as configurações do sistema"));
        btnConfiguracoes.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                ConfiguracoesView configuracoes = new ConfiguracoesView(null, true);
                configuracoes.setVisible(true);
            }
        });
        configuracoesBand.addCommandButton(btnConfiguracoes, RibbonElementPriority.TOP);

        JRibbonBand janelaBand = new JRibbonBand("Organizar", getResizableIconFromResource("exit.png"));
        janelaBand.setResizePolicies((List) Arrays.asList(
                new CoreRibbonResizePolicies.None(janelaBand.getControlPanel()),
                new CoreRibbonResizePolicies.None(janelaBand.getControlPanel()),
                new IconRibbonBandResizePolicy(janelaBand.getControlPanel())));
        JCommandButton btnLadoALado = new JCommandButton(null, getResizableIconFromResource("tile_vertical.png"));
        JCommandButton btnCascata = new JCommandButton(null, getResizableIconFromResource("cascade.png"));

        btnLadoALado.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                desktop.tileFrames();
            }
        });

        btnCascata.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                desktop.cascadeFrames();
            }
        });

        janelaBand.addCommandButton(btnLadoALado, RibbonElementPriority.MEDIUM);
        janelaBand.addCommandButton(btnCascata, RibbonElementPriority.MEDIUM);

        JRibbonBand modeloBand = new JRibbonBand("Modelos", getResizableIconFromResource("models.png"));

        modeloBand.setResizePolicies((List) Arrays.asList(
                new CoreRibbonResizePolicies.None(janelaBand.getControlPanel()),
                new IconRibbonBandResizePolicy(janelaBand.getControlPanel())));

        JCommandButton btnManterModelos = new JCommandButton(null, getResizableIconFromResource("models.png"));

        btnManterModelos.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                mantemModelos();
            }
        });

        modeloBand.addCommandButton(btnManterModelos, RibbonElementPriority.MEDIUM);

        JRibbonBand bands[] = new JRibbonBand[4];
        bands[0] = projetoBand;
        bands[1] = volumeBand;
        bands[2] = indLocalBand;
        bands[3] = modeloBand;
View Full Code Here

  /* BANDS */
  /*********/
  private JRibbonBand getDocumentBand () {
   
    if (documentBand == null) { 
      documentBand = new JRibbonBand(Messages.getString("Document.textBandTitle"), null);
      documentBand.setResizePolicies(CoreRibbonResizePolicies.getCorePoliciesNone(documentBand));
         
      documentBand.addCommandButton(getNewButton(),  RibbonElementPriority.TOP);
      documentBand.addCommandButton(getOpenButton(),  RibbonElementPriority.TOP);
      documentBand.addCommandButton(getRecentButton(), RibbonElementPriority.TOP);
View Full Code Here

  }

  private JRibbonBand getSaveBand() {
   
    if (saveBand == null) {
      saveBand = new JRibbonBand(Messages.getString("Save.textBandTitle"), null);
      saveBand.setResizePolicies(CoreRibbonResizePolicies.getCorePoliciesNone(saveBand));
      saveBand.addCommandButton(getSaveButton(), RibbonElementPriority.TOP);
      saveBand.addCommandButton(getSaveAsButton(), RibbonElementPriority.TOP);
    }
   
View Full Code Here

  }
 
  private JRibbonBand getOutputBand() {
   
    if (outputBand == null) {
      outputBand = new JRibbonBand(Messages.getString("DataOutput.textBandTitle"), null);
      outputBand.setResizePolicies(CoreRibbonResizePolicies.getCorePoliciesNone(outputBand));
      outputBand.addCommandButton(getPrintButton(), RibbonElementPriority.TOP);
      outputBand.addCommandButton(getExportButton(), RibbonElementPriority.TOP);
    }
   
View Full Code Here

  }*/
     
  private JRibbonBand getEditBand() {
   
    if (editBand == null) {
      editBand = new JRibbonBand(Messages.getString("Edit.textBandTitle"), null);
      editBand.setResizePolicies(CoreRibbonResizePolicies.getCorePoliciesNone(editBand));
      editBand.addCommandButton(getUndoButton(),  RibbonElementPriority.TOP);
      editBand.addCommandButton(getRedoButton(),  RibbonElementPriority.TOP);
      editBand.addCommandButton(getCutButton(),  RibbonElementPriority.TOP);
      editBand.addCommandButton(getCopyButton(),  RibbonElementPriority.TOP);
View Full Code Here

  }
 
  private JRibbonBand getFormsBand() {
     
    if (formsBand == null) {
      formsBand = new JRibbonBand(Messages.getString("Forms.textBandTitle"), new forms_place());
      formsBand.setResizePolicies(CoreRibbonResizePolicies.getCorePoliciesNone(formsBand));
   
      formsBand.addCommandButton(getPlaceButton(), RibbonElementPriority.MEDIUM);
      formsBand.addCommandButton(getTransitionButton(), RibbonElementPriority.MEDIUM);
      formsBand.addCommandButton(getAndSplitButton(), RibbonElementPriority.MEDIUM);
View Full Code Here

  }

  private JRibbonBand getLayoutBand() {
   
    if (layoutBand == null) {
      layoutBand = new JRibbonBand(Messages.getString("View.textBandTitle"), new editor_group());
      layoutBand.setResizePolicies(CoreRibbonResizePolicies.getCorePoliciesNone(layoutBand));
      layoutBand.startGroup();

      layoutBand.addCommandButton(getChangeOrientationButton(),RibbonElementPriority.TOP);
      layoutBand.addCommandButton(getOptimizeLayoutButton(),RibbonElementPriority.TOP);
View Full Code Here

TOP

Related Classes of org.pushingpixels.flamingo.api.ribbon.JRibbonBand

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.