1   /*
2    * jcurl java curling software framework https://JCurl.mro.name
3    * Copyright (C) 2005-2009 M. Rohrmoser
4    * 
5    * This program is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU General Public License as published by the
7    * Free Software Foundation; either version 2 of the License, or (at your
8    * option) any later version.
9    * 
10   * This program is distributed in the hope that it will be useful, but
11   * WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
13   * Public License for more details.
14   * 
15   * You should have received a copy of the GNU General Public License along
16   * with this program; if not, write to the Free Software Foundation, Inc.,
17   * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18   */
19  
20  package org.jcurl.zui.scenario;
21  
22  import java.awt.geom.AffineTransform;
23  
24  import javax.swing.JFrame;
25  import javax.swing.WindowConstants;
26  
27  import org.jcurl.core.api.Rock;
28  import org.jcurl.core.api.RockDouble;
29  import org.jcurl.core.api.RockType.Pos;
30  
31  import com.sun.scenario.scenegraph.JSGPanel;
32  import com.sun.scenario.scenegraph.SGGroup;
33  import com.sun.scenario.scenegraph.SGNode;
34  import com.sun.scenario.scenegraph.SGTransform;
35  
36  /**
37   * @author <a href="mailto:JCurl@mro.name">M. Rohrmoser </a>
38   * @version $Id$
39   */
40  public class RockDemo {
41  	public static void main(final String[] args) {
42  		final JFrame f = new JFrame("Demo");
43  		f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
44  
45  		final JSGPanel panel = new JSGPanel();
46  
47  		final AffineTransform at = new AffineTransform();
48  		at.translate(200, 400);
49  		at.scale(200, 200);
50  
51  		final SGGroup content = new SGGroup();
52  		final Rock<Pos> rock = new RockDouble<Pos>(0.1, 0.2, 3);
53  		content.add(new SGRockFactory.Fancy(200).newInstance(3, true, rock));
54  		final SGNode ice = new SGIceFactory.Fancy().newInstance(content);
55  		panel.setScene(SGTransform.createAffine(at, ice));
56  
57  		// TODO
58  		rock.setA(0);
59  
60  		f.add(panel);
61  		f.setSize(400, 800);
62  		f.setVisible(true);
63  	}
64  }