Package java.awt.geom

Examples of java.awt.geom.Area.transform()


     
      //create shape for text using transformation to make correct size
            at =new AffineTransform(dX*Trm[0][0],dX*Trm[0][1],dY*Trm[1][0],dY*Trm[1][1] ,0,y);

            if(transformedGlyph2!=null){
        transformedGlyph2.transform(at);
      }
     
      //save so we can reuse if it occurs again in this TJ command
      setCachedShape(rawInt, transformedGlyph2,at);
    }
View Full Code Here


                //String charName = StandardFonts.getUnicodeChar(StandardFonts.WIN, rawInt);
                float leading=(float)(currentWidth-(width+glyphX+glyphX))/2;

                if(leading>0){
                    at =AffineTransform.getTranslateInstance(leading,0);
                    transformedGlyph2.transform(at);
                }
            }else{
             
              if(glyphX<0){ //ensure inside box
                glyphX=-glyphX;
View Full Code Here

            }else{
             
              if(glyphX<0){ //ensure inside box
                glyphX=-glyphX;
                  at =AffineTransform.getTranslateInstance(glyphX,0);
                  transformedGlyph2.transform(at);
              }
             
                double scaleFactor=currentWidth/(transformedGlyph2.getBounds2D().getWidth());
                if(scaleFactor<1)  {
                    at =AffineTransform.getScaleInstance(scaleFactor,1);
View Full Code Here

              }
             
                double scaleFactor=currentWidth/(transformedGlyph2.getBounds2D().getWidth());
                if(scaleFactor<1)  {
                    at =AffineTransform.getScaleInstance(scaleFactor,1);
                    transformedGlyph2.transform(at);
                }
            }
        }

        return transformedGlyph2;
View Full Code Here

            AffineTransform toWheel = new AffineTransform();
            toWheel.concatenate(toCenter);
            toWheel.concatenate(toBorder);

            primitive.transform(toWheel);
            primitive.transform(toCircle);
           
            ticker[(int) i] = primitive;
        }
View Full Code Here

            AffineTransform toWheel = new AffineTransform();
            toWheel.concatenate(toCenter);
            toWheel.concatenate(toBorder);

            primitive.transform(toWheel);
            primitive.transform(toCircle);
           
            ticker[(int) i] = primitive;
        }

        return ticker;
View Full Code Here

    }

    protected Area transformRegion(Rectangle r) {
        Area a = new Area(r);
        a.transform(transform);
        return a;
    }

//    protected Rectangle computeBounds(int x, int y, int width, int height) {
//        return transformRegion(new Rectangle(x, y, width, height)).getBounds();
View Full Code Here

            Area a =  getBridgeArea(loc.rotateCCW(tileRotation));
            //bridge is independent on tile rotation
            if ((loc == Location.WE && (tileRotation == Rotation.R90 || tileRotation == Rotation.R180)) ||
                (loc == Location.NS && (tileRotation == Rotation.R180 || tileRotation == Rotation.R270))) {
                a = new Area(a);
                a.transform(Rotation.R180.getAffineTransform(ResourcePlugin.NORMALIZED_SIZE));
            }
            return a;
        }
        loc = loc.rotateCCW(tileRotation);
        FeatureDescriptor lookups[] = getLookups(tile, featureClass, loc);
View Full Code Here

    public Map<Location, Area> getBarnTileAreas(Tile tile, int size, Set<Location> corners) {
        Map<Location, Area> result = new HashMap<>();
        for (Location corner : corners) {
            int r = size/2;
            Area a = new Area(new Ellipse2D.Double(-r,-r,2*r,2*r));
            if (corner.isPartOf(Location.NR.union(Location.EL))) a.transform(Rotation.R90.getAffineTransform(size));
            if (corner.isPartOf(Location.SL.union(Location.ER))) a.transform(Rotation.R180.getAffineTransform(size));
            if (corner.isPartOf(Location.SR.union(Location.WL))) a.transform(Rotation.R270.getAffineTransform(size));
            result.put(corner, a);
        }
        return result;
View Full Code Here

        Map<Location, Area> result = new HashMap<>();
        for (Location corner : corners) {
            int r = size/2;
            Area a = new Area(new Ellipse2D.Double(-r,-r,2*r,2*r));
            if (corner.isPartOf(Location.NR.union(Location.EL))) a.transform(Rotation.R90.getAffineTransform(size));
            if (corner.isPartOf(Location.SL.union(Location.ER))) a.transform(Rotation.R180.getAffineTransform(size));
            if (corner.isPartOf(Location.SR.union(Location.WL))) a.transform(Rotation.R270.getAffineTransform(size));
            result.put(corner, a);
        }
        return result;
    }
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.