Examples of ActionButton


Examples of org.jfree.report.modules.gui.swing.common.action.ActionButton

    mainPanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));

    final JLabel lblFileName = new JLabel(getResources().getString("pdfsavedialog.filename"));
    final JLabel lblEncoding = new JLabel(getResources().getString("pdfsavedialog.encoding"));

    final JButton btnSelect = new ActionButton(new ActionSelectFile(getResources()));
    txFilename = new JTextField();
    statusBar = new JStatusBar();

    encodingModel = EncodingComboBoxModel.createDefaultModel(Locale.getDefault());
    encodingModel.addEncodingUnchecked("Identity-H", "PDF-Unicode encoding");
    encodingModel.addEncodingUnchecked("Identity-V", "PDF-Unicode encoding");
    encodingModel.sort();

    final JComboBox cbEncoding = new JComboBox(encodingModel);

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(3, 1, 1, 1);
    mainPanel.add(lblFileName, gbc);

    gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 1;
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.ipadx = 120;
    gbc.insets = new Insets(3, 1, 1, 1);
    mainPanel.add(txFilename, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 2;
    gbc.gridy = 0;
    mainPanel.add(btnSelect, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.insets = new Insets(1, 1, 1, 1);
    mainPanel.add(lblEncoding, gbc);

    gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 1;
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.ipadx = 120;
    gbc.insets = new Insets(1, 1, 1, 1);
    mainPanel.add(cbEncoding, gbc);

    final JButton btnCancel = new ActionButton(getCancelAction());
    final JButton btnConfirm = new ActionButton(getConfirmAction());
    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout(1, 2, 5, 5));
    buttonPanel.add(btnConfirm);
    buttonPanel.add(btnCancel);
    btnConfirm.setDefaultCapable(true);
    getRootPane().setDefaultButton(btnConfirm);
    buttonPanel.registerKeyboardAction(getConfirmAction(),
            KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
            JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
View Full Code Here

Examples of org.jfree.report.modules.gui.swing.common.action.ActionButton

    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 2;
    gbc.gridy = 0;
    final HtmlZipExportDialog.ActionSelectTargetFile selectTargetAction =
        new HtmlZipExportDialog.ActionSelectTargetFile(getResources());
    contentPane.add(new ActionButton(selectTargetAction), gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.gridwidth = 1;
    gbc.weightx = 1;
    gbc.insets = new Insets(1, 1, 1, 1);
    contentPane.add(dataDirField, gbc);


    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 0;
    gbc.gridy = 2;
    contentPane.add(exportMethodLabel, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 1;
    gbc.gridy = 2;
    gbc.gridwidth = 1;
    gbc.insets = new Insets(1, 1, 1, 1);
    contentPane.add(exportTypeSelectionPanel, gbc);


    final JButton btnCancel = new ActionButton(getCancelAction());
    final JButton btnConfirm = new ActionButton(getConfirmAction());

    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout());
    buttonPanel.add(btnConfirm);
    buttonPanel.add(btnCancel);
    btnConfirm.setDefaultCapable(true);
    buttonPanel.registerKeyboardAction(getConfirmAction(),
        KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
        JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);

    gbc = new GridBagConstraints();
View Full Code Here

Examples of org.jfree.report.modules.gui.swing.common.action.ActionButton

   * @return a button based on the supplied action.
   */
  private static JButton createButton(final Action action,
                                      final SwingGuiContext swingGuiContext)
  {
    final JButton button = new ActionButton(action);
    boolean needText = true;
    if (isLargeButtonsEnabled(swingGuiContext))
    {
      final Icon icon = (Icon) action.getValue(SwingCommonModule.LARGE_ICON_PROPERTY);
      if (icon != null && (icon.getIconHeight() > 1 && icon.getIconHeight() > 1))
      {
        button.setIcon(icon);
        needText = false;
      }
    }
    else
    {
      final Icon icon = (Icon) action.getValue(Action.SMALL_ICON);
      if (icon != null && (icon.getIconHeight() > 1 && icon.getIconHeight() > 1))
      {
        button.setIcon(icon);
        needText = false;
      }
    }

    if (needText)
    {
      final Object value = action.getValue(Action.NAME);
      if (value != null)
      {
        button.setText(String.valueOf(value));
      }
    }
    else
    {
      button.setText(null);
      button.setMargin(new Insets(0, 0, 0, 0));
    }

    return button;
  }
View Full Code Here

Examples of org.jfree.report.modules.gui.swing.common.action.ActionButton

    final JPanel buttonPane = new JPanel();
    buttonPane.setLayout(new FlowLayout(2));
    buttonPane.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    final OKAction okAction = new OKAction();

    final JButton ok = new ActionButton(okAction);
    final JButton details = new ActionButton(detailsAction);

    buttonPane.add(ok);
    buttonPane.add(details);
    return buttonPane;
  }
View Full Code Here

Examples of org.jfree.report.modules.gui.swing.common.action.ActionButton

    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 2;
    gbc.gridy = 0;
    final ActionSelectTargetFile selectTargetAction =
        new ActionSelectTargetFile(getResources());
    contentPane.add(new ActionButton(selectTargetAction), gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.gridwidth = 1;
    gbc.weightx = 1;
    gbc.insets = new Insets(1, 1, 1, 1);
    contentPane.add(dataDirField, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 0;
    gbc.gridy = 2;
    contentPane.add(exportMethodLabel, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 1;
    gbc.gridy = 2;
    gbc.gridwidth = 1;
    gbc.insets = new Insets(1, 1, 1, 1);
    contentPane.add(exportTypeSelectionPanel, gbc);


    final JButton btnCancel = new ActionButton(getCancelAction());
    final JButton btnConfirm = new ActionButton(getConfirmAction());

    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout());
    buttonPanel.add(btnConfirm);
    buttonPanel.add(btnCancel);
    btnConfirm.setDefaultCapable(true);
    buttonPanel.registerKeyboardAction(getConfirmAction(),
        KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
        JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);

    gbc = new GridBagConstraints();
View Full Code Here

Examples of org.jfree.ui.action.ActionButton

    mainPanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));

    final JLabel lblFileName = new JLabel(getResources().getString("pdfsavedialog.filename"));
    final JLabel lblEncoding = new JLabel(getResources().getString("pdfsavedialog.encoding"));

    final JButton btnSelect = new ActionButton(new ActionSelectFile(getResources()));
    txFilename = new JTextField();
    statusBar = new JStatusBar();

    encodingModel = EncodingComboBoxModel.createDefaultModel(Locale.getDefault());
    encodingModel.addEncodingUnchecked("Identity-H", "PDF-Unicode encoding");
    encodingModel.addEncodingUnchecked("Identity-V", "PDF-Unicode encoding");
    encodingModel.sort();

    final JComboBox cbEncoding = new JComboBox(encodingModel);

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(3, 1, 1, 1);
    mainPanel.add(lblFileName, gbc);

    gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 1;
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.ipadx = 120;
    gbc.insets = new Insets(3, 1, 1, 1);
    mainPanel.add(txFilename, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 2;
    gbc.gridy = 0;
    mainPanel.add(btnSelect, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.insets = new Insets(1, 1, 1, 1);
    mainPanel.add(lblEncoding, gbc);

    gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 1;
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.ipadx = 120;
    gbc.insets = new Insets(1, 1, 1, 1);
    mainPanel.add(cbEncoding, gbc);

    final JButton btnCancel = new ActionButton(getCancelAction());
    final JButton btnConfirm = new ActionButton(getConfirmAction());
    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout(1, 2, 5, 5));
    buttonPanel.add(btnConfirm);
    buttonPanel.add(btnCancel);
    btnConfirm.setDefaultCapable(true);
    getRootPane().setDefaultButton(btnConfirm);
    buttonPanel.registerKeyboardAction(getConfirmAction(),
            KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
            JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
View Full Code Here

Examples of org.jfree.ui.action.ActionButton

    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 2;
    gbc.gridy = 0;
    final ActionSelectTargetFile selectTargetAction =
        new ActionSelectTargetFile(getResources());
    contentPane.add(new ActionButton(selectTargetAction), gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.gridwidth = 1;
    gbc.weightx = 1;
    gbc.insets = new Insets(1, 1, 1, 1);
    contentPane.add(dataDirField, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 0;
    gbc.gridy = 2;
    contentPane.add(exportMethodLabel, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 1;
    gbc.gridy = 2;
    gbc.gridwidth = 1;
    gbc.insets = new Insets(1, 1, 1, 1);
    contentPane.add(exportTypeSelectionPanel, gbc);


    final JButton btnCancel = new ActionButton(getCancelAction());
    final JButton btnConfirm = new ActionButton(getConfirmAction());

    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout());
    buttonPanel.add(btnConfirm);
    buttonPanel.add(btnCancel);
    btnConfirm.setDefaultCapable(true);
    buttonPanel.registerKeyboardAction(getConfirmAction(),
        KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
        JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);

    gbc = new GridBagConstraints();
View Full Code Here

Examples of org.jfree.ui.action.ActionButton

    mainPanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));

    final JLabel lblFileName = new JLabel(getResources().getString("pdfsavedialog.filename"));
    final JLabel lblEncoding = new JLabel(getResources().getString("pdfsavedialog.encoding"));

    final JButton btnSelect = new ActionButton(new ActionSelectFile(getResources()));
    txFilename = new JTextField();
    statusBar = new JStatusBar();

    encodingModel = EncodingComboBoxModel.createDefaultModel(Locale.getDefault());
    encodingModel.addEncodingUnchecked("Identity-H", "PDF-Unicode encoding");
    encodingModel.addEncodingUnchecked("Identity-V", "PDF-Unicode encoding");
    encodingModel.sort();

    final JComboBox cbEncoding = new JComboBox(encodingModel);

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(3, 1, 1, 1);
    mainPanel.add(lblFileName, gbc);

    gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 1;
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.ipadx = 120;
    gbc.insets = new Insets(3, 1, 1, 1);
    mainPanel.add(txFilename, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 2;
    gbc.gridy = 0;
    mainPanel.add(btnSelect, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.insets = new Insets(1, 1, 1, 1);
    mainPanel.add(lblEncoding, gbc);

    gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 1;
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.ipadx = 120;
    gbc.insets = new Insets(1, 1, 1, 1);
    mainPanel.add(cbEncoding, gbc);

    final JButton btnCancel = new ActionButton(getCancelAction());
    final JButton btnConfirm = new ActionButton(getConfirmAction());
    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout(1, 2, 5, 5));
    buttonPanel.add(btnConfirm);
    buttonPanel.add(btnCancel);
    btnConfirm.setDefaultCapable(true);
    getRootPane().setDefaultButton(btnConfirm);
    buttonPanel.registerKeyboardAction(getConfirmAction(),
            KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
            JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
View Full Code Here

Examples of org.jfree.ui.action.ActionButton

    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 2;
    gbc.gridy = 0;
    final HtmlZipExportDialog.ActionSelectTargetFile selectTargetAction =
        new HtmlZipExportDialog.ActionSelectTargetFile(getResources());
    contentPane.add(new ActionButton(selectTargetAction), gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.gridwidth = 1;
    gbc.weightx = 1;
    gbc.insets = new Insets(1, 1, 1, 1);
    contentPane.add(dataDirField, gbc);


    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 0;
    gbc.gridy = 2;
    contentPane.add(exportMethodLabel, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 1;
    gbc.gridy = 2;
    gbc.gridwidth = 1;
    gbc.insets = new Insets(1, 1, 1, 1);
    contentPane.add(exportTypeSelectionPanel, gbc);


    final JButton btnCancel = new ActionButton(getCancelAction());
    final JButton btnConfirm = new ActionButton(getConfirmAction());

    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout());
    buttonPanel.add(btnConfirm);
    buttonPanel.add(btnCancel);
    btnConfirm.setDefaultCapable(true);
    buttonPanel.registerKeyboardAction(getConfirmAction(),
        KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
        JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);

    gbc = new GridBagConstraints();
View Full Code Here

Examples of org.nasutekds.guitools.controlpanel.ui.components.ActionButton

      gbc2.gridy = 0;
      gbc2.weightx = 1;
      gbc2.fill = GridBagConstraints.HORIZONTAL;
      for (Action action : category.getActions())
      {
        final ActionButton b = new ActionButton(action);
        actions.add(b);
        b.addActionListener(new ActionListener()
        {
          /**
           * {@inheritDoc}
           */
          public void actionPerformed(ActionEvent ev)
          {
            // Constructs the panels using reflection.
            Action action = b.getActionObject();
            GenericFrame frame = frames.get(action);
            if (frame == null)
            {
              Class<? extends StatusGenericPanel> panelClass =
                action.getAssociatedPanelClass();
              try
              {
                Constructor<? extends StatusGenericPanel> constructor =
                  panelClass.getDeclaredConstructor();
                StatusGenericPanel panel = constructor.newInstance();
                if (getInfo() != null)
                {
                  panel.setInfo(getInfo());
                }
                frame = createFrame(panel);

                frames.put(action, frame);
                Utilities.centerGoldenMean(frame,
                    Utilities.getFrame(MainActionsPane.this));
              }
              catch (Throwable t)
              {
                // Bug
                t.printStackTrace();
              }
            }
            if (!frame.isVisible())
            {
              frame.setVisible(true);
            }
            else
            {
              frame.toFront();
            }
          }
        });
        categoryPanel.add(b, gbc2);
        gbc2.gridy++;
        group.add(b);
        maxWidth = Math.max(maxWidth, b.getPreferredSize().width);
      }
      CategoryPanel p = new CategoryPanel(categoryPanel, category);
      maxWidth = Math.max(maxWidth, p.getPreferredSize().width);
      p.setExpanded(false);
      add(p, gbc1);
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.