Package org.pushingpixels.flamingo.api.common

Examples of org.pushingpixels.flamingo.api.common.JCommandButtonStrip


        }

        DataLaboratoryHelper dlh = DataLaboratoryHelper.getDefault();
        AttributeColumnsManipulator[] manipulators = dlh.getAttributeColumnsManipulators();

        JCommandButtonStrip currentButtonGroup = new JCommandButtonStrip(JCommandButtonStrip.StripOrientation.HORIZONTAL);
        currentButtonGroup.setDisplayState(CommandButtonDisplayState.BIG);
        Integer lastManipulatorType = null;
        for (AttributeColumnsManipulator acm : manipulators) {
            if (lastManipulatorType == null) {
                lastManipulatorType = acm.getType();
            }
            if (lastManipulatorType != acm.getType()) {
                columnManipulatorsPanel.add(currentButtonGroup);
                currentButtonGroup = new JCommandButtonStrip(JCommandButtonStrip.StripOrientation.HORIZONTAL);
                currentButtonGroup.setDisplayState(CommandButtonDisplayState.BIG);
            }
            lastManipulatorType = acm.getType();
            currentButtonGroup.add(prepareJCommandButton(table, columns, acm));
        }
        columnManipulatorsPanel.add(currentButtonGroup);
    }
View Full Code Here


    /**
     * Create the special Add new column button.
     */
    private void prepareAddColumnButton() {
        JCommandButtonStrip strip = new JCommandButtonStrip(JCommandButtonStrip.StripOrientation.HORIZONTAL);
        strip.setDisplayState(CommandButtonDisplayState.BIG);
        JCommandButton button = new JCommandButton(NbBundle.getMessage(DataTableTopComponent.class, "DataTableTopComponent.addColumnButton.text"), ImageWrapperResizableIcon.getIcon(ImageUtilities.loadImage("org/gephi/desktop/datalab/resources/table-insert-column.png", true), new Dimension(16, 16)));
        button.setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_ONLY);
        button.setDisplayState(CommandButtonDisplayState.BIG);
        if (classDisplayed == ClassDisplayed.NODE) {
            button.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    showAddColumnUI(AddColumnUI.Mode.NODES_TABLE);
                }
            });
        } else {
            button.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    showAddColumnUI(AddColumnUI.Mode.EDGES_TABLE);
                }
            });
        }
        strip.add(button);
        columnManipulatorsPanel.add(strip);
    }
View Full Code Here

    /**
     * Create the special merge columns button.
     */
    private void prepareMergeColumnsButton() {
        JCommandButtonStrip strip = new JCommandButtonStrip(JCommandButtonStrip.StripOrientation.HORIZONTAL);
        strip.setDisplayState(CommandButtonDisplayState.BIG);
        JCommandButton button = new JCommandButton(NbBundle.getMessage(DataTableTopComponent.class, "DataTableTopComponent.mergeColumnsButton.text"), ImageWrapperResizableIcon.getIcon(ImageUtilities.loadImage("org/gephi/desktop/datalab/resources/merge.png", true), new Dimension(16, 16)));
        button.setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_ONLY);
        button.setDisplayState(CommandButtonDisplayState.BIG);
        if (classDisplayed == ClassDisplayed.NODE) {
            button.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    showMergeColumnsUI(MergeColumnsUI.Mode.NODES_TABLE);
                }
            });
        } else {
            button.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    showMergeColumnsUI(MergeColumnsUI.Mode.EDGES_TABLE);
                }
            });
        }
        strip.add(button);
        columnManipulatorsPanel.add(strip);
    }
View Full Code Here

    return builder.getPanel();
  }

  private JCommandButtonStrip getStrip1(double hgapScaleFactor,
      double vgapScaleFactor) {
    JCommandButtonStrip buttonStrip = new JCommandButtonStrip();
    buttonStrip.setHGapScaleFactor(hgapScaleFactor);
    buttonStrip.setVGapScaleFactor(vgapScaleFactor);
    buttonStrip.add(new JCommandButton("", new format_justify_left()));
    buttonStrip.add(new JCommandButton("", new format_justify_center()));
    buttonStrip.add(new JCommandButton("", new format_justify_right()));
    return buttonStrip;
  }
View Full Code Here

    return buttonStrip;
  }

  private JCommandButtonStrip getStrip2(double hgapScaleFactor,
      double vgapScaleFactor) {
    JCommandButtonStrip buttonStrip2 = new JCommandButtonStrip();
    buttonStrip2.setHGapScaleFactor(hgapScaleFactor);
    buttonStrip2.setVGapScaleFactor(vgapScaleFactor);
    buttonStrip2.add(new JCommandButton("", new format_text_bold()));
    buttonStrip2.add(new JCommandButton("", new format_text_italic()));
    buttonStrip2.add(new JCommandButton("", new format_text_underline()));
    JCommandButton strike = new JCommandButton("",
        new format_text_strikethrough());
    strike
        .setCommandButtonKind(CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION);
    strike.setPopupCallback(new PopupPanelCallback() {
      @Override
      public JPopupPanel getPopupPanel(JCommandButton commandButton) {
        return new SamplePopupMenu(commandButton
            .getComponentOrientation());
      }
    });
    buttonStrip2.add(strike);
    return buttonStrip2;
  }
View Full Code Here

    return builder.getPanel();
  }

  private JCommandButtonStrip getStrip1(double hgapScaleFactor,
      double vgapScaleFactor) {
    JCommandButtonStrip buttonStrip = new JCommandButtonStrip(
        StripOrientation.VERTICAL);
    buttonStrip.setHGapScaleFactor(hgapScaleFactor);
    buttonStrip.setVGapScaleFactor(vgapScaleFactor);
    buttonStrip.add(new JCommandButton("", new format_justify_left()));
    buttonStrip.add(new JCommandButton("", new format_justify_center()));
    buttonStrip.add(new JCommandButton("", new format_justify_right()));
    return buttonStrip;
  }
View Full Code Here

    return buttonStrip;
  }

  private JCommandButtonStrip getStrip2(double hgapScaleFactor,
      double vgapScaleFactor) {
    JCommandButtonStrip buttonStrip2 = new JCommandButtonStrip(
        StripOrientation.VERTICAL);
    buttonStrip2.setHGapScaleFactor(hgapScaleFactor);
    buttonStrip2.setVGapScaleFactor(vgapScaleFactor);
    buttonStrip2.add(new JCommandButton("", new format_text_bold()));
    buttonStrip2.add(new JCommandButton("", new format_text_italic()));
    buttonStrip2.add(new JCommandButton("", new format_text_underline()));
    buttonStrip2
        .add(new JCommandButton("", new format_text_strikethrough()));
    return buttonStrip2;
  }
View Full Code Here

       
        JComboBox zoomBox = ((MapViewController) Controller.getCurrentController().getMapViewManager()).createZoomBox();
        addDefaultToggleHandler(context,zoomBox);
        band.addFlowComponent(zoomBox);
       
        JCommandButtonStrip strip = new JCommandButtonStrip();
               
        AFreeplaneAction action = context.getBuilder().getMode().getAction("ZoomInAction");       
        JCommandButton button = RibbonActionContributorFactory.createCommandButton(action);       
        button.setDisplayState(CommandButtonDisplayState.SMALL);
        getAccelChangeListener().addAction(action.getKey(), button);
        addDefaultToggleHandler(context, action, button);
        strip.add(button);
       
        action = context.getBuilder().getMode().getAction("ZoomOutAction");       
        button = RibbonActionContributorFactory.createCommandButton(action);       
        button.setDisplayState(CommandButtonDisplayState.SMALL);
        getAccelChangeListener().addAction(action.getKey(), button);
        addDefaultToggleHandler(context, action, button);
        strip.add(button);
       
        action = context.getBuilder().getMode().getAction("FitToPage");       
        button = RibbonActionContributorFactory.createCommandButton(action);       
        button.setDisplayState(CommandButtonDisplayState.MEDIUM);
        getAccelChangeListener().addAction(action.getKey(), button);
        addDefaultToggleHandler(context, action, button);
        strip.add(button);
       
        band.addFlowComponent(strip);
       
        List<RibbonBandResizePolicy> policies = new ArrayList<RibbonBandResizePolicy>();       
        policies.add(new CoreRibbonResizePolicies.FlowTwoRows(band.getControlPanel()));
View Full Code Here

        JRibbonComponent styleComboWrapper = new JRibbonComponent((JComponent) styleBox);
        styleComboWrapper.setKeyTip("SD");
        addDefaultToggleHandler(context, styleComboWrapper);
        band.addFlowComponent(styleComboWrapper);

        JCommandButtonStrip styleStrip = new JCommandButtonStrip();

        AFreeplaneAction action = context.getBuilder().getMode().getAction("BoldAction");
        final JCommandToggleButton boldButton = RibbonActionContributorFactory.createCommandToggleButton(action);
        addDefaultToggleHandler(context, action, boldButton);       
        styleStrip.add(boldButton);

        action = context.getBuilder().getMode().getAction("ItalicAction");
        final JCommandToggleButton italicButton = RibbonActionContributorFactory.createCommandToggleButton(action);
        addDefaultToggleHandler(context, action, italicButton);
        styleStrip.add(italicButton);
       
        action = context.getBuilder().getMode().getAction("NodeColorAction");
        JCommandButton button = RibbonActionContributorFactory.createCommandButton(action);
        addDefaultToggleHandler(context, action, button);
        styleStrip.add(button);
       
        action = context.getBuilder().getMode().getAction("NodeBackgroundColorAction");
        button = RibbonActionContributorFactory.createCommandButton(action);
        addDefaultToggleHandler(context, action, button);
        styleStrip.add(button);
       
        action = context.getBuilder().getMode().getAction("NodeColorBlendAction");
        button = RibbonActionContributorFactory.createCommandButton(action);
        addDefaultToggleHandler(context, action, button);
        styleStrip.add(button);
       
        action = context.getBuilder().getMode().getAction("BlinkingNodeHookAction");
        button = RibbonActionContributorFactory.createCommandButton(action);
        addDefaultToggleHandler(context, action, button);
        styleStrip.add(button);
       
        action = context.getBuilder().getMode().getAction("MapBackgroundColorAction");
        button = RibbonActionContributorFactory.createCommandButton(action);
        addDefaultToggleHandler(context, action, button);
        styleStrip.add(button);
               
        band.addFlowComponent(styleStrip);
       
        action = context.getBuilder().getMode().getAction("RemoveFormatAction");       
        button = RibbonActionContributorFactory.createCommandButton(action);
View Full Code Here

TOP

Related Classes of org.pushingpixels.flamingo.api.common.JCommandButtonStrip

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.