Coverage details for net.sourceforge.demetrix.ui.SideBar

LineHitsSource
1 /*******************************************************************************
2  * Demetrix process modelling system
3  *
4  * Copyright (c) 2003, 2004 Dimitri A. Pissarenko
5  *
6  * This file is part of Demetrix.
7  *
8  * Demetrix is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2.1 of the License, or
11  * (at your option) any later version.
12  *
13  * Demetrix is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with Demetrix; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21  *
22  * For further information you may
23  *
24  * - send an e-mail in Russian, German or English to dimitri.pissarenko@gmx.net
25  * - look at http://sourceforge.net/projects/demetrix/
26  * - look at http://demetrix.sourceforge.net/
27  * - look at http://members.inode.at/d.pissarenko/
28  *
29  *****************************************************************************/
30 package net.sourceforge.demetrix.ui;
31 import javax.swing.JPanel;
32 import javax.swing.JScrollPane;
33 import javax.swing.JSplitPane;
34 import javax.swing.JTree;
35 import javax.swing.tree.DefaultMutableTreeNode;
36  
37 import org.apache.log4j.Logger;
38 import org.swixml.SwingEngine;
39 import org.swixml.XSplitPane;
40  
41 /**
42  * @author Dimitri Pissarenko
43  *
44  */
45 public class SideBar {
46     private Logger logger = Logger.getLogger(getClass());
47     private XSplitPane splitPane;
48     private JTree graphStructureTree;
49     private JScrollPane propetiesPanelScrollPane;
50     public final static String UI_DEF_FILE_NAME="net/sourceforge/demetrix/ui/SideBar.xml";
51     private static SideBar instance;
52     public static SideBar getInstance()
53     {
5415        if (instance==null)
55         {
564            instance=new SideBar();
57         }
5815        return instance;
59     }
604    private SideBar() {
614        DefaultMutableTreeNode root=null;
62         
63         
64  
65         try {
664            this.splitPane =
67                 (XSplitPane) (new SwingEngine(this)).render(
68             ClassLoader.getSystemClassLoader().getResource(UI_DEF_FILE_NAME));
690        } catch (Exception exception) {
70             this.logger.error("", exception);
714        }
72  
734        JScrollPane treeScrollPane=null;
74         
754        this.propetiesPanelScrollPane=new JScrollPane((new NodePropertiesPanel()).getPanel());
76  
774        root=new DefaultMutableTreeNode(CurrentProcessChainSingleton.getInstance().getCurrentGraphParent());
78  
794        this.graphStructureTree=new ProcessChainNodeTree(new ProcessChainNodeTreeModel(root));
804        treeScrollPane=new JScrollPane(this.graphStructureTree);
81  
824        this.splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
834        this.splitPane.setTopComponent(treeScrollPane);
844        this.splitPane.setBottomComponent(this.propetiesPanelScrollPane);
854    }
86     public XSplitPane getSplitPane() {
875        return this.splitPane;
88     }
89     /**
90      * @return
91      */
92     public JTree getGraphStructureTree() {
9310        return graphStructureTree;
94     }
95     public void setNodePropertiesPanel(JPanel panel)
96     {
970        this.propetiesPanelScrollPane.setViewportView(panel);
980    }
99 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.