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