本文整理匯總了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);
}
}