static private boolean contains(Point2D.Double point, Rectangle2D... rects) { for (Rectangle2D r : rects) { if (r.contains(point)) { return true; } } return false; }
/** * {@inheritDoc} */ @Override protected void processTextPosition( TextPosition text ) { for (String region : regionArea.keySet()) { Rectangle2D rect = regionArea.get( region ); if( rect.contains( text.getX(), text.getY() ) ) { charactersByArticle = regionCharacterList.get( region ); super.processTextPosition( text ); } } }
static private boolean contains(Point2D.Double point, Rectangle2D... rects) { for (Rectangle2D r : rects) { if (r.contains(point)) { return true; } } return false; }
private boolean collidesWithAnyStaticCollisionBox(final Point2D location) { for (final Rectangle2D collisionBox : this.staticCollisionBoxes) { if (collisionBox.contains(location)) { return true; } } return false; }
@Override public boolean contains(AnchoredText primitive, AttributeSet style, Point2D point) { Rectangle2D bounds = boundingBox(primitive, style); return bounds != null && bounds.contains(point); }
public boolean isCaptureZone( int x, int y ){ Rectangle2D crect = captureZone(x, y); return crect!=null ? crect.contains(x, y) : false; } public boolean isCaptureZone( MouseEvent me ){
/** Test if point is in view box, where point is in svg coords */ private boolean inViewBox(Point2D pt) { Rectangle2D box = viewBox(); return box == null || box.contains(pt); }
private boolean isCursorOnResizePoint(IResizableNode node, MouseEvent event) { Point currentLocation = event.getPoint(); double x = currentLocation.getX() / zoom; double y = currentLocation.getY() / zoom; currentLocation.setLocation(x, y); return getResizablePoint(node).contains(currentLocation); }
void pick(Point2D point, boolean boundingBox, List retVec) throws SVGException { if (getBoundingBox().contains(point)) { retVec.add(getPath(null)); } }
void pick(Point2D point, boolean boundingBox, List retVec) throws SVGException { if (getBoundingBox().contains(point)) { retVec.add(getPath(null)); } }
@Override void pick(Point2D point, boolean boundingBox, List<List<SVGElement>> retVec) throws SVGException { if (getBoundingBox().contains(point)) { retVec.add(getPath(null)); } }
/** * Returns how many times ray from point (x,y) cross shape */ public static int crossShape(Shape s, double x, double y) { if (!s.getBounds2D().contains(x, y)) { return 0; } return crossPath(s.getPathIterator(null), x, y); }
/** * @see prefuse.render.Renderer#locatePoint(java.awt.geom.Point2D, prefuse.visual.VisualItem) */ public boolean locatePoint(Point2D p, VisualItem item) { if ( item.getBounds().contains(p) ) { // if within bounds, check within shape outline Shape s = getShape(item); return (s != null ? s.contains(p) : false); } else { return false; } }
/** * Mouse event should be forwarded. * * @param e * the e * @return true, if successful */ protected boolean mouseEventShouldBeForwarded(final MouseEvent e) { return this.isForwardMouseEvents() && this.isVisible() && this.isEnabled() && !this.isSuspended() && e != null && this.getBoundingBox().contains(e.getPoint()); }
public JGraphFixture isWithin() { assertTrue("There must be two previous invocations of selectOrigin and selectTarget", originCell!=null && targetCell!=null); Rectangle2D boundsTarget = getBounds(targetCell); Rectangle2D boundsSource=getBounds(originCell); assertTrue("the source cell should be within the target cell",boundsTarget.contains(boundsSource)); return this; }
public boolean isShowing(final Territory territory) { final Point territoryCenter = uiContext.getMapData().getCenter(territory); final Rectangle2D screenBounds = new Rectangle2D.Double(super.getXOffset(), super.getYOffset(), super.getScaledWidth(), super.getScaledHeight()); return screenBounds.contains(territoryCenter); }
private void checkForTrafficLights(Point2D transformedPoint, RoadSegment roadSegment, RoadMapping roadMapping) { for (final TrafficLight trafficLight : roadSegment.trafficLights()) { final double widthHeight = roadMapping.roadWidth(); // hack: just proxy for strokeWidth final PosTheta posTheta = roadMapping.map(trafficLight.position(), 0); final Rectangle2D trafficLightRect = TrafficCanvasUtils.getRectangle(posTheta, widthHeight); if (trafficLightRect.contains(transformedPoint)) { LOG.info("mouse clicked: traffic light triggers next phase"); trafficLight.triggerNextPhase(); trafficCanvas.repaint(); } } }