Package java.awt

Examples of java.awt.Rectangle.translate()


    }
    switch (valign) {
      case V_TOP:      break;
      case V_CENTER:   ret.translate(0, -(ascent / 2)); break;
      case V_CENTER_OVERALL: ret.translate(0, -(height / 2)); break;
      case V_BASELINE: ret.translate(0, -ascent); break;
      case V_BOTTOM:   ret.translate(0, -height); break;
      default: ;
    }
    return ret;
  }
View Full Code Here


    switch (valign) {
      case V_TOP:      break;
      case V_CENTER:   ret.translate(0, -(ascent / 2)); break;
      case V_CENTER_OVERALL: ret.translate(0, -(height / 2)); break;
      case V_BASELINE: ret.translate(0, -ascent); break;
      case V_BOTTOM:   ret.translate(0, -height); break;
      default: ;
    }
    return ret;
  }
View Full Code Here

    public void actionPerformed(ActionEvent e) {
      if (graph != null) {
        int step = 70;
        Rectangle rect = graph.getVisibleRect();
        if (direction == 1)
          rect.translate(0, -step); // up
        else if (direction == 2)
          rect.translate(step, 0); // right
        else if (direction == 3)
          rect.translate(0, step); // down
        else if (direction == 4)
View Full Code Here

        int step = 70;
        Rectangle rect = graph.getVisibleRect();
        if (direction == 1)
          rect.translate(0, -step); // up
        else if (direction == 2)
          rect.translate(step, 0); // right
        else if (direction == 3)
          rect.translate(0, step); // down
        else if (direction == 4)
          rect.translate(-step, 0); // left
        graph.scrollRectToVisible(rect);
View Full Code Here

        if (direction == 1)
          rect.translate(0, -step); // up
        else if (direction == 2)
          rect.translate(step, 0); // right
        else if (direction == 3)
          rect.translate(0, step); // down
        else if (direction == 4)
          rect.translate(-step, 0); // left
        graph.scrollRectToVisible(rect);
      }
    }
View Full Code Here

        else if (direction == 2)
          rect.translate(step, 0); // right
        else if (direction == 3)
          rect.translate(0, step); // down
        else if (direction == 4)
          rect.translate(-step, 0); // left
        graph.scrollRectToVisible(rect);
      }
    }

    public boolean isEnabled() {
View Full Code Here

    int tileWidth = image.getWidth(me);
    Rectangle rb = new Rectangle(0, 0, 1, 1);
    me.getBounds(rb);
    Insets ri = new Insets(0, 0, 0, 0);
    Insets riv = me.getInsets(ri);
    rb.translate(riv.left, riv.top);
    rb.width -= (riv.left + riv.right);
    rb.height -= (riv.top + riv.bottom);
    Shape ccache = g.getClip();
    g.clipRect(rb.x, rb.y, rb.width, rb.height);
    int xp, yp;
View Full Code Here

        Rectangle r = (Rectangle)rect.clone();

        if (r.intersects(getBounds()) == false)
            return null;
        r = r.intersection(getBounds());
        r.translate(-getMinX(), - getMinY());

        Raster ret = bi.getData(r);
        return ret.createTranslatedChild(ret.getMinX()+getMinX(),
                                         ret.getMinY()+getMinY());
    }
View Full Code Here

            setComposedText();
            Rectangle rect;
            Point location = jta.getLocationOnScreen();
            for (int i = 0; i < 7; i++) {
                rect = jta.modelToView(i);
                rect.translate(location.x, location.y);
                assertNull(imr.getLocationOffset(rect.x, rect.y));
            }
            for (int i = 7; i < 13; i++) {
                rect = jta.modelToView(i);
                rect.translate(location.x, location.y);
View Full Code Here

                rect.translate(location.x, location.y);
                assertNull(imr.getLocationOffset(rect.x, rect.y));
            }
            for (int i = 7; i < 13; i++) {
                rect = jta.modelToView(i);
                rect.translate(location.x, location.y);
                assertEquals(TextHitInfo.afterOffset(i - 7), imr.getLocationOffset(rect.x,
                        rect.y));
            }
        } catch (BadLocationException e) {
        }
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.