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.io.Serializable;
027    
028    import org.tigris.gef.graph.GraphModel;
029    import org.tigris.gef.graph.presentation.NetPort;
030    
031    public abstract class AbstractActivityPort extends NetPort implements
032                    Serializable {
033            private ActivityNode activityNode;
034            
035            public AbstractActivityPort(ActivityNode activityNode) {
036                    super(activityNode);
037                    this.activityNode=activityNode;
038            }
039    
040            /**
041             * @return Returns the activityNode.
042             */
043            public ActivityNode getActivityNode() {
044                    return activityNode;
045            }
046    
047            /* (non-Javadoc)
048             * @see org.tigris.gef.graph.presentation.NetPort#canConnectTo(org.tigris.gef.graph.GraphModel, java.lang.Object)
049             */
050            @Override
051            public boolean canConnectTo(GraphModel gm, Object anotherPort) {
052                    boolean canConnect = super.canConnectTo(gm, anotherPort);
053                    canConnect &= (anotherPort instanceof AbstractActivityPort);
054                    return canConnect;
055            }
056    
057        protected abstract Class defaultEdgeClass(NetPort otherPort);
058            
059    }