Changeset 1215
- Timestamp:
- 01/30/19 13:00:59 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/Browser.java
r1182 r1215 20 20 21 21 import java.io.File; 22 import java.io.IOException; 22 23 import java.net.Authenticator; 24 import java.security.KeyStoreException; 25 import java.security.NoSuchAlgorithmException; 26 import java.security.cert.CertificateException; 27 import java.sql.SQLException; 23 28 import java.util.ArrayList; 24 29 import java.util.Collection; … … 51 56 import org.expeditee.taskmanagement.SaveStateChangedEvent; 52 57 import org.expeditee.taskmanagement.SaveStateChangedEventListener; 58 import org.ngikm.NGIKMSystem; 59 import org.ngikm.actions.DebugActions; 60 import org.ngikm.actions.EntityActions; 53 61 54 62 /** … … 148 156 protected static boolean _initComplete = false; 149 157 150 pr otectedstatic String _startFrame = null;158 private static String _startFrame = null; 151 159 152 160 /** … … 159 167 // Parse the starting frame command-line argument 160 168 if(args.length > 0) { 161 _startFrame = args[0];162 if(!Character.isDigit( _startFrame.charAt(_startFrame.length() - 1))) {163 _startFrame = _startFrame + "1";169 setStartFrame(args[0]); 170 if(!Character.isDigit(getStartFrame().charAt(getStartFrame().length() - 1))) { 171 setStartFrame(getStartFrame() + "1"); 164 172 } 165 173 } else { 166 _startFrame = "home1";174 setStartFrame("home1"); 167 175 } 168 176 … … 188 196 } 189 197 190 public static void init() 191 { 198 public static void init() { 199 if (Boolean.getBoolean("auth")) { 200 try { 201 org.expeditee.auth.Authenticator.getInstance(); 202 _initComplete = true; 203 return; 204 } catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | IOException | ClassNotFoundException | SQLException e) { 205 e.printStackTrace(); 206 } 207 } else if (Boolean.getBoolean("ngikmspike")) { 208 System.out.println("Running NGIKM Demo"); 209 Actions.LoadMethods(EntityActions.class); 210 Actions.LoadMethods(DebugActions.class); 211 } 192 212 _theBrowser = new Browser(); 193 213 … … 202 222 * @return 203 223 * 204 * True if the application is about to exit. False if not. Not that this is224 * True if the application is about to exit. False if not. Note that this is 205 225 * only set once the window is in its closed state (not closing) or if the 206 * application has explicit y being requested to exit.226 * application has explicitly being requested to exit. 207 227 * 208 228 * @see Browser#exit() … … 217 237 } 218 238 219 protected Browser() 220 { 239 protected Browser() { 221 240 // center the frame on the screen 222 241 GraphicsManager g = EcosystemManager.getGraphicsManager(); … … 227 246 228 247 DisplayController.Init(); 229 248 230 249 DisplayController.addDisplayObserver(WidgetCacheManager.getInstance()); 231 250 if (ECOSYSTEM_TYPE == Ecosystem.Swing) { … … 234 253 235 254 setInputManagerWindowRoutines(); 236 255 237 256 // Reset windows to user specified size 238 257 Dimension initialWindowSize = new Dimension(UserSettings.InitialWidth.get(), UserSettings.InitialHeight.get()); 239 258 g.setWindowSize(initialWindowSize); 240 259 241 260 // Load documentation and start pages 242 261 FrameUtils.extractResources(false); 243 244 // Load fonts before loading any frames so the items on the frames will be able to access their fonts 262 263 // Load fonts before loading any frames so the items on the frames will be able 264 // to access their fonts 245 265 Text.InitFonts(); 246 266 247 267 Settings.Init(); 248 268 Frame userProfile = loadProfiles(); … … 250 270 // Listen for save status to display during and after runtime 251 271 EntitySaveManager.getInstance().addSaveStateChangedEventListener(this); 252 272 253 273 try { 254 274 MessageBay.warningMessages(Actions.Init()); … … 256 276 // Go to the start frame if specified, otherwise go to the profile frame 257 277 Frame start = null; 258 if (_startFrame== null) {259 _startFrame = UserSettings.StartFrame.get();260 if (_startFrame != null && !Character.isDigit(_startFrame.charAt(_startFrame.length() - 1))) {261 _startFrame = _startFrame + "1";262 } 263 } 264 265 if((start = FrameIO.LoadFrame(_startFrame)) != null) {266 267 268 269 270 271 272 273 if(_startFrame!= null) {274 MessageBay.warningMessage("Unknown frame: " + _startFrame);275 } 276 277 278 279 280 278 if (getStartFrame() == null) { 279 setStartFrame(UserSettings.StartFrame.get()); 280 if (getStartFrame() != null && !Character.isDigit(getStartFrame().charAt(getStartFrame().length() - 1))) { 281 setStartFrame(getStartFrame() + "1"); 282 } 283 } 284 285 if ((start = FrameIO.LoadFrame(getStartFrame())) != null) { 286 // Make sure HomeFrame gets set 287 UserSettings.HomeFrame.set(start.getName()); 288 289 // Go to the start frame 290 DisplayController.setCurrentFrame(start, true); 291 } else { 292 // If an invalid start frame was specified, show a warning 293 if (getStartFrame() != null) { 294 MessageBay.warningMessage("Unknown frame: " + getStartFrame()); 295 } 296 297 // Go to the profile frame 298 FrameUtils.loadFirstFrame(userProfile); 299 } 300 281 301 DisplayController.updateTitle(); 282 302 … … 284 304 if (!DisplayController.getCurrentFrame().equals(userProfile)) { 285 305 StandardGestureActions.Refresh(); 286 // If it's the profile frame just reparse it in order to display images/circles/widgets correctly 306 // If it's the profile frame just reparse it in order to display 307 // images/circles/widgets correctly 287 308 } else { 288 309 FrameUtils.Parse(userProfile); … … 434 455 } 435 456 436 private static void setInputManagerWindowRoutines() 437 { 457 private static void setInputManagerWindowRoutines() { 438 458 InputManager manager = EcosystemManager.getInputManager(); 439 459 … … 497 517 * @return The user's profile frame. 498 518 */ 499 p rivatestatic Frame loadProfiles()519 public static Frame loadProfiles() 500 520 { 501 521 String defaultProfileName = UserSettings.DEFAULT_PROFILE_NAME; … … 539 559 return profile; 540 560 } 561 562 public static String getStartFrame() { 563 return _startFrame; 564 } 565 566 public static void setStartFrame(String _startFrame) { 567 Browser._startFrame = _startFrame; 568 } 541 569 }
Note:
See TracChangeset
for help on using the changeset viewer.