Package java.awt.geom

Examples of java.awt.geom.AffineTransform


        g2.draw(new Line2D.Double(posX, posY, slopeEndposX, slopeEndposY));

        // Draw arrow
        double  theta = Math.atan2((slopeEndposY-posY),(slopeEndposX-posX));

        AffineTransform affineTransform = new AffineTransform();
        affineTransform.setToTranslation(slopeEndposX, slopeEndposY);
        affineTransform.rotate(theta);
        Polygon first = new Polygon(new int[] {-5,0,-5},new int[] {2,0,-2},3);
        Shape firstArrow = affineTransform.createTransformedShape(first);
        g2.fill(firstArrow);
        g2.draw(firstArrow);

        // Restore old preferences
        g2.setColor(oldColor);
View Full Code Here


        g.setColor(drawColor);

        // draw shape
        if (symbol != null){
           
            AffineTransform oldTrasfrom = g.getTransform();
            Stroke oldStroke = g.getStroke();
           
            g.translate(_ox, _oy - _h);
            g.scale(_w / 10., _h/ 10.);
            g.setStroke(new BasicStroke(0.1f));
View Full Code Here

            } else  if (gate.getSide() == Gate.SOUTH){
                res.x += offsetX;
            }
           
            if (gateComponent instanceof AbstractShape){
               AffineTransform at = (( AbstractShape)gateComponent).getTransform();
               if (at != null){
                   at.transform(res, res);
               }
            }
        }
        return res;
    }
View Full Code Here

    g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
        AbstractShape.ANTI_ALIASING
            ? RenderingHints.VALUE_ANTIALIAS_ON
            : RenderingHints.VALUE_ANTIALIAS_OFF);

    AffineTransform oldTransform=null;
    if(transform!=null){
      oldTransform=g.getTransform();
      g.transform(transform.getTransform());
    }
   
View Full Code Here

    /**
     * Update the preview field
     */
    protected void updatePreview() {
        if ((tfpreview != null) && (currentFont != null)) {
            Font noScaleFont = currentFont.deriveFont(new AffineTransform());
            if (!noScaleFont.equals(tfpreview.getFont())) {
                tfpreview.setFont(noScaleFont);
                updateLayout();
            }
        }
View Full Code Here

   */
  public AffineTransformData(Listener listener){
    rotEnabled=false;
    transEnabled=false;
    translationFirst=false;
    transform=new AffineTransform();
    transformBounds=new double[8];
    angleUnitScale=1.; // use of radians
    transUnitScale=1.; // use of pixels
    setListener(listener);
  }
View Full Code Here

   */
  public AffineTransformData cloneTransform(boolean withDataListener) {
      AffineTransformData clone = null;
      try{
          clone = (AffineTransformData)clone();
          clone.transform=new AffineTransform(transform);
          clone.transformBounds=new double[8];

          if (withDataListener){
              clone.subscribeToDataNotifications();
          }   
View Full Code Here

      tyValue =transyValue.doubleValue();
     }
     else tyMapper = null;
    
    transformBounds=new double[8];
    transform=new AffineTransform();
  }
View Full Code Here

    double h=pageFormat.getImageableHeight();
   
    // create image accordingly
    BufferedImage bi=new BufferedImage((int)w,(int)h,BufferedImage.TYPE_3BYTE_BGR);
    Graphics2D g2=bi.createGraphics();
    AffineTransform t=g2.getTransform();
   
    // get diagram size
    Point pmax;

    if (comp.isAutofit()){
View Full Code Here

        if(name.equalsIgnoreCase("DISPLAY_FIRST_ARROW")) {
            if(value instanceof Boolean) {
                if(((Boolean)value).booleanValue()){
                    if(firstArrowTransform==null){
                        firstArrowTransform=new AffineTransform();
                        setBounds();
                    }
                }
                else{
                    firstArrowTransform = null;
                }
            }
        } else if(name.equalsIgnoreCase("DISPLAY_LAST_ARROW")) {
            if(value instanceof Boolean) {
                if(((Boolean)value).booleanValue()){
                    if(lastArrowTransform==null){
                        lastArrowTransform=new AffineTransform();
                        setBounds();
                    }
                }
                else{
                    lastArrowTransform=null;
View Full Code Here

TOP

Related Classes of java.awt.geom.AffineTransform

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.