cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amania...@apache.org
Subject svn commit: r684399 - in /cayenne/main/trunk/framework/cayenne-modeler/src/main: java/org/apache/cayenne/modeler/ java/org/apache/cayenne/modeler/event/ java/org/apache/cayenne/modeler/util/ resources/org/apache/cayenne/modeler/images/
Date Sun, 10 Aug 2008 02:47:44 GMT
Author: amaniatis
Date: Sat Aug  9 19:47:44 2008
New Revision: 684399

URL: http://svn.apache.org/viewvc?rev=684399&view=rev
Log:
CAY-894 Patch from Andrey Razumovsky

Create Welcome screen on Cayenne modeler with recently opened files history.


Added:
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/WelcomeScreen.java
  (with props)
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/RecentFileListListener.java
  (with props)
    cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-new-over.png
  (with props)
    cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-new.png
  (with props)
    cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-open-over.png
  (with props)
    cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-open.png
  (with props)
    cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/welcome.jpg
  (with props)
Modified:
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/RecentFileMenu.java

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java?rev=684399&r1=684398&r2=684399&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java
Sat Aug  9 19:47:44 2008
@@ -43,7 +43,6 @@
 import org.apache.cayenne.modeler.pref.ComponentGeometry;
 import org.apache.cayenne.modeler.pref.FSPath;
 import org.apache.cayenne.modeler.util.CayenneController;
-import org.apache.cayenne.modeler.util.RecentFileMenu;
 import org.apache.cayenne.pref.Domain;
 import org.apache.cayenne.project.Project;
 import org.apache.cayenne.project.validator.Validator;
@@ -220,9 +219,7 @@
         // update preferences
         if (!project.isLocationUndefined()) {
             getLastDirectory().setDirectory(project.getProjectDirectory());
-            RecentFileMenu recentFileMenu = frame.getRecentFileMenu();
-            recentFileMenu.rebuildFromPreferences();
-            recentFileMenu.setEnabled(recentFileMenu.getMenuComponentCount() > 0);
+            frame.fireRecentFileListChanged();
         }
 
         // --- check for load errors

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java?rev=684399&r1=684398&r2=684399&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java
Sat Aug  9 19:47:44 2008
@@ -20,21 +20,81 @@
 
 package org.apache.cayenne.modeler;
 
-import org.apache.cayenne.modeler.action.*;
+import java.awt.AWTEvent;
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.Toolkit;
+import java.awt.event.AWTEventListener;
+import java.awt.event.KeyEvent;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JPanel;
+import javax.swing.JSplitPane;
+import javax.swing.JTextField;
+import javax.swing.JToolBar;
+
+import org.apache.cayenne.modeler.action.AboutAction;
+import org.apache.cayenne.modeler.action.ConfigurePreferencesAction;
+import org.apache.cayenne.modeler.action.CreateDataMapAction;
+import org.apache.cayenne.modeler.action.CreateDbEntityAction;
+import org.apache.cayenne.modeler.action.CreateDomainAction;
+import org.apache.cayenne.modeler.action.CreateNodeAction;
+import org.apache.cayenne.modeler.action.CreateObjEntityAction;
+import org.apache.cayenne.modeler.action.CreateProcedureAction;
+import org.apache.cayenne.modeler.action.CreateQueryAction;
+import org.apache.cayenne.modeler.action.DocumentationAction;
+import org.apache.cayenne.modeler.action.ExitAction;
+import org.apache.cayenne.modeler.action.FindAction;
+import org.apache.cayenne.modeler.action.GenerateCodeAction;
+import org.apache.cayenne.modeler.action.GenerateDBAction;
+import org.apache.cayenne.modeler.action.ImportDBAction;
+import org.apache.cayenne.modeler.action.ImportDataMapAction;
+import org.apache.cayenne.modeler.action.ImportEOModelAction;
+import org.apache.cayenne.modeler.action.MigrateAction;
+import org.apache.cayenne.modeler.action.NavigateBackwardAction;
+import org.apache.cayenne.modeler.action.NavigateForwardAction;
+import org.apache.cayenne.modeler.action.NewProjectAction;
+import org.apache.cayenne.modeler.action.ObjEntitySyncAction;
+import org.apache.cayenne.modeler.action.OpenProjectAction;
+import org.apache.cayenne.modeler.action.ProjectAction;
+import org.apache.cayenne.modeler.action.RemoveAction;
+import org.apache.cayenne.modeler.action.RevertAction;
+import org.apache.cayenne.modeler.action.SaveAction;
+import org.apache.cayenne.modeler.action.SaveAsAction;
+import org.apache.cayenne.modeler.action.ShowLogConsoleAction;
+import org.apache.cayenne.modeler.action.ValidateAction;
 import org.apache.cayenne.modeler.dialog.LogConsole;
 import org.apache.cayenne.modeler.editor.EditorView;
-import org.apache.cayenne.modeler.event.*;
+import org.apache.cayenne.modeler.event.DataMapDisplayEvent;
+import org.apache.cayenne.modeler.event.DataMapDisplayListener;
+import org.apache.cayenne.modeler.event.DataNodeDisplayEvent;
+import org.apache.cayenne.modeler.event.DataNodeDisplayListener;
+import org.apache.cayenne.modeler.event.DbEntityDisplayListener;
+import org.apache.cayenne.modeler.event.EntityDisplayEvent;
+import org.apache.cayenne.modeler.event.MultipleObjectsDisplayEvent;
+import org.apache.cayenne.modeler.event.MultipleObjectsDisplayListener;
+import org.apache.cayenne.modeler.event.ObjEntityDisplayListener;
+import org.apache.cayenne.modeler.event.ProcedureDisplayEvent;
+import org.apache.cayenne.modeler.event.ProcedureDisplayListener;
+import org.apache.cayenne.modeler.event.QueryDisplayEvent;
+import org.apache.cayenne.modeler.event.QueryDisplayListener;
+import org.apache.cayenne.modeler.event.RecentFileListListener;
 import org.apache.cayenne.modeler.pref.ComponentGeometry;
 import org.apache.cayenne.modeler.util.CayenneAction;
 import org.apache.cayenne.modeler.util.OperatingSystem;
 import org.apache.cayenne.modeler.util.RecentFileMenu;
 import org.apache.cayenne.pref.Domain;
 
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.AWTEventListener;
-import java.awt.event.KeyEvent;
-
 /**
  * Main frame of CayenneModeler. Responsibilities include coordination of
  * enabling/disabling of menu and toolbar.
@@ -64,13 +124,28 @@
      */
     protected Component dockComponent;
     
+    /**
+     * Listeners for changes in recent file menu
+     */
+    protected List<RecentFileListListener> recentFileListeners;
+    
+    /**
+     * Welcome screen, shown when no project is open
+     */
+    protected WelcomeScreen welcomeScreen;
+    
     public CayenneModelerFrame(ActionManager actionManager) {
         super(ModelerConstants.TITLE);
         this.actionManager = actionManager;
+        
+        recentFileListeners = new Vector<RecentFileListListener>();
 
         initMenus();
         initToolbar();
         initStatusBar();
+        initWelcome();
+        
+        fireRecentFileListChanged(); //start filling list in welcome screen and in menu
         
         setView(null);
     }
@@ -108,8 +183,7 @@
         fileMenu.addSeparator();
 
         recentFileMenu = new RecentFileMenu("Recent Projects");
-        recentFileMenu.rebuildFromPreferences();
-        recentFileMenu.setEnabled(recentFileMenu.getMenuComponentCount() > 0);
+        addRecentFileListListener(recentFileMenu);
         fileMenu.add(recentFileMenu);
 
         // Mac OS X doesn't use File->Exit, it uses CayenneModeler->Quit (command-Q)
@@ -206,6 +280,14 @@
     }
     
     /**
+     * Initializes welcome screen
+     */
+    protected void initWelcome() {
+        welcomeScreen = new WelcomeScreen();
+        addRecentFileListListener(welcomeScreen);
+    }
+    
+    /**
      * Plugs a component in the frame, between main area and status bar
      */
     public void setDockComponent(Component c) {
@@ -349,10 +431,26 @@
             splitPane.setTopComponent(view);
         }
         else {
-            splitPane.setTopComponent(new JPanel());
+            splitPane.setTopComponent(welcomeScreen);
         }
 
         validate();
         splitPane.setDividerLocation(oldLocation);
     }
+    
+    /**
+     * Adds listener for recent menu changes
+     */
+    public void addRecentFileListListener(RecentFileListListener listener) {
+        recentFileListeners.add(listener);
+    }
+    
+    /**
+     * Notifies all listeners that recent file list has changed
+     */
+    public void fireRecentFileListChanged() {
+        for (int i = 0; i < recentFileListeners.size(); i++) {
+            recentFileListeners.get(i).recentFileListChanged();
+        }
+    }
 }

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/WelcomeScreen.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/WelcomeScreen.java?rev=684399&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/WelcomeScreen.java
(added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/WelcomeScreen.java
Sat Aug  9 19:47:44 2008
@@ -0,0 +1,313 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+
+package org.apache.cayenne.modeler;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseEvent;
+import java.io.File;
+import java.util.Vector;
+
+import javax.swing.AbstractListModel;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.SwingConstants;
+import javax.swing.SwingUtilities;
+import javax.swing.event.MouseInputListener;
+
+import org.apache.cayenne.modeler.action.NewProjectAction;
+import org.apache.cayenne.modeler.action.OpenProjectAction;
+import org.apache.cayenne.modeler.event.RecentFileListListener;
+import org.apache.cayenne.modeler.util.ModelerUtil;
+
+/**
+ * Welcome screen (CAY-894) is a panel shown when no project is open.
+ * User can quickly create new project or open an existing one.
+ * @author Andrey Razumovsky
+ */
+public class WelcomeScreen extends JPanel implements RecentFileListListener {
+
+    /**
+     * Top color of gradient background
+     */
+    private static final Color TOP_GRADIENT = new Color(153, 153, 153);
+
+    /**
+     * Bottom color of gradient background
+     */
+    private static final Color BOTTOM_GRADIENT = new Color(230, 230, 230);
+    
+    /**
+     * List of recent projects
+     */
+    private JList recentsList;
+
+    public WelcomeScreen() {
+        initView();
+    }
+
+    /**
+     * Creates all neccesary components
+     */
+    protected void initView() {
+        setLayout(new GridBagLayout());
+
+        ImageIcon welcome = ModelerUtil.buildIcon("welcome.jpg");
+        JLabel imageLabel = new JLabel(welcome);
+
+        ImageIcon newOutIcon = ModelerUtil.buildIcon("icon-welcome-new.png");
+        ImageIcon newOverIcon = ModelerUtil.buildIcon("icon-welcome-new-over.png");
+        ImageIcon openOutIcon = ModelerUtil.buildIcon("icon-welcome-open.png");
+        ImageIcon openOverIcon = ModelerUtil.buildIcon("icon-welcome-open-over.png");
+
+        JPanel buttonsPane = new JPanel(null);
+        buttonsPane.setPreferredSize(new Dimension(300, 30));
+
+        buttonsPane.setOpaque(false);
+
+        JButton newButton = createButton(newOutIcon, newOverIcon);
+        newButton.addActionListener(Application.getInstance().getAction(NewProjectAction.getActionName()));
+        
+        JLabel newLabel = new JLabel(NewProjectAction.getActionName(), SwingConstants.CENTER);
+
+        JButton openButton = createButton(openOutIcon, openOverIcon);
+        openButton.addActionListener(Application.getInstance().getAction(OpenProjectAction.getActionName()));
+        
+        JLabel openLabel = new JLabel(OpenProjectAction.getActionName(), SwingConstants.CENTER);
+
+        imageLabel.setLayout(new BorderLayout());
+
+        newButton.setLocation(10, 130);
+        buttonsPane.add(newButton);
+
+        newLabel.setLocation(newButton.getX()
+                + newButton.getWidth() / 2 - newLabel.getPreferredSize().width / 2, 
+                newButton.getY() + newButton.getHeight());
+        newLabel.setSize(newLabel.getPreferredSize());
+        buttonsPane.add(newLabel);
+
+        openButton.setLocation(120, newButton.getY());
+        buttonsPane.add(openButton);
+
+        openLabel.setLocation(openButton.getX()
+                + openButton.getWidth() / 2 - openLabel.getPreferredSize().width / 2, 
+                openButton.getY() + openButton.getHeight());
+        openLabel.setSize(openLabel.getPreferredSize());
+        buttonsPane.add(openLabel);
+        
+        JLabel recents = new JLabel("Recent Projects:");
+        recents.setLocation(207, newButton.getY());
+        recents.setSize(recents.getPreferredSize());
+        recents.setHorizontalTextPosition(10);
+        
+        buttonsPane.add(recents);
+        
+        recentsList = new JList();
+        recentsList.setOpaque(false);
+        
+        recentsList.setLocation(recents.getX(), recents.getY() + 2 * recents.getHeight());
+        recentsList.setSize(welcome.getIconWidth() - recentsList.getX() - 1, 
+                welcome.getIconHeight() - recentsList.getY());
+        
+        recentsList.setCellRenderer(new RecentFileListRenderer(recentsList));
+        
+        buttonsPane.add(recentsList);
+
+        imageLabel.add(buttonsPane);
+
+        add(imageLabel);
+    }
+
+    /**
+     * Creates welcome screen-specific button
+     */
+    private JButton createButton(Icon outIcon, Icon overIcon) {
+        JButton button = new JButton();
+
+        button.setFocusPainted(false);
+        button.setFocusable(false);
+        button.setBorderPainted(false);
+        button.setOpaque(false);
+        button.setContentAreaFilled(false);
+
+        button.setPressedIcon(overIcon);
+        button.setRolloverIcon(overIcon);
+        button.setIcon(outIcon);
+
+        button.setSize(outIcon.getIconWidth(), outIcon.getIconHeight());
+
+        return button;
+    }
+
+    /**
+     * Paints gradient background
+     */
+    @Override
+    public void paintComponent(Graphics g) {
+        Graphics2D g2 = (Graphics2D) g.create();
+        g2.setPaint(new GradientPaint(
+                        0,
+                        0,
+                        TOP_GRADIENT,
+                        0,
+                        getHeight(),
+                        BOTTOM_GRADIENT));
+        g2.fillRect(0, 0, getWidth(), getHeight());
+
+        g2.dispose();
+    }
+    
+    public void recentFileListChanged() {
+        ModelerPreferences pref = ModelerPreferences.getPreferences();
+        final Vector<?> arr = pref.getVector(ModelerPreferences.LAST_PROJ_FILES);
+        
+        recentsList.setModel(
+            new AbstractListModel() {
+                public int getSize() { return arr.size(); }
+                public Object getElementAt(int i) { return arr.elementAt(i); }
+            });
+    }
+    
+    /**
+     * Renderer for the list of last files. Ignores the selection, instead paints
+     * with ROLLOVER_BACKGROUND (currently red) the row mouse is hovering over
+     */
+    class RecentFileListRenderer extends DefaultListCellRenderer implements MouseInputListener
{
+        /**
+         * Color for background of row mouse is over
+         */
+        final Color ROLLOVER_BACKGROUND = Color.RED;
+        
+        /**
+         * Color for foreground of row mouse is over
+         */
+        final Color ROLLOVER_FOREGROUND = Color.WHITE;
+        
+        /**
+         * List which is rendered
+         */
+        private JList list;
+        
+        /**
+         * Row mouse is over
+         */
+        private int rolloverRow;
+        
+        public RecentFileListRenderer(JList list) {
+            list.addMouseListener(this);
+            list.addMouseMotionListener(this);
+            
+            this.list = list;
+            rolloverRow = -1;
+            
+            setHorizontalTextPosition(10);
+        }
+        
+        @Override
+        public Component getListCellRendererComponent(
+                JList list,
+                Object value,
+                int index,
+                boolean isSelected,
+                boolean cellHasFocus) {
+            //selection is ignored
+            super.getListCellRendererComponent(list, value, index, false, false);
+            
+            if (rolloverRow == index) {
+                setOpaque(true);
+                setForeground(ROLLOVER_FOREGROUND);
+                setBackground(ROLLOVER_BACKGROUND);
+            }
+            else {
+                setOpaque(false);
+            }
+            
+            return this;
+        }
+
+        public void mouseClicked(MouseEvent e) {
+        }
+
+        public void mouseEntered(MouseEvent e) {
+            mouseMoved(e);
+        }
+
+        public void mouseExited(MouseEvent e) {
+            rolloverRow = -1;
+            list.repaint();
+        }
+
+        public void mousePressed(MouseEvent e) {
+        }
+
+        public void mouseReleased(MouseEvent e) {
+            if (SwingUtilities.isLeftMouseButton(e) && rolloverRow != -1) {
+                File file = new File((String) list.getModel().getElementAt(rolloverRow));
+                
+                /**
+                 * Fire an action with the file as source
+                 */
+                Application.getInstance().getAction(OpenProjectAction.getActionName()).performAction(
+                        new ActionEvent(file, 0, null));
+                
+                rolloverRow = -1; //clear selection
+            }
+        }
+
+        public void mouseDragged(MouseEvent e) {
+        }
+
+        public void mouseMoved(MouseEvent e) {
+            int newRow;
+            
+            /**
+             * Check that a row boundary contains the mouse point, so that rolloverRow would
+             * be -1 if we are below last row
+             */
+            if (list.getModel().getSize() > 0 && 
+                    !list.getCellBounds(0, list.getModel().getSize() - 1).contains(e.getPoint()))
{
+                newRow = -1;
+            }
+            else {
+                newRow = list.locationToIndex(e.getPoint()); 
+            }
+            
+            if (rolloverRow != newRow) {
+                rolloverRow = newRow;
+                list.repaint();
+            }
+            
+            
+        }
+        
+    }
+}
\ No newline at end of file

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/WelcomeScreen.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/RecentFileListListener.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/RecentFileListListener.java?rev=684399&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/RecentFileListListener.java
(added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/RecentFileListListener.java
Sat Aug  9 19:47:44 2008
@@ -0,0 +1,32 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+
+package org.apache.cayenne.modeler.event;
+
+/**
+ * Listens to changes in recent file list 
+ * @author Andrey Razumovsky
+ */
+public interface RecentFileListListener {
+    /**
+     * Invoked when recent files list changed (for instance, a new project was opened
+     * and so must be added to recent files menu
+     */
+    public void recentFileListChanged();
+}
\ No newline at end of file

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/RecentFileListListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/RecentFileMenu.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/RecentFileMenu.java?rev=684399&r1=684398&r2=684399&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/RecentFileMenu.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/RecentFileMenu.java
Sat Aug  9 19:47:44 2008
@@ -29,6 +29,7 @@
 import org.apache.cayenne.modeler.Application;
 import org.apache.cayenne.modeler.ModelerPreferences;
 import org.apache.cayenne.modeler.action.OpenProjectAction;
+import org.apache.cayenne.modeler.event.RecentFileListListener;
 import org.apache.cayenne.swing.control.FileMenuItem;
 
 /**
@@ -37,7 +38,7 @@
  * 
  * @author Andrus Adamchik
  */
-public class RecentFileMenu extends JMenu {
+public class RecentFileMenu extends JMenu implements RecentFileListListener {
     /**
      * Constructor for RecentFileMenu.
      */
@@ -93,4 +94,9 @@
     protected Action findAction() {
         return Application.getInstance().getAction(OpenProjectAction.getActionName());
     }
+
+    public void recentFileListChanged() {
+        rebuildFromPreferences();
+        setEnabled(getMenuComponentCount() > 0);
+    }
 }

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-new-over.png
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-new-over.png?rev=684399&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-new-over.png
------------------------------------------------------------------------------
    svn:executable = *

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-new-over.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-new.png
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-new.png?rev=684399&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-new.png
------------------------------------------------------------------------------
    svn:executable = *

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-new.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-open-over.png
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-open-over.png?rev=684399&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-open-over.png
------------------------------------------------------------------------------
    svn:executable = *

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-open-over.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-open.png
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-open.png?rev=684399&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-open.png
------------------------------------------------------------------------------
    svn:executable = *

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-welcome-open.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/welcome.jpg
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/welcome.jpg?rev=684399&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/welcome.jpg
------------------------------------------------------------------------------
    svn:executable = *

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/welcome.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message