Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: MODIFIED: util ...

gef
Discussion topic

Back to topic list

CVS update: MODIFIED: util ...

Reply

Author 1sturm
Full name Thorsten Sturm
Date 2002-02-26 01:26:12 PST
Message User: 1sturm
  Date: 02/02/26 01:26:12

  Modified: src/org/tigris/gef/util ResourceLoader.java
  Log:
  making some features non-static
  
  Revision Changes Path
  1.3 +3 -2 gef/src/org/tigris/g​ef/base/ModeCreate.j​ava
  
  http://gef.tigris.or​g/source/browse/gef/​src/org/tigris/gef/b​ase/ModeCreate.java.​diff?r1=1.2&r2=1​.3
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ModeCreate.java
  ====================​====================​====================​=======
  RCS file: /usr/local/tigris/da​ta/helm/cvs/reposito​ry/gef/src/org/tigri​s/gef/base/ModeCreat​e.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- ModeCreate.java 2000/10/16 12:04:47 1.2
  +++ ModeCreate.java 2002/02/26 09:26:11 1.3
  @@ -24,7 +24,7 @@
   // File: ModeCreate.java
   // Classes: ModeCreate
   // Original Author: jrobbins at ics dot uci dot edu
  -// $Id: ModeCreate.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
  +// $Id: ModeCreate.java,v 1.3 2002/02/26 09:26:11 1sturm Exp $
   
   package org.tigris.gef.base;
   
  @@ -61,7 +61,8 @@
   
     /** The default size of a Fig if the user simply clicks instead of
      * dragging out a size. */
  - protected static int _defaultWidth = 32, _defaultHeight = 32;
  + protected int _defaultWidth = 32;
  + protected int _defaultHeight = 32;
   
   
   
  
  
  
  1.3 +7 -1 gef/src/org/tigris/g​ef/base/ModeCreateFi​gText.java
  
  http://gef.tigris.or​g/source/browse/gef/​src/org/tigris/gef/b​ase/ModeCreateFigTex​t.java.diff?r1=1.2​&r2=1.3
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ModeCreateFigText.java
  ====================​====================​====================​=======
  RCS file: /usr/local/tigris/da​ta/helm/cvs/reposito​ry/gef/src/org/tigri​s/gef/base/ModeCreat​eFigText.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- ModeCreateFigText.java 2000/10/16 12:04:47 1.2
  +++ ModeCreateFigText.java 2002/02/26 09:26:11 1.3
  @@ -26,7 +26,7 @@
   // File: ModeCreateFigText.java
   // Classes: ModeCreateFigText
   // Original Author: ics125 spring 1996
  -// $Id: ModeCreateFigText.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
  +// $Id: ModeCreateFigText.java,v 1.3 2002/02/26 09:26:11 1sturm Exp $
   
   package org.tigris.gef.base;
   
  @@ -41,6 +41,12 @@
   
   public class ModeCreateFigText extends ModeCreate {
   
  + public ModeCreateFigText() {
  + super();
  + _defaultWidth = 15;
  + _defaultHeight = 15;
  + }
  +
     public String instructions() {
       return "Drag to define a text rectangle, then type";
     }
  
  
  
  1.2 +25 -4 gef/src/org/tigris/g​ef/util/ResourceLoad​er.java
  
  http://gef.tigris.or​g/source/browse/gef/​src/org/tigris/gef/u​til/ResourceLoader.j​ava.diff?r1=1.1&​r2=1.2
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ResourceLoader.java
  ====================​====================​====================​=======
  RCS file: /usr/local/tigris/da​ta/helm/cvs/reposito​ry/gef/src/org/tigri​s/gef/util/ResourceL​oader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- ResourceLoader.java 2001/07/19 10:10:26 1.1
  +++ ResourceLoader.java 2002/02/26 09:26:12 1.2
  @@ -24,7 +24,7 @@
   // File: ResourceLoader.java
   // Classes: ResourceLoader
   // Original Author: Thorsten Sturm
  -// $Id: ResourceLoader.java,v 1.1 2001/07/19 10:10:26 1sturm Exp $
  +// $Id: ResourceLoader.java,v 1.2 2002/02/26 09:26:12 1sturm Exp $
   
   package org.tigris.gef.util;
   
  @@ -65,6 +65,7 @@
        *
        * @param resource Name of the image to be looked after.
        * @param desc A description for the ImageIcon.
  + * @param loader The class loader that should be used for loading the resource.
        * @return ImageIcon for the given name, null if no image could be found.
        */
       public static ImageIcon lookupIconResource(String resource) {
  @@ -75,6 +76,14 @@
           return getInstance().doLook​upIconResource(resou​rce,desc);
       }
   
  + public static ImageIcon lookupIconResource(String resource, ClassLoader loader) {
  + return getInstance().doLook​upIconResource(resou​rce,loader);
  + }
  +
  + public static ImageIcon lookupIconResource(String resource, String desc, ClassLoader loader) {
  + return getInstance().doLook​upIconResource(resou​rce,desc,loader);
  + }
  +
       /**
        * This method adds a new location to the list of known locations.
        *
  @@ -191,8 +200,16 @@
       }
   
       protected ImageIcon doLookupIconResource(String resource, String desc) {
  + return doLookupIconResource(resource, desc, null);
  + }
  +
  + protected ImageIcon doLookupIconResource(String resource, ClassLoader loader) {
  + return doLookupIconResource(resource, resource, loader);
  + }
  +
  + protected ImageIcon doLookupIconResource(String resource, String desc, ClassLoader loader) {
           String strippedName = Util.stripJunk(resource);
  - if ( resourceCache.contai​nsKey(strippedName) )
  + if ( doIsInCache(strippedName) )
               return (ImageIcon)resourceC​ache.get(strippedNam​e);
           
           ImageIcon res = null;
  @@ -202,7 +219,11 @@
                   String tmpExt = (String)extensions.next();
                   for (Iterator locations = resourceLocations.iterator(); locations.hasNext();) {
                       String imageName = (String)locations.ne​xt()+"/"+strippedNam​e+"."+tmpExt;
  + //System.out.println​("[ResourceLoader] try loading " + imageName);
  + if (loader == null)
                       imgURL = getClass().getResour​ce(imageName);
  + else
  + imgURL = loader.getResource(imageName);
                       if (imgURL != null)
                           break;
                   }
  @@ -218,7 +239,7 @@
               return res;
           }
           catch (Exception ex) {
  - System.out.println("Exception in looking up IconResource");
  + System.err.println("Exception in looking up IconResource");
               ex.printStackTrace();
               return new ImageIcon(strippedName);
           }
  
  
  

--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe at gef dot tigris dot org
For additional commands, e-mail: cvs-help at gef dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: MODIFIED: util ... 1sturm Thorsten Sturm 2002-02-26 01:26:12 PST
Messages per page: