Actually i fell dumb for the last question..maybe I need to get some
sleep...jjeje well...resolved the last isue i end up withs a new a "working"
bxml, a simple laucnher class (atached below) and my modified clases of wtk
module :D now im getting this porblem...

org.apache.pivot.serialization.SerializationException: class
org.apache.pivot.wtk.media.Drawing is not a sequence.

and I just don't get it...:S any help will be reaaaaaaaaaaaaally
apreciated!!! :D

<Drawing xmlns:bxml="http://pivot.apache.org/wtkx"; 
        xmlns:freedrawing="org.apache.pivot.wtk.media.drawing"
        xmlns="org.apache.pivot.wtk.media">


        <freedrawing:Canvas bxml:id="canvas">
                <freedrawing:Ellipse width="320" height="320" stroke="" 
fill="#eeeeee" />
                
        </freedrawing:Canvas>


</Drawing>

and a simple class like this...

package co.com.adv.salarixexternal.ui.controller.localcanvas;

import org.apache.pivot.beans.BXML;
import org.apache.pivot.beans.BXMLSerializer;
import org.apache.pivot.collections.Map;
import org.apache.pivot.wtk.Application;
import org.apache.pivot.wtk.ApplicationContext;
import org.apache.pivot.wtk.Display;
import org.apache.pivot.wtk.ImageView;
import org.apache.pivot.wtk.Window;
import org.apache.pivot.wtk.media.Drawing;
import org.apache.pivot.wtk.media.drawing.Canvas;
import org.apache.pivot.wtk.media.drawing.Line;
import org.apache.pivot.wtk.media.drawing.Shape;

import co.com.adv.salarixexternal.BXMLauncher;

public class RotateLine implements Application {

        private Drawing drawing = null;
        @BXML
    private Shape.Rotate rotation = null;
        
        private Window window = null;
        @BXML
    private Canvas canvas;

        @Override
        public void startup(Display display, Map&lt;String, String&gt; 
properties)
                        throws Exception {
                BXMLSerializer bxmlSerializer = new BXMLSerializer();
                drawing = (Drawing)bxmlSerializer.readObject(BXMLauncher.class,
"/co/com/adv/salarixexternal/ui/bxml/RotateLine.bxml");
                //now we try to paint a line by hand
        Line line = new Line();
        line.setEndpoints(0, 0, 300, 300);
        line.setStroke("#000000");
        //line.setFill("#000000");
        canvas.add(line);
        ApplicationContext.scheduleRecurringCallback(new Runnable() {
            @Override
            public void run() {
                int angle = (int)rotation.getAngle();
                angle = (angle + 6) % 360;
                rotation.setAngle(angle);
            }
        }, 1000);

        window = new Window(new ImageView(drawing));
        window.setMaximized(true);
        window.open(display);
        }

        @Override
        public boolean shutdown(boolean optional) throws Exception {
                if (window != null) {
            window.close();
        }

        return false;
        }

        @Override
        public void suspend() throws Exception {
                // TODO Auto-generated method stub
                
        }

        @Override
        public void resume() throws Exception {
                // TODO Auto-generated method stub
                
        }

}


--
View this message in context: 
http://apache-pivot-users.399431.n3.nabble.com/Programmatic-drawing-in-Pivot-2-0-tp2253493p3284577.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Reply via email to