Changeset f893d48fe61df73547fa433cb8114324c3c76a00

Show
Ignore:
Timestamp:
02/25/07 10:55:17 (2 years ago)
Author:
Christopher Jung <bktheg@web.de>
git-committer:
Christopher Jung <bktheg@web.de> 1172397317 +0100
git-parent:

[b0b7d550cde18a78889e74482730fa3519cf8c2d]

git-author:
Christopher Jung <bktheg@web.de> 1172397317 +0100
Message:

Einie Warnungen gefixt

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • clients/jstarmap/net/driftingsouls/ds2/framework/JImageCache.java

    re5910b8 rf893d48  
    4848 */ 
    4949public class JImageCache implements ImageObserver { 
    50         private HashMap images; 
    51         private HashMap imageNotifierList; 
    52         private HashMap imageNotifierData; 
    53         private Vector resizeTodo; 
     50        protected Map<String,BufferedImage> images; 
     51        protected Map<String,IImageStatusNotifier> imageNotifierList; 
     52        protected Map<String,Object> imageNotifierData; 
     53        protected Vector<Vector<Object>> resizeTodo; 
    5454        private String datapath; 
    5555        private final GraphicsConfiguration gc; 
    5656        private BufferedImage unknownImage; 
    57         private int loadercount; 
    58         private int resizerCount; 
    59         private Vector loadTodo; 
    60         private IWindowManager wm; 
     57        protected int loadercount; 
     58        protected int resizerCount; 
     59        protected Vector<String> loadTodo; 
     60        protected IWindowManager wm; 
    6161         
    6262        /** 
     
    6767         */ 
    6868        public JImageCache( IWindowManager wm, String datapath ) { 
    69                 images = new HashMap(); 
    70                 imageNotifierList = new HashMap(); 
    71                 imageNotifierData = new HashMap(); 
    72                 loadTodo = new Vector(); 
    73                 resizeTodo = new Vector(); 
     69                images = new HashMap<String,BufferedImage>(); 
     70                imageNotifierList = new HashMap<String,IImageStatusNotifier>(); 
     71                imageNotifierData = new HashMap<String,Object>(); 
     72                loadTodo = new Vector<String>(); 
     73                resizeTodo = new Vector<Vector<Object>>(); 
    7474                resizerCount = 0; 
    7575                this.wm = wm; 
     
    144144         */ 
    145145        public BufferedImage getImage(final String myfile, boolean forceLoad ) { 
    146                 BufferedImage myimg = (BufferedImage)images.get(myfile); 
     146                BufferedImage myimg = images.get(myfile); 
    147147         
    148148                if( (myimg == null) && (myfile.indexOf('#') == -1) ) { 
     
    165165                                                                        String nextfile; 
    166166                                                                        synchronized(loadTodo) { 
    167                                                                                 nextfile = (String)loadTodo.firstElement(); 
     167                                                                                nextfile = loadTodo.firstElement(); 
    168168                                                                                loadTodo.remove(0); 
    169169                                                                        } 
     
    174174                                                                        if( imageNotifierList.get(nextfile) != null ) { 
    175175                                                                                Object data = imageNotifierData.get(nextfile); 
    176                                                                                 ((IImageStatusNotifier)imageNotifierList.get(nextfile)).onImageLoaded(nextfile,data); 
     176                                                                                imageNotifierList.get(nextfile).onImageLoaded(nextfile,data); 
    177177                                                                                 
    178178                                                                                imageNotifierData.remove(nextfile); 
     
    200200                        String str = "interface/jstarmap/starmap_unknown.png" + myfile.substring(myfile.indexOf('#')); 
    201201 
    202                         myimg = (BufferedImage)images.get(str); 
     202                        myimg = images.get(str); 
    203203                        if( myimg == null ) { 
    204204                                myimg = this.unknownImage; 
     
    249249         */ 
    250250        public boolean isLoaded( String myfile ) { 
    251                 BufferedImage myimg = (BufferedImage)images.get(myfile); 
     251                BufferedImage myimg = images.get(myfile); 
    252252                if( myimg == null ) { 
    253253                        return false; 
    254254                } 
    255                 else { 
    256                         return true; 
    257                 } 
     255                return true; 
    258256        } 
    259257         
     
    301299                } 
    302300 
    303                 Vector todoentry = new Vector(); 
     301                Vector<Object> todoentry = new Vector<Object>(); 
    304302                todoentry.addElement(image); 
    305303                todoentry.addElement(new Integer(width)); 
     
    324322                                                        try { 
    325323                                                                while( !resizeTodo.isEmpty() ) { 
    326                                                                         Vector nextfile; 
     324                                                                        Vector<Object> nextfile; 
    327325                                                                        synchronized(resizeTodo) { 
    328                                                                                 nextfile = (Vector)resizeTodo.firstElement(); 
     326                                                                                nextfile = resizeTodo.firstElement(); 
    329327                                                                                resizeTodo.remove(0); 
    330328                                                                        } 
     
    359357                                                                        } 
    360358                                                                         
    361                                                                         BufferedImage currentImage = (BufferedImage)images.get(filename); 
     359                                                                        BufferedImage currentImage = images.get(filename); 
    362360                                                                                         
    363361                                                                        BufferedImage sizedImage = createImg( newwidth.intValue(), newheight.intValue(), currentImage.getColorModel().getTransparency() ); 
     
    392390         
    393391        public void dropImages( String filename ) { 
    394                 HashMap cloneMap = (HashMap)images.clone(); 
     392                Map<String,BufferedImage> cloneMap = new HashMap<String,BufferedImage>(); 
     393                cloneMap.putAll(images); 
    395394                 
    396395                Iterator itr = cloneMap.keySet().iterator();