Changeset 5217


Ignore:
Timestamp:
2003-08-19T16:56:40+12:00 (21 years ago)
Author:
mdewsnip
Message:

Changed "move to top/up/down/bottom" buttons to be DoubleImageButtons.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/PlugInManager.java

    r5207 r5217  
    4343import org.greenstone.gatherer.cdm.DynamicListModel;
    4444import org.greenstone.gatherer.cdm.PlugIn;
     45import org.greenstone.gatherer.gui.DoubleImageButton;
    4546import org.greenstone.gatherer.gui.GComboBox;
    4647import org.greenstone.gatherer.msm.MSMUtils;
     
    594595        instructions.setRows(6);
    595596        instructions.setWrapStyleWord(true);
    596         move_bottom = new JButton();
    597         JLabel move_bottom_label = new JLabel(get("CDM.Move.Move_Bottom"));
    598         move_bottom_label.setHorizontalAlignment(JLabel.CENTER);
    599         move_bottom_label.setPreferredSize(LABEL_SIZE);
    600         move_bottom.setLayout(new BorderLayout());
    601         move_bottom.add(new JLabel(Utility.getImage("arrow-bottom.gif")), BorderLayout.WEST);
    602         move_bottom.add(move_bottom_label, BorderLayout.CENTER);
    603         move_bottom.add(new JLabel(Utility.getImage("arrow-bottom.gif")), BorderLayout.EAST);
     597
     598        move_top = new DoubleImageButton(get("CDM.Move.Move_Top"), Utility.getImage("arrow-top.gif"), Utility.getImage("arrow-top-disabled.gif"));
     599        move_top.setEnabled(false);
     600        move_top.setMnemonic(KeyEvent.VK_T);
     601        move_top.setDisplayedMnemonicIndex(8);  // !! English-centric hack
     602        move_top.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE);
     603        move_up = new DoubleImageButton(get("CDM.Move.Move_Up"), Utility.getImage("arrow-up.gif"), Utility.getImage("arrow-up-disabled.gif"));
     604        move_up.setEnabled(false);
     605        move_up.setMnemonic(KeyEvent.VK_U);
     606        move_up.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE);
     607        move_down = new DoubleImageButton(get("CDM.Move.Move_Down"), Utility.getImage("arrow-down.gif"), Utility.getImage("arrow-down-disabled.gif"));
     608        move_down.setEnabled(false);
     609        move_down.setMnemonic(KeyEvent.VK_D);
     610        move_down.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE);
     611        move_bottom = new DoubleImageButton(get("CDM.Move.Move_Bottom"), Utility.getImage("arrow-bottom.gif"), Utility.getImage("arrow-bottom-disabled.gif"));
     612        move_bottom.setEnabled(false);
    604613        move_bottom.setMnemonic(KeyEvent.VK_B);
    605         move_down = new JButton();
    606         JLabel move_down_label = new JLabel(get("CDM.Move.Move_Down"));
    607         move_down_label.setHorizontalAlignment(JLabel.CENTER);
    608         move_down_label.setPreferredSize(LABEL_SIZE);
    609         move_down.setLayout(new BorderLayout());
    610         move_down.add(new JLabel(Utility.getImage("arrow-down.gif")), BorderLayout.WEST);
    611         move_down.add(move_down_label, BorderLayout.CENTER);
    612         move_down.add(new JLabel(Utility.getImage("arrow-down.gif")), BorderLayout.EAST);
    613         move_down.setMnemonic(KeyEvent.VK_D);
    614         move_top = new JButton();
    615         JLabel move_top_label = new JLabel(get("CDM.Move.Move_Top"));
    616         move_top_label.setHorizontalAlignment(JLabel.CENTER);
    617         move_top_label.setPreferredSize(LABEL_SIZE);
    618         move_top.setLayout(new BorderLayout());
    619         move_top.add(new JLabel(Utility.getImage("arrow-top.gif")), BorderLayout.WEST);
    620         move_top.add(move_top_label, BorderLayout.CENTER);
    621         move_top.add(new JLabel(Utility.getImage("arrow-top.gif")), BorderLayout.EAST);
    622         move_top.setMnemonic(KeyEvent.VK_T);
    623         move_up = new JButton();
    624         JLabel move_up_label = new JLabel(get("CDM.Move.Move_Up"));
    625         move_up_label.setHorizontalAlignment(JLabel.CENTER);
    626         move_up_label.setPreferredSize(LABEL_SIZE);
    627         move_up.setLayout(new BorderLayout());
    628         move_up.add(new JLabel(Utility.getImage("arrow-up.gif")), BorderLayout.WEST);
    629         move_up.add(move_up_label, BorderLayout.CENTER);
    630         move_up.add(new JLabel(Utility.getImage("arrow-up.gif")), BorderLayout.EAST);
    631         move_up.setMnemonic(KeyEvent.VK_U);
     614        move_bottom.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE);
     615
    632616        movement_pane = new JPanel();
    633617
     
    696680        plugin_pane.add(plugin);
    697681
    698                 // Scope these mad bordering skillz.
     682        // Scope these mad bordering skillz.
    699683        JPanel temp = new JPanel(new BorderLayout());
    700684        temp.setBorder
     
    704688          (BorderFactory.createTitledBorder(get("Controls")),
    705689           BorderFactory.createEmptyBorder(2,2,2,2))));
    706                                                                      
     690
    707691        temp.add(plugin_pane, BorderLayout.NORTH);
    708692        temp.add(button_pane, BorderLayout.SOUTH);
     
    841825
    842826        public void valueChanged(ListSelectionEvent e) {
    843         if (!e.getValueIsAdjusting()) { // we get two events for one change in list selection - use the false one ( the second one)
     827        if (!e.getValueIsAdjusting()) { // we get two events for one change in list selection - use the false one (the second one)
    844828            if (plugin_list.isSelectionEmpty()) {
     829            move_top.setEnabled(false);
     830            move_up.setEnabled(false);
     831            move_down.setEnabled(false);
     832            move_bottom.setEnabled(false);
    845833            configure.setEnabled(false);
    846834            remove.setEnabled(false);
    847             } else {
     835            }
     836            else {
     837            move_top.setEnabled(true);
     838            move_up.setEnabled(true);
     839            move_down.setEnabled(true);
     840            move_bottom.setEnabled(true);
    848841            configure.setEnabled(true);
    849842            remove.setEnabled(true);
Note: See TracChangeset for help on using the changeset viewer.