Package java.awt

Examples of java.awt.Graphics2D.translate()


            GradientPaint gp = new GradientPaint(180.0f, 280.0f, new Color(255, 255, 255, 255), 250.0f, 380.0f, new Color(255, 255, 0, 0));
            g2.setPaint(gp);
            for(int i = 0; i < 3; i ++ ) {
                g2.drawOval(150, 280, 100, 100);
                g2.fillOval(150, 280, 100, 100);
                g2.translate(120, 20);
            }
        }
    }

    private class TranslucentComponent extends JComponent {
View Full Code Here


      at.translate( 1.15, -1.15 );
      recalcTransforms();
    }
   
    g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
    g2.translate( insets.left, insets.top );
    for( int i = 0; i < tOutlines.size(); i++ ) {
      g2.setPaint( (Paint) outlinePaints.get( i ));
      g2.draw( (Shape) tOutlines.get( i ));
    }
    for( int i = 0; i < tAreas.size(); i++ ) {
View Full Code Here

      g2.fill( (Shape) tAreas.get( i ));
    }
       
    trnsX  = (ctrlPt.getX() + 1.15) * radius;
    trnsY  = (1.15 - ctrlPt.getY()) * radius;
    g2.translate( trnsX, trnsY );
    g2.setPaint( pntCtrlIn );
    g2.fill( shpCtrlIn );
    if( isDragging ) {
      g2.setPaint( pntCtrlOutS );
    } else {
View Full Code Here

      g2.setPaint( pntCtrlOutS );
    } else {
      g2.setPaint( pntCtrlOut );
    }
    g2.fill( shpCtrlOut );
    g2.translate( -trnsX, -trnsY );

    g2.setTransform( oldAT );
  }

  private void recalcTransforms()
View Full Code Here

    final int      w  = getWidth();
    final int      x  = Math.min( w - 36, lbTrackName.getX() + lbTrackName.getWidth() );
   
//    g2.setColor( colrDarken );
//    g2.fillRect( 0, 19, w, 2 );
  g2.translate( x, 0 );
    g2.setPaint( pntDarken );
    g2.fillRect( -x, 19, x + 36, 2 );
//    g2.setColor( selected ? colrSelected : colrUnselected );
//    g2.fillRect( 0, 0, 5, h );
//    g2.fillRect( 5, 0, w, 20 );
View Full Code Here

//    g2.setColor( selected ? colrSelected : colrUnselected );
//    g2.fillRect( 0, 0, 5, h );
//    g2.fillRect( 5, 0, w, 20 );
    g2.setPaint( selected ? pntSelected : pntUnselected );
    g2.fillRect( -x, 0, x + 36, 20 );
  g2.translate( -x, 0 );

//    g2.setPaint( pntTopBorder );
//    g2.fillRect( 0, 0, w, 8 );
  g2.translate( 0, h - 8 );
    g2.setPaint( GradientPanel.pntBottomBorder );
View Full Code Here

    g2.fillRect( -x, 0, x + 36, 20 );
  g2.translate( -x, 0 );

//    g2.setPaint( pntTopBorder );
//    g2.fillRect( 0, 0, w, 8 );
  g2.translate( 0, h - 8 );
    g2.setPaint( GradientPanel.pntBottomBorder );
//    g2.fillRect( 0, h - 9, w, 8 );
    g2.fillRect( 0, 0, w, 8 );
  g2.translate( 0, 8 - h );
View Full Code Here

//    g2.fillRect( 0, 0, w, 8 );
  g2.translate( 0, h - 8 );
    g2.setPaint( GradientPanel.pntBottomBorder );
//    g2.fillRect( 0, h - 9, w, 8 );
    g2.fillRect( 0, 0, w, 8 );
  g2.translate( 0, 8 - h );

  }

  public void paintChildren( Graphics g )
  {
View Full Code Here

      at.translate( 0, -1.0 );
      recalcTransforms();
    }
   
    g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
    g2.translate( insets.left, insets.top );
    for( int i = 0; i < tShpFades.length; i++ ) {
      g2.draw( tShpFades[ i ]);
    }
   
    for( int i = 0; i < ctrlPt.length; i++ ) {
View Full Code Here

    }
   
    for( int i = 0; i < ctrlPt.length; i++ ) {
      trnsX  = ctrlPt[i].getX() * currentWidth;
      trnsY  = (1.0 - ctrlPt[i].getY()) * currentHeight;
      g2.translate( trnsX, trnsY );
      g2.setPaint( pntCtrlIn );
      g2.fill( shpCtrlIn );
      if( ctrlPt[i] == dragPt ) {
        g2.setPaint( pntCtrlOutS );
      } else {
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.