- Timestamp:
- 2019-03-25T18:13:17+13:00 (5 years ago)
- Location:
- main/trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r32695 r32923 672 672 } 673 673 674 } 675 676 677 /** Returns the correct version of the (local or remote) Greenstone server if init() has already been called. */ 678 public static int serverVersionNumber() { 679 return GS3 ? 3 : 2; 680 } 681 682 /** Returns "Server: version number" if init() has already been called. */ 683 public static String getServerVersionAsString() { 684 return "Server: v" + serverVersionNumber(); 685 } 686 687 public void openGUI() 688 { 689 690 // openGUI() is called on the EDT (graphical/swing thread) 691 // remoteGS.downloadCollectionConfigurations() moved here as it calls remoteGS3.authenticateUser() 692 // which displays a dialog to get user input and therefore belongs on the EDT. 674 693 // If using a remote Greenstone we need to download the collection configurations now 675 694 if (Gatherer.isGsdlRemote) { … … 682 701 } 683 702 } 684 } 685 686 687 /** Returns the correct version of the (local or remote) Greenstone server if init() has already been called. */ 688 public static int serverVersionNumber() { 689 return GS3 ? 3 : 2; 690 } 691 692 /** Returns "Server: version number" if init() has already been called. */ 693 public static String getServerVersionAsString() { 694 return "Server: v" + serverVersionNumber(); 695 } 696 697 public void openGUI() 698 { 703 699 704 // Size and place the frame on the screen 700 705 Rectangle bounds = Configuration.getBounds("general.bounds", true); -
main/trunk/gli/src/org/greenstone/gatherer/GathererProg.java
r32920 r32923 76 76 // Create an instance of the Gatherer class, which will parse the args and prepare the rest of the GLI 77 77 Gatherer gatherer = new Gatherer(args); 78 79 // Display the GUI immediately 80 gatherer.openGUI(); 81 82 /* 78 83 79 // TESTING circumventing the old GUI event dispatch thread exceptions in GLI. Follows 84 80 // https://docs.oracle.com/javase/6/docs/api/javax/swing/package-summary.html#threading … … 90 86 SwingUtilities.invokeLater(new Runnable() { 91 87 public void run() { 92 // These lines used to be done immediate after setGLIDirectoryPath() call above 93 // but are now inside an invokeLater(). 94 95 // Create an instance of the Gatherer class, which will parse the args and prepare the rest of the GLI 96 Gatherer gatherer = new Gatherer(args); 97 88 // This line used to be done immediately after setGLIDirectoryPath() 89 // and new Gatherer() above, but is now inside an invokeLater() to do graphical stuff here. 90 98 91 // Display the GUI immediately 99 92 gatherer.openGUI(); 100 93 } 101 94 }); 102 */95 103 96 } 104 97 } -
main/trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r32920 r32923 183 183 } 184 184 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()); 187 187 } 188 188 else if (esrc == menu_bar.file_cdimage) { … … 203 203 } 204 204 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()); 207 207 } 208 208 else if (esrc == menu_bar.file_open) { 209 new OpenCollectionTask().start(); // will cause an EDT access violation exception209 //new OpenCollectionTask().start(); // will cause an EDT access violation exception 210 210 // 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()); 212 212 } 213 213 else if (esrc == menu_bar.file_options) { … … 940 940 941 941 private class OpenCollectionTask 942 extends Thread 943 //implements Runnable //extends Thread -> If this extends Thread, it will cause an EDT access 942 implements Runnable //extends Thread -> If this extends Thread, it will cause an EDT access 944 943 // violation since the GUI stuff in run() is not done in the Swing Event Dispatch Thread/EDT. 945 944 { … … 989 988 990 989 private class NewCollectionTask 991 extends Thread 992 //implements Runnable //extends Thread 990 implements Runnable //extends Thread 993 991 { 994 992 public void run() … … 1022 1020 1023 1021 private class DeleteCollectionTask 1024 extends Thread 1025 //implements Runnable //extends Thread 1022 implements Runnable //extends Thread 1026 1023 { 1027 1024 public void run() … … 1092 1089 public void updateUI() 1093 1090 { 1094 //SwingUtilities.invokeLater(new Runnable() {1095 //public void run() {1091 SwingUtilities.invokeLater(new Runnable() { 1092 public void run() { 1096 1093 JPanel pane = (JPanel) getContentPane(); 1097 1094 pane.updateUI(); … … 1103 1100 workflowUpdate("Create", Configuration.get("workflow.create", false)); 1104 1101 workflowUpdate("Format", Configuration.get("workflow.format", false)); 1105 //}1106 //});1102 } 1103 }); 1107 1104 } 1108 1105 -
main/trunk/gli/src/org/greenstone/gatherer/remote/RemoteGreenstoneServer.java
r31777 r32923 265 265 String threadName = Thread.currentThread().getName(); 266 266 267 /* 267 268 // If we're running in the GUI thread we must return immediately 268 269 // We cannot wait for the action to complete because this will block any GUI updates … … 273 274 return null; 274 275 } 276 */ 275 277 276 278 // Otherwise wait until the action is processed
Note:
See TracChangeset
for help on using the changeset viewer.