⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mapextentlayer.java

📁 geotools的源码
💻 JAVA
字号:
package uk.ac.leeds.ccg.geotools;

import java.lang.*;
import java.awt.*;
public class MapExtentLayer extends SimpleLayer implements uk.ac.leeds.ccg.geotools.Layer
{
    private GeoRectangle box = new GeoRectangle();
    public MapExtentLayer(){
    }
    
    public MapExtentLayer(GeoRectangle r){
        box = r;
    }
        
    public void paintScaled(GeoGraphics g){
        paintScaled(g.getGraphics(),g.getScale(),g.getShade(),g.getData(),g.getStyle());
    } 
    public void paintScaled(Graphics g, Scaler scale,Shader shade,GeoData data,ShadeStyle style)
    {
        box = scale.getMapExtent();
        int p[] = scale.toGraphics(box.x,box.y);
        int w = scale.toGraphics(box.width);
        int h = scale.toGraphics(box.height);
        g.setColor(style.getLineColor());
        g.drawRect(p[0],p[1],w,h);
    }
    
    public void paintHighlight(Graphics g,Scaler scale,int id,ShadeStyle style){
        //do nothing
    }
    
    public GeoRectangle getBounds(){
        return box;
    }
    
    /**
     * This method does not realy make sense for a map extent layer.
     */
     public GeoRectangle getBoundsOf(int id){
        return new GeoRectangle();
     }
     /**
     * This method does not realy make sense for a map extent layer.
     */
     public GeoRectangle getBoundsOf(int[] ids){
        return new GeoRectangle();
     }
     
    
    public int getID(GeoPoint p){
        return 0;
    }
    
    public int getID(double x,double y){
        return 0;
    }
    
    
    
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -