本文整理了Java中java.awt.Rectangle.intersectsLine
方法的一些代码示例,展示了Rectangle.intersectsLine
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rectangle.intersectsLine
方法的具体详情如下:
包路径:java.awt.Rectangle
类名称:Rectangle
方法名:intersectsLine
暂无
代码示例来源:origin: sc.fiji/TrakEM2_
/** May return a false positive but never a false negative.
* Checks only for itself and towards its parent. */
public boolean isRoughlyInside(final Rectangle localbox) {
if (null == parent) {
return localbox.contains((int)this.x, (int)this.y);
} else {
return localbox.intersectsLine(parent.x, parent.y, this.x, this.y);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-vmd-game
private void drawQuadrants(Graphics g) {
Point quadrantOrigin = this.adjustFromOriginShift(new Point(0, 0));
Rectangle clip = g.getClipBounds();
g.setColor(COLOR_GRID_QUADRANT);
// vertical quadrant separator
if (clip.intersectsLine(quadrantOrigin.x, Integer.MAX_VALUE,
quadrantOrigin.x, Integer.MIN_VALUE)) {
g.drawLine(quadrantOrigin.x, clip.y, quadrantOrigin.x, clip.y
+ clip.height);
}
// horizontal quadrant separator
if (clip.intersectsLine(Integer.MAX_VALUE, quadrantOrigin.y,
Integer.MIN_VALUE, quadrantOrigin.y)) {
g.drawLine(clip.x, quadrantOrigin.y, clip.x + clip.width,
quadrantOrigin.y);
}
}
代码示例来源:origin: sc.fiji/TrakEM2_
@Override
public boolean isRoughlyInside(final Rectangle localbox) {
if (0 == this.r) {
if (null == parent) {
return localbox.contains((int)this.x, (int)this.y);
} else {
if (0 == parent.getData()) { // parent.getData() == ((RadiusNode)parent).r
return localbox.intersectsLine(parent.x, parent.y, this.x, this.y);
} else {
return segmentIntersects(localbox);
}
}
} else {
if (null == parent) {
return localbox.contains((int)this.x, (int)this.y);
} else {
return segmentIntersects(localbox);
}
}
}
代码示例来源:origin: RPTools/maptool
Point currentPoint = new Point(entry.get("x"), entry.get("y"));
if (ctr > 0) {
if (targetArea.intersectsLine(new Line2D.Double(previousPoint, currentPoint)) ||
targetArea.intersects(tokenArea)) {
firstPoint.put("x1", (int) previousPoint.getX());
代码示例来源:origin: Audiveris/audiveris
if (nc.getBounds().intersectsLine(ce.x, ce.y, ae.x, ae.y)) {
final boolean crossing;
代码示例来源:origin: net.sf.ingenias/ingeniasjgraphmod
Point2D p0 = edgeView.getPoint(0);
Point2D p1 = edgeView.getPoint(1);
if (rect.intersectsLine(p0.getX(), p0.getY(), p1.getX(), p1
.getY()))
return true;
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
if (rect.intersectsLine(p0.getX(), p0.getY(),
p1.getX(), p1.getY()))
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
if (rect.intersectsLine(p0.getX(), p0.getY(),
p1.getX(), p1.getY()))
内容来源于网络,如有侵权,请联系作者删除!