From: Artur H. <ko...@us...> - 2001-11-21 13:48:23
|
Update of /cvsroot/geotools/geotools/src/uk/ac/leeds/ccg/geotools In directory usw-pr-cvs1:/tmp/cvs-serv13012/uk/ac/leeds/ccg/geotools Modified Files: SimpleLayer.java Log Message: Added support for creating ImageLayer with InputStream as image data source and full support for downaloding map data from WMS with jprotocols package Index: SimpleLayer.java =================================================================== RCS file: /cvsroot/geotools/geotools/src/uk/ac/leeds/ccg/geotools/SimpleLayer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SimpleLayer.java 2001/11/15 13:49:07 1.6 --- SimpleLayer.java 2001/11/21 13:48:19 1.7 *************** *** 8,74 **** public abstract class SimpleLayer extends java.lang.Object implements uk.ac.leeds.ccg.geotools.Layer { ! int status = Layer.COMPLETED; ! Vector listeners = new Vector(); ! protected String name = "Unknown"; ! public void removeLayerChangedListener(LayerChangedListener lcl) ! { ! listeners.removeElement(lcl); ! } ! public void addLayerChangedListener(LayerChangedListener lcl) ! { ! listeners.addElement(lcl); ! } ! public void notifyLayerChangedListeners(int reason){ Vector l; ! LayerChangedEvent lce = new LayerChangedEvent(this,reason); ! synchronized(this) {l = (Vector)listeners.clone(); } ! for (int i = 0; i < l.size();i++) { ! ((LayerChangedListener)l.elementAt(i)).layerChanged(lce); ! } ! } ! public int[] getIDs(GeoRectangle box,int mode){ ! return new int[0]; ! } ! public int getStatus(){ ! return status; ! } ! public void setStatus(int stat){ ! System.out.println(this+" status changed to "+stat); ! if(status != Layer.COMPLETED&&stat==Layer.COMPLETED){ ! status=stat; ! System.out.println("Notifing listeners of change"); ! notifyLayerChangedListeners(LayerChangedEvent.GEOGRAPHY); ! } else { ! status=stat; ! } ! } ! /*public void paintScaled(GeoGraphics g){ ! paintScaled(g.getGraphics(),g.getScale(),g.getShade(),g.getData(),g.getStyle()); }*/ ! //Rough implementation, you should write your own! ! public void paintSelection(Graphics g,Scaler scale,int ids[],ShadeStyle style){ ! for(int i=0;i<ids.length;i++){ ! paintHighlight(g,scale,ids[i],style); ! } } ! public void setName(String n){ ! name = n; ! } ! public String getName(){ ! return name; ! } ! public String toString() { ! return name; ! } } --- 8,74 ---- public abstract class SimpleLayer extends java.lang.Object implements uk.ac.leeds.ccg.geotools.Layer { ! int status = Layer.COMPLETED; ! Vector listeners = new Vector(); ! protected String name = "Unknown"; ! public void removeLayerChangedListener(LayerChangedListener lcl) ! { ! listeners.removeElement(lcl); ! } ! public void addLayerChangedListener(LayerChangedListener lcl) ! { ! listeners.addElement(lcl); ! } ! public void notifyLayerChangedListeners(int reason){ Vector l; ! LayerChangedEvent lce = new LayerChangedEvent(this,reason); ! synchronized(this) {l = (Vector)listeners.clone(); } ! for (int i = 0; i < l.size();i++) { ! ((LayerChangedListener)l.elementAt(i)).layerChanged(lce); ! } ! } ! public int[] getIDs(GeoRectangle box,int mode){ ! return new int[0]; ! } ! public int getStatus(){ ! return status; ! } ! public void setStatus(int stat){ ! System.out.println(this+" status changed to "+stat); ! if(status != Layer.COMPLETED&&stat==Layer.COMPLETED){ ! status=stat; ! System.out.println("Notifing listeners of change"); ! notifyLayerChangedListeners(LayerChangedEvent.GEOGRAPHY); ! } else { ! status=stat; ! } ! } ! /*public void paintScaled(GeoGraphics g){ ! paintScaled(g.getGraphics(),g.getScale(),g.getShade(),g.getData(),g.getStyle()); }*/ ! //Rough implementation, you should write your own! ! public void paintSelection(Graphics g,Scaler scale,int ids[],ShadeStyle style){ ! for(int i=0;i<ids.length;i++){ ! paintHighlight(g,scale,ids[i],style); } + } ! public void setName(String n){ ! name = n; ! } ! public String getName(){ ! return name; ! } ! public String toString() { ! return name; ! } } |