Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.CanvasElement


          rotateAngle += angle;
        }
     //   System.out.println(rotateAngle); 
        context.translate(x+hexWidth/2, y+hexHeight/2);
        context.rotate(rotateAngle);
        CanvasElement arrow = Draw.arrow(hexWidth/4, hexHeight/4);
        context.drawImage(arrow, -arrow.getWidth()/2,-arrow.getHeight()/2);
    }
    context.restore();
    //System.out.println(calculating);
  }
View Full Code Here


   */
  public void resize(int width, int height)
    {
    assert (image != null || this.canvas != null) : "You must load an image first";
   
    CanvasElement canvas = Document.get().createCanvasElement().cast();
    canvas.setWidth(width);
    canvas.setHeight(height);
    if (image != null)
    {
      canvas.getContext2d().drawImage(image.asImageElement(), 0, 0, width, height);
    }
    else
    {
      canvas.getContext2d().drawImage(this.canvas, 0, 0, this.canvas.getWidth(), this.canvas.getHeight(), 0, 0, width, height);
    }
   
    this.canvas = canvas;
    image = null;
    }
View Full Code Here

        }

        @Override
        public CanvasElement getCanvasElement()
        {
            CanvasElement element = null;

            if (LienzoGlobals.getInstance().isCanvasSupported())
            {
                element = super.getCanvasElement();
View Full Code Here

        {
            if (LienzoGlobals.getInstance().isCanvasSupported())
            {
                super.setPixelSize(wide, high);

                CanvasElement element = getCanvasElement();

                element.setHeight(high);

                element.setWidth(wide);

                element.getStyle().setPosition(Position.ABSOLUTE);

                element.getStyle().setDisplay(Display.INLINE_BLOCK);
            }
        }
View Full Code Here

    @Override
    public void add(Layer layer)
    {
        if ((null != layer) && (LienzoGlobals.getInstance().isCanvasSupported()))
        {
            CanvasElement element = layer.getCanvasElement();

            layer.setPixelSize(m_wide, m_high);

            element.getStyle().setPosition(Position.ABSOLUTE);

            element.getStyle().setDisplay(Display.INLINE_BLOCK);

            getElement().appendChild(element);

            super.add(layer);
View Full Code Here

    @Override
    public void remove(Layer layer)
    {
        if ((null != layer) && (LienzoGlobals.getInstance().isCanvasSupported()))
        {
            CanvasElement element = layer.getCanvasElement();

            getElement().removeChild(element);

            super.remove(layer);
        }
View Full Code Here

    {
        if (LienzoGlobals.getInstance().isCanvasSupported())
        {
            while (getElement().getChildCount() > 0)
            {
                CanvasElement element = getElement().getChild(0).cast();

                getElement().removeChild(element);
            }
            super.removeAll();
        }
View Full Code Here

    @Override
    public void moveDown(Layer layer)
    {
        if ((null != layer) && (LienzoGlobals.getInstance().isCanvasSupported()))
        {
            CanvasElement element = layer.getCanvasElement();

            int size = getElement().getChildCount();

            if (size < 2)
            {
                return;
            }
            for (int i = 0; i < size; i++)
            {
                CanvasElement look = getElement().getChild(i).cast();

                if (look == element)
                {
                    if (i == 0)
                    {
View Full Code Here

            if (size < 2)
            {
                return;
            }
            CanvasElement element = layer.getCanvasElement();

            for (int i = 0; i < size; i++)
            {
                CanvasElement look = getElement().getChild(i).cast();

                if (look == element)
                {
                    if ((i + 1) == size)
                    {
View Full Code Here

            if (size < 2)
            {
                return;
            }
            CanvasElement element = layer.getCanvasElement();

            getElement().removeChild(element);

            getElement().appendChild(element);
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.CanvasElement

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.