| 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 | ||
| 31 | package net.sourceforge.demetrix.graph; | |
| 32 | ||
| 33 | import net.sourceforge.demetrix.model.Resource; | |
| 34 | ||
| 35 | import net.sourceforge.demetrix.model.Task; | |
| 36 | ||
| 37 | import org.apache.log4j.Logger; | |
| 38 | ||
| 39 | import org.jgraph.JGraph; | |
| 40 | ||
| 41 | import org.jgraph.graph.BasicMarqueeHandler; | |
| 42 | import org.jgraph.graph.CellMapper; | |
| 43 | ||
| 44 | import org.jgraph.graph.CellView; | |
| 45 | ||
| 46 | import org.jgraph.graph.DefaultGraphCell; | |
| 47 | ||
| 48 | import org.jgraph.graph.GraphCell; | |
| 49 | ||
| 50 | import org.jgraph.graph.GraphModel; | |
| 51 | ||
| 52 | import org.jgraph.graph.VertexView; | |
| 53 | ||
| 54 | /** | |
| 55 | * @author Dimitri Pissarenko | |
| 56 | * | |
| 57 | */ | |
| 58 | ||
| 59 | public class ProcessChainGraph extends JGraph { | |
| 60 | ||
| 61 | private Logger logger = Logger.getLogger(getClass()); | |
| 62 | ||
| 63 | public ProcessChainGraph(GraphModel model, BasicMarqueeHandler marqueeHandler) { | |
| 64 | ||
| 65 | 7 | super(model, marqueeHandler); |
| 66 | ||
| 67 | 7 | } |
| 68 | ||
| 69 | public void createNewTask() { | |
| 70 | ||
| 71 | 0 | } |
| 72 | ||
| 73 | public void createNewResource() { | |
| 74 | ||
| 75 | 0 | } |
| 76 | ||
| 77 | /* (non-Javadoc) | |
| 78 | * @see org.jgraph.graph.CellViewFactory#createView(java.lang.Object, org.jgraph.graph.CellMapper) | |
| 79 | */ | |
| 80 | ||
| 81 | public CellView createView(Object cell, CellMapper cellMapper) { | |
| 82 | ||
| 83 | 36 | VertexView view = null; |
| 84 | ||
| 85 | 36 | Object userObject = null; |
| 86 | ||
| 87 | 36 | userObject = ((DefaultGraphCell) cell).getUserObject(); |
| 88 | ||
| 89 | 36 | if (userObject instanceof Resource) { |
| 90 | ||
| 91 | 5 | view = new ResourceCellView((GraphCell) cell, this, cellMapper); |
| 92 | ||
| 93 | 5 | cellMapper.putMapping(cell, view); |
| 94 | ||
| 95 | 5 | view.refresh(true); |
| 96 | ||
| 97 | 5 | view.update(); |
| 98 | ||
| 99 | 5 | return view; |
| 100 | ||
| 101 | 31 | } else if (userObject instanceof Task) { |
| 102 | ||
| 103 | 12 | view = new TaskCellView((GraphCell) cell, this, cellMapper); |
| 104 | ||
| 105 | 12 | cellMapper.putMapping(cell, view); |
| 106 | ||
| 107 | 12 | view.refresh(true); |
| 108 | ||
| 109 | 12 | view.update(); |
| 110 | ||
| 111 | 12 | return view; |
| 112 | ||
| 113 | } else { | |
| 114 | ||
| 115 | 19 | return super.createView(cell, cellMapper); |
| 116 | ||
| 117 | } | |
| 118 | ||
| 119 | } | |
| 120 | ||
| 121 | } |
|
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |