Statistics
| Revision:

root / branches / v2_0_0_prep / extensions / extEditing / src / org / gvsig / editing / gui / cad / tools / split / SplitGraphNode.java @ 29685

History | View | Annotate | Download (2.23 KB)

1
/* Spatial Operations & Editing Tools for uDig
2
 * 
3
 * Axios Engineering under a funding contract with: 
4
 *      Diputación Foral de Gipuzkoa, Ordenación Territorial 
5
 *
6
 *      http://b5m.gipuzkoa.net
7
 *      http://www.axios.es 
8
 *
9
 * (C) 2006, Diputación Foral de Gipuzkoa, Ordenación Territorial (DFG-OT). 
10
 * DFG-OT agrees to licence under Lesser General Public License (LGPL).
11
 * 
12
 * You can redistribute it and/or modify it under the terms of the 
13
 * GNU Lesser General Public License as published by the Free Software 
14
 * Foundation; version 2.1 of the License.
15
 *
16
 * This library is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19
 * Lesser General Public License for more details.
20
 */
21
package org.gvsig.editing.gui.cad.tools.split;
22

    
23
import com.vividsolutions.jts.geom.Coordinate;
24
import com.vividsolutions.jts.geomgraph.DirectedEdge;
25
import com.vividsolutions.jts.geomgraph.EdgeEnd;
26
import com.vividsolutions.jts.geomgraph.Node;
27

    
28
/**
29
 * Custom node type. Does nothing special by now but to force the use of {@link SplitEdgeStar}
30
 * instances as the node's list of incident edges and allow to remove edges from its list of
31
 * incident edges.
32
 * 
33
 * @author Gabriel Roldán, Axios Engineering
34
 * @author Mauricio Pazos, Axios Engineering
35
 * @since 1.1.0
36
 */
37
class SplitGraphNode extends Node {
38
    public SplitGraphNode( Coordinate coord, SplitEdgeStar incidentEdges ) {
39
        super(coord, incidentEdges);
40
    }
41

    
42
    public void add( DirectedEdge edge ) {
43
        super.add(edge);
44
    }
45

    
46
    @Override
47
    public void add( EdgeEnd edge ) {
48
        add((DirectedEdge) edge);
49
    }
50

    
51
    /**
52
     * Removes the given <code>edge</code> from this node's {@link #getEdges() edge list}.
53
     * 
54
     * @param edge
55
     */
56
    public void remove( DirectedEdge edge ) {
57
        SplitEdgeStar edges = (SplitEdgeStar) getEdges();
58
        edges.remove(edge);
59
    }
60

    
61
    public String toString() {
62
        StringBuffer sb = new StringBuffer("Node[");
63
        sb.append(coord.x).append(":").append(coord.y);
64
        sb.append(", ").append(label);
65
        sb.append(", ").append(getEdges());
66
        sb.append("]");
67
        return sb.toString();
68
    }
69
}