Changeset 8837


Ignore:
Timestamp:
2004-12-17T09:27:35+13:00 (19 years ago)
Author:
mdewsnip
Message:

Right-clicking on a table row now selects it correctly. By Matthew Whyte.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gems/GEMS.java

    r8821 r8837  
    556556    button_label_pane.setLayout(new GridLayout(4,1,0,2));
    557557    button_label_pane.setBorder(BorderFactory.createEmptyBorder(0,0,0,2));
    558     //button_label_pane.add(set_label);
    559     // button_label_pane.add(file_label);
    560     //button_label_pane.add(element_label);
    561     //button_label_pane.add(attribute_label);
    562     //button_label_pane.add(value_label);
    563558
    564559    inner_button_pane.setLayout(new GridLayout(4,3,0,2));       
    565     //inner_button_pane.add(add_set);
    566     //inner_button_pane.add(edit_set_pane);
    567     //inner_button_pane.add(remove_set);
    568        
    569      //inner_button_pane.add(add_file);
    570      //inner_button_pane.add(edit_file_pane);
    571     // inner_button_pane.add(remove_file);
    572        
    573     //inner_button_pane.add(add_element);
    574     //inner_button_pane.add(edit_element_pane);
    575     //inner_button_pane.add(remove_element);
    576     //inner_button_pane.add(add_attribute);
    577     //inner_button_pane.add(edit_attribute);
    578     //inner_button_pane.add(remove_attribute);
    579     //inner_button_pane.add(add_value);
    580     //inner_button_pane.add(edit_value);
    581     //inner_button_pane.add(remove_value);
    582560         
    583561    button_pane.setBorder(BorderFactory.createEmptyBorder(5,0,0,0));
     
    769747        // File -> Exit
    770748        if (event_source == file_exit) {
    771                 exit();
    772               /* 
    773                 if(set_changed == true) {
    774                     int result = JOptionPane.showOptionDialog(self, Dictionary.get("GEMS.Menu.Confirm_Exit_Save", Dictionary.get("GEMS.Element")), Dictionary.get("GEMS.Menu.Confirm_Exit_Save_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
    775        
    776                  //   System.out.println("Exit: "+result);
    777                     if(result == 0) {
    778                         msm.save();
    779                         exit();
    780                     }
    781                     else{
    782                         exit();
    783                     }
    784  
    785                 }
    786                 else{
    787                    
    788                     exit();
    789                 }*/
     749                exit(); //The exit() method checks if data needs saving.
     750             
    790751        }
    791752
     
    31083069        private void maybeShowPopup(MouseEvent e) {
    31093070           
    3110            //TreeNode oTreeNode = e.getSource().
     3071         //TreeNode oTreeNode = e.getSource().
    31113072         int selRow = mds_tree.getRowForLocation(e.getX(), e.getY());
    31123073     TreePath selPath = mds_tree.getPathForLocation(e.getX(), e.getY());
     3074     Point p = null;
    31133075            if (e.isPopupTrigger()) {
    31143076               // setPopup.show(e.getComponent(),
     
    31343096               
    31353097                    GEMSNode t = (GEMSNode)selPath.getLastPathComponent();
    3136                
    3137                
     3098           
     3099            mds_tree.setSelectionPath(selPath); //Select node right-clicked on
    31383100               
    31393101                if(t.type == ELEMENT){
     
    31653127                   
    31663128             }
    3167              else if(e.getSource() == set_attributes){
    3168                  
     3129             else if(e.getSource() == set_attributes){ //When right-click on table of set attributes
     3130         
     3131         //Select the table row that was right-clicked on.
     3132         p = e.getPoint();
     3133         set_attributes.changeSelection(set_attributes.rowAtPoint(p), set_attributes.columnAtPoint(p), false, false);
     3134
    31693135                 attributePopup.show(e.getComponent(),
     3136                           e.getX(), e.getY()); 
     3137             }
     3138             else if(e.getSource() == element_attributes)  { //When right-click on table of element attributes
     3139               
     3140         //Select the table row that was right-clicked on.
     3141         p = e.getPoint();
     3142         element_attributes.changeSelection(element_attributes.rowAtPoint(p), element_attributes.columnAtPoint(p), false, false);
     3143
     3144         attributePopup.show(e.getComponent(),
    31703145                           e.getX(), e.getY());
    3171                  
    3172              }
    3173              else if(e.getSource() == element_attributes)  {
    3174                  attributePopup.show(e.getComponent(),
    3175                            e.getX(), e.getY());
    3176                  
    31773146             }
    31783147               
Note: See TracChangeset for help on using the changeset viewer.