本文整理汇总了Java中java.awt.geom.Line2D.intersects方法的典型用法代码示例。如果您正苦于以下问题:Java Line2D.intersects方法的具体用法?Java Line2D.intersects怎么用?Java Line2D.intersects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.geom.Line2D
的用法示例。
在下文中一共展示了Line2D.intersects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: countNodeIntersections
import java.awt.geom.Line2D; //导入方法依赖的package包/类
private int countNodeIntersections(Collection<Widget> nodeWidgets, Line2D... lines){
int count=0;
for(Widget nw : nodeWidgets){
if(nw.isVisible()) {
Rectangle bounds = nw.convertLocalToScene(nw.getBounds());
for( Line2D line : lines){
if(line.intersects(bounds))
count++;
}
}
}
return count;
}
示例2: drawSlowPans
import java.awt.geom.Line2D; //导入方法依赖的package包/类
private void drawSlowPans(Graphics2D g2d, double downsampleFactor, Rectangle clippingRectangle) {
g2d.setStroke(new BasicStroke((float)boundsThicknessScalar.get() *
((downsampleFactor > 1) ? (float) downsampleFactor : 1)));
g2d.setColor(Color.BLUE);
TrackerFeatureList slowPans = trackerFeatures.getBoundsFeatures().getSlowPans();
for (TrackerFeature slowPan : slowPans) {
Rectangle startRect = slowPan.getFrameAtFeatureIndex(0).getImageBounds();
Rectangle endRect = slowPan.getFrameAtFeatureIndex(slowPan.size() - 1).getImageBounds();
g2d.setColor(TrackerUtils.colorFXtoAWT(
(javafx.scene.paint.Color)zoomPeakStartColorProperty.get()));
if (startRect.intersects(clippingRectangle))
g2d.draw(startRect);
g2d.setColor(TrackerUtils.colorFXtoAWT(
(javafx.scene.paint.Color)zoomPeakEndColorProperty.get()));
if (endRect.intersects(clippingRectangle))
g2d.draw(endRect);
g2d.setStroke(new BasicStroke((float)boundsThicknessScalar.get() *
((downsampleFactor > 1) ? (float) downsampleFactor : 1)));
g2d.setColor(TrackerUtils.colorFXtoAWT(
(javafx.scene.paint.Color)zoomPeakPathColorProperty.get()));
for (Line2D line : makeSlowPanLines(startRect, endRect)) {
if (line.intersects(clippingRectangle)) {
g2d.draw(line);
}
}
}
}