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

📄 fullprojectionrenderpolicy.java

📁 openmap java写的开源数字地图程序. 用applet实现,可以像google map 那样放大缩小地图.
💻 JAVA
字号:
// **********************************************************************// // <copyright>// //  BBN Technologies//  10 Moulton Street//  Cambridge, MA 02138//  (617) 873-8000// //  Copyright (C) BBNT Solutions LLC. All rights reserved.// // </copyright>// **********************************************************************// // $Source: /cvs/distapps/openmap/src/openmap/com/bbn/openmap/layer/policy/FullProjectionRenderPolicy.java,v $// $RCSfile: FullProjectionRenderPolicy.java,v $// $Revision: 1.1.2.3 $// $Date: 2005/10/26 15:47:15 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.layer.policy;import com.bbn.openmap.layer.OMGraphicHandlerLayer;import com.bbn.openmap.proj.Projection;import java.awt.Graphics;/** * The FullProjectionRenderPolicy is a StandardRenderPolicy that sets * the clip of the java.awt.Graphics passed into the paint method with * the clipping area of the projection. You'll need to use this render * policy if you want to paint into a buffer that is bigger than the * layer size (and MapBean size), because Java sets the max clipping * size to the size of the component. * <p> * This class seems useless, because it looks like the * StandardRenderPolicy does the same thing automatically. */public class FullProjectionRenderPolicy extends StandardRenderPolicy {    public FullProjectionRenderPolicy() {}    /**     * Don't pass in a null layer.     */    public FullProjectionRenderPolicy(OMGraphicHandlerLayer layer) {        super(layer);    }    public void paint(Graphics g) {        if (layer != null && layer.isProjectionOK(layer.getProjection())) {            Projection proj = layer.getProjection();            // The proj shouldn't be null, because isProjectionOK            // checks for that, but that method may be overridden            if (proj != null) {                g.setClip(0, 0, proj.getWidth(), proj.getHeight());            }        }        super.paint(g);    }}

⌨️ 快捷键说明

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