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

📄 graphiclist.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/corba/com/bbn/openmap/layer/specialist/GraphicList.java,v $// $RCSfile: GraphicList.java,v $// $Revision: 1.2.2.1 $// $Date: 2004/10/14 18:26:30 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.layer.specialist;import java.util.*;import com.bbn.openmap.CSpecialist.*;/** * This class implements a basic GraphicList class that [OpenMap] * Specialists can utilize. It maintains a list of SGraphics and * UGraphics, and can return an array of UGraphics that corresponds to * its contained list */public class GraphicList implements com.bbn.openmap.util.GraphicList {    /** our list of graphics */    protected Vector graphics = new Vector();    /**     * Create a new empty GraphicList     */    public GraphicList() {}    /**     * Add a new SGraphic to the GraphicList     *      * @param g the SGraphic to add     */    public void addSGraphic(SGraphic g) {        graphics.addElement(g);    }    /**     * Add a new UGraphic to the GraphicList     *      * @param ug the UGraphic to add     */    public void addUGraphic(UGraphic ug) {        graphics.addElement(ug);    }    /**     * Add a new UGraphic to the GraphicList     *      * @param sg add sg.ufill() to the graphic list     * @see SGraphic#ufill()     */    public void addUGraphic(SGraphic sg) {        graphics.addElement(sg.ufill());    }    /**     * Remove all elements from the graphic list     */    public void clear() {        graphics.removeAllElements();    }    /**     * pack() the graphics into a UGraphic[]     *      * @return the packed graphic list     */    public UGraphic[] packGraphics() {        UGraphic retval[] = new UGraphic[graphics.size()];        for (int i = 0; i < graphics.size(); i++) {            Object o = graphics.elementAt(i);            if (o instanceof SGraphic) {                retval[i] = ((SGraphic) o).ufill();            } else {                retval[i] = (UGraphic) o;            }        }        return retval;    }    /**     * pack() the graphics into a UGraphic[]     *      * @return the packed graphic list     */    public Comp[] getComps() {        int len = graphics.size();        Comp retval[] = new Comp[len];        for (int i = 0; i < len; i++) {            Object o = graphics.elementAt(i);            if (o instanceof SGraphic) {                retval[i] = ((SGraphic) o).object();            }        }        return retval;    }}

⌨️ 快捷键说明

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