Java Code Examples for java.awt.Rectangle#setFrame()
The following examples show how to use
java.awt.Rectangle#setFrame() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SunGraphics2D.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public Rectangle getClipBounds(Rectangle r) { if (clipState != CLIP_DEVICE) { if (transformState <= TRANSFORM_INT_TRANSLATE) { if (usrClip instanceof Rectangle) { r.setBounds((Rectangle) usrClip); } else { r.setFrame(usrClip.getBounds2D()); } r.translate(-transX, -transY); } else { r.setFrame(getClip().getBounds2D()); } } else if (r == null) { throw new NullPointerException("null rectangle parameter"); } return r; }
Example 2
Source File: IslandMap.java From TFC2 with GNU General Public License v3.0 | 6 votes |
public void generateFake() { points.clear(); edges.clear(); centers.clear(); corners.clear(); lakes.clear(); rivers.clear(); caves = new CaveProcessor(this); ores = new OreProcessor(this); animalProc = new AnimalProcessor(this); dungeons.clear(); points = this.generateHexagon(SIZE); Rectangle R = new Rectangle(); R.setFrame(0, 0, SIZE, SIZE); //System.out.println("Starting Creating map Voronoi..."); Voronoi voronoi = new Voronoi(points, R); //System.out.println("Finished Creating map Voronoi..."); buildGraph(points, voronoi); }
Example 3
Source File: SunGraphics2D.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
public Rectangle getClipBounds(Rectangle r) { if (clipState != CLIP_DEVICE) { if (transformState <= TRANSFORM_INT_TRANSLATE) { if (usrClip instanceof Rectangle) { r.setBounds((Rectangle) usrClip); } else { r.setFrame(usrClip.getBounds2D()); } r.translate(-transX, -transY); } else { r.setFrame(getClip().getBounds2D()); } } else if (r == null) { throw new NullPointerException("null rectangle parameter"); } return r; }
Example 4
Source File: SunGraphics2D.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public Rectangle getClipBounds(Rectangle r) { if (clipState != CLIP_DEVICE) { if (transformState <= TRANSFORM_INT_TRANSLATE) { if (usrClip instanceof Rectangle) { r.setBounds((Rectangle) usrClip); } else { r.setFrame(usrClip.getBounds2D()); } r.translate(-transX, -transY); } else { r.setFrame(getClip().getBounds2D()); } } else if (r == null) { throw new NullPointerException("null rectangle parameter"); } return r; }
Example 5
Source File: SunGraphics2D.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
public Rectangle getClipBounds(Rectangle r) { if (clipState != CLIP_DEVICE) { if (transformState <= TRANSFORM_INT_TRANSLATE) { if (usrClip instanceof Rectangle) { r.setBounds((Rectangle) usrClip); } else { r.setFrame(usrClip.getBounds2D()); } r.translate(-transX, -transY); } else { r.setFrame(getClip().getBounds2D()); } } else if (r == null) { throw new NullPointerException("null rectangle parameter"); } return r; }
Example 6
Source File: SunGraphics2D.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public Rectangle getClipBounds(Rectangle r) { if (clipState != CLIP_DEVICE) { if (transformState <= TRANSFORM_INT_TRANSLATE) { if (usrClip instanceof Rectangle) { r.setBounds((Rectangle) usrClip); } else { r.setFrame(usrClip.getBounds2D()); } r.translate(-transX, -transY); } else { r.setFrame(getClip().getBounds2D()); } } else if (r == null) { throw new NullPointerException("null rectangle parameter"); } return r; }
Example 7
Source File: SunGraphics2D.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public Rectangle getClipBounds(Rectangle r) { if (clipState != CLIP_DEVICE) { if (transformState <= TRANSFORM_INT_TRANSLATE) { if (usrClip instanceof Rectangle) { r.setBounds((Rectangle) usrClip); } else { r.setFrame(usrClip.getBounds2D()); } r.translate(-transX, -transY); } else { r.setFrame(getClip().getBounds2D()); } } else if (r == null) { throw new NullPointerException("null rectangle parameter"); } return r; }
Example 8
Source File: SunGraphics2D.java From hottub with GNU General Public License v2.0 | 6 votes |
public Rectangle getClipBounds(Rectangle r) { if (clipState != CLIP_DEVICE) { if (transformState <= TRANSFORM_INT_TRANSLATE) { if (usrClip instanceof Rectangle) { r.setBounds((Rectangle) usrClip); } else { r.setFrame(usrClip.getBounds2D()); } r.translate(-transX, -transY); } else { r.setFrame(getClip().getBounds2D()); } } else if (r == null) { throw new NullPointerException("null rectangle parameter"); } return r; }
Example 9
Source File: SunGraphics2D.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public Rectangle getClipBounds(Rectangle r) { if (clipState != CLIP_DEVICE) { if (transformState <= TRANSFORM_INT_TRANSLATE) { if (usrClip instanceof Rectangle) { r.setBounds((Rectangle) usrClip); } else { r.setFrame(usrClip.getBounds2D()); } r.translate(-transX, -transY); } else { r.setFrame(getClip().getBounds2D()); } } else if (r == null) { throw new NullPointerException("null rectangle parameter"); } return r; }
Example 10
Source File: SunGraphics2D.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public Rectangle getClipBounds(Rectangle r) { if (clipState != CLIP_DEVICE) { if (transformState <= TRANSFORM_INT_TRANSLATE) { if (usrClip instanceof Rectangle) { r.setBounds((Rectangle) usrClip); } else { r.setFrame(usrClip.getBounds2D()); } r.translate(-transX, -transY); } else { r.setFrame(getClip().getBounds2D()); } } else if (r == null) { throw new NullPointerException("null rectangle parameter"); } return r; }
Example 11
Source File: SunGraphics2D.java From Bytecoder with Apache License 2.0 | 6 votes |
public Rectangle getClipBounds(Rectangle r) { if (clipState != CLIP_DEVICE) { if (transformState <= TRANSFORM_INT_TRANSLATE) { if (usrClip instanceof Rectangle) { r.setBounds((Rectangle) usrClip); } else { r.setFrame(usrClip.getBounds2D()); } r.translate(-transX, -transY); } else { r.setFrame(getClip().getBounds2D()); } } else if (r == null) { throw new NullPointerException("null rectangle parameter"); } return r; }
Example 12
Source File: SunGraphics2D.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public Rectangle getClipBounds(Rectangle r) { if (clipState != CLIP_DEVICE) { if (transformState <= TRANSFORM_INT_TRANSLATE) { if (usrClip instanceof Rectangle) { r.setBounds((Rectangle) usrClip); } else { r.setFrame(usrClip.getBounds2D()); } r.translate(-transX, -transY); } else { r.setFrame(getClip().getBounds2D()); } } else if (r == null) { throw new NullPointerException("null rectangle parameter"); } return r; }
Example 13
Source File: SunGraphics2D.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public Rectangle getClipBounds(Rectangle r) { if (clipState != CLIP_DEVICE) { if (transformState <= TRANSFORM_INT_TRANSLATE) { if (usrClip instanceof Rectangle) { r.setBounds((Rectangle) usrClip); } else { r.setFrame(usrClip.getBounds2D()); } r.translate(-transX, -transY); } else { r.setFrame(getClip().getBounds2D()); } } else if (r == null) { throw new NullPointerException("null rectangle parameter"); } return r; }
Example 14
Source File: SunGraphics2D.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public Rectangle getClipBounds(Rectangle r) { if (clipState != CLIP_DEVICE) { if (transformState <= TRANSFORM_INT_TRANSLATE) { if (usrClip instanceof Rectangle) { r.setBounds((Rectangle) usrClip); } else { r.setFrame(usrClip.getBounds2D()); } r.translate(-transX, -transY); } else { r.setFrame(getClip().getBounds2D()); } } else if (r == null) { throw new NullPointerException("null rectangle parameter"); } return r; }
Example 15
Source File: SunGraphics2D.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public Rectangle getClipBounds(Rectangle r) { if (clipState != CLIP_DEVICE) { if (transformState <= TRANSFORM_INT_TRANSLATE) { if (usrClip instanceof Rectangle) { r.setBounds((Rectangle) usrClip); } else { r.setFrame(usrClip.getBounds2D()); } r.translate(-transX, -transY); } else { r.setFrame(getClip().getBounds2D()); } } else if (r == null) { throw new NullPointerException("null rectangle parameter"); } return r; }
Example 16
Source File: DataLoader.java From ramus with GNU General Public License v3.0 | 5 votes |
public static Rectangle readRectangle(final InputStream stream) throws IOException { final double x = readDouble(stream); final double y = readDouble(stream); final double w = readDouble(stream); final double h = readDouble(stream); final Rectangle rec = new Rectangle(); rec.setFrame(x, y, w, h); return rec; }
Example 17
Source File: SiteList.java From TFC2 with GNU General Public License v3.0 | 5 votes |
public Rectangle getSitesBounds() { if (_sorted == false && _sites != null) { Collections.sort(_sites, new Site()); _currentIndex = 0; _sorted = true; } double xmin, xmax, ymin, ymax; if (_sites.size() == 0) { return new Rectangle(0, 0, 0, 0); } xmin = Integer.MAX_VALUE; xmax = Integer.MIN_VALUE; for (int i = 0; i < _sites.size(); ++i) { Site site = _sites.get(i); if (site.getX() < xmin) { xmin = site.getX(); } if (site.getX() > xmax) { xmax = site.getX(); } } // here's where we assume that the sites have been sorted on y: ymin = _sites.get(0).getY(); ymax = _sites.get(_sites.size() - 1).getY(); Rectangle out = new Rectangle(); out.setFrame(xmin, ymin, xmax - xmin, ymax - ymin); return out; }
Example 18
Source File: ColorIcon.java From osp with GNU General Public License v3.0 | 5 votes |
/** * Paints the icon. * * @param c the component on which it is painted * @param _g the graphics context * @param x the x coordinate of the icon * @param y the y coordinate of the icon */ public void paintIcon(Component c, Graphics _g, int x, int y) { Graphics2D g = (Graphics2D) _g; Rectangle rect = new Rectangle(x, y, w, h); Paint gPaint = g.getPaint(); if (outline!=null) { g.setPaint(outline); g.fill(rect); rect.setFrame(x+lineWidth, y+lineWidth, w-2*lineWidth, h-2*lineWidth); } g.setPaint(color); g.fill(rect); // restore graphics paint g.setPaint(gPaint); }