Author: daceywang
Date: Thu Apr 23 13:42:29 2009
New Revision: 3002

Added:
trunk/src/icons/architect_header_architect.png (contents, props changed)
   trunk/src/icons/architect_header_bkgd.png   (contents, props changed)
   trunk/src/icons/architect_header_sqlpower.png   (contents, props changed)
   trunk/src/icons/architect_header_welcome.png   (contents, props changed)
Removed:
   trunk/src/icons/architect_welcome_heading.png
Modified:
   trunk/src/ca/sqlpower/architect/ArchitectVersion.java
   trunk/src/ca/sqlpower/architect/profile/output/ProfilePDFFormat.java
   trunk/src/ca/sqlpower/architect/swingui/ASUtils.java
   trunk/src/ca/sqlpower/architect/swingui/ExceptionHandler.java
   trunk/src/ca/sqlpower/architect/swingui/SwingUIProject.java
   trunk/src/ca/sqlpower/architect/swingui/WelcomeScreen.java
   trunk/src/ca/sqlpower/architect/swingui/action/AboutAction.java
   trunk/src/ca/sqlpower/architect/swingui/action/CheckForUpdateAction.java
trunk/src/ca/sqlpower/architect/swingui/action/ExportPlaypenToPDFAction.java

Log:
Update branding on the welcome screen to the new Architect images.

Modified: trunk/src/ca/sqlpower/architect/ArchitectVersion.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/ArchitectVersion.java       (original)
+++ trunk/src/ca/sqlpower/architect/ArchitectVersion.java Thu Apr 23 13:42:29 2009
@@ -67,11 +67,16 @@
     public static final String APP_VERSION_SUFFIX = "alpha";

     /**
+     * The normal readable version number, formatted as Major.Minor.Tiny.
+     */
+ public static final ArchitectVersion APP_VERSION = new ArchitectVersion(APP_VERSION_MAJOR + "." +
+            APP_VERSION_MINOR + "." + APP_VERSION_TINY);
+    /**
* The full version number, formatted as Major.Minor.Tiny[-Suffix]. Note the square * brackets are not part of the version string; they indicate that the hyphen and
      * suffix are omitted when there is no suffix.
      */
- public static final ArchitectVersion APP_VERSION = new ArchitectVersion(APP_VERSION_MAJOR + "." + + public static final ArchitectVersion APP_FULL_VERSION = new ArchitectVersion(APP_VERSION_MAJOR + "." + APP_VERSION_MINOR + "." + APP_VERSION_TINY + (APP_VERSION_SUFFIX.length() > 0
                                               ? "-" + APP_VERSION_SUFFIX

Modified: trunk/src/ca/sqlpower/architect/profile/output/ProfilePDFFormat.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/profile/output/ProfilePDFFormat.java (original) +++ trunk/src/ca/sqlpower/architect/profile/output/ProfilePDFFormat.java Thu Apr 23 13:42:29 2009
@@ -140,7 +140,7 @@
         document.addTitle("Table Profiling Report");
         document.addSubject("Tables: " + profileResults);
         document.addAuthor(System.getProperty("user.name"));
- document.addCreator("Power*Architect version "+ArchitectVersion.APP_VERSION); + document.addCreator("Power*Architect version "+ArchitectVersion.APP_FULL_VERSION);

         document.open();


Modified: trunk/src/ca/sqlpower/architect/swingui/ASUtils.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/ASUtils.java        (original)
+++ trunk/src/ca/sqlpower/architect/swingui/ASUtils.java Thu Apr 23 13:42:29 2009
@@ -439,7 +439,7 @@
         try {
UserSettings settings = context.getUserSettings().getQfaUserSettings(); if (!settings.getBoolean(QFAUserSettings.EXCEPTION_REPORTING,true)) return; - ExceptionReport report = new ExceptionReport(t, ExceptionHandler.DEFAULT_REPORT_URL, ArchitectVersion.APP_VERSION.toString(), "Architect"); + ExceptionReport report = new ExceptionReport(t, ExceptionHandler.DEFAULT_REPORT_URL, ArchitectVersion.APP_FULL_VERSION.toString(), "Architect");

             if (session != null &&
                     session.getProject() != null &&

Modified: trunk/src/ca/sqlpower/architect/swingui/ExceptionHandler.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/ExceptionHandler.java       
(original)
+++ trunk/src/ca/sqlpower/architect/swingui/ExceptionHandler.java Thu Apr 23 13:42:29 2009
@@ -85,7 +85,7 @@
ASUtils.showExceptionDialogNoReport("An unexpected exception has occured: ", e); UserSettings settings = context.getUserSettings().getQfaUserSettings(); if (!settings.getBoolean(QFAUserSettings.EXCEPTION_REPORTING,true)) return; - ExceptionReport report = new ExceptionReport(e, DEFAULT_REPORT_URL, ArchitectVersion.APP_VERSION.toString(), "Architect"); + ExceptionReport report = new ExceptionReport(e, DEFAULT_REPORT_URL, ArchitectVersion.APP_FULL_VERSION.toString(), "Architect");

         StringBuffer remarks = new StringBuffer();
         Collection<ArchitectSession> sessions = context.getSessions();

Modified: trunk/src/ca/sqlpower/architect/swingui/SwingUIProject.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/SwingUIProject.java (original)
+++ trunk/src/ca/sqlpower/architect/swingui/SwingUIProject.java Thu Apr 23 13:42:29 2009
@@ -716,7 +716,7 @@

         try {
ioo.println(out, "<?xml version=\"1.0\" encoding=\""+encoding+"\"?>"); //$NON-NLS-1$ //$NON-NLS-2$ - ioo.println(out, "<architect-project version=\"1.0\" appversion=\""+ArchitectVersion.APP_VERSION+"\">"); //$NON-NLS-1$ //$NON-NLS-2$ + ioo.println(out, "<architect-project version=\"1.0\" appversion=\""+ArchitectVersion.APP_FULL_VERSION+"\">"); //$NON-NLS-1$ //$NON-NLS-2$
             ioo.indent++;
ioo.println(out, "<project-name>"+SQLPowerUtils.escapeXML(getSession().getName())+"</project-name>"); //$NON-NLS-1$ //$NON-NLS-2$
             savePrintSettings(out, getSession().getPrintSettings());
@@ -740,13 +740,13 @@
                 oSession.saveNotify();
             }
         } catch (IOException e) {
- ioo.println(out, new ExceptionReport(e, "", ArchitectVersion.APP_VERSION.toString(), "Architect").toXML()); + ioo.println(out, new ExceptionReport(e, "", ArchitectVersion.APP_FULL_VERSION.toString(), "Architect").toXML());
             throw e;
         } catch (SQLObjectException e) {
- ioo.println(out, new ExceptionReport(e, "", ArchitectVersion.APP_VERSION.toString(), "Architect").toXML()); + ioo.println(out, new ExceptionReport(e, "", ArchitectVersion.APP_FULL_VERSION.toString(), "Architect").toXML());
             throw e;
         } catch (RuntimeException e) {
- ioo.println(out, new ExceptionReport(e, "", ArchitectVersion.APP_VERSION.toString(), "Architect").toXML()); + ioo.println(out, new ExceptionReport(e, "", ArchitectVersion.APP_FULL_VERSION.toString(), "Architect").toXML());
             throw e;
         } finally {
             if (out != null) out.close();

Modified: trunk/src/ca/sqlpower/architect/swingui/WelcomeScreen.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/WelcomeScreen.java  (original)
+++ trunk/src/ca/sqlpower/architect/swingui/WelcomeScreen.java Thu Apr 23 13:42:29 2009
@@ -19,13 +19,18 @@
 package ca.sqlpower.architect.swingui;

 import java.awt.BorderLayout;
+import java.awt.Color;
 import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.LayoutManager;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.io.IOException;
 import java.net.URL;

 import javax.swing.BorderFactory;
+import javax.swing.ImageIcon;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JDialog;
@@ -40,6 +45,10 @@
 import ca.sqlpower.swingui.SPSUtils;
 import ca.sqlpower.util.BrowserUtil;

+import com.jgoodies.forms.builder.DefaultFormBuilder;
+import com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.FormLayout;
+
 /**
* Creates a JPanel that is the Welcome Screen, for adding to the main window.
  */
@@ -62,7 +71,7 @@
     final static String welcomeHTMLstuff =
"<html><head><style type=\"text/css\">body {margin-left: 100px; margin-right: 100px;}</style></head>" + //$NON-NLS-1$
         "<body>" + //$NON-NLS-1$
- "<h1 align=\"center\">Power*Architect " + ArchitectVersion.APP_VERSION + "</h1>" + //$NON-NLS-1$ //$NON-NLS-2$ + "<h1 align=\"center\">Power*Architect " + ArchitectVersion.APP_FULL_VERSION + "</h1>" + //$NON-NLS-1$ //$NON-NLS-2$
         "<br><br><br>" + //$NON-NLS-1$
"<p>" + Messages.getString("WelcomeScreen.forumInfo", SPSUtils.FORUM_URL) + //$NON-NLS-1$ //$NON-NLS-2$
         "<br><br>" + //$NON-NLS-1$
@@ -74,8 +83,12 @@
     public void showWelcomeDialog(Component dialogOwner) {
final JDialog d = SPSUtils.makeOwnedDialog(dialogOwner, Messages.getString("WelcomeScreen.welcomeScreenTitle")); //$NON-NLS-1$
         d.setLayout(new BorderLayout(0, 12));
-
-        d.add(imageLabel, BorderLayout.NORTH);
+ DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout("pref:grow, fill:pref, pref:grow", "pref, pref, pref"));
+        CellConstraints cc = new CellConstraints();
+        JPanel logoPanel = LogoLayout.generateLogoPanel();
+        builder.add(logoPanel, cc.xyw(1, 1, 3));
+        d.add(builder.getPanel(), BorderLayout.NORTH);
+        logoPanel.getLayout().layoutContainer(logoPanel);

         HTMLEditorKit htmlKit = new HTMLEditorKit();
         final JEditorPane htmlComponent = new JEditorPane();
@@ -129,5 +142,70 @@

         d.setLocationRelativeTo(dialogOwner);
         d.setVisible(true);
+    }
+
+    private static class LogoLayout implements LayoutManager {
+
+        private int textStartY = 130;
+        private int textStartX = 400;
+
+        public static JPanel generateLogoPanel() {
+            JPanel panel = new JPanel(new LogoLayout());
+
+ JLabel bgLabel = new JLabel(new ImageIcon(WelcomeScreen.class.getClassLoader().getResource("icons/architect_header_bkgd.png"))); + JLabel welcomeLabel = new JLabel(new ImageIcon(WelcomeScreen.class.getClassLoader().getResource("icons/architect_header_welcome.png"))); + JLabel architectLabel = new JLabel(new ImageIcon(WelcomeScreen.class.getClassLoader().getResource("icons/architect_header_architect.png"))); + JLabel sqlpowerLabel = new JLabel(new ImageIcon(WelcomeScreen.class.getClassLoader().getResource("icons/architect_header_sqlpower.png"))); + JLabel versionLabel = new JLabel("" + ArchitectVersion.APP_VERSION);
+            versionLabel.setForeground(new Color(0x999999));
+
+            panel.add(welcomeLabel);
+            panel.add(architectLabel);
+            panel.add(sqlpowerLabel);
+            panel.add(versionLabel);
+            panel.add(bgLabel);
+            return panel;
+        }
+
+        private LogoLayout() {
+            //Do nothing for init.
+        }
+
+        public void layoutContainer(Container parent) {
+            JLabel bgLabel = (JLabel) parent.getComponent(4);
+            JLabel welcomeLabel = (JLabel) parent.getComponent(0);
+            JLabel architectLabel = (JLabel) parent.getComponent(1);
+            JLabel sqlpowerLabel = (JLabel) parent.getComponent(2);
+            JLabel versionLabel = (JLabel) parent.getComponent(3);
+
+            int headerStartX = (parent.getWidth() - 800) / 2;
+
+            bgLabel.setBounds(0, 0, parent.getWidth(), parent.getHeight());
+ welcomeLabel.setBounds(headerStartX, 0, welcomeLabel.getPreferredSize().width, welcomeLabel.getPreferredSize().height); + architectLabel.setBounds(welcomeLabel.getX() + welcomeLabel.getPreferredSize().width, 0, architectLabel.getPreferredSize().width, architectLabel.getPreferredSize().height); + sqlpowerLabel.setBounds(headerStartX + 800 - sqlpowerLabel.getPreferredSize().width, 0, sqlpowerLabel.getPreferredSize().width, sqlpowerLabel.getPreferredSize().height); + versionLabel.setBounds(architectLabel.getX() + textStartX, architectLabel.getY() + textStartY, versionLabel.getPreferredSize().width, versionLabel.getPreferredSize().height);
+        }
+
+        public Dimension minimumLayoutSize(Container parent) {
+            JLabel welcomeLabel = (JLabel) parent.getComponent(0);
+            JLabel architectLabel = (JLabel) parent.getComponent(1);
+            JLabel sqlpowerLabel = (JLabel) parent.getComponent(2);
+
+ return new Dimension(welcomeLabel.getWidth() + architectLabel.getWidth() + sqlpowerLabel.getWidth(), + Math.max(Math.max(welcomeLabel.getHeight(), architectLabel.getHeight()), sqlpowerLabel.getHeight()));
+        }
+
+        public Dimension preferredLayoutSize(Container parent) {
+            return minimumLayoutSize(parent);
+        }
+
+        public void removeLayoutComponent(Component comp) {
+            // no-op
+        }
+
+        public void addLayoutComponent(String name, Component comp) {
+            // no-op
+        }
     }
 }

Modified: trunk/src/ca/sqlpower/architect/swingui/action/AboutAction.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/action/AboutAction.java (original) +++ trunk/src/ca/sqlpower/architect/swingui/action/AboutAction.java Thu Apr 23 13:42:29 2009
@@ -53,7 +53,7 @@
                
ImageIcon imageIcon = SPSUtils.createIcon("architect128", "Architect Logo");
                
- final AboutPanel aboutPanel = new AboutPanel(imageIcon, "Power*Architect", "ca/sqlpower/architect/architect.version.properties", ArchitectVersion.APP_VERSION.toString()); + final AboutPanel aboutPanel = new AboutPanel(imageIcon, "Power*Architect", "ca/sqlpower/architect/architect.version.properties", ArchitectVersion.APP_FULL_VERSION.toString());
                cp.add(aboutPanel, BorderLayout.CENTER);
                        
                JPanel buttonPanel = new JPanel(new 
FlowLayout(FlowLayout.RIGHT));

Modified: trunk/src/ca/sqlpower/architect/swingui/action/CheckForUpdateAction.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/action/CheckForUpdateAction.java (original) +++ trunk/src/ca/sqlpower/architect/swingui/action/CheckForUpdateAction.java Thu Apr 23 13:42:29 2009
@@ -78,7 +78,7 @@

versionPropertyString = properties.getProperty("app.version"); //$NON-NLS-1$ ArchitectVersion latestVersion = new ArchitectVersion(versionPropertyString);
-            ArchitectVersion userVersion = ArchitectVersion.APP_VERSION;
+ ArchitectVersion userVersion = ArchitectVersion.APP_FULL_VERSION;

             if (userVersion.compareTo(latestVersion) < 0) {
                 promptUpdate();

Modified: trunk/src/ca/sqlpower/architect/swingui/action/ExportPlaypenToPDFAction.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/action/ExportPlaypenToPDFAction.java (original) +++ trunk/src/ca/sqlpower/architect/swingui/action/ExportPlaypenToPDFAction.java Thu Apr 23 13:42:29 2009
@@ -140,7 +140,7 @@

d.addTitle(Messages.getString("ExportPlaypenToPDFAction.PdfTitle")); //$NON-NLS-1$
             d.addAuthor(System.getProperty("user.name")); //$NON-NLS-1$
- d.addCreator(Messages.getString("ExportPlaypenToPDFAction.powerArchitectVersion")+ArchitectVersion.APP_VERSION); //$NON-NLS-1$ + d.addCreator(Messages.getString("ExportPlaypenToPDFAction.powerArchitectVersion")+ArchitectVersion.APP_FULL_VERSION); //$NON-NLS-1$

             PdfWriter writer = PdfWriter.getInstance(d, out);
             d.open();

Added: trunk/src/icons/architect_header_architect.png
==============================================================================
Binary file. No diff available.

Added: trunk/src/icons/architect_header_bkgd.png
==============================================================================
Binary file. No diff available.

Added: trunk/src/icons/architect_header_sqlpower.png
==============================================================================
Binary file. No diff available.

Added: trunk/src/icons/architect_header_welcome.png
==============================================================================
Binary file. No diff available.

Reply via email to