本文整理汇总了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;未经允许,请勿转载。 |
请发表评论