Package com.levigo.util.gwtawt.client

Examples of com.levigo.util.gwtawt.client.WebGraphics


        return null;
    }

    public void renderEnvironment(Context2d ctx) {

        WebGraphics g = new WebGraphics(ctx);
        // Draw it on the Canvas
        ctx.setLineWidth(33);
        g.setColor(java.awt.Color.WHITE);
        g.draw(envPath);
        ctx.setLineWidth(30);
        g.setColor(java.awt.Color.LIGHT_GRAY);
        g.draw(envPath);
        ctx.setLineWidth(7);
        g.setColor(java.awt.Color.DARK_GRAY);
        g.draw(envPath);
    }
View Full Code Here


        rotation = getEnvObject().getCurrentRepresentation().getRotation();
        dx = getEnvObject().getCurrentRepresentation().getOffset().getX();
        dy = getEnvObject().getCurrentRepresentation().getOffset().getY();
        context.translate(dx, dy);
        context.rotate(rotation);
        WebGraphics g = new WebGraphics(context);
        if (ImageUtils.CachedImages.containsKey(OBJECT_PATH + file)) {
            Image im = ImageUtils.CachedImages.get(OBJECT_PATH + file);
            ImageElement ie = ImageElement.as(im.getElement());
            //ghostPath = new Rectangle(ie.getWidth(),ie.getHeight());
            ghostPath = objectBounds;
            context.drawImage(ie, 0, 0, box.getWidth(), box.getHeight());

            //draw box surronding object                   
            //draw the border
            context.setLineWidth(1);
            g.setColor(new Color(137, 174, 32));
            g.draw(box);


        } else {
//          //TODO: Cache path       
//        Paint paint = new Paint();
View Full Code Here

        double dx = getEnvObject().getCurrentRepresentation().getOffset().getX();
        double dy = getEnvObject().getCurrentRepresentation().getOffset().getY();
        context.translate(dx, dy);
        context.rotate(rotation);
        Color c = new Color(getIndexColor());
        WebGraphics g = new WebGraphics(context);
        g.setColor(c);
        g.fill(ghostPath);
        //    if (ghostBitmap!= null)
//    {     
//      ghostBitmap.eraseColor(indexColor);
//      canvas.drawBitmap(ghostBitmap,drawingMatrix, null);
//    }
View Full Code Here

        bounds = this.drawingPath.getBounds2D();
    }

    @Override
    public void draw(Context2d context) {
        WebGraphics g = new WebGraphics(context);

        //draw the fill       
        if (isFillRoom()) {
            drawFill(context, g);
        }
        //draw the border
        context.setLineWidth(2); // 7 pixel line width.
        g.setColor(Color.DARK_GRAY);
        g.draw(drawingPath);
        //draw the text
        g.setColor(Color.BLACK);
        context.fillText(roomObject.getName(), bounds.getMinX() + 22, bounds.getMinY() + 22);
    }
View Full Code Here

    }

    @Override
    public void drawGhost(Context2d context) {
        Color c = new Color(getIndexColor());
        WebGraphics g = new WebGraphics(context);
        g.setColor(c);
        g.fill(drawingPath);
    }
View Full Code Here

    bounds = this.drawingPath.getBounds2D();
  }
  @Override
  public void draw(Context2d context)
  {
    WebGraphics g = new WebGraphics(context);

    //draw the fill       
    if (isFillRoom())
      drawFill(context,g);   
    //draw the border
    context.setLineWidth(2); // 7 pixel line width.
    g.setColor(Color.DARK_GRAY);
    g.draw(drawingPath);         
    //draw the text
    g.setColor(Color.BLACK);
    context.fillText(roomObject.getName(), bounds.getMinX()+22, bounds.getMinY()+22);
  }
View Full Code Here

 
  @Override
  public void drawGhost(Context2d context)
  {
    Color c = new Color(getIndexColor());       
    WebGraphics g = new WebGraphics(context);   
    g.setColor(c);   
    g.fill(drawingPath);
  }
View Full Code Here

    rotation =  getEnvObject().getCurrentRepresentation().getRotation();
    dx =getEnvObject().getCurrentRepresentation().getOffset().getX();
    dy = getEnvObject().getCurrentRepresentation().getOffset().getY();   
    context.translate(dx,dy);   
    context.rotate(rotation);
    WebGraphics g = new WebGraphics(context);
    if (ImageUtils.CachedImages.containsKey(OBJECT_PATH+file))
    {     
      Image im =ImageUtils.CachedImages.get(OBJECT_PATH+file);     
      ImageElement ie = ImageElement.as(im.getElement());     
      //ghostPath = new Rectangle(ie.getWidth(),ie.getHeight());
      ghostPath =objectBounds;       
      context.drawImage(ie, 0, 0,box.getWidth(),box.getHeight());
     
      //draw box surronding object                   
      //draw the border
      context.setLineWidth(1);
      g.setColor(new Color(137,174,32));
      g.draw(box);         
     
     
    }
     
        else
View Full Code Here

    double dx =getEnvObject().getCurrentRepresentation().getOffset().getX();
    double dy = getEnvObject().getCurrentRepresentation().getOffset().getY();   
    context.translate(dx,dy);
    context.rotate(rotation);
    Color c = new Color(getIndexColor());       
    WebGraphics g = new WebGraphics(context);   
    g.setColor(c);   
    g.fill(ghostPath);
    //    if (ghostBitmap!= null)
//    {     
//      ghostBitmap.eraseColor(indexColor);
//      canvas.drawBitmap(ghostBitmap,drawingMatrix, null);
//    }
View Full Code Here

  }
 
    public void renderEnvironment(Context2d ctx)
    {         
          
      WebGraphics g = new WebGraphics(ctx);   
    // Draw it on the Canvas
    ctx.setLineWidth(33);
    g.setColor(java.awt.Color.WHITE);   
    g.draw(envPath);
    ctx.setLineWidth(30);
    g.setColor(java.awt.Color.LIGHT_GRAY);   
    g.draw(envPath);
    ctx.setLineWidth(7);
    g.setColor(java.awt.Color.DARK_GRAY);
    g.draw(envPath);   
    }
View Full Code Here

TOP

Related Classes of com.levigo.util.gwtawt.client.WebGraphics

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.