• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java WaypointRenderer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: proxyAll

import org.jdesktop.swingx.mapviewer.WaypointRenderer; //导入依赖的package包/类
private Map<Class<? extends Waypoint>, WaypointRenderer> proxyAll(
		final int xOffset, final int yOffset,
		Map<Class<? extends Waypoint>, WaypointRenderer> map) {
	Function<WaypointRenderer, WaypointRenderer> f = new Function<WaypointRenderer, WaypointRenderer>() {
		@Override
		public WaypointRenderer apply(WaypointRenderer renderer) {
			return new OffsetWaypointRendererDelegate(xOffset, yOffset,
					renderer);
		}
	};
	return ImmutableMap.copyOf(Maps.transformValues(map, f));
}
 
开发者ID:pfichtner,项目名称:jrunalyzer,代码行数:13,代码来源:MapViewPlugin.java


示例2: createWaypointRenderers

import org.jdesktop.swingx.mapviewer.WaypointRenderer; //导入依赖的package包/类
private Map<Class<? extends Waypoint>, WaypointRenderer> createWaypointRenderers(
		Theme theme) {
	Font font = new Font(Font.SANS_SERIF, 0, 12);
	return ImmutableMap.<Class<? extends Waypoint>, WaypointRenderer> of(
			TrackStartWaypoint.class,
			new SegmentBorderWaypointRendererStart(theme, font),
			SegmentBorderWaypoint.class,
			new SegmentBorderWaypointRendererPoint(theme, font),
			TrackEndWaypoint.class, new SegmentBorderWaypointRendererEnd(
					theme, font), SelectedWaypoint.class,
			new SelectedWaypointRenderer(theme, font));
}
 
开发者ID:pfichtner,项目名称:jrunalyzer,代码行数:13,代码来源:MapViewPlugin.java


示例3: hDrawButtonActionPerformed

import org.jdesktop.swingx.mapviewer.WaypointRenderer; //导入依赖的package包/类
/**
 * Draws the Waypoints on the map that are sized and colored according to
 * the provided hubness information. Larger circles correspond to larger
 * hubs in the data and the color corresponds to whether their influence is
 * beneficial or detrimental on the analysis. Red coloring corresponds to
 * high bad hubness.
 *
 * @param evt ActionEvent object.
 */
private void hDrawButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hDrawButtonActionPerformed
    // Initialize the waypoints.
    Set<Waypoint> waypoints = new HashSet<>(latitudeLongitudeData.size());
    for (int i = 0; i < latitudeLongitudeData.size(); i++) {
        waypoints.add(new SensorWayPoint(
                latitudeLongitudeData.data.get(i).fAttr[0],
                -latitudeLongitudeData.data.get(i).fAttr[1],
                hubnessArray[i],
                badHubnessArray[i]));
    }
    // Create a WaypointPainter to draw the points.
    WaypointPainter painter = new WaypointPainter();
    painter.setWaypoints(waypoints);
    painter.setRenderer(new WaypointRenderer() {
        @Override
        public boolean paintWaypoint(Graphics2D g, JXMapViewer map,
                Waypoint wp) {
            SensorWayPoint waypoint = (SensorWayPoint) wp;
            float darkRange = 0.25f;
            float redRange = 0.5f;
            float greenRange = 0.5f;
            // Calculate the badness coefficient that will be used to
            // determine the Waypoint color in the visualization.
            float badnessCoefficient;
            if (maxBadHubness != minBadHubness) {
                badnessCoefficient =
                        (waypoint.getBadHubness() - minBadHubness)
                        / (maxBadHubness - minBadHubness);
            } else {
                badnessCoefficient = 0;
            }
            float r = badnessCoefficient * darkRange
                    + badnessCoefficient * redRange;
            float gr = badnessCoefficient * darkRange
                    + (1 - badnessCoefficient) * greenRange;
            float b = badnessCoefficient * darkRange;
            Color currColor = new Color(r, gr, b);
            // Get the zoom level.
            int zLevel = jXMapKit1.getMainMap().getZoom();
            // Determine the radius according the the relative hubness
            // score.
            int radius = (int) ((((waypoint.getHubness() - minHubness)
                    / (maxHubness - minHubness)) * (radiusMax - radiusMin))
                    + radiusMin);
            if (zLevel < 14 && zLevel >= 12) {
                radius += 4;
            } else if (zLevel < 12 && zLevel >= 10) {
                radius += 8;
            } else if (zLevel < 10) {
                radius += 12;
            }
            g.setColor(currColor);
            g.fillOval(-radius, -radius, 2 * radius, 2 * radius);
            return true;
        }
    });
    jXMapKit1.getMainMap().setOverlayPainter(painter);
}
 
开发者ID:datapoet,项目名称:hubminer,代码行数:68,代码来源:GeospatialSensorHubnessDrawer.java


示例4: WaypointRendererDelegate

import org.jdesktop.swingx.mapviewer.WaypointRenderer; //导入依赖的package包/类
public WaypointRendererDelegate(
		Map<Class<? extends Waypoint>, ? extends WaypointRenderer> delegates) {
	this.delegates = ImmutableMap.copyOf(delegates);
}
 
开发者ID:pfichtner,项目名称:jrunalyzer,代码行数:5,代码来源:WaypointRendererDelegate.java


示例5: getDelegate

import org.jdesktop.swingx.mapviewer.WaypointRenderer; //导入依赖的package包/类
@Override
public WaypointRenderer getDelegate() {
	return this.delegate;
}
 
开发者ID:pfichtner,项目名称:jrunalyzer,代码行数:5,代码来源:OffsetWaypointRendererDelegate.java


示例6: OffsetWaypointRendererDelegate

import org.jdesktop.swingx.mapviewer.WaypointRenderer; //导入依赖的package包/类
public OffsetWaypointRendererDelegate(int xoffset, int yoffset,
		WaypointRenderer delegate) {
	this.xoffset = xoffset;
	this.yoffset = yoffset;
	this.delegate = delegate;
}
 
开发者ID:pfichtner,项目名称:jrunalyzer,代码行数:7,代码来源:OffsetWaypointRendererDelegate.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MailboxList类代码示例发布时间:2022-05-23
下一篇:
Java Row11类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap