Examples of JCommandButton


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

  }

  @Override
  protected JCommandButton createActionAndPopupMainActionButton(
      CommandButtonDisplayState state) {
    JCommandButton result = new JCommandButton(new edit_cut());
    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

      try {
        FileInputStream fis = new FileInputStream(
            "C:/JTools/icons/oxygen/categories/applications-accessories.svgz");
        SvgBatikResizableIcon icon = SvgBatikResizableIcon.getSvgzIcon(
            fis, new Dimension(32, 32));
        iconButton = new JCommandButton("just icon", icon);
        iconButton.setDisplayState(CommandButtonDisplayState.BIG);
        add(iconButton);
      } catch (IOException ioe) {
        ioe.printStackTrace();
      }
View Full Code Here

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

  }

  @Override
  protected JCommandButton createActionAndPopupMainPopupButton(
      CommandButtonDisplayState state) {
    JCommandButton result = new JCommandButton(new edit_copy());
    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(new edit_select_all());
    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

  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

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

  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());
      }
View Full Code Here

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

      this.componentListener = null;
    }
  }

  protected JCommandButton createLeadingScroller() {
    JCommandButton b = new JCommandButton(
        null,
        new DoubleArrowResizableIcon(
            new Dimension(9, 9),
            this.scrollablePanel.getScrollType() == ScrollType.HORIZONTALLY ? SwingConstants.WEST
                : SwingConstants.NORTH));

    b.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    b.setFocusable(false);
    b.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    b.putClientProperty(BasicCommandButtonUI.EMULATE_SQUARE_BUTTON,
        Boolean.TRUE);
    b.putClientProperty(BasicCommandButtonUI.DONT_DISPOSE_POPUPS,
        Boolean.TRUE);
    return b;
  }
View Full Code Here

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

        Boolean.TRUE);
    return b;
  }

  protected JCommandButton createTrailingScroller() {
    JCommandButton b = new JCommandButton(
        null,
        new DoubleArrowResizableIcon(
            new Dimension(9, 9),
            this.scrollablePanel.getScrollType() == ScrollType.HORIZONTALLY ? SwingConstants.EAST
                : SwingConstants.SOUTH));

    b.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    b.setFocusable(false);
    b.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    b.putClientProperty(BasicCommandButtonUI.EMULATE_SQUARE_BUTTON,
        Boolean.TRUE);
    b.putClientProperty(BasicCommandButtonUI.DONT_DISPOSE_POPUPS,
        Boolean.TRUE);
    return b;
  }
View Full Code Here

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

import test.svg.transcoded.edit_paste;

public class TestCommandButtonsNoIcon extends TestCommandButtons {
  @Override
  protected JCommandButton createActionButton(CommandButtonDisplayState state) {
    JCommandButton result = new JCommandButton(resourceBundle
        .getString("Paste.text"));
    result.setExtraText(resourceBundle.getString("Paste.textExtra"));
    result.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        System.out.println(stamp() + ": Main paste");
      }
    });
    result
        .setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_ONLY);
    result.setDisplayState(state);
    result.setFlat(false);
    return result;
  }
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.