Changeset 4410
- Timestamp:
- 2003-05-30T10:38:01+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPane.java
r4367 r4410 58 58 import org.greenstone.gatherer.msm.Metadata; 59 59 import org.greenstone.gatherer.msm.MSMEvent; 60 import org.greenstone.gatherer.msm.MSMListener; 60 61 import org.greenstone.gatherer.util.ArrayTools; 61 62 import org.greenstone.gatherer.util.DragGroup; … … 73 74 public class MetaEditPane 74 75 extends JPanel 75 implements ActionListener, ListSelectionListener, TreeModelListener, TreeSelectionListener {76 implements ActionListener, ListSelectionListener, TreeModelListener, TreeSelectionListener, MSMListener { 76 77 /** <i>true</i> if the selection has changed since the last time it was asked for, <i>false</i> otherwise. */ 77 78 public boolean has_changed = false; … … 282 283 collection_tree.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 283 284 collection_tree.setForeground(Gatherer.config.getColor("coloring.collection_tree_foreground", false)); 284 285 // Register our msm dependant components (or correctly their models) with msm. 285 286 if(model != null) { 287 // remove the listener first - in case its already present 288 Gatherer.c_man.getCollection().msm.removeMSMListener(model); 286 289 Gatherer.c_man.getCollection().msm.addMSMListener(model); 287 290 } 291 // register the pane itself as an MSMListener, so if we add a new metadata set, it will immediately show up. - remove itself first just in case 292 Gatherer.c_man.getCollection().msm.removeMSMListener(this); 293 Gatherer.c_man.getCollection().msm.addMSMListener(this); 294 288 295 tree.setElementModel(Gatherer.c_man.getCollection().msm.getElementModel()); 296 289 297 } 290 298 else { … … 562 570 this.add(external_split, BorderLayout.CENTER); 563 571 } 572 573 /** Method that is called whenever an element within a set is changed or modified. - needed for MSMListener 574 * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired. 575 */ 576 public void elementChanged(MSMEvent event) {} 577 564 578 /** Ensures a certain tree path is expanded, visible and selected within the collection tree. 565 579 * @param path The <strong>TreePath</strong> to make visible. … … 604 618 public Metadata getSelectedMetadata() { 605 619 return selected_metadata; 620 } 621 622 /** Called whenever the metadata value changes in some way, such as the addition of a new value. - needed for MSMListener 623 * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired. 624 */ 625 public void metadataChanged(MSMEvent event) {} 626 627 /** Method that is called whenever the metadata set collection changes in some way, such as the addition of a new set or the merging of two sets. - needed for MSMListener 628 * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired. 629 */ 630 public void setChanged(MSMEvent event){ 631 // call the collection tree value changed - we need to do the same stuff here 632 valueChanged((TreeSelectionEvent) null); 633 606 634 } 607 635 … … 717 745 } 718 746 } 747 748 /** Called whenever the value tree of an metadata element changes in some way, such as the addition of a new value. - needed for MSMListener 749 * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired. 750 */ 751 public void valueChanged(MSMEvent event) {} 719 752 720 753 /** This method is called whenever the selection within the collection … … 977 1010 } 978 1011 } 1012 979 1013 }
Note:
See TracChangeset
for help on using the changeset viewer.