本文整理汇总了Java中java.awt.geom.Rectangle2D.intersects方法的典型用法代码示例。如果您正苦于以下问题:Java Rectangle2D.intersects方法的具体用法?Java Rectangle2D.intersects怎么用?Java Rectangle2D.intersects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.geom.Rectangle2D
的用法示例。
在下文中一共展示了Rectangle2D.intersects方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRoots
import java.awt.geom.Rectangle2D; //导入方法依赖的package包/类
/**
* Return all cells that intersect the given rectangle.
*/
public CellView[] getRoots(Rectangle clip) {
java.util.List<CellView> result = new ArrayList<CellView>();
CellView[] views = getRoots();
Rectangle2D bounds;
for (CellView view : views) {
bounds = view.getBounds();
if (bounds != null) {
if (bounds.intersects(clip)) {
result.add(view);
}
}
}
views = new CellView[result.size()];
result.toArray(views);
return views;
}
示例2: select
import java.awt.geom.Rectangle2D; //导入方法依赖的package包/类
public boolean select( Shape shape, Rectangle2D shapeBounds ) {
if( shapeBounds.intersects(box) )return shape.intersects(box);
return false;
}
示例3: select
import java.awt.geom.Rectangle2D; //导入方法依赖的package包/类
public boolean select( Shape shape, Rectangle2D shapeBounds ) {
if( shapeBounds.intersects(getBounds()) )return shape.intersects(getBounds());
return false;
}
示例4: isValidBounds
import java.awt.geom.Rectangle2D; //导入方法依赖的package包/类
protected boolean isValidBounds(Rectangle2D bounds) {
return bounds.intersects(-180, -90, 360, 180);
}
示例5: isValidBounds
import java.awt.geom.Rectangle2D; //导入方法依赖的package包/类
protected boolean isValidBounds(Rectangle2D bounds) {
Dimension mapDim = map.getDefaultSize();
return bounds.intersects(0., 0., mapDim.getWidth(), mapDim.getHeight());
}