public Element union(Element elem) { Rectangle r1 = new Rectangle(x, y, w, h); Rectangle r2 = new Rectangle(elem.x, elem.y, elem.w, elem.h); return new Element(r1.union(r2)); }
Rectangle screenRect = new Rectangle(0, 0, 0, 0); for (GraphicsDevice gd : GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) { screenRect = screenRect.union(gd.getDefaultConfiguration().getBounds()); } BufferedImage capture = new Robot().createScreenCapture(screenRect);
@Override public String waitForTransition(TransitionListener token) { this.token = token; maxR = clickables.get(0).getBounds(); if (clickables.size() > 1) { for (SxClickable c : clickables.subList(1, clickables.size())) { maxR = maxR.union(c.getActualBounds()); } } setBounds(maxR); setVisible(true); mouseTracker.start(); return "Next"; }
Rectangle r = p0.union(p1); g2d.fillRect(r.x, r.y, r.width, r.height);
currentBounds = new Rectangle(gdevs[i].getDefaultConfiguration().getBounds()); if (null != allMonitors) { allMonitors = allMonitors.union(currentBounds); } else { allMonitors = currentBounds;
/** * Repaint the given line range. * * @param line0 The starting line number to repaint. This must * be a valid line number in the model. * @param line1 The ending line number to repaint. This must * be a valid line number in the model. * @param a The region allocated for the view to render into. * @param host The component hosting the view (used to call repaint). */ protected void damageLineRange(int line0, int line1, Shape a, Component host) { if (a != null) { Rectangle area0 = lineToRect(a, line0); Rectangle area1 = lineToRect(a, line1); if ((area0 != null) && (area1 != null)) { Rectangle dmg = area0.union(area1); // damage. host.repaint(dmg.x, dmg.y, dmg.width, dmg.height); } else { host.repaint(); } } }
@SuppressWarnings("NullableProblems") @Override public Coords union(Rectangle r) { return new Coords(super.union(r)); }
/** * Returns the rectangle of all screens on the system * @return */ private static Rectangle getScreensRectangle() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Rectangle screenRect = new Rectangle(0, 0, 0, 0); for (GraphicsDevice gd : ge.getScreenDevices()) { screenRect = screenRect.union(gd.getDefaultConfiguration().getBounds()); } return screenRect; }
private static Rectangle getScreenBounds() { Rectangle SCREEN_BOUNDS = new Rectangle(); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] gs = ge.getScreenDevices(); for (GraphicsDevice gd : gs) { GraphicsConfiguration gc = gd.getDefaultConfiguration(); SCREEN_BOUNDS = SCREEN_BOUNDS.union(gc.getBounds()); } return SCREEN_BOUNDS; }
private Rectangle getMinorBounds(int majorOrder) { Rectangle r = new Rectangle(); Rectangle temp = null; for(int i = 0; i < componentInfos.size(); i++) { ComponentInfo ci = (ComponentInfo) componentInfos.get(i); if(ci.constraints.majorOrder == majorOrder) { temp = ci.comp.getBounds(temp); r = r.union(temp); } } return r; }
mappingBB = sourceBB.union(targetBB); } else { mappingBB = targetBB;
public static Rectangle getVirtualScreenBounds() { Rectangle virtualBounds = new Rectangle(); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] gs = ge.getScreenDevices(); for (GraphicsDevice gd : gs) { GraphicsConfiguration[] gc = gd.getConfigurations(); for (GraphicsConfiguration aGc : gc) { virtualBounds = virtualBounds.union(aGc.getBounds()); } } return virtualBounds; }
public void setSelectionSize(Rectangle rect, Component component) { currentRect = rect; updateDrawableRect(component.getWidth(), component.getHeight()); Rectangle totalRepaint = rectToDraw.union(previousRectDrawn); component.repaint(totalRepaint.x, totalRepaint.y, totalRepaint.width, totalRepaint.height); }
r = r.union(textArea.modelToView(end));
public ScreenUnion() { super(true); _bounds = new Rectangle(); for (int i = 0; i < Screen.getNumberScreens(); i++) { _bounds = _bounds.union(Screen.getBounds(i)); } x = _bounds.x; y = _bounds.y; w = _bounds.width; h = _bounds.height; }
union = union.union(currentExtent);
@Override public Rectangle getBounds () { Rectangle box = super.getBounds(); if (box != null) { return box; } return new Rectangle(bounds = l1.getBounds().union(l2.getBounds())); }
public void modifyCell(Object value, Rectangle r) { if (value == null) { throw new NullArgumentException("value is null"); } if (!cellMap.containsKey(value)) { throw new IllegalArgumentException("value not exists"); } Rectangle rectOld = _removeCell0(value, false); cellMap.put(value, r); repaint(getCellRect(r).union(rectOld)); fireValueChanged(new GridCellModelEvent(this, GridCellModelEvent.Type.MODIFY)); }
private boolean canMerge (Filament fil, Rectangle core, Section section) { // A section must always touch one of fil current member sections if (!fil.touches(section)) { return false; } // If this does not increase thickness beyond core, it's OK Rectangle oSct = VERTICAL.oriented(section.getBounds()); return core.union(oSct).height <= core.height; }
/** * create a new region containing both regions * * @param ur region to unite with * @return the new region */ public Region union(Region ur) { Rectangle r = getRect().union(ur.getRect()); return Region.create(r.x, r.y, r.width, r.height, scr); }