Package java.awt

Examples of java.awt.Rectangle


      }
    });

    SwingUtilities.invokeLater(new Runnable(){
      public void run() {
        infoPanel.scrollRectToVisible(new Rectangle(0,0));
      }
    });

    panel.add(ok, cc.xy(2,3));
View Full Code Here


      if ((blockArr != null) && (blockArr.length > 0)) {
        boolean toggleFlag = false;

        int width = getWidth();
        int height = getHeight();
        Rectangle clipBounds = grp.getClipBounds();

        grp.setFont(TABLE_WEST_FONT);
        grp.setColor(TABLE_WEST_FONT_COLOR);
        for (int i = 0; i < blockArr.length; i++) {
          toggleFlag = !toggleFlag;
          // Get the y positions of this time block
          int minY = blockArr[i].mStartY;
          int maxY;
          if ((i + 1) < blockArr.length) {
            maxY = blockArr[i + 1].mStartY;
          } else {
            maxY = height;
          }
          if (!clipBounds.intersects(0, minY, width, maxY - minY)) {
            // this piece is not visible at all
            continue;
          }

          // Get the image of this time block
View Full Code Here

        super.onPreWindowOpen(configurer);

        // Uncomment to hide the menubar, toolbar, or alter window size...
        // configurer.setShowMenuBar(false);
        // configurer.setShowToolBar(false);
        Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
        configurer.setInitialSize(new Dimension(rect.width, rect.height));

        if (!appSettings.isAutoImport())
            return;
View Full Code Here

        // check for intersection between two lists; if non-empty check
        // for contains
        Vector<Rectangle> vHoriz = tbtHorizProj.getValue();
        Vector<Rectangle> vVert = tbtVertProj.getValue();
        for (Enumeration<Rectangle> e = vHoriz.elements(); e.hasMoreElements();) {
            Rectangle r = e.nextElement();
            for (Enumeration<Rectangle> f = vVert.elements(); f.hasMoreElements();) {
                Rectangle s = f.nextElement();
                if (r == s) {
                    if (s.contains(p)) {
                        return s;
                    }
                }
            }
        }
View Full Code Here

    public BinaryModel getModel() {
        return model_;
    }

    public void paintComponent(Graphics g) {
        Rectangle clipRect = g.getClipBounds();
        FontMetrics fm = getFontMetrics(getFont());

        g.setColor(getBackground());
        g.fillRect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
        g.setColor(getForeground());
View Full Code Here

        double dx = Math.max(0.0, (imWidth - bds.getWidth()) / 2);
        g2.translate(-bds.getX() + dx, -bds.getY());
      }
     
      // Ensure that the circuit is eligible to be drawn
      Rectangle clip = g.getClipBounds();
      clip.add(bds.getX(), bds.getY());
      clip.add(bds.getX() + bds.getWidth(),
          bds.getY() + bds.getHeight());
      g.setClip(clip);
     
      // And finally draw the circuit onto the page
      ComponentDrawContext context = new ComponentDrawContext(
View Full Code Here

      int y = Integer.parseInt(s.substring(comma + 1));
      while (isProjectFrameAt(x, y)) {
        x += 20;
        y += 20;
      }
      Rectangle desired = new Rectangle(x, y, 50, 50);
   
      int gcBestSize = 0;
      Point gcBestPoint = null;
      GraphicsEnvironment ge;
      ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
      for (GraphicsDevice gd : ge.getScreenDevices()) {
        for (GraphicsConfiguration gc : gd.getConfigurations()) {
          Rectangle gcBounds = gc.getBounds();
          if (gcBounds.intersects(desired)) {
            Rectangle inter = gcBounds.intersection(desired);
            int size = inter.width * inter.height;
            if (size > gcBestSize) {
              gcBestSize = size;
              int x2 = Math.max(gcBounds.x, Math.min(inter.x,
                  inter.x + inter.width - 50));
View Full Code Here

    if (exceptions == null || exceptions.size() == 0) {
      viewport.setWidthMessage(null);
      return;
    }

    Rectangle viewableBase;
    Rectangle viewable;
    if (canvasPane != null) {
      viewableBase = canvasPane.getViewport().getViewRect();
    } else {
      Bounds bds = proj.getCurrentCircuit().getBounds();
      viewableBase = new Rectangle(0, 0, bds.getWidth(), bds.getHeight());
    }
    double zoom = getZoomFactor();
    if (zoom == 1.0) {
      viewable = viewableBase;
    } else {
      viewable = new Rectangle((int) (viewableBase.x / zoom),
          (int) (viewableBase.y / zoom),
          (int) (viewableBase.width / zoom),
          (int) (viewableBase.height / zoom));
    }
View Full Code Here

    String textTrim = text.endsWith(" ") ? text.substring(0, text.length() - 1) : text;
    Bounds newBds;
    if (textTrim.equals("")) {
      newBds = Bounds.EMPTY_BOUNDS;
    } else {
      Rectangle bdsOut = GraphicsUtil.getTextBounds(g, textTrim, 0, 0,
          halign, valign);
      newBds = Bounds.create(bdsOut).expand(4);
    }
    if (attrs.setOffsetBounds(newBds)) {
      Instance instance = painter.getInstance();
View Full Code Here

    public final void dragGestureRecognized(DragGestureEvent dge) {
      TreePath path = tree.getSelectionPath();
      if (path != null) {
        draggedNode = path.getLastPathComponent();
        if (drawImage) {
          Rectangle pathBounds = tree.getPathBounds(path); // getpathbounds
                                    // of
                                    // selectionpath
          JComponent lbl = (JComponent) tree
              .getCellRenderer()
              .getTreeCellRendererComponent(
View Full Code Here

TOP

Related Classes of java.awt.Rectangle

Copyright © 2018 www.massapicom. 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.