From: <ox-...@us...> - 2003-06-02 08:06:22
|
Update of /cvsroot/sheets/sheets In directory sc8-pr-cvs1:/tmp/cvs-serv19018 Modified Files: Sheets.sheets todo.txt Log Message: 1. New splash screen on startup... Must see! - Cool new design (thanks, Mike) - Uses the new logo - Has a progress bar 2. Fixed the timing of the initialization process - Splash screen disappears once sheets opens - New project dialog comes up after Sheets 3. New icon to match the logo Index: Sheets.sheets =================================================================== RCS file: /cvsroot/sheets/sheets/Sheets.sheets,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** Sheets.sheets 29 May 2003 19:23:56 -0000 1.51 --- Sheets.sheets 2 Jun 2003 08:05:04 -0000 1.52 *************** *** 2251,2255 **** BrokenLink.tryFixing(); ! SentinelMgr.finalizeSentinels(); LanguageExpert.compressEverything(); } --- 2251,2257 ---- BrokenLink.tryFixing(); ! SentinelMgr.finalizeSentinels(); ! // Display any messages that might have been generated during finalization ! Console.displayBatchedMessages(); LanguageExpert.compressEverything(); } *************** *** 26775,26795 **** type=java section text nkramer:27865 ! private static void Sheets.loadFiles (InitState state) { ! if (!(state.sheetsFiles.isEmpty() && state.projects.isEmpty())) { ! try { ! ObjectIdSentinel.loadAll(state.projects, state.sheetsFiles); ! } ! catch (IOException e) { ! System.err.println(e + " while reading a project."); ! DB.abort(); ! System.exit(1); ! } ! } else if (state.filesToImport.size() == 0 && state.newDB) { ! try { ! HistoryManager.beginChangeCommand("import dumpfile"); ! new ProjectWizardDialog(Sheets.getRootFrame()).show(); ! } finally { ! HistoryManager.endChangeCommand("import dumpfile"); ! } } --- 26777,26790 ---- type=java section text nkramer:27865 ! private static boolean Sheets.loadFiles (InitState state) { ! boolean loadedSomething = false; ! ! if (!(state.sheetsFiles.isEmpty() && state.projects.isEmpty())) try { ! loadedSomething = true; ! ObjectIdSentinel.loadAll(state.projects, state.sheetsFiles); ! } catch (IOException e) { ! System.err.println(e + " while reading a project."); ! DB.abort(); ! System.exit(1); } *************** *** 26800,26803 **** --- 26795,26799 ---- } if (importList.size() > 0) try { + loadedSomething = true; HistoryManager.beginChangeCommand("import files"); new FileImportProgressDialog(Sheets.getRootFrame(), importList).show(); *************** *** 26805,26808 **** --- 26801,26806 ---- HistoryManager.endChangeCommand("import files"); } + + return loadedSomething; } object nkramer:27868 *************** *** 26973,26981 **** return false; } catch (IOException e) { ! // I'm not sure what the right thing to do here is... ! throw new Error("ServerSocket failed: " + e); } ! new Thread(new ExistingSheetsProcess(), "Sheets server process").run(); return true; } --- 26971,26980 ---- return false; } catch (IOException e) { ! Console.error(e); } ! Thread thread = new Thread(new ExistingSheetsProcess(), "Sheets server process"); ! thread.setDaemon(true); ! thread.start(); return true; } *************** *** 27037,27043 **** section text nkramer:27930 private static void ExistingSheetsProcess.showUsageAndExit () { ! System.out.println ! ("Usage: java org.browsecode.sheets.ExistingSheetsProcess" ! + " someFile.comp"); System.exit(1); } --- 27036,27040 ---- section text nkramer:27930 private static void ExistingSheetsProcess.showUsageAndExit () { ! System.out.println("Usage: java org.browsecode.sheets.ExistingSheetsProcess someFile.comp"); System.exit(1); } *************** *** 37268,37271 **** --- 37265,37270 ---- // give them the chance. SentinelMgr.finalizeSentinels(); + // Display any messages that might have been generated during finalization + Console.displayBatchedMessages(); } *************** *** 51655,51662 **** ((Sentinel)sentinels.get(i)).finalizeEvents(); } - - // Hack: Calling "displayBatchedMessages" is not logically part of our job, - // but someone needs to call it, and this is the most convenient place. - Console.displayBatchedMessages(); } object rgs:7180 --- 51654,51657 ---- *************** *** 69885,69889 **** // forces the menubar to use the right L&F SwingUtilities.updateComponentTreeUI(Sheets.getRootFrame()); - rootFrame.setVisible(true); } object schin:39 --- 69880,69883 ---- *************** *** 71766,71782 **** schin:323 schin:281 - schin:279 - schin:271 schin:400 object schin:267 pkg=org.browsecode.sheets.archive type=java section text schin:267 ! Image Wizard.backgroundImage; object schin:268 pkg=org.browsecode.sheets.archive type=java section text schin:268 ! public void Wizard.setBackground(Image backgroundImage) { this.backgroundImage = backgroundImage; setOpaque(false); --- 71760,71775 ---- schin:323 schin:281 schin:400 + schin:279 object schin:267 pkg=org.browsecode.sheets.archive type=java section text schin:267 ! ImageIcon Wizard.backgroundImage; object schin:268 pkg=org.browsecode.sheets.archive type=java section text schin:268 ! public void Wizard.setBackgroundImage(ImageIcon backgroundImage) { this.backgroundImage = backgroundImage; setOpaque(false); *************** *** 71787,71800 **** section text schin:270 WizardListener Wizard.listener; - object schin:271 - pkg=org.browsecode.sheets.archive - type=java - section text schin:271 - public void Wizard.paint(Graphics2D g) { - if (backgroundImage != null) - // draw the background - g.drawImage(backgroundImage, 0, 0, getSize().width, getSize().height, this); - super.paint(g); - } object schin:274 pkg=org.browsecode.sheets.archive --- 71780,71783 ---- *************** *** 71826,71831 **** type=java section text schin:279 ! public void Wizard.paintComponents(Graphics2D g) { ! super.paintComponent(g); } object schin:280 --- 71809,71816 ---- type=java section text schin:279 ! public void Wizard.paintComponent(Graphics g) { ! if (backgroundImage != null) ! // draw the background ! backgroundImage.paintIcon(this, g, 0, 0); } object schin:280 *************** *** 72276,72280 **** super(parent, title, true); ! Image image = getToolkit().createImage(getClass().getResource("/graphics/project-wizard.jpg")); addWindowListener(new WindowAdapter() { --- 72261,72265 ---- super(parent, title, true); ! ImageIcon image = new ImageIcon(getClass().getResource("/graphics/project-wizard.jpg")); addWindowListener(new WindowAdapter() { *************** *** 72284,72290 **** }); ! getContentPane().add(wizard = new Wizard(this, firstCard)); wizard.setPreferredSize(new Dimension(600, 400)); ! wizard.setBackground(image); pack(); setLocationRelativeTo(parent); --- 72269,72276 ---- }); ! wizard = new Wizard(this, firstCard); ! wizard.setBackgroundImage(image); wizard.setPreferredSize(new Dimension(600, 400)); ! getContentPane().add(wizard); pack(); setLocationRelativeTo(parent); *************** *** 73145,73148 **** --- 73131,73137 ---- if (closeOnFinish) wizard.finishWizard(); + else + // would be nice to show this in the wizard + Console.displayBatchedMessages(); } }; *************** *** 73240,73244 **** type=java section text schin:417 ! public void ImportProgressCard.execute() { ArrayList importList = (ArrayList)getProperty("imports"); int count = 0; --- 73229,73233 ---- type=java section text schin:417 ! public void ImportProgressCard.execute() throws IOException { ArrayList importList = (ArrayList)getProperty("imports"); int count = 0; *************** *** 73257,73260 **** --- 73246,73255 ---- }); } + + setStatusText("Finalizing Import"); + SentinelMgr.finalizeSentinels(); + + setStatusText("Synchronizing Database"); + State.getObjectDatabase().sync(); } object schin:418 *************** *** 73763,73766 **** --- 73758,73762 ---- setStatusText("Synchronizing Database"); State.getObjectDatabase().sync(); + progress.setValue(progress.getMaximum()); } object schin:473 *************** *** 80181,80185 **** { super("Sheets"); - showSplash(); } object schin:1033 --- 80177,80180 ---- *************** *** 80201,80205 **** }); ! setIconImage(getToolkit().createImage(getClass().getResource("/graphics/stump.gif"))); getContentPane().setLayout(new BorderLayout()); --- 80196,80200 ---- }); ! setIconImage(getToolkit().createImage(getClass().getResource("/graphics/icon.gif"))); getContentPane().setLayout(new BorderLayout()); *************** *** 82330,82333 **** --- 82325,82481 ---- return null; } + object schin:1256 + pkg=org.browsecode.sheets + type=java + section text schin:1256 + public class Splash + section exports schin:1256 + schin:1257 + schin:1260 + schin:1258 + schin:1268 + schin:1259 + schin:1261 + object schin:1257 + pkg=org.browsecode.sheets + type=java + section text schin:1257 + JWindow Splash.window; + object schin:1258 + pkg=org.browsecode.sheets + type=java + section text schin:1258 + public Splash(int numIncrements) + { + window = new JWindow(); + + Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); + progress = new Progress(new Rectangle(29, 302, 440, 20), new ImageIcon(getClass().getResource("/graphics/sheets-logo.jpg")), numIncrements); + progress.setBorder(BorderFactory.createLineBorder(Color.black)); + window.getContentPane().add(progress); + window.pack(); + window.move((int)((d.getWidth() - window.getWidth()) / 2), (int)((d.getHeight() - window.getHeight()) / 2)); + window.show(); + window.toFront(); + } + object schin:1259 + pkg=org.browsecode.sheets + type=java + section text schin:1259 + public void Splash.close() { + progress.timer.cancel(); + window.dispose(); + window = null; + progress = null; + } + object schin:1260 + pkg=org.browsecode.sheets + type=java + section text schin:1260 + Progress Splash.progress; + object schin:1261 + pkg=org.browsecode.sheets + type=java + section text schin:1261 + public static class Splash.Progress extends JComponent + section exports schin:1261 + schin:1262 + schin:1263 + schin:1264 + schin:1270 + schin:1271 + schin:1269 + schin:1265 + schin:1266 + schin:1272 + schin:1267 + object schin:1262 + pkg=org.browsecode.sheets + type=java + section text schin:1262 + Rectangle Splash.Progress.progressArea; + object schin:1263 + pkg=org.browsecode.sheets + type=java + section text schin:1263 + ImageIcon Splash.Progress.image; + object schin:1264 + pkg=org.browsecode.sheets + type=java + section text schin:1264 + int Splash.Progress.increment; + object schin:1265 + pkg=org.browsecode.sheets + type=java + section text schin:1265 + public Splash.Progress (Rectangle area, ImageIcon image, int numIncrements) { + this.progressArea = area; + this.image = image; + this.numIncrements = numIncrements; + setOpaque(false); + setPreferredSize(new Dimension(image.getIconWidth(), image.getIconHeight())); + + // We use a timer to get the effect that the progress bar is updated more frequently than it + // really is. For each 1/30th of a second interval, we increment the taskbar 10% of the way + // to the next increment. + timer = new java.util.Timer(); + timer.schedule(new TimerTask() { + public void run() { + if (firstPaintComplete) { + subincrement = 1f - (1f - subincrement) * .9f; + paintImmediately(progressArea); + } + } + }, 0, 33); + } + object schin:1266 + pkg=org.browsecode.sheets + type=java + section text schin:1266 + public void Splash.Progress.updateProgress(int increment) { + this.increment = increment; + subincrement = 0f; + paintImmediately(progressArea); + } + object schin:1267 + pkg=org.browsecode.sheets + type=java + section text schin:1267 + public void Splash.Progress.paintComponent(Graphics g) { + Graphics2D g2d = (Graphics2D)g; + image.paintIcon(this, g2d, 0, 0); + g2d.setPaint(new Color(0, 0, 0, 63)); + Rectangle scaledRegion = (Rectangle)progressArea.clone(); + scaledRegion.setSize((int)(scaledRegion.getWidth() * (increment + subincrement) / numIncrements), (int)scaledRegion.getHeight()); + g2d.fill(scaledRegion); + firstPaintComplete = true; + } + object schin:1268 + pkg=org.browsecode.sheets + type=java + section text schin:1268 + public void Splash.updateProgress(int increment) { + progress.updateProgress(increment); + } + object schin:1269 + pkg=org.browsecode.sheets + type=java + section text schin:1269 + java.util.Timer Splash.Progress.timer; + object schin:1270 + pkg=org.browsecode.sheets + type=java + section text schin:1270 + int Splash.Progress.numIncrements; + object schin:1271 + pkg=org.browsecode.sheets + type=java + section text schin:1271 + float Splash.Progress.subincrement; + object schin:1272 + pkg=org.browsecode.sheets + type=java + section text schin:1272 + private boolean Splash.Progress.firstPaintComplete; object sjc:1 pkg=org.browsecode.sheets.dicer *************** *** 87572,87575 **** --- 87720,87725 ---- public static void Sheets.main (String args[]) throws Exception { + final Splash splash = new Splash(6); + EventQueue.invokeAndWait(new Runnable() { public void run() { *************** *** 87577,87589 **** } }); InitState state = new InitState(); parseCommandLine(args, state); - scanFilenames(state); initDatabase(state); Sheet lostStuff = checkForCrash(); ! loadFiles(state); startOpenRequestServer(state); Console.status("Synchronizing...."); --- 87727,87744 ---- } }); + splash.updateProgress(1); InitState state = new InitState(); parseCommandLine(args, state); scanFilenames(state); + splash.updateProgress(2); + initDatabase(state); + splash.updateProgress(3); + Sheet lostStuff = checkForCrash(); ! boolean loadedSomething = loadFiles(state); startOpenRequestServer(state); + splash.updateProgress(4); Console.status("Synchronizing...."); *************** *** 87595,87606 **** Console.status("Synchronizing....failed."); } - HistoryManager.init(); EventQueue.invokeAndWait(new Runnable() { public void run() { createRootFrame(); Console.status("Welcome to Sheets, " + Profile.username + "!"); } }); if (lostStuff != null) --- 87750,87765 ---- Console.status("Synchronizing....failed."); } HistoryManager.init(); + splash.updateProgress(5); + EventQueue.invokeAndWait(new Runnable() { public void run() { createRootFrame(); + splash.updateProgress(6); + rootFrame.setVisible(true); Console.status("Welcome to Sheets, " + Profile.username + "!"); } }); + splash.close(); if (lostStuff != null) *************** *** 87627,87630 **** --- 87786,87796 ---- ExistingSheetsProcess.maybeStartServer(); + + if (!loadedSomething && state.newDB) try { + HistoryManager.beginChangeCommand("import dumpfile"); + new ProjectWizardDialog(Sheets.getRootFrame()).show(); + } finally { + HistoryManager.endChangeCommand("import dumpfile"); + } } object wlott:770 *************** *** 94868,94871 **** --- 95034,95055 ---- ram:2360 lightWeight:separator + schin:1261 + schin:1262 + schin:1263 + schin:1264 + schin:1270 + schin:1271 + schin:1269 + schin:1265 + schin:1266 + schin:1272 + schin:1267 + schin:1256 + schin:1257 + schin:1260 + schin:1258 + schin:1268 + schin:1259 + lightWeight:separator nkramer:9 nkramer:6934 *************** *** 98330,98335 **** schin:1026 schin:147 - schin:1034 - schin:28 schin:1032 schin:1033 --- 98514,98517 ---- *************** *** 101459,101463 **** schin:281 schin:279 - schin:271 object ram:2109 title=Applying --- 101641,101644 ---- Index: todo.txt =================================================================== RCS file: /cvsroot/sheets/sheets/todo.txt,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** todo.txt 30 May 2003 08:16:01 -0000 1.20 --- todo.txt 2 Jun 2003 08:05:15 -0000 1.21 *************** *** 2,7 **** - ! Important: ! need to fix sync on open so it is iterative annoying bugs that should be fixed: --- 2,7 ---- - ! * Fix the background image of the project wizard dialog ! * Show the import errors in a new wizard pane annoying bugs that should be fixed: |