Package java.awt

Examples of java.awt.Graphics2D.rotate()


           //g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);

           g.setColor(getForeground());
           g.setFont(stdFont);          
           g2d.translate(getFontMetrics(g.getFont()).getAscent(), (getHeight()/2)+(getFontMetrics(g.getFont()).stringWidth(text)/2 ));
           g2d.rotate( Math.toRadians(-90) );
           g2d.drawString(text, 0, 0);          
        }
}
View Full Code Here


           //g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);

           g.setColor(getForeground());
           g.setFont(stdFont);          
           g2d.translate(getFontMetrics(g.getFont()).getAscent(), (getHeight()/2)+(getFontMetrics(g.getFont()).stringWidth(text)/2 ));
           g2d.rotate( Math.toRadians(-90) );
           g2d.drawString(text, 0, 0);          
        }
}
View Full Code Here

            AffineTransform origTransform = g.getTransform();

            g.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BICUBIC);
            g.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
           
            g.rotate(-3.14+angle,mitteX,mitteY);

            int ws=spitze.getImage().getWidth(null);
            int hs=spitze.getImage().getHeight(null);

            double z = (double)( (double)w/(double)ws*2)*(double)nibbleLenInProzent.getValue()/100.0 ;
View Full Code Here

                        - charwidth;
                Graphics2D g2d = (Graphics2D) graphics;

                // NOTE: Fudge factor so label doesn't touch axis labels.
                int startx = (charcenter + halflabelheight) - 2;
                g2d.rotate(Math.toRadians(-90), startx, starty);
                g2d.drawString(_ylabel, startx, starty);
                g2d.rotate(Math.toRadians(90), startx, starty);
            } else {
                // Not graphics 2D, no support for rotation.
                // Vertical label is fairly complex to draw.
View Full Code Here

                // NOTE: Fudge factor so label doesn't touch axis labels.
                int startx = (charcenter + halflabelheight) - 2;
                g2d.rotate(Math.toRadians(-90), startx, starty);
                g2d.drawString(_ylabel, startx, starty);
                g2d.rotate(Math.toRadians(90), startx, starty);
            } else {
                // Not graphics 2D, no support for rotation.
                // Vertical label is fairly complex to draw.
                int starty = (_uly + ((_lry - _uly) / 2))
                        - (yl * halflabelheight) + labelheight;
View Full Code Here

    case SwingConstants.VERTICAL: 
      g.drawString(name, xOffset, yOffset); break;
    case SwingConstants.HORIZONTAL: 
      Graphics2D g2d = (Graphics2D)g;
      g2d.translate(plotSize.width-xOffset+10, plotSize.height-yOffset);
      g2d.rotate(-Math.PI/2);
      g2d.drawString(name, 0, 0);
//      g2d.drawString(name, plotSize.width-xOffset, plotSize.height-yOffset);
      g2d.rotate(Math.PI/2);
      g2d.translate(xOffset-plotSize.width-10, yOffset-plotSize.height);
      break;
View Full Code Here

      Graphics2D g2d = (Graphics2D)g;
      g2d.translate(plotSize.width-xOffset+10, plotSize.height-yOffset);
      g2d.rotate(-Math.PI/2);
      g2d.drawString(name, 0, 0);
//      g2d.drawString(name, plotSize.width-xOffset, plotSize.height-yOffset);
      g2d.rotate(Math.PI/2);
      g2d.translate(xOffset-plotSize.width-10, yOffset-plotSize.height);
      break;
    }
  }
 
View Full Code Here

        graphics.setBackground( TRANSPARENT_WHITE );
        graphics.clearRect( 0, 0, retval.getWidth(), retval.getHeight() );
        if (rotation != 0)
        {
            graphics.translate(retval.getWidth(), 0.0f);
            graphics.rotate(rotation);
        }
        graphics.scale( scaling, scaling );
        PageDrawer drawer = new PageDrawer();
        drawer.drawPage( graphics, this, pageDimension );
View Full Code Here

            int rotation = page.findRotation();
            if (rotation == 90 || rotation == 270)
            {
                Graphics2D g2D = (Graphics2D)g;
                g2D.translate(pageDimension.getWidth(), 0.0f);
                g2D.rotate(Math.toRadians(rotation));
            }

            drawer.drawPage( g, page, drawDimension );
        }
        catch( IOException e )
View Full Code Here

              getStringBounds(this.text, painter.getFontRenderContext()).getWidth();
    double textHeight = painter.getFont().
                getStringBounds(this.text, painter.getFontRenderContext()).getHeight();

    painter.translate(textHeight, textWidth+textHeight);
    painter.rotate(1.5*Math.PI);
//    super.paintComponent(painter);
    painter.drawString(text, 0, 0);
    painter.setTransform(transform);
  }
}
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.