this.setCursorExecuting(true);
    public void init() {        addKeyListener( this );        int control_count = 0;        super.init();        		this.setFont(new Font("Default", Font.PLAIN, 10));		        int sthick = ( this.shadows ? SHADOW : 0 );                double border = 5;        double p = TableLayout.PREFERRED;        double f = TableLayout.FILL;        // size[0] = the columns        // size[1] = the rows        double size[][] =         	{{0.50, 0.50},        	 {p,p,p,p,p,p,p,p,p,f}};        TableLayout layout = new TableLayout(size);        if ( this.network != null ) {            if ( this.getMakesGui() ) {                Dimension d = this.getSize();                int tpw = d.width - ( 2 + sthick );               // cardPanel.setBounds( 2, 2, tpw, d.height - ( 2 + sthick ) );            }            return ;        }        //        // Clumsy api here.  I should pass network into this.readNetwork but        // I didn't want to force subclasses to change.        //        this.network = new Network();        this.readNetwork();        this.setNetwork( this.network );                if ( this.getMakesGui() == false )            return ;        Dimension d = this.getSize();        int panel_cnt = network.getPanelCount();                cardPanel = new TabbedPanel();        this.add( cardPanel );             int i = 0;        while ( i < panel_cnt ) {        	ControlPanel cp = network.getPanel( i );        	cp.buildPanel();        	cardPanel.addPanel( cp, cp.getName() );        	i++;        }	        //        // Add execution control panel        //        this.execCtrl = new ControlPanel( this.network, "Execution",                                          this.network.getPanelCount() + 1 );        //this.execCtrl.setFont ( new Font( "Helvetica", Font.PLAIN, 10 ) );        this.execCtrl.buildPanel();        this.execCtrl.setLayout(layout);        cardPanel.addPanel( this.execCtrl, this.execCtrl.getName() );        Dimension crd = cardPanel.getSize();        crd.height = d.height - ( 35 + 12 + sthick + cardPanel.getInsets().top + cardPanel.getInsets().bottom);		crd.width = d.width - (  20 + sthick + cardPanel.getInsets().left + cardPanel.getInsets().right);		crd.width = (crd.width > 400 ? 400 : crd.width );				this.execCtrl.setSize(new Dimension(crd.width, crd.height));		//Dimension d2 = this.execCtrl.getSize();		//System.out.print("size: ");		//System.out.print( d2.width );		//System.out.print(", ");		//System.out.println(d2.height);				// Executing Label		this.executing = new Panel();		//this.executing.setFont(new Font("Helvetica", Font.ITALIC, 12));		//this.executing.setForeground(new Color((float)0.0, (float)1.0, (float)0.49));		Label l = new Label("Running, Please Wait ...");		l.setFont(new Font("Helvetica", Font.ITALIC, 12));		l.setForeground(new Color((float)0.0, (float)1.0, (float)0.49));		this.executing.add(l);		//this.executing.setBounds(d.height+5, 60, 140, 40);		this.executing.setLocation(d.height+5, 60);		this.add(this.executing);		this.executing.setVisible(true);        //        // Connect option        //        String cstr = getParameter( "CONNECT_OPTION" );        boolean has_connect = false;        if ( cstr != null )            has_connect = Boolean.valueOf( cstr ).booleanValue();        if ( has_connect ) {        	            this.connect_btn = new Button( "Connect" );            this.connect_btn.setBackground( this.getBackground() );            this.execCtrl.add( this.connect_btn, "0, 0, 1, 0" );                        connect_btn.addActionListener( this );                        Separator sep = new Separator();            sep.setForeground(new Color(200, 200, 200));            sep.setSize(new Dimension(crd.width -20, 2));            this.execCtrl.add(sep, "0, 1, 1, 1, c, c");        }        //        // Execute - On - Change        //                FlowLayout cfl = new FlowLayout(FlowLayout.CENTER, 5, 0);                String eoc = getParameter( "EXECUTE_ON_CHANGE" );        if ( eoc != null )            this.eocMode = Boolean.valueOf( eoc ).booleanValue();        else this.eocMode = false;        this.exec_on_change = new Checkbox( "Execute On Change" );        this.exec_on_change.setBackground( this.getBackground() );        this.exec_on_change.setState( this.eocMode );        this.execCtrl.add( this.exec_on_change, "0, 2, 1, 2, c, c" );        exec_on_change.addItemListener( this );        //        // Execute Once        //        this.execute_once = new Button( "Execute Once" );        this.execute_once.setBackground( this.getBackground() );        this.execCtrl.add(this.execute_once, "0, 3, c, c");        		        execute_once.addActionListener( this );                 //        // End Execution        //        this.end_execution = new Button( "End Execution" );        this.end_execution.setBackground( this.getBackground() );                this.execCtrl.add(this.end_execution, "1, 3, c, c");        end_execution.addActionListener( this );        Separator sep1 = new Separator();        sep1.setForeground(new Color(200, 200, 200));        sep1.setSize(new Dimension(crd.width -20, 2));        this.execCtrl.add(sep1, "0, 4, 1, 4, c, c");        //        // We'll conditionally allow users to set caching features        // so that we don't wreck existing web pages by added        // unexpected features.  When the version number jumps to        // 1.1, then we should add caching features by default.        //        this.setCachingMode( false, false );        String enabstr = getParameter( "CACHING_FEATURES" );        boolean enable_animation = false;        if ( enabstr != null )            enable_animation = Boolean.valueOf( enabstr ).booleanValue();        if ( enable_animation || ( this.sequencer != null) ) {            //            // Image caching            //            //this.setCachingMode( true, false );            this.set_caching = new Checkbox( "Enable Animation" );            this.set_caching.setState( this.getCachingMode() );            this.set_caching.setBackground( this.getBackground() );            this.execCtrl.add( this.set_caching, "0, 5, 1, 5, c, c" );            set_caching.addItemListener( this );            //            // Image cache options            //                        this.cache_options = new Choice();            this.cache_options.setBackground( this.getBackground() );            this.cache_options.addItem( "Loop" );            this.cache_options.addItem( "Palindrome" );            this.cache_options.addItem( "Faster" );            this.cache_options.addItem( "Slower" );            this.cache_options.addItem( "Reset" );            this.execCtrl.add( this.cache_options, "0, 6, c, c" );            this.cache_options.setEnabled( this.getCachingMode() );                        cache_options.addItemListener( this );                        //            // Image cache size - number of frames to cache.            //                        Panel pFrames = new Panel();            pFrames.setLayout(cfl);                        Label lab = new Label( "Frames:" );            lab.setAlignment( Label.RIGHT );            pFrames.add(lab);            this.cache_size = new TextField( "0", 4 );            this.cache_size.setBackground( this.getBackground() );            pFrames.add(this.cache_size);            this.cache_size.setEnabled( this.getCachingMode() );            this.execCtrl.add(pFrames, "1, 6, c, c" );            			            cache_size.addActionListener(this);            // Only allow numbers to be entered.            cache_size.addKeyListener(new KeyAdapter() {            	public void keyTyped(KeyEvent e) {					char c = e.getKeyChar();					if(!(Character.isDigit(c) ||						( c == KeyEvent.VK_BACK_SPACE) ||						(c == KeyEvent.VK_DELETE) ||						(c == KeyEvent.VK_ENTER) ||						(c == KeyEvent.VK_ACCEPT))) {						e.consume();					}            	}            	public void keyPressed(KeyEvent e) {            		char c = e.getKeyChar();            		if(!(Character.isDigit(c) ||            		   (c == KeyEvent.VK_BACK_SPACE) ||            		   (c == KeyEvent.VK_DELETE) ||            		   (c == KeyEvent.VK_ENTER) ||            		   (c == KeyEvent.VK_ACCEPT))) {            		       e.consume();            		   }				}            });                        //this.cache_size.setEnabled( false );                        Separator sep = new Separator();            sep.setForeground(new Color(200, 200, 200));            sep.setSize(new Dimension(crd.width -20, 2));            this.execCtrl.add(sep, "0, 7, 1, 7, c, c" );        }                //        // Image chooser        //                double optList[][] = {{ 75, f}, {p, p, p, p, f}};        Panel optionsList = new Panel();        TableLayout optLayout = new TableLayout(optList);		optionsList.setLayout(optLayout);                        if ( ( this.named_image_list != null ) && ( this.named_image_list.size() > 1 ) ) {            Label lab = new Label( "Image: " );            lab.setAlignment( Label.RIGHT );            optionsList.add(lab, "0, 0, r, c");            image_chooser = new Choice();            image_chooser.setBackground( this.getBackground() );            Enumeration enum1 = this.named_image_list.elements();            while ( enum1.hasMoreElements() ) {                ImageNode in = ( ImageNode ) enum1.nextElement();                String name = in.getTitle();                image_chooser.addItem( name );            }            image_chooser.addItemListener( this );            image_chooser.select( 0 );            this.selected_image = ( ImageNode ) this.named_image_list.elementAt( 0 );            optionsList.add( image_chooser, "1, 0, l, c" );        }		//		// Determine if pick should be active.		//        Vector pick_list = null;        Class pc = null;        try {            pc = Class.forName( "dx.net.PickNode" );        }        catch ( Exception e ) {            System.out.println ( "DXApplication: failed to list PickNodes" );        }        if ( pc != null )            pick_list = this.network.makeNodeList( pc, false );        //        // Mode chooser        //        if ( ( this.named_image_list != null ) && ( this.named_image_list.size() > 0 ) ) {            Label lab = new Label( "View: " );            lab.setAlignment( Label.RIGHT );			optionsList.add(lab, "0, 1, r, c");            this.view_chooser = new Choice();            this.view_chooser.setBackground( this.getBackground() );            this.view_chooser.addItem( "Front" );            this.view_chooser.addItem( "Back" );            this.view_chooser.addItem( "Top" );            this.view_chooser.addItem( "Bottom" );            this.view_chooser.addItem( "Right" );            this.view_chooser.addItem( "Left" );            this.view_chooser.addItem( "Diagonal" );            this.view_chooser.addItem( "Off Front" );            this.view_chooser.addItem( "Off Back" );            this.view_chooser.addItem( "Off Top" );            this.view_chooser.addItem( "Off Bottom" );            this.view_chooser.addItem( "Off Right" );            this.view_chooser.addItem( "Off Left" );            this.view_chooser.addItem( "Off Diagonal" );            view_chooser.addItemListener( this );            optionsList.add( this.view_chooser, "1, 1, l, c" );            lab = new Label( "Mode: " );            lab.setAlignment( Label.RIGHT );			optionsList.add(lab, "0, 2, r, c");			            int m = 0;            mode_chooser = new Choice();            mode_chooser.setBackground( this.getBackground() );            mode_chooser.addItem( "(None)" ); this.modes[ m++ ] = ImageWindow.NO_MODE;            mode_chooser.addItem( "Rotate" ); this.modes[ m++ ] = ImageWindow.ROTATE_MODE;            if ( pick_list != null ) {                mode_chooser.addItem( "Pick" ); this.modes[ m++ ] = ImageWindow.PICK_MODE;            }            mode_chooser.addItem( "Pan" ); this.modes[ m++ ] = ImageWindow.PAN_MODE;            mode_chooser.addItem( "Zoom" ); this.modes[ m++ ] = ImageWindow.ZOOM_MODE;            mode_chooser.addItem( "Orbit" ); this.modes[ m++ ] = ImageWindow.ORBIT_MODE;            mode_chooser.addItem( "Reset Camera" );this.modes[ m++ ] = ImageWindow.RESET_CAMERA;            if ( this.sequencer != null ) {                this.sequence_mode_choice = m;                mode_chooser.addItem( "Sequence" );this.modes[ m++ ] = ImageWindow.LOOP_MODE;            }            else if ( enable_animation ) {                mode_chooser.addItem( "Review" ); this.modes[ m++ ] = ImageWindow.LOOP_MODE;            }            mode_chooser.addItemListener( this );            if ( this.selected_image != null ) {                this.selected_mode = this.selected_image.getInteractionMode();                mode_chooser.select( this.selected_mode );            }            else {                mode_chooser.select( 0 );                this.selected_mode = ImageWindow.NO_MODE;            }            optionsList.add( mode_chooser, "1, 2, l, c" );        }                //        // Pick tool chooser        //        pick_chooser = null;        if ( ( pick_list != null ) && ( pick_list.size() == 1 ) ) {            this.selected_pick = ( PickNode ) pick_list.elementAt( 0 );        }        else if ( ( pick_list != null ) && ( pick_list.size() > 1 ) ) {            Label lab = new Label( "Pick: " );            lab.setAlignment( Label.RIGHT );			optionsList.add( lab, "0, 3, r, c");            pick_chooser = new Choice();            pick_chooser.setBackground( this.getBackground() );            Enumeration enum1 = pick_list.elements();            while ( enum1.hasMoreElements() ) {                PickNode pn = ( PickNode ) enum1.nextElement();                String name = pn.getName() + "_" + pn.getInstanceNumber();                pick_chooser.addItem( name );            }            //System.out.println("selected: " + mode_chooser.getSelectedItem());			pick_chooser.setEnabled(false);            pick_chooser.select( 0 );            pick_chooser.addItemListener( this );            this.selected_pick = ( PickNode ) pick_list.elementAt( 0 );            optionsList.add( pick_chooser, "1, 3, l, c" );        }		this.execCtrl.add(optionsList, "0, 8, 1, 8, l, c");        //        // If this parameter is set to false, then we won't draw shadows        // The purpose would be to let the user wrap in the applet in html        // table dressing.        //        String nobrd = this.getParameter( "SHADOWS" );        if ( nobrd != null )            this.shadows = Boolean.valueOf( nobrd ).booleanValue();    }