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