Changeset 4432
- Timestamp:
- 2003-05-30T14:37:40+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/msm/MSMPrompt.java
r4365 r4432 43 43 import javax.swing.event.*; 44 44 import org.greenstone.gatherer.Gatherer; 45 import org.greenstone.gatherer.gui.ModalDialog; 46 import org.greenstone.gatherer.gui.SimpleMenuBar; 45 47 import org.greenstone.gatherer.msm.Declarations; 46 48 import org.greenstone.gatherer.msm.MetadataSet; … … 77 79 private Object result = null; 78 80 79 final static private Dimension MDE_SIZE = new Dimension(500,2 00);80 final static private Dimension MDS_SIZE = new Dimension(800,4 00);81 final static private Dimension PROGRESS_SIZE = new Dimension(500, 80);81 final static private Dimension MDE_SIZE = new Dimension(500,225); 82 final static private Dimension MDS_SIZE = new Dimension(800,425); 83 final static private Dimension PROGRESS_SIZE = new Dimension(500,105); 82 84 final static private Dimension RENAME_LABEL_SIZE = new Dimension(100,25); 83 final static private Dimension RENAME_SIZE = new Dimension(300,1 20);84 final static private Dimension SELECT_ELEMENT_SIZE = new Dimension(500, 280);85 final static private Dimension RENAME_SIZE = new Dimension(300,145); 86 final static private Dimension SELECT_ELEMENT_SIZE = new Dimension(500,305); 85 87 final static private Dimension SELECT_LABEL_SIZE = new Dimension(175, 25); 86 88 final static private Dimension SELECT_SET_SIZE = new Dimension(600,210); 87 final static private Dimension SELECT_SIZE = new Dimension(200,2 00);89 final static private Dimension SELECT_SIZE = new Dimension(200,225); 88 90 final static private int SELECT_LINE_COUNT = 8; 89 91 … … 174 176 action = Declarations.SKIP; 175 177 } 176 on_screen. hide();178 on_screen.setVisible(false); 177 179 } 178 180 /** Method called when the merging process is complete and the progress bar is no longer needed. … … 199 201 action = Declarations.NO_ACTION; 200 202 // Construction and configuration 201 JDialog dialog = new JDialog();203 JDialog dialog = new ModalDialog(Gatherer.g_man); 202 204 dialog.setModal(true); 203 205 dialog.setSize(MDE_SIZE); 204 206 dialog.setTitle(get("Merge_MDE")); 207 dialog.setJMenuBar(new SimpleMenuBar("6.8")); 205 208 JPanel content_pane = (JPanel)dialog.getContentPane(); 206 209 … … 269 272 dialog.setLocation((screen_size.width - MDE_SIZE.width) / 2, (screen_size.height - MDE_SIZE.height) / 2); 270 273 on_screen = dialog; 271 off_screen. hide();272 on_screen.s how();273 off_screen.s how();274 off_screen.setVisible(false); 275 on_screen.setVisible(true); 276 off_screen.setVisible(true); 274 277 on_screen.dispose(); 275 278 … … 303 306 action = Declarations.NO_ACTION; 304 307 // Construction and configuration 305 JDialog dialog = new JDialog();308 JDialog dialog = new ModalDialog(Gatherer.g_man); 306 309 dialog.setModal(true); 307 310 dialog.setSize(MDS_SIZE); 308 311 dialog.setTitle(get("Merge_MDS")); 312 dialog.setJMenuBar(new SimpleMenuBar("6.8")); 309 313 JPanel content_pane = (JPanel)dialog.getContentPane(); 310 314 if(mde_cur != null) { … … 398 402 dialog.setLocation((screen_size.width - MDS_SIZE.width) / 2, (screen_size.height - MDS_SIZE.height) / 2); 399 403 on_screen = dialog; 400 off_screen. hide();401 on_screen.s how(); // Blocks until hidden.402 off_screen.s how();404 off_screen.setVisible(false); 405 on_screen.setVisible(true); // Blocks until hidden. 406 off_screen.setVisible(true); 403 407 on_screen.dispose(); 404 408 on_screen = null; … … 427 431 public void startMerge(int element_count) { 428 432 action = Declarations.NO_ACTION; 429 JDialog dialog = new JDialog();433 JDialog dialog = new ModalDialog(Gatherer.g_man); 430 434 dialog.setModal(false); 431 435 dialog.setSize(PROGRESS_SIZE); 432 436 dialog.setTitle(get("Merge_Progress")); 437 //dialog.setJMenuBar(new SimpleMenuBar("0")); ?? do we want help here?? 438 433 439 JPanel content_pane = (JPanel)dialog.getContentPane(); 434 440 progress.setMaximum(element_count); … … 444 450 dialog.setLocation((screen_size.width - PROGRESS_SIZE.width) / 2, (screen_size.height - PROGRESS_SIZE.height) / 2); 445 451 off_screen = dialog; 446 dialog.s how();452 dialog.setVisible(true); 447 453 content_pane = null; 448 454 dialog = null; … … 455 461 action = Declarations.NO_ACTION; 456 462 // Create 457 JDialog dialog = new JDialog();463 JDialog dialog = new ModalDialog(Gatherer.g_man); 458 464 dialog.setModal(true); 459 465 dialog.setSize(RENAME_SIZE); 460 466 dialog.setTitle(get("Rename")); 461 467 dialog.setJMenuBar(new SimpleMenuBar("6.8")); 462 468 JLabel old_name_label = new JLabel(get("Old_Name")); 463 469 old_name_label.setPreferredSize(RENAME_LABEL_SIZE); … … 509 515 dialog.setLocation((screen_size.width - RENAME_SIZE.width) / 2, (screen_size.height - RENAME_SIZE.height) / 2); 510 516 on_screen = dialog; 511 off_screen. hide();512 on_screen.s how();513 off_screen.s how();517 off_screen.setVisible(false); 518 on_screen.setVisible(true); 519 off_screen.setVisible(true); 514 520 on_screen.dispose(); 515 521 on_screen = null; … … 567 573 action = Declarations.NO_ACTION; 568 574 // Create 569 JDialog dialog = new JDialog();575 JDialog dialog = new ModalDialog(Gatherer.g_man); 570 576 dialog.setModal(true); 571 577 dialog.setSize(SELECT_SIZE); 572 578 dialog.setTitle(get("Select")); 573 579 dialog.setJMenuBar(new SimpleMenuBar("6.8")); 580 574 581 JButton ok = new JButton(get("General.OK")); 575 582 ok.addActionListener(this); … … 604 611 dialog.setLocation((screen_size.width - SELECT_SIZE.width) / 2, (screen_size.height - SELECT_SIZE.height) / 2); 605 612 on_screen = dialog; 606 off_screen. hide();607 on_screen.s how();608 off_screen.s how();613 off_screen.setVisible(false); 614 on_screen.setVisible(true); 615 off_screen.setVisible(true); 609 616 on_screen.dispose(); 610 617 on_screen = null; … … 645 652 dialog.setSize(SELECT_ELEMENT_SIZE); 646 653 dialog.setTitle(get("Select_Element_Title")); 654 dialog.setJMenuBar(new SimpleMenuBar("6.8")); 647 655 JPanel content_pane = (JPanel) dialog.getContentPane(); 648 656 JPanel control_pane = new JPanel(); … … 755 763 // Display 756 764 dialog.setLocation((screen_size.width - SELECT_ELEMENT_SIZE.width) / 2, (screen_size.height - SELECT_ELEMENT_SIZE.height) / 2); 757 dialog.s how();765 dialog.setVisible(true); 758 766 // Deallocate everything because JDK1.4 won't. 759 767 // Why, oh why did I do this? … … 818 826 dialog.setSize(SELECT_SET_SIZE); 819 827 dialog.setTitle(get("Select_Set_Title")); 828 dialog.setJMenuBar(new SimpleMenuBar("6.8")); 820 829 JPanel content_pane = (JPanel) dialog.getContentPane(); 821 830 JPanel control_pane = new JPanel(); … … 863 872 // Display 864 873 dialog.setLocation((screen_size.width - SELECT_SET_SIZE.width) / 2, (screen_size.height - SELECT_SET_SIZE.height) / 2); 865 dialog.s how();874 dialog.setVisible(true); 866 875 Object value = set.getSelectedItem(); 867 876 if(value instanceof MetadataSet) { … … 980 989 981 990 private class MSMDialog 982 extends JDialog { 991 extends ModalDialog { 992 993 public MSMDialog() { 994 super(Gatherer.g_man); 995 } 983 996 public void destroy() { 984 997 rootPane = null;
Note:
See TracChangeset
for help on using the changeset viewer.