Changeset 32920


Ignore:
Timestamp:
2019-03-21T16:48:24+13:00 (3 years ago)
Author:
ak19
Message:

EDT related changes for setting up GUI testing worked okay with GLI but break client-GLI. Undoing these changes for the release at least.

Location:
main/trunk/gli/src/org/greenstone/gatherer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/GathererProg.java

    r32725 r32920  
    7474    Gatherer.setGLIDirectoryPath(System.getProperty("user.dir") + File.separator);
    7575   
    76 
     76    // Create an instance of the Gatherer class, which will parse the args and prepare the rest of the GLI
     77    Gatherer gatherer = new Gatherer(args);
     78   
     79    // Display the GUI immediately
     80    gatherer.openGUI();
     81   
     82    /* 
    7783    // TESTING circumventing the old GUI event dispatch thread exceptions in GLI. Follows
    7884    // https://docs.oracle.com/javase/6/docs/api/javax/swing/package-summary.html#threading
     
    8187    // Schedule a job for the event-dispatching thread:
    8288        // creating and showing this application's GUI.
    83         SwingUtilities.invokeLater(new Runnable() {
     89
     90    SwingUtilities.invokeLater(new Runnable() {
    8491            public void run() {
    8592        // These lines used to be done immediate after setGLIDirectoryPath() call above
     
    93100            }
    94101        });
     102    */
    95103    }
    96104}
  • main/trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r32712 r32920  
    183183    }
    184184    else if (esrc == menu_bar.file_delete) {
    185         //new DeleteCollectionTask().start();
    186         SwingUtilities.invokeLater(new DeleteCollectionTask());
     185        new DeleteCollectionTask().start();
     186        //SwingUtilities.invokeLater(new DeleteCollectionTask());
    187187    }
    188188    else if (esrc == menu_bar.file_cdimage) {
     
    203203    }
    204204        else if (esrc == menu_bar.file_new) {
    205         //new NewCollectionTask().start();
    206         SwingUtilities.invokeLater(new NewCollectionTask());
     205        new NewCollectionTask().start();
     206        //SwingUtilities.invokeLater(new NewCollectionTask());
    207207    }
    208208    else if (esrc == menu_bar.file_open) {
    209         //new OpenCollectionTask().start(); // will cause an EDT access violation exception
     209        new OpenCollectionTask().start(); // will cause an EDT access violation exception
    210210        // since the GUI stuff of opening a collection is not done in a Swing thread
    211         SwingUtilities.invokeLater(new OpenCollectionTask());
     211        //SwingUtilities.invokeLater(new OpenCollectionTask());
    212212    }
    213213    else if (esrc == menu_bar.file_options) {
     
    940940
    941941    private class OpenCollectionTask
    942     implements Runnable //extends Thread -> If this extends Thread, it will cause an EDT access
     942    extends Thread
     943    //implements Runnable //extends Thread -> If this extends Thread, it will cause an EDT access
    943944           // violation since the GUI stuff in run() is not done in the Swing Event Dispatch Thread/EDT.
    944945    {
     
    988989
    989990    private class NewCollectionTask
    990     implements Runnable //extends Thread
     991    extends Thread
     992    //implements Runnable //extends Thread
    991993    {
    992994    public void run()
     
    10201022
    10211023    private class DeleteCollectionTask
    1022     implements Runnable //extends Thread
     1024    extends Thread
     1025    //implements Runnable //extends Thread
    10231026    {
    10241027    public void run()
     
    10891092    public void updateUI()
    10901093    {
    1091     SwingUtilities.invokeLater(new Runnable() {
    1092         public void run() {
     1094    //SwingUtilities.invokeLater(new Runnable() {
     1095    //  public void run() {
    10931096            JPanel pane = (JPanel) getContentPane();
    10941097            pane.updateUI();
     
    11001103            workflowUpdate("Create", Configuration.get("workflow.create", false));
    11011104            workflowUpdate("Format", Configuration.get("workflow.format", false));
    1102         }
    1103         });
     1105        //  }
     1106        //      });
    11041107    }
    11051108
Note: See TracChangeset for help on using the changeset viewer.