avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core ImageRepositoryImpl.xinfo DesktopKernelImpl.java DesktopKernelImpl.xinfo ImageRepositoryImpl.java
Date Wed, 07 Nov 2001 16:26:43 GMT
hammant     01/11/07 08:26:43

  Modified:    apps/jesktop/src/conf jesktop-assembly.xml
                        jesktop-config.xml
               apps/jesktop/src/java/org/apache/avalon/jesktop/core
                        DesktopKernelImpl.java DesktopKernelImpl.xinfo
                        ImageRepositoryImpl.java
  Added:       apps/jesktop/src/java/org/apache/avalon/jesktop/core
                        ImageRepositoryImpl.xinfo
  Log:
  Image Repository is now a block
  
  Revision  Changes    Path
  1.7       +5 -0      jakarta-avalon-cornerstone/apps/jesktop/src/conf/jesktop-assembly.xml
  
  Index: jesktop-assembly.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/jesktop/src/conf/jesktop-assembly.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jesktop-assembly.xml	2001/11/06 14:42:58	1.6
  +++ jesktop-assembly.xml	2001/11/07 16:26:43	1.7
  @@ -45,11 +45,16 @@
         <provide name="objectstorage" role="org.apache.avalon.cornerstone.services.store.Store"/>
     </block>  
     
  +  <block class="org.apache.avalon.jesktop.core.ImageRepositoryImpl" name="image-repository">
  +      <provide name="objectstorage" role="org.apache.avalon.cornerstone.services.store.Store"/>
  +  </block>    
  +  
     <block class="org.apache.avalon.jesktop.windowmanagers.windoze.WindozeWindowManager1"
            name="jesktop-windowmanager"/>
   
     <block class="org.apache.avalon.jesktop.core.DesktopKernelImpl" name="jesktop-kernel"
>
       <provide name="cfg-mgr" role="org.apache.avalon.jesktop.services.KernelConfigManager"/>
  +    <provide name="image-repository" role="org.jesktop.api.ImageRepository"/>
       <provide name="jesktop-windowmanager" role="org.apache.avalon.jesktop.services.WindowManager"/>
       <provide name="objectstorage" role="org.apache.avalon.cornerstone.services.store.Store"/>
       <provide name="thread-manager" role="org.apache.avalon.cornerstone.services.threads.ThreadManager"/>
  
  
  
  1.6       +7 -0      jakarta-avalon-cornerstone/apps/jesktop/src/conf/jesktop-config.xml
  
  Index: jesktop-config.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/jesktop/src/conf/jesktop-config.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jesktop-config.xml	2001/11/06 11:08:36	1.5
  +++ jesktop-config.xml	2001/11/07 16:26:43	1.6
  @@ -95,6 +95,13 @@
         </repository>  
     </cfg-mgr>
       
  +  <image-repository>
  +      <repository destinationURL="file://./ImageStore/"
  +                type="OBJECT"
  +                model="SYNCHRONOUS">
  +      </repository>  
  +  </image-repository>    
  +    
     <dom-builder-factory>
         <domClass>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</domClass>
     </dom-builder-factory>  
  
  
  
  1.14      +4 -4      jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/DesktopKernelImpl.java
  
  Index: DesktopKernelImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/DesktopKernelImpl.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DesktopKernelImpl.java	2001/11/06 14:42:58	1.13
  +++ DesktopKernelImpl.java	2001/11/07 16:26:43	1.14
  @@ -243,6 +243,7 @@
               mJesktopStore =  (Store) mCompManager.lookup(Store.ROLE);
               mThreadManager = (ThreadManager) mCompManager.lookup(ThreadManager.ROLE);
               mConfigManager = (KernelConfigManager) mCompManager.lookup(KernelConfigManager.class.getName());
  +            mImageRepository = (ImageRepository) mCompManager.lookup(ImageRepository.class.getName());
   
               Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
   
  @@ -267,8 +268,7 @@
                       "Default Decorator", "decorators/default");
               mMimeManager = new MimeManagerImpl(launchableTargetHolder, repository);
               mDesktopKernelProxy = (DesktopKernel) DynamicProxy.newInstance(this, new Class[]
{DesktopKernel.class});
  -            mMimeManagerProxy = (MimeManager) DynamicProxy.newInstance(mMimeManager, new
Class[] {MimeManager.class});            
  -            mImageRepository = new ImageRepositoryImpl(repository);
  +            mMimeManagerProxy = (MimeManager) DynamicProxy.newInstance(mMimeManager, new
Class[] {MimeManager.class});
               mImageRepositoryProxy = (ImageRepository) DynamicProxy.newInstance(mImageRepository,
new Class[] {ImageRepository.class});
               mAppInstaller = new AppInstallerImpl(propertyChangeSupport, this,
                                                   launchableTargetHolder, mImageRepository,
mBaseDirectory);
  @@ -794,7 +794,7 @@
        *
        *
        * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  -     * @version $Revision: 1.13 $
  +     * @version $Revision: 1.14 $
        */
       private class KernelLaunchedTarget extends LaunchedTargetImpl {
   
  @@ -855,7 +855,7 @@
        *
        *
        * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  -     * @version $Revision: 1.13 $
  +     * @version $Revision: 1.14 $
        */
       private class KernelFrimbleListener extends FrimbleAdapter {
   
  
  
  
  1.9       +3 -0      jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/DesktopKernelImpl.xinfo
  
  Index: DesktopKernelImpl.xinfo
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/DesktopKernelImpl.xinfo,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DesktopKernelImpl.xinfo	2001/11/06 14:42:58	1.8
  +++ DesktopKernelImpl.xinfo	2001/11/07 16:26:43	1.9
  @@ -21,5 +21,8 @@
   		<dependency>
   			<service name="org.apache.avalon.jesktop.services.KernelConfigManager" version="1.0"/>
   		</dependency>
  +		<dependency>
  +			<service name="org.jesktop.api.ImageRepository" version="1.0"/>
  +		</dependency>		
   	</dependencies>
   </blockinfo>
  
  
  
  1.2       +51 -19    jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/ImageRepositoryImpl.java
  
  Index: ImageRepositoryImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/ImageRepositoryImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ImageRepositoryImpl.java	2001/09/08 17:42:53	1.1
  +++ ImageRepositoryImpl.java	2001/11/07 16:26:43	1.2
  @@ -9,6 +9,19 @@
   
   import org.jesktop.api.ImageRepository;
   import org.apache.avalon.cornerstone.services.store.ObjectRepository;
  +import org.apache.avalon.cornerstone.services.store.Store;
  +import org.apache.avalon.framework.logger.AbstractLoggable;
  +import org.apache.avalon.framework.context.Contextualizable;
  +import org.apache.avalon.framework.context.Context;
  +import org.apache.avalon.framework.context.ContextException;
  +import org.apache.avalon.framework.component.Composable;
  +import org.apache.avalon.framework.component.ComponentManager;
  +import org.apache.avalon.framework.component.ComponentException;
  +import org.apache.avalon.framework.activity.Initializable;
  +import org.apache.avalon.framework.configuration.Configurable;
  +import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.avalon.phoenix.Block;
   
   import javax.swing.ImageIcon;
   import java.util.HashMap;
  @@ -21,9 +34,10 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
  -public class ImageRepositoryImpl implements ImageRepository {
  +public class ImageRepositoryImpl extends AbstractLoggable implements Block, ImageRepository,
Contextualizable,
  +        Composable, Configurable, Initializable  {
   
       private static final String PATH = "org/apache/avalon/jesktop/icons/";
       private static final ImageIcon DEFAULT_APP_ICON_32 = makeImage(PATH
  @@ -34,16 +48,11 @@
                                                                       + "default_file_32x32.gif");
       private static final ImageIcon DEFAULT_FILE_ICON_16 = makeImage(PATH
                                                                       + "default_file_16x16.gif");
  -    private HashMap images = new HashMap();
  -    private ObjectRepository repository;
  +    private HashMap mImages = new HashMap();
  +    private ObjectRepository mObjectRepository;
  +    private Store mStore;
  +    private Configuration mRepository;
   
  -    protected ImageRepositoryImpl(final ObjectRepository repository) {
  -
  -        this.repository = repository;
  -
  -        setDefaults();
  -    }
  -
       private static ImageIcon makeImage(final String resource) {
   
           URL url =
  @@ -52,6 +61,29 @@
           return new ImageIcon(url);
       }
   
  +    public void contextualize(Context context)
  +            throws ContextException {
  +    }
  +
  +    public void compose(ComponentManager componentManager)
  +            throws ComponentException {
  +        mStore = (Store) componentManager.lookup(Store.class.getName());
  +    }
  +
  +    public void configure(Configuration configuration)
  +            throws ConfigurationException {
  +        mRepository = configuration.getChild("repository");
  +
  +    }
  +
  +    public void initialize()
  +            throws Exception {
  +        mObjectRepository = (ObjectRepository) mStore.select(mRepository);
  +    }
  +
  +    public ImageRepositoryImpl() {
  +    }
  +
       private void setDefaults() {
   
           // these will only happen during install.
  @@ -62,8 +94,8 @@
   
       private void setDefault(final String name, final String imgPath) {
   
  -        if (!repository.containsKey(name)) {
  -            repository.put(name, makeImage(imgPath));
  +        if (!mObjectRepository.containsKey(name)) {
  +            mObjectRepository.put(name, makeImage(imgPath));
           }
       }
   
  @@ -149,16 +181,16 @@
   
       private ImageIcon getImageIcon(final String name, final ImageIcon defaultIcon) {
   
  -        ImageIcon ii = (ImageIcon) images.get(name);
  +        ImageIcon ii = (ImageIcon) mImages.get(name);
   
           if (ii == null) {
  -            if (repository.containsKey(name)) {
  -                ii = (ImageIcon) repository.get(name);
  +            if (mObjectRepository.containsKey(name)) {
  +                ii = (ImageIcon) mObjectRepository.get(name);
               } else {
                   ii = defaultIcon;
               }
   
  -            images.put(name, ii);
  +            mImages.put(name, ii);
           }
   
           return ii;
  @@ -173,7 +205,7 @@
        *
        */
       public void setImageIcon(final String name, final ImageIcon imageIcon) {
  -        repository.put(name, imageIcon);
  -        images.put(name, imageIcon);
  +        mObjectRepository.put(name, imageIcon);
  +        mImages.put(name, imageIcon);
       }
   }
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/ImageRepositoryImpl.xinfo
  
  Index: ImageRepositoryImpl.xinfo
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <blockinfo>
  	<!-- section to describe block -->
  	<block>
  		<version>1.0</version>
  	</block>
  	<!-- services that are offered by this block -->
  	<services>
  		<service name="org.jesktop.api.ImageRepository" version="1.0"/>
  	</services>
  	<dependencies>
  		<dependency>
  			<service name="org.apache.avalon.cornerstone.services.store.Store" version="1.0"/>
  		</dependency>
  	</dependencies>
  </blockinfo>
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message