package a3test.basic;

import jp.sourceforge.acerola3d.a3.*;

public class Selected3DTest extends A3Adapter {
    public Selected3DTest() throws Exception {
        A3Window w = new A3Window(300,300);
        w.addA3Listener(this);
        Action3D a3[][] = new Action3D[3][3];
        for (int x=0;x<3;x++) {
            for (int y=0;y<3;y++) {
                //a3[x][y] = new Action3D("x-res:///axis.a3");
                a3[x][y] = new Action3D("x-res:///vesma9.a3");
                //a3[x][y] = new Action3D("x-res:///measure.a3");
                a3[x][y].setLoc(0.5*(x-1),0.5*(y-1),0.0);
                a3[x][y].setScale(0.02*(x+1)+0.06*(y+1));
                //a3[x][y].setScale(0.00002*(x+1)+0.00006*(y+1));
                a3[x][y].setUserData("x:"+x+":y:"+y);
                w.add(a3[x][y]);
            }            
        }
    }
    public void mouseClicked(A3Event e) {
        A3Object a3 = e.getA3Object();
        if (a3!=null) {
            boolean b = a3.isSelected3D();
            b = !b;
            a3.setSelected3D(b);
            System.out.println(a3.getUserData());
        }
    }
    public static void main(String args[]) throws Exception {
        new Selected3DTest();
    }
}
