001 /** 002 * planningtool - A Planning Tool with Critiquing Support. 003 * 004 * Copyright (C) 2006 olale 005 006 * This program is free software; you can redistribute it and/or 007 * modify it under the terms of the GNU General Public License 008 * as published by the Free Software Foundation; either version 2 009 * of the License, or (at your option) any later version. 010 011 * This program is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 * GNU General Public License for more details. 015 016 * You should have received a copy of the GNU General Public License 017 * along with this program; if not, write to the Free Software 018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 019 020 * Contact information: 021 * E-mail: olale@ida.liu.se 022 * olale@lysator.liu.se 023 */ 024 package se.liu.ida.critiquer.gui.graph; 025 026 import java.awt.Graphics; 027 import java.util.ArrayList; 028 029 import javax.swing.JComponent; 030 031 import org.tigris.gef.base.Diagram; 032 import org.tigris.gef.base.Editor; 033 import org.tigris.gef.base.Layer; 034 import org.tigris.gef.graph.GraphModel; 035 036 /** 037 * @author olale 038 * 039 */ 040 public class ActivityEditor extends Editor { 041 042 /** 043 * 044 */ 045 private static final long serialVersionUID = 1L; 046 047 private ArrayList<GraphRenderingListener> renderingListeners = new ArrayList<GraphRenderingListener>(); 048 049 050 /** 051 * @param gm 052 * @param jComponent 053 */ 054 public ActivityEditor(GraphModel gm, JComponent jComponent) { 055 super(gm, jComponent); 056 // TODO Auto-generated constructor stub 057 } 058 059 /** 060 * @param gm 061 */ 062 public ActivityEditor(GraphModel gm) { 063 super(gm); 064 // TODO Auto-generated constructor stub 065 } 066 067 /** 068 * 069 */ 070 public ActivityEditor() { 071 super(); 072 // TODO Auto-generated constructor stub 073 } 074 075 /** 076 * @param d 077 */ 078 public ActivityEditor(Diagram d) { 079 super(d); 080 // TODO Auto-generated constructor stub 081 } 082 083 /** 084 * @param gm 085 * @param jComponent 086 * @param lay 087 */ 088 public ActivityEditor(GraphModel gm, JComponent jComponent, Layer lay) { 089 super(gm, jComponent, lay); 090 // TODO Auto-generated constructor stub 091 } 092 093 /** 094 * 095 * Render the graph and notify rendering listeners 096 * 097 * @see org.tigris.gef.base.Editor#paint(java.awt.Graphics) 098 */ 099 @Override 100 public synchronized void paint(Graphics g) { 101 super.paint(g); 102 for (GraphRenderingListener listener : renderingListeners) { 103 listener.graphRendered(); 104 } 105 } 106 107 public void addRenderingListener(GraphRenderingListener l) { 108 renderingListeners.add(l); 109 } 110 111 112 }