Examples of JCommandButton


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

     * Prepare a button for the popup panel for plugin general actions.
     * @param m PluginGeneralActionsManipulator for the button
     * @return JCommandButton for the manipulator
     */
    private JCommandButton preparePluginGeneralActionsButton(final PluginGeneralActionsManipulator m) {
        JCommandButton button = new JCommandButton(m.getName(), m.getIcon() != null ? ImageWrapperResizableIcon.getIcon(ImageUtilities.icon2Image(m.getIcon()), new Dimension(16, 16)) : null);//Convert icon to Image if it is not null
        button.setDisplayState(CommandButtonDisplayState.BIG);
        button.setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_ONLY);
        if (m.getDescription() != null && !m.getDescription().isEmpty()) {
            button.setToolTipText(m.getDescription());
        }
        if (m.canExecute()) {
            button.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    DataLaboratoryHelper.getDefault().executeManipulator(m);
                }
            });
        } else {
            button.setEnabled(false);
        }
        return button;
    }
View Full Code Here

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

      @Override
      protected void executeInEDT() throws Throwable {
        buttonFrame = new JFrame();
        buttonFrame.setLayout(new FlowLayout());

        button = new JCommandButton("test1", icon1);
        button.setDisplayState(CommandButtonDisplayState.BIG);
        buttonFrame.add(button);

        buttonFrame.setSize(300, 200);
        buttonFrame.setLocationRelativeTo(null);
View Full Code Here

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

      @Override
      protected void executeInEDT() throws Throwable {
        buttonFrame = new JFrame();
        buttonFrame.setLayout(new FlowLayout());

        button1 = new JCommandButton("test1", icon1);
        button1.setDisplayState(CommandButtonDisplayState.BIG);
        buttonFrame.add(button1);

        button2 = new JCommandButton("test2", icon2);
        button2.setDisplayState(CommandButtonDisplayState.BIG);
        buttonFrame.add(button2);

        buttonFrame.setSize(300, 200);
        buttonFrame.setLocationRelativeTo(null);
View Full Code Here

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

      @Override
      protected void executeInEDT() throws Throwable {
        buttonFrame = new JFrame();
        buttonFrame.setLayout(new FlowLayout());

        button1 = new JCommandButton(icon1);
        button1.setDisplayState(CommandButtonDisplayState.BIG);
        buttonFrame.add(button1);

        button2 = new JCommandButton(icon2);
        button2.setDisplayState(CommandButtonDisplayState.BIG);
        buttonFrame.add(button2);

        buttonFrame.setSize(300, 200);
        buttonFrame.setLocationRelativeTo(null);
View Full Code Here

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

      @Override
      protected void executeInEDT() throws Throwable {
        buttonFrame = new JFrame();
        buttonFrame.setLayout(new FlowLayout());

        button1 = new JCommandButton("test");
        button1.setDisplayState(CommandButtonDisplayState.BIG);
        buttonFrame.add(button1);

        button2 = new JCommandButton("test");
        button2.setDisplayState(CommandButtonDisplayState.BIG);
        buttonFrame.add(button2);

        buttonFrame.setSize(300, 200);
        buttonFrame.setLocationRelativeTo(null);
View Full Code Here

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

      super(initialDim, direction);
    }

    @Override
    protected boolean toPaintEnabled(Component c) {
      JCommandButton jcb = (JCommandButton) c;
      return jcb.isEnabled() && jcb.getPopupModel().isEnabled();
    }
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 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

      try {
        FileInputStream fis = new FileInputStream(
            "C:/jtools/tango-icon-theme-0.8.0/scalable/actions/edit-paste.svg");
        SvgBatikResizableIcon icon = SvgBatikResizableIcon.getSvgIcon(
            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

import test.svg.transcoded.*;

public class TestCommandButtonsNoText extends TestCommandButtons {
  @Override
  protected JCommandButton createActionButton(CommandButtonDisplayState state) {
    JCommandButton result = new JCommandButton(new edit_paste());
    result.setDisabledIcon(new FilteredResizableIcon(new edit_paste(),
        new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY),
            null)));
    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.