Examples of JCommandButton


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

  }

  @Override
  protected JCommandButton createActionAndPopupMainActionButton(
      CommandButtonDisplayState state) {
    JCommandButton result = new JCommandButton(resourceBundle
        .getString("Cut.text"));
    result.setExtraText(resourceBundle.getString("Cut.textExtra"));
    result.setPopupCallback(new TestPopupCallback());
    result
        .setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION);
    result.setDisplayState(state);
    result.setFlat(false);
    result.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        System.out.println(stamp() + ": Cut");
      }
    });
    return result;
View Full Code Here

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

  }

  @Override
  protected JCommandButton createActionAndPopupMainPopupButton(
      CommandButtonDisplayState state) {
    JCommandButton result = new JCommandButton(resourceBundle
        .getString("Copy.text"));
    result.setExtraText(resourceBundle.getString("Copy.textExtra"));
    result.setPopupCallback(new TestPopupCallback());
    result
        .setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_POPUP);
    result.setDisplayState(state);
    result.setFlat(false);
    result.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        System.out.println(stamp() + ": Copy");
      }
    });
    return result;
View Full Code Here

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

    return result;
  }

  @Override
  protected JCommandButton createPopupButton(CommandButtonDisplayState state) {
    JCommandButton result = new JCommandButton(resourceBundle
        .getString("SelectAll.text"));
    result.setExtraText(resourceBundle.getString("SelectAll.textExtra"));
    result.setPopupCallback(new TestPopupCallback());
    result
        .setCommandButtonKind(JCommandButton.CommandButtonKind.POPUP_ONLY);
    result.setDisplayState(state);
    result.setFlat(false);
    return result;
  }
View Full Code Here

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

  private static void apply(Container cont, Command cmd) {
    for (int i = 0; i < cont.getComponentCount(); i++) {
      Component comp = cont.getComponent(i);
      if (comp instanceof JCommandButton) {
        JCommandButton cb = (JCommandButton) comp;
        cmd.apply(cb);
      }
      if (comp instanceof Container) {
        apply((Container) comp, cmd);
      }
View Full Code Here

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

      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

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

      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

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

      CommandButtonDisplayState state,
      CommandButtonKind commandButtonKind, int fontSize) {
    ResizableIcon mainPasteIcon = SvgBatikResizableIcon.getSvgIcon(
        TestCommandButtons.class.getClassLoader().getResource(
            "test/svg/edit-paste.svg"), new Dimension(32, 32));
    JCommandButton mainButton = new JCommandButton(text, mainPasteIcon);
    mainButton.setDisabledIcon(new FilteredResizableIcon(mainPasteIcon,
        new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY),
            null)));
    // mainButton.setMnemonic('P');
    mainButton.setExtraText("Extra for " + text.toLowerCase());
    mainButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        System.out.println("Action invoked");
      }
    });
    mainButton.setPopupCallback(new PopupPanelCallback() {
      @Override
      public JPopupPanel getPopupPanel(JCommandButton commandButton) {
        return new SamplePopupMenu(commandButton
            .getComponentOrientation());
      }
    });
    mainButton.setCommandButtonKind(commandButtonKind);
    mainButton.setDisplayState(state);
    mainButton.setFlat(false);
    mainButton.setFont(mainButton.getFont().deriveFont((float) fontSize));
    return mainButton;
  }
View Full Code Here

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

      private JRibbonBand createBand(int buttonCount, String title,
          String titlePrefix) {
        JRibbonBand result = new JRibbonBand(title,
            new EmptyResizableIcon(32));
        for (int i = 0; i < buttonCount; i++) {
          result.addCommandButton(new JCommandButton(titlePrefix
              + (i + 1), new EmptyResizableIcon(32)),
              RibbonElementPriority.TOP);
        }
        return result;
      }
View Full Code Here

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

  private static JRibbonBand getSampleRibbonBand(
      ActionListener expandActionListener) {
    JRibbonBand clipboardBand = new JRibbonBand("Clipboard",
        new edit_paste(), expandActionListener);

    JCommandButton mainButton = new JCommandButton("Paste",
        new edit_paste());
    mainButton
        .setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION);
    clipboardBand.addCommandButton(mainButton, RibbonElementPriority.TOP);

    JCommandButton cutButton = new JCommandButton("Cut", new edit_cut());
    cutButton
        .setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION);
    clipboardBand.addCommandButton(cutButton, RibbonElementPriority.MEDIUM);

    JCommandButton copyButton = new JCommandButton("Copy", new edit_copy());
    copyButton
        .setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_POPUP);
    clipboardBand
        .addCommandButton(copyButton, RibbonElementPriority.MEDIUM);

    JCommandButton formatButton = new JCommandButton("Format",
        new edit_paste());
    formatButton
        .setCommandButtonKind(JCommandButton.CommandButtonKind.POPUP_ONLY);
    clipboardBand.addCommandButton(formatButton,
        RibbonElementPriority.MEDIUM);

    List<RibbonBandResizePolicy> resizePolicies = new ArrayList<RibbonBandResizePolicy>();
View Full Code Here

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

              List<AFreeplaneAction> openActions = lastOpenedList.createOpenLastMapActionList();
              for (AFreeplaneAction action : openActions) {
                String restoreable = (String) action.getValue(Action.DEFAULT);
                StringTokenizer tokens = new StringTokenizer(restoreable, ";");
                File file = lastOpenedList.createFileFromRestorable(tokens);
                JCommandButton menuButton = new JCommandButton(file.getName());
                menuButton.addActionListener(action);
                menuButton.setCommandButtonKind(CommandButtonKind.ACTION_ONLY);
                menuButton.setHorizontalAlignment(SwingUtilities.LEADING);
                menuButton.setPopupOrientationKind(CommandButtonPopupOrientationKind.SIDEWARD);
                menuButton.setEnabled(true);
                menuButton.setActionRichTooltip(new RichTooltip((String) action
                    .getValue(Action.SHORT_DESCRIPTION), file.toString()));
                secondary.addButtonToLastGroup(menuButton);
              }
              JScrollablePanel<JCommandButtonPanel> scrollPanel = new JScrollablePanel<JCommandButtonPanel>(
                  secondary, ScrollType.VERTICALLY);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.