当前位置: 首页>>代码示例>>Java>>正文


Java MapRectangle类代码示例

本文整理汇总了Java中org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle的典型用法代码示例。如果您正苦于以下问题:Java MapRectangle类的具体用法?Java MapRectangle怎么用?Java MapRectangle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MapRectangle类属于org.openstreetmap.gui.jmapviewer.interfaces包,在下文中一共展示了MapRectangle类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: JMapViewer

import org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle; //导入依赖的package包/类
/**
 * Creates a new {@link JMapViewer} instance.
 * @param tileCache The cache where to store tiles
 *
 */
public JMapViewer(TileCache tileCache) {
    tileSource = new OsmTileSource.Mapnik();
    tileController = new TileController(tileSource, tileCache, this);
    mapMarkerList = Collections.synchronizedList(new LinkedList<MapMarker>());
    mapPolygonList = Collections.synchronizedList(new LinkedList<MapPolygon>());
    mapRectangleList = Collections.synchronizedList(new LinkedList<MapRectangle>());
    mapMarkersVisible = true;
    mapRectanglesVisible = true;
    mapPolygonsVisible = true;
    tileGridVisible = false;
    setLayout(null);
    initializeZoomSlider();
    setMinimumSize(new Dimension(tileSource.getTileSize(), tileSource.getTileSize()));
    setPreferredSize(new Dimension(400, 400));
    setDisplayPosition(new Coordinate(50, 9), 3);
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:22,代码来源:JMapViewer.java

示例2: paintRectangle

import org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle; //导入依赖的package包/类
/**
 * Paint a single rectangle.
 * @param g Graphics used for painting
 * @param rectangle rectangle to paint
 */
protected void paintRectangle(Graphics g, MapRectangle rectangle) {
    Coordinate topLeft = rectangle.getTopLeft();
    Coordinate bottomRight = rectangle.getBottomRight();
    if (topLeft != null && bottomRight != null) {
        Point pTopLeft = getMapPosition(topLeft, false);
        Point pBottomRight = getMapPosition(bottomRight, false);
        if (pTopLeft != null && pBottomRight != null) {
            rectangle.paint(g, pTopLeft, pBottomRight);
            if (scrollWrapEnabled) {
                int tilesize = tileSource.getTileSize();
                int mapSize = tilesize << zoom;
                int xTopLeftSave = pTopLeft.x;
                int xTopLeftWrap = xTopLeftSave;
                int xBottomRightSave = pBottomRight.x;
                int xBottomRightWrap = xBottomRightSave;
                while ((xBottomRightWrap -= mapSize) >= 0) {
                    xTopLeftWrap -= mapSize;
                    pTopLeft.x = xTopLeftWrap;
                    pBottomRight.x = xBottomRightWrap;
                    rectangle.paint(g, pTopLeft, pBottomRight);
                }
                xTopLeftWrap = xTopLeftSave;
                xBottomRightWrap = xBottomRightSave;
                while ((xTopLeftWrap += mapSize) <= getWidth()) {
                    xBottomRightWrap += mapSize;
                    pTopLeft.x = xTopLeftWrap;
                    pBottomRight.x = xBottomRightWrap;
                    rectangle.paint(g, pTopLeft, pBottomRight);
                }
            }
        }
    }
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:39,代码来源:JMapViewer.java

示例3: paintRectangle

import org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle; //导入依赖的package包/类
/**
 * Paint a single rectangle.
 */
protected void paintRectangle(Graphics g, MapRectangle rectangle) {
    Coordinate topLeft = rectangle.getTopLeft();
    Coordinate bottomRight = rectangle.getBottomRight();
    if (topLeft != null && bottomRight != null) {
        Point pTopLeft = getMapPosition(topLeft, false);
        Point pBottomRight = getMapPosition(bottomRight, false);
        if (pTopLeft != null && pBottomRight != null) {
            rectangle.paint(g, pTopLeft, pBottomRight);
            if (scrollWrapEnabled) {
                int tilesize = tileSource.getTileSize();
                int mapSize = tilesize << zoom;
                int xTopLeftSave = pTopLeft.x;
                int xTopLeftWrap = xTopLeftSave;
                int xBottomRightSave = pBottomRight.x;
                int xBottomRightWrap = xBottomRightSave;
                while ((xBottomRightWrap -= mapSize) >= 0) {
                    xTopLeftWrap -= mapSize;
                    pTopLeft.x = xTopLeftWrap;
                    pBottomRight.x = xBottomRightWrap;
                    rectangle.paint(g, pTopLeft, pBottomRight);
                }
                xTopLeftWrap = xTopLeftSave;
                xBottomRightWrap = xBottomRightSave;
                while ((xTopLeftWrap += mapSize) <= getWidth()) {
                    xBottomRightWrap += mapSize;
                    pTopLeft.x = xTopLeftWrap;
                    pBottomRight.x = xBottomRightWrap;
                    rectangle.paint(g, pTopLeft, pBottomRight);
                }

            }
        }
    }
}
 
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:38,代码来源:JMapViewer.java

示例4: setMapRectangleList

import org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle; //导入依赖的package包/类
/**
 * Sets the list of {@link MapRectangle}s.
 * @param mapRectangleList list of {@link MapRectangle}s
 */
public void setMapRectangleList(List<MapRectangle> mapRectangleList) {
    this.mapRectangleList = mapRectangleList;
    repaint();
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:9,代码来源:JMapViewer.java

示例5: addMapRectangle

import org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle; //导入依赖的package包/类
/**
 * Add a {@link MapRectangle}.
 * @param rectangle map rectangle to add
 */
public void addMapRectangle(MapRectangle rectangle) {
    mapRectangleList.add(rectangle);
    repaint();
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:9,代码来源:JMapViewer.java

示例6: removeMapRectangle

import org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle; //导入依赖的package包/类
/**
 * Remove a {@link MapRectangle}.
 * @param rectangle map rectangle to remove
 */
public void removeMapRectangle(MapRectangle rectangle) {
    mapRectangleList.remove(rectangle);
    repaint();
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:9,代码来源:JMapViewer.java

示例7: setMapRectangleList

import org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle; //导入依赖的package包/类
public void setMapRectangleList(List<MapRectangle> mapRectangleList) {
    this.mapRectangleList = mapRectangleList;
    repaint();
}
 
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:5,代码来源:JMapViewer.java

示例8: getMapRectangleList

import org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle; //导入依赖的package包/类
public List<MapRectangle> getMapRectangleList() {
    return mapRectangleList;
}
 
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:4,代码来源:JMapViewer.java

示例9: addMapRectangle

import org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle; //导入依赖的package包/类
public void addMapRectangle(MapRectangle rectangle) {
    mapRectangleList.add(rectangle);
    repaint();
}
 
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:5,代码来源:JMapViewer.java

示例10: removeMapRectangle

import org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle; //导入依赖的package包/类
public void removeMapRectangle(MapRectangle rectangle) {
    mapRectangleList.remove(rectangle);
    repaint();
}
 
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:5,代码来源:JMapViewer.java

示例11: getMapRectangleList

import org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle; //导入依赖的package包/类
/**
 * Returns the list of {@link MapRectangle}s.
 * @return list of {@link MapRectangle}s
 */
public List<MapRectangle> getMapRectangleList() {
    return mapRectangleList;
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:8,代码来源:JMapViewer.java


注:本文中的org.openstreetmap.gui.jmapviewer.interfaces.MapRectangle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。