Package java.awt

Examples of java.awt.Rectangle.translate()


        //Uu.p("this = " + canvas);
        if (getCanvas() == null) {
            return this.temp_canvas;
        } else {
            Rectangle rect = getCanvas().getFixedRectangle();
            rect.translate(getCanvas().getX(), getCanvas().getY());
            return rect;
        }
    }

    private NamespaceHandler namespaceHandler;
View Full Code Here


    Component viewParent = view.getParent();
    if (viewParent instanceof JViewport)
    {
      Rectangle viewBounds = ((JViewport) viewParent).getViewRect();
      Rectangle translatedCursorBounds = (Rectangle) cursorBounds.clone();
      translatedCursorBounds.translate(-viewBounds.x, -viewBounds.y);

      ret = computeBounds(popup, viewBounds.width, viewBounds.height,
        translatedCursorBounds, placement);

      if (ret != null)
View Full Code Here

    final boolean scrollUp = cursor.y - r.y < dragScrollActivationMargin;
    final boolean scrollDown = r.y + r.height - cursor.y < dragScrollActivationMargin;
    final boolean scrollLeft = cursor.x - r.x < dragScrollActivationMargin;
    final boolean scrollRight = r.x + r.width - cursor.x < dragScrollActivationMargin;
    if (scrollUp)
      r.translate(0, -dragScrollDistance);
    else if (scrollDown)
      r.translate(0, +dragScrollDistance);
    if (scrollLeft)
      r.translate(-dragScrollDistance, 0);
    else if (scrollRight)
View Full Code Here

    final boolean scrollLeft = cursor.x - r.x < dragScrollActivationMargin;
    final boolean scrollRight = r.x + r.width - cursor.x < dragScrollActivationMargin;
    if (scrollUp)
      r.translate(0, -dragScrollDistance);
    else if (scrollDown)
      r.translate(0, +dragScrollDistance);
    if (scrollLeft)
      r.translate(-dragScrollDistance, 0);
    else if (scrollRight)
      r.translate(+dragScrollDistance, 0);
    scrollRectToVisible(r);
View Full Code Here

    if (scrollUp)
      r.translate(0, -dragScrollDistance);
    else if (scrollDown)
      r.translate(0, +dragScrollDistance);
    if (scrollLeft)
      r.translate(-dragScrollDistance, 0);
    else if (scrollRight)
      r.translate(+dragScrollDistance, 0);
    scrollRectToVisible(r);
    lastDragAutoscroll = currentTime;
  }
View Full Code Here

    else if (scrollDown)
      r.translate(0, +dragScrollDistance);
    if (scrollLeft)
      r.translate(-dragScrollDistance, 0);
    else if (scrollRight)
      r.translate(+dragScrollDistance, 0);
    scrollRectToVisible(r);
    lastDragAutoscroll = currentTime;
  }

  public void dropActionChanged(DropTargetDragEvent dtde) {
View Full Code Here

   */
  public void moveView(float dx, float dy) {
    if (getParent() instanceof JViewport) {
      JViewport viewport = (JViewport)getParent();
      Rectangle viewRectangle = viewport.getViewRect();
      viewRectangle.translate(Math.round(dx * getScale()), Math.round(dy * getScale()));
      viewRectangle.x = Math.min(Math.max(0, viewRectangle.x), getWidth() - viewRectangle.width);
      viewRectangle.y = Math.min(Math.max(0, viewRectangle.y), getHeight() - viewRectangle.height);
      viewport.setViewPosition(viewRectangle.getLocation());
    }
  }
View Full Code Here

      t      = doc.markerTrack;
      vpSelections.add( markAxis.getBounds() );
      vpSelectionColors.add( doc.selectedTracks.contains( t ) ? colrSelection : colrSelection2 );
      for( int ch = 0; ch < waveView.getNumChannels(); ch++ ) {
        r    = new Rectangle( waveView.rectForChannel( ch ));
        r.translate( x, y );
        t    = (Track) doc.audioTracks.get( ch );
        vpSelections.add( r );
        vpSelectionColors.add( doc.selectedTracks.contains( t ) ? colrSelection : colrSelection2 );
      }
    }
View Full Code Here

        }

        Rectangle destRect = null;
        for (int i = 0; i < 4; i++) {
            Rectangle srcRect = sourceRect;
            srcRect.translate(xTrans[i], yTrans[i]);
            Rectangle overlap = srcRect.intersection(getBounds());
            if (!overlap.isEmpty()) {
                destRect = destRect == null ?
                    overlap : destRect.union(overlap);
            }
View Full Code Here

        Rectangle sourceRect = null;
        for (int i = 0; i < 4; i++) {
            Rectangle overlap = destRect.intersection(bounds[i]);
            if (!overlap.isEmpty()) {
                overlap.translate(-xTrans[i], -yTrans[i]);
                sourceRect = sourceRect == null ?
                    overlap : sourceRect.union(overlap);
            }
        }
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.