Package org.apache.flex.compiler.internal.fxg.dom.types

Examples of org.apache.flex.compiler.internal.fxg.dom.types.FillMode


    public static DefineShapeTag createShapeForImage(DefineImage image, BitmapGraphicNode node)
    {
      double width = node.width;
      double height = node.height;
      boolean repeat = node.repeat;
      FillMode fillMode = node.fillMode;
      FXGVersion fileVersion = node.getFileVersion();

        // Use default width/height information if none specified
        if (Double.isNaN(width))
            width = image.getWidth();

        if (Double.isNaN(height))
            height = image.getHeight();

        // Create Fill Style
        Matrix matrix = new Matrix();
        double twx = (ISWFConstants.TWIPS_PER_PIXEL);
        matrix.setScale(twx, twx);
       
        FillStyle fs = null;
        if (fileVersion.equalTo(FXGVersion.v1_0))
        {
          if (repeat)
            fs = new FillStyle(FillStyle.REPEATING_BITMAP_FILL, matrix, image.getTag());
          else
            fs = new FillStyle(FillStyle.CLIPPED_BITMAP_FILL, matrix, image.getTag());
        }
        else
        {
          if (fillMode.equals(FillMode.REPEAT))
          {
            fs = new FillStyle(FillStyle.REPEATING_BITMAP_FILL, matrix, image.getTag());
          }
          else if (fillMode.equals(FillMode.CLIP))
          {
            fs = new FillStyle(FillStyle.CLIPPED_BITMAP_FILL, matrix, image.getTag());
          }
          else if (fillMode.equals(FillMode.SCALE))
          {
            //override the scale for matrix
              double fwidth = (width*ISWFConstants.TWIPS_PER_PIXEL)/(double)image.getWidth();
              double fheight = (height*ISWFConstants.TWIPS_PER_PIXEL)/(double)image.getHeight();
               
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.internal.fxg.dom.types.FillMode

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.