Examples of ImageButton


Examples of megamek.client.ui.AWT.widget.ImageButton

        panel.add(new AdvancedLabel(Messages
                .getString("CamoChoiceDialog.keep_old_camo")), layout); //$NON-NLS-1$
        layout.gridy++;

        // Create the "keep old camo" button.
        keep = new ImageButton();
        keep.setLabel(Messages.getString("CamoChoiceDialog.no_camo")); //$NON-NLS-1$
        keep.setPreferredSize(84, 72);
        keep.addActionListener(new ActionListener() {
            // Pressing this button closes without saving.
            public void actionPerformed(ActionEvent event) {
                close();
            }
        });
        keep.addKeyListener(new KeyAdapter() {
            public void keyPressed(KeyEvent event) {
                // Pressing enter on this button closes without saving.
                if (KeyEvent.VK_ENTER == event.getKeyCode()) {
                    close();
                }
            }
        });
        panel.add(keep, layout);
        layout.gridy++;

        // Add a label for the "select new camo" button.
        panel.add(new AdvancedLabel(Messages
                .getString("CamoChoiceDialog.select_new_camo")), layout); //$NON-NLS-1$
        layout.gridy++;

        // Create the "select new camo" button.
        select = new ImageButton();
        select.setLabel(Messages.getString("CamoChoiceDialog.no_camo")); //$NON-NLS-1$
        select.setPreferredSize(84, 72);
        select.addActionListener(this);
        panel.add(select, layout);
View Full Code Here

Examples of megamek.client.ui.AWT.widget.ImageButton

                    .getString("MegaMek.ScenarioDialog.otherh")); //$NON-NLS-1$
            m_typeChoices[x].add(Messages
                    .getString("MegaMek.ScenarioDialog.bot")); //$NON-NLS-1$
            final Color defaultBackground = m_typeChoices[x].getBackground();

            m_camoButtons[x] = new ImageButton();
            final ImageButton curButton = m_camoButtons[x];
            curButton.setLabel(Messages.getString("MegaMek.NoCamoBtn")); //$NON-NLS-1$
            curButton.setPreferredSize(84, 72);
            curButton.setBackground(PlayerColors.getColor(x));
            curButton.setActionCommand("camo"); //$NON-NLS-1$

            // When a camo button is pressed, remove any previous
            // listener from the dialog, update the dialog for the
            // button's player, and add a new listener.
            curButton.addActionListener(new ActionListener() {
                private final CamoChoiceDialog dialog = camoDialog;
                private final ImageButton button = curButton;
                private final Color background = defaultBackground;
                private final Player player = curPlayer;
View Full Code Here

Examples of megamek.client.ui.AWT.widget.ImageButton

                System.exit(0);
            }
        });

        // Display an image button to show the camo selection dialog.
        camo = new ImageButton();
        camo.setLabel("Choose...");
        camo.setPreferredSize(84, 72);
        camo.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                dialog.setVisible(true);
            }
        });
        camo.addKeyListener(new KeyAdapter() {
            public void keyPressed(KeyEvent event) {
                if (KeyEvent.VK_ENTER == event.getKeyCode()) {
                    dialog.setVisible(true);
                }
            }
        });
        frame.add(camo);

        // Construct a dialog.
        dialog = new Dialog(frame, "Choose a pattern", true);
        dialog.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                dialog.setVisible(false);
            }
        });

        // Create a main panel for the dialog.
        Panel main = new Panel();
        main.setLayout(new BorderLayout());
        dialog.add(main);

        // Create a list as the center of the dialog.
        list = new List(5);
        list.add("data/images/camo/Wood1.jpg");
        list.add("data/images/camo/Wood2.jpg");
        list.add("data/images/camo/Urban.jpg");
        list.add("data/images/camo/Winter.jpg");
        list.select(0);
        list.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent event) {
                imgButton.setImage(Toolkit.getDefaultToolkit()
                        .getImage(
                                (String) event.getItemSelectable()
                                        .getSelectedObjects()[0]));
            }
        });
        list.addKeyListener(new KeyAdapter() {
            public void keyPressed(KeyEvent event) {
                if (KeyEvent.VK_ENTER == event.getKeyCode()
                        || KeyEvent.VK_SPACE == event.getKeyCode()) {
                    Dimension size = imgButton.getPreferredSize();
                    camo.setBackground(imgButton.getBackground());
                    camo.setLabel(imgButton.getLabel());
                    camo.setImage(imgButton.getImage().getScaledInstance(
                            size.width, size.height, Image.SCALE_FAST));
                    dialog.setVisible(false);
                }
            }
        });
        main.add(list, BorderLayout.CENTER);

        // Create a panel for the buttons.
        Panel panel = new Panel();
        panel.setLayout(new GridLayout(0, 1));
        dialog.add(panel, BorderLayout.EAST);

        // Create a "camo" button on the panel.
        imgButton = new ImageButton();
        imgButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                Dimension size = imgButton.getPreferredSize();
                camo.setBackground(imgButton.getBackground());
                camo.setLabel(imgButton.getLabel());
View Full Code Here

Examples of megamek.client.ui.AWT.widget.ImageButton

        dialog = new CamoChoiceDialog(this);
        dialog.addItemListener(this);
        dialog.setCategory("flashhawk2k.zip");
        dialog.setItemName("camo1.jpg");

        butCamo = new ImageButton();
        Image[] array = (Image[]) dialog.getSelectedObjects();
        if (null != array)
            butCamo.setImage(array[0]);
        butCamo.setLabel("Choose Camo...");
        butCamo.setPreferredSize(84, 72);
View Full Code Here

Examples of nz.govt.natlib.meta.ui.ImageButton

  public PropertyEditorController(PropertyContainer properties) {

    view = new PropertyEditor(properties);
    try {
      ok = new ImageButton("Ok", new ImageIcon(ImagePanel
          .resolveImage("button_ok.gif")));
      cancel = new ImageButton("Close", new ImageIcon(ImagePanel
          .resolveImage("button_close.gif")));
      jbInit();
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

Examples of org.apache.uima.tools.util.gui.ImageButton

    annotationFeaturesViewer = new AnnotationFeaturesViewer();
    annotationFeaturesPanel.add(annotationFeaturesViewer, BorderLayout.CENTER);

    JPanel iconPanel = new JPanel();

    addTableEntryButton = new ImageButton(Images.FORWARD);
    addTableEntryButton.setToolTipText("Create stylemap table entry");
    addTableEntryButton.addActionListener(this);

    iconPanel.add(addTableEntryButton);

    annotationFeaturesPanel.add(iconPanel, BorderLayout.EAST);

    JPanel tablePanel = new JPanel();
    tablePanel.setLayout(new BorderLayout());

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true,
            annotationFeaturesPanel, tablePanel);
    Dimension screenDimension = getToolkit().getScreenSize();
    splitPane.setDividerLocation((int) (screenDimension.width * 0.28));

    okButton.setToolTipText("Save stylemap and exit");
    cancelButton.setToolTipText("Exit without saving");
    resetButton.setToolTipText("Reset stylemap to that auto-generated from metadata");

    JPanel buttonsPanel = new JPanel();
    buttonsPanel.add(okButton);
    buttonsPanel.add(cancelButton);
    buttonsPanel.add(resetButton);

    getContentPane().add(splitPane, BorderLayout.CENTER);
    getContentPane().add(buttonsPanel, BorderLayout.SOUTH);

    // creating a jtable to hold the styles

    tableModel = new StyleMapTableModel(StyleConstants.columnNames);
    med = new TableGUIMediator();
    annotationsTable = new StyleMapTable(tableModel, annotationFeaturesViewer, this, med);
    med.setTable(annotationsTable);

    annotationsTable.setDefaultRenderer(Color.class, new ColorRenderer(annotationsTable));
    setUpColorEditor(annotationsTable);
    annotationsTable.setDefaultEditor(String.class, new LabelCellEditor());

    final JScrollPane scrollPane = new JScrollPane();
    scrollPane.getViewport().add(annotationsTable, null);

    tablePanel.add(scrollPane, BorderLayout.CENTER);

    JPanel tableButtonsPanel = new JPanel();
    moveRowUpButton = new ImageButton(Images.UP);
    moveRowUpButton.setToolTipText("Move Row Up");
    moveRowUpButton.addActionListener(this);
    tableButtonsPanel.add(moveRowUpButton);

    moveRowDownButton = new ImageButton(Images.DOWN);
    moveRowDownButton.setToolTipText("Move Row Down");
    moveRowDownButton.addActionListener(this);
    tableButtonsPanel.add(moveRowDownButton);

    removeTableRowButton = new ImageButton(Images.ROW_DELETE);
    removeTableRowButton.setToolTipText("Delete Row");
    removeTableRowButton.addActionListener(this);
    tableButtonsPanel.add(removeTableRowButton);

    // pass all these to the mediator which turns them on and off
View Full Code Here

Examples of org.apache.wicket.markup.html.form.ImageButton

        }
      });

      add(new LinesListView("lines"));

      add(new ImageButton("saveButton"));

      add(new Link("resetButtonLink")
      {
        private static final long serialVersionUID = 1L;
View Full Code Here

Examples of org.drools.guvnor.client.common.ImageButton

            public void onChange(ChangeEvent event) {
                fillFieldConstrains();
            }
        });

        Image addNewConstraint = new ImageButton(images.newItem());
        addNewConstraint.setTitle(constants.AddNewConstraint());

        addNewConstraint.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                showNewConstrainPop();
            }
        });
View Full Code Here

Examples of org.drools.guvnor.client.common.ImageButton

        initWidget( layout );
    }

    private void doActions() {
        VerticalPanel actions = new VerticalPanel();
        Image add = new ImageButton( images.newItem() );
        add.setTitle( constants.AddANewCategory() );

        add.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent event) {
                doOKClick();
            }
        } );
View Full Code Here

Examples of org.drools.guvnor.client.common.ImageButton

            list.setWidget( i,
                            0,
                            new SmallLabel( data.getCategories()[i] ) );
            if ( !readOnly ) {

                Image del = new ImageButton( images.trash() );
                del.setTitle( constants.RemoveThisCategory() );
                del.addClickHandler( new ClickHandler() {
                    public void onClick(ClickEvent event) {
                        removeCategory( idx );
                    }
                } );
                list.setWidget( i,
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.