本文整理汇总了Java中com.bbn.openmap.omGraphics.OMLine.generate方法的典型用法代码示例。如果您正苦于以下问题:Java OMLine.generate方法的具体用法?Java OMLine.generate怎么用?Java OMLine.generate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.bbn.openmap.omGraphics.OMLine
的用法示例。
在下文中一共展示了OMLine.generate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paintLine
import com.bbn.openmap.omGraphics.OMLine; //导入方法依赖的package包/类
/**
* Draw a rubberband line between two points into the Graphics object.
*
* @param pt1 the anchor point.
* @param pt2 the current (mouse) position.
* @param graphics a java.awt.Graphics object to render into.
*/
public void paintLine(Point2D pt1, Point2D pt2, Graphics graphics) {
Graphics2D g = (Graphics2D) graphics;
g.setXORMode(java.awt.Color.lightGray);
g.setColor(java.awt.Color.darkGray);
if (pt1 != null && pt2 != null) {
// the line connecting the segments
OMLine cLine = new OMLine(pt1.getY(), pt1.getX(), pt2.getY(), pt2.getX(), lineType);
// get the map projection
Projection proj = theMap.getProjection();
// prepare the line for rendering
cLine.generate(proj);
// render the line graphic
cLine.render(g);
}
}
示例2: paintLine
import com.bbn.openmap.omGraphics.OMLine; //导入方法依赖的package包/类
/**
* Draw a rubberband line between two points
*
* @param pt1 the anchor point.
* @param pt2 the current (mouse) position.
*/
public void paintLine(Point2D pt1, Point2D pt2) {
if (pt1 != null && pt2 != null) {
// the line connecting the segments
OMLine cLine = new OMLine(pt1.getY(), pt1.getX(), pt2.getY(), pt2.getX(), OMGraphic.LINETYPE_GREATCIRCLE);
// get the map projection
Projection proj = theMap.getProjection();
// prepare the line for rendering
cLine.generate(proj);
distanceList.add(cLine);
}
}