Ignore:
Timestamp:
2003-05-30T14:37:40+12:00 (21 years ago)
Author:
kjdon
Message:

the modal dialogs now are one of our special ModalDialogs which only block the parent, enabling the use of help files while the dialogs are open. A SimpleMenuBar with help on it has been added to the dialogs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/msm/MSMPrompt.java

    r4365 r4432  
    4343import javax.swing.event.*;
    4444import org.greenstone.gatherer.Gatherer;
     45import org.greenstone.gatherer.gui.ModalDialog;
     46import org.greenstone.gatherer.gui.SimpleMenuBar;
    4547import org.greenstone.gatherer.msm.Declarations;
    4648import org.greenstone.gatherer.msm.MetadataSet;
     
    7779    private Object result = null;
    7880
    79     final static private Dimension MDE_SIZE = new Dimension(500,200);
    80     final static private Dimension MDS_SIZE = new Dimension(800,400);
    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);
    8284    final static private Dimension RENAME_LABEL_SIZE = new Dimension(100,25);
    83     final static private Dimension RENAME_SIZE = new Dimension(300,120);
    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);
    8587    final static private Dimension SELECT_LABEL_SIZE = new Dimension(175, 25);
    8688    final static private Dimension SELECT_SET_SIZE = new Dimension(600,210);
    87     final static private Dimension SELECT_SIZE = new Dimension(200,200);
     89    final static private Dimension SELECT_SIZE = new Dimension(200,225);
    8890    final static private int SELECT_LINE_COUNT = 8;
    8991     
     
    174176        action = Declarations.SKIP;
    175177    }
    176     on_screen.hide();
     178    on_screen.setVisible(false);
    177179    }
    178180    /** Method called when the merging process is complete and the progress bar is no longer needed.
     
    199201    action = Declarations.NO_ACTION;
    200202    // Construction and configuration
    201     JDialog dialog = new JDialog();
     203    JDialog dialog = new ModalDialog(Gatherer.g_man);
    202204    dialog.setModal(true);
    203205    dialog.setSize(MDE_SIZE);
    204206    dialog.setTitle(get("Merge_MDE"));
     207    dialog.setJMenuBar(new SimpleMenuBar("6.8"));
    205208    JPanel content_pane = (JPanel)dialog.getContentPane();
    206209
     
    269272    dialog.setLocation((screen_size.width - MDE_SIZE.width) / 2, (screen_size.height - MDE_SIZE.height) / 2);
    270273    on_screen = dialog;
    271     off_screen.hide();
    272     on_screen.show();
    273     off_screen.show();
     274    off_screen.setVisible(false);
     275    on_screen.setVisible(true);
     276    off_screen.setVisible(true);
    274277    on_screen.dispose();
    275278
     
    303306    action = Declarations.NO_ACTION;
    304307    // Construction and configuration
    305     JDialog dialog = new JDialog();
     308    JDialog dialog = new ModalDialog(Gatherer.g_man);
    306309    dialog.setModal(true);
    307310    dialog.setSize(MDS_SIZE);
    308311    dialog.setTitle(get("Merge_MDS"));
     312    dialog.setJMenuBar(new SimpleMenuBar("6.8"));
    309313    JPanel content_pane = (JPanel)dialog.getContentPane();
    310314    if(mde_cur != null) {
     
    398402    dialog.setLocation((screen_size.width - MDS_SIZE.width) / 2, (screen_size.height - MDS_SIZE.height) / 2);
    399403    on_screen = dialog;
    400     off_screen.hide();
    401     on_screen.show(); // Blocks until hidden.
    402     off_screen.show();
     404    off_screen.setVisible(false);
     405    on_screen.setVisible(true); // Blocks until hidden.
     406    off_screen.setVisible(true);
    403407    on_screen.dispose();
    404408    on_screen = null;
     
    427431    public void startMerge(int element_count) {
    428432    action = Declarations.NO_ACTION;
    429     JDialog dialog = new JDialog();
     433    JDialog dialog = new ModalDialog(Gatherer.g_man);
    430434    dialog.setModal(false);
    431435    dialog.setSize(PROGRESS_SIZE);
    432436    dialog.setTitle(get("Merge_Progress"));
     437    //dialog.setJMenuBar(new SimpleMenuBar("0")); ?? do we want help here??
     438
    433439    JPanel content_pane = (JPanel)dialog.getContentPane();
    434440    progress.setMaximum(element_count);
     
    444450    dialog.setLocation((screen_size.width - PROGRESS_SIZE.width) / 2, (screen_size.height - PROGRESS_SIZE.height) / 2);
    445451    off_screen = dialog;
    446     dialog.show();
     452    dialog.setVisible(true);
    447453    content_pane = null;
    448454    dialog = null;
     
    455461    action = Declarations.NO_ACTION;
    456462    // Create
    457     JDialog dialog = new JDialog();
     463    JDialog dialog = new ModalDialog(Gatherer.g_man);
    458464    dialog.setModal(true);
    459465    dialog.setSize(RENAME_SIZE);
    460466    dialog.setTitle(get("Rename"));
    461 
     467    dialog.setJMenuBar(new SimpleMenuBar("6.8"));
    462468    JLabel old_name_label = new JLabel(get("Old_Name"));
    463469    old_name_label.setPreferredSize(RENAME_LABEL_SIZE);
     
    509515    dialog.setLocation((screen_size.width - RENAME_SIZE.width) / 2, (screen_size.height - RENAME_SIZE.height) / 2);
    510516    on_screen = dialog;
    511     off_screen.hide();
    512     on_screen.show();
    513     off_screen.show();
     517    off_screen.setVisible(false);
     518    on_screen.setVisible(true);
     519    off_screen.setVisible(true);
    514520    on_screen.dispose();
    515521    on_screen = null;         
     
    567573    action = Declarations.NO_ACTION;
    568574    // Create
    569     JDialog dialog = new JDialog();
     575    JDialog dialog = new ModalDialog(Gatherer.g_man);
    570576    dialog.setModal(true);
    571577    dialog.setSize(SELECT_SIZE);
    572578    dialog.setTitle(get("Select"));
    573          
     579    dialog.setJMenuBar(new SimpleMenuBar("6.8"));
     580
    574581    JButton ok = new JButton(get("General.OK"));
    575582    ok.addActionListener(this);
     
    604611    dialog.setLocation((screen_size.width - SELECT_SIZE.width) / 2, (screen_size.height - SELECT_SIZE.height) / 2);
    605612    on_screen = dialog;
    606     off_screen.hide();
    607     on_screen.show();
    608     off_screen.show();
     613    off_screen.setVisible(false);
     614    on_screen.setVisible(true);
     615    off_screen.setVisible(true);
    609616    on_screen.dispose();
    610617    on_screen = null;   
     
    645652    dialog.setSize(SELECT_ELEMENT_SIZE);
    646653    dialog.setTitle(get("Select_Element_Title"));
     654    dialog.setJMenuBar(new SimpleMenuBar("6.8"));
    647655    JPanel content_pane = (JPanel) dialog.getContentPane();
    648656    JPanel control_pane = new JPanel();
     
    755763    // Display
    756764    dialog.setLocation((screen_size.width - SELECT_ELEMENT_SIZE.width) / 2, (screen_size.height - SELECT_ELEMENT_SIZE.height) / 2);
    757     dialog.show();
     765    dialog.setVisible(true);
    758766    // Deallocate everything because JDK1.4 won't.
    759767    // Why, oh why did I do this?
     
    818826    dialog.setSize(SELECT_SET_SIZE);
    819827    dialog.setTitle(get("Select_Set_Title"));
     828    dialog.setJMenuBar(new SimpleMenuBar("6.8"));
    820829    JPanel content_pane = (JPanel) dialog.getContentPane();
    821830    JPanel control_pane = new JPanel();
     
    863872    // Display
    864873    dialog.setLocation((screen_size.width - SELECT_SET_SIZE.width) / 2, (screen_size.height - SELECT_SET_SIZE.height) / 2);
    865     dialog.show();
     874    dialog.setVisible(true);
    866875    Object value = set.getSelectedItem();
    867876    if(value instanceof MetadataSet) {
     
    980989
    981990    private class MSMDialog
    982     extends JDialog {
     991    extends ModalDialog {
     992
     993    public MSMDialog() {
     994        super(Gatherer.g_man);
     995    }
    983996    public void destroy() {
    984997        rootPane = null;
Note: See TracChangeset for help on using the changeset viewer.