KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > management > browser > state > rules > GraphInternalFrameRule


1 /*
2  * Created on 20 juin 2003
3  *
4  * To change this generated comment go to
5  * Window>Preferences>Java>Code Generation>Code Template
6  */

7 package org.ejtools.management.browser.state.rules;
8
9 import java.beans.beancontext.BeanContextServices JavaDoc;
10 import java.util.Map JavaDoc;
11
12 import org.ejtools.graph.frame.GraphInternalFrame;
13 import org.ejtools.util.state.DefaultRule;
14 import org.xml.sax.Attributes JavaDoc;
15
16 /**
17  * @author letiemble
18  * @created 20 juin 2003
19  * @version $Revision: 1.2 $
20  */

21 public class GraphInternalFrameRule extends DefaultRule
22 {
23    /**
24     * Description of the Method
25     *
26     * @param context Description of the Parameter
27     */

28    public void loadEnter(Map JavaDoc context)
29    {
30       BeanContextServices JavaDoc container = (BeanContextServices JavaDoc) context.get("CONTAINER");
31
32       GraphInternalFrame frame = new GraphInternalFrame();
33       Attributes JavaDoc attrs = (Attributes JavaDoc) context.get("ATTRIBUTES");
34
35       String JavaDoc name = attrs.getValue("name");
36       frame.setName(name);
37
38       String JavaDoc delay = attrs.getValue("delay");
39       frame.setName(name);
40       frame.setDelay(Long.parseLong(delay));
41
42       String JavaDoc scale = attrs.getValue("scale");
43       frame.setName(name);
44       frame.setScale(Double.parseDouble(scale));
45
46       container.add(frame);
47    }
48 }
49
Popular Tags