Package java.awt

Examples of java.awt.Rectangle.union()


            Rectangle rect = null;
            if (figIterator.hasNext()) rect = ((Figure) figIterator.next()).getDisplayBox();

            while (figIterator.hasNext()) {
                Figure fig = (Figure) figIterator.next();
                rect.union(fig.getDisplayBox());
            }

            if (rect == null) return;

            adjustFigureToCenter(drawingView, rect);
View Full Code Here


    GraphicsDevice[] gs = ge.getScreenDevices();
    for (int j = 0; j < gs.length; j++) {
        GraphicsDevice gd = gs[j];
        GraphicsConfiguration[] gc = gd.getConfigurations();
        for (int i=0; i < gc.length; i++) {
            virtualBounds = virtualBounds.union(gc[i].getBounds());
        }
    }
    this.setLocation( (virtualBounds.width-WIDTH)/2, (virtualBounds.height-HEIGHT)/2);
    this.getContentPane().setBackground(new Color(180,180,255));
    this.setCursor(new Cursor(Cursor.WAIT_CURSOR));
View Full Code Here

    GraphicsDevice[] gs = ge.getScreenDevices();
    for (int j = 0; j < gs.length; j++) {
        GraphicsDevice gd = gs[j];
        GraphicsConfiguration[] gc = gd.getConfigurations();
        for (int i=0; i < gc.length; i++) {
            virtualBounds = virtualBounds.union(gc[i].getBounds());
        }
    }
    this.setLocation( (virtualBounds.width-440)/2, (virtualBounds.height-320)/2);
    this.getContentPane().setBackground(new Color(180,180,255));
View Full Code Here

                    }
                    cost2 = (overhead                 +
                             (cr.height*lineOverhead) +
                             (cr.height*cr.width));

                    mr = r.union(cr);
                    cost3 = (overhead                 +
                             (mr.height*lineOverhead) +
                             (mr.height*mr.width));
                    if (cost3 <= cost1+cost2) {
                        r = rects[i] = mr;
View Full Code Here

                    }
                    cost2 = (overhead                 +
                             (cr.height*lineOverhead) +
                             (cr.height*cr.width));

                    mr = r.union(cr);
                    cost3 = (overhead                 +
                             (mr.height*lineOverhead) +
                             (mr.height*mr.width));
                    if (cost3 <= cost1+cost2) {
                        r = rects[i] = mr;
View Full Code Here

      r = textArea.modelToView(start);
      if (r==null) { // Not yet visible; i.e. JUnit tests
        return;
      }
      if (end!=start) {
        r = r.union(textArea.modelToView(end));
      }
    } catch (BadLocationException ble) { // Never happens
      ble.printStackTrace();
      textArea.setSelectionStart(start);
      textArea.setSelectionEnd(end);
View Full Code Here

                    }
                    cost2 = (overhead                 +
                             (cr.height*lineOverhead) +
                             (cr.height*cr.width));

                    mr = r.union(cr);
                    cost3 = (overhead                 +
                             (mr.height*lineOverhead) +
                             (mr.height*mr.width));
                    if (cost3 <= cost1+cost2) {
                        r = rects[i] = mr;
View Full Code Here

                    if ((cr == null) || (cr == r)) continue;
                    cost2 = (overhead                 +
                             (cr.height*lineOverhead) +
                             (cr.height*cr.width));

                    mr = r.union(cr);
                    cost3 = (overhead                 +
                             (mr.height*lineOverhead) +
                             (mr.height*mr.width));
                    if (cost3 <= cost1+cost2) {
                        rects[j] = mr;
View Full Code Here

                    }
                    cost2 = (overhead                 +
                             (cr.height*lineOverhead) +
                             (cr.height*cr.width));

                    mr = r.union(cr);
                    cost3 = (overhead                 +
                             (mr.height*lineOverhead) +
                             (mr.height*mr.width));
                    if (cost3 <= cost1+cost2) {
                        r = rects[i] = mr;
View Full Code Here

      JRibbonTaskToggleButton button = taskToggleButtons.get(group
          .getTask(j));
      if (rect == null)
        rect = button.getBounds();
      else
        rect = rect.union(button.getBounds());
    }
    int buttonGap = getTabButtonGap();
    Point location = SwingUtilities.convertPoint(
        taskToggleButtonsScrollablePanel.getView(), rect.getLocation(),
        ribbon);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.