| Line | Hits | Source |
|---|---|---|
| 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 | { | |
| 54 | 15 | if (instance==null) |
| 55 | { | |
| 56 | 4 | instance=new SideBar(); |
| 57 | } | |
| 58 | 15 | return instance; |
| 59 | } | |
| 60 | 4 | private SideBar() { |
| 61 | 4 | DefaultMutableTreeNode root=null; |
| 62 | ||
| 63 | ||
| 64 | ||
| 65 | try { | |
| 66 | 4 | this.splitPane = |
| 67 | (XSplitPane) (new SwingEngine(this)).render( | |
| 68 | ClassLoader.getSystemClassLoader().getResource(UI_DEF_FILE_NAME)); | |
| 69 | 0 | } catch (Exception exception) { |
| 70 | this.logger.error("", exception); | |
| 71 | 4 | } |
| 72 | ||
| 73 | 4 | JScrollPane treeScrollPane=null; |
| 74 | ||
| 75 | 4 | this.propetiesPanelScrollPane=new JScrollPane((new NodePropertiesPanel()).getPanel()); |
| 76 | ||
| 77 | 4 | root=new DefaultMutableTreeNode(CurrentProcessChainSingleton.getInstance().getCurrentGraphParent()); |
| 78 | ||
| 79 | 4 | this.graphStructureTree=new ProcessChainNodeTree(new ProcessChainNodeTreeModel(root)); |
| 80 | 4 | treeScrollPane=new JScrollPane(this.graphStructureTree); |
| 81 | ||
| 82 | 4 | this.splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT); |
| 83 | 4 | this.splitPane.setTopComponent(treeScrollPane); |
| 84 | 4 | this.splitPane.setBottomComponent(this.propetiesPanelScrollPane); |
| 85 | 4 | } |
| 86 | public XSplitPane getSplitPane() { | |
| 87 | 5 | return this.splitPane; |
| 88 | } | |
| 89 | /** | |
| 90 | * @return | |
| 91 | */ | |
| 92 | public JTree getGraphStructureTree() { | |
| 93 | 10 | return graphStructureTree; |
| 94 | } | |
| 95 | public void setNodePropertiesPanel(JPanel panel) | |
| 96 | { | |
| 97 | 0 | this.propetiesPanelScrollPane.setViewportView(panel); |
| 98 | 0 | } |
| 99 | } |
|
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |