Refine search
/** * Gets a clip area which excludes the area of widgets which overlay the world map. * * @param baseRectangle The base area to clip from * @return An {@link Area} representing <code>baseRectangle</code>, with the area * of visible widgets overlaying the world map clipped from it. */ private Area getWorldMapClipArea(Rectangle baseRectangle) { final Widget overview = client.getWidget(WidgetInfo.WORLD_MAP_OVERVIEW_MAP); final Widget surfaceSelector = client.getWidget(WidgetInfo.WORLD_MAP_SURFACE_SELECTOR); Area clipArea = new Area(baseRectangle); if (overview != null && !overview.isHidden()) { clipArea.subtract(new Area(overview.getBounds())); } if (surfaceSelector != null && !surfaceSelector.isHidden()) { clipArea.subtract(new Area(surfaceSelector.getBounds())); } return clipArea; }
@Override protected void paintComponent(Graphics g) { super.paintComponent(g); Area area = new Area(new Rectangle(0, 0, getWidth(), getHeight())); area.subtract(new Area(new RoundRectangle2D.Float(10, 10, getWidth() - 20, getHeight() - 20, 20, 20))); Graphics2D g2d = (Graphics2D) g.create(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setColor(Color.BLACK); g2d.fill(area); g2d.dispose(); }
@Override public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D g2d = (Graphics2D) g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); RoundRectangle2D.Double rectangle = new RoundRectangle2D.Double(x, y, width - 1, height - 1, radius, radius); Area rectangleArea = new Area(rectangle); Area area = new Area(new Rectangle(0, 0, width, height)); area.subtract(rectangleArea); g2d.setClip(area); g2d.setColor(c.getParent().getBackground()); g2d.fillRect(0, 0, width, height); g2d.setClip(null); if (color == null) { g2d.setColor(c.getBackground()); } else { g2d.setColor(color); } g2d.setStroke(stroke); g2d.draw(rectangleArea); }
} else if (pathSegmentType == PathIterator.SEG_CLOSE) { gp.closePath(); regions.add(new Area(gp)); } else { System.err.println("Unexpected value! " + pathSegmentType); Area imageShapeArea = new Area(imageShape); Area shapeArea = new Area(shapeCentered); imageShapeArea.subtract(shapeArea); ArrayList<Shape> regions = separateShapeIntoRegions(imageShapeArea); g.setStroke(new BasicStroke(1));
} else if (pathSegmentType == PathIterator.SEG_CLOSE) { gp.closePath(); regions.add(new Area(gp)); } else { System.err.println("Unexpected value! " + pathSegmentType); Area imageShapeArea = new Area(imageShape); Area shapeArea = new Area(shapeCentered); imageShapeArea.subtract(shapeArea); ArrayList<Shape> regions = separateShapeIntoRegions(imageShapeArea); g.setStroke(new BasicStroke(1));
Rectangle drawCrop = getCropBounds(); if (drawCrop != null) { Area area = new Area(new Rectangle(0, 0, getWidth() - 1, getHeight() - 1)); area.subtract(new Area(drawCrop)); Color color = UIManager.getColor("List.selectionBackground"); g2d.setColor(color); Composite composite = g2d.getComposite(); g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f)); g2d.fill(area); g2d.setComposite(composite); g2d.draw(area); }
private Shape getInnerSubDecoration() { if (innerSubDecoration == null) { innerSubDecoration = new Area(new Ellipse2D.Float(0, 0, 356, 114)); innerSubDecoration.subtract( new Area(new Rectangle2D.Float(Float.MIN_VALUE, Float.MIN_VALUE, Float.MAX_VALUE, 88))); innerSubDecoration.subtract( new Area(new Rectangle2D.Float(Float.MIN_VALUE, Float.MIN_VALUE, 184, Float.MAX_VALUE))); innerSubDecoration.subtract(new Area(new Rectangle2D.Float(209, Float.MIN_VALUE, 3, Float.MAX_VALUE))); } return innerSubDecoration; }
Area area = new Area(outerPath); for (IfcCurve innerCurve : ifcArbitraryProfileDefWithVoids.getInnerCurves()) { Path2D.Float innerPath = curveToPath(matrix, innerCurve, multiplierMillimeters); if (innerPath != null) { area.subtract(new Area(innerPath)); return new Area(path2d); } else if (outerCurve instanceof IfcCompositeCurve) { IfcCompositeCurve ifcCompositeCurve = (IfcCompositeCurve)outerCurve;
private Shape getInnerDecoration() { if (innerDecoration == null) { innerDecoration = new Area(new Ellipse2D.Float(0, 0, 368, 120)); innerDecoration.subtract(new Area(new Rectangle2D.Float(Float.MIN_VALUE, 30, Float.MAX_VALUE, 56))); innerDecoration.subtract(new Area(new Rectangle2D.Float(181, Float.MIN_VALUE, 7, Float.MAX_VALUE))); } return innerDecoration; }