Coverage details for edu.uci.ics.jung.graph.event.GraphEvent

LineHitsSource
1 /*
2  * Copyright (c) 2003, the JUNG Project and the Regents of the University
3  * of California
4  * All rights reserved.
5  *
6  * This software is open-source under the BSD license; see either
7  * "license.txt" or
8  * http://jung.sourceforge.net/license.txt for a description.
9  */
10 package edu.uci.ics.jung.graph.event;
11  
12 import java.util.EventObject;
13  
14 import edu.uci.ics.jung.graph.ArchetypeEdge;
15 import edu.uci.ics.jung.graph.ArchetypeGraph;
16 import edu.uci.ics.jung.graph.ArchetypeVertex;
17 import edu.uci.ics.jung.graph.Element;
18  
19 /**
20  * An event which indicates that a change in the graph structure has occurred. Every
21  * graph listener when notified of a change is passed a GraphEvent which contains a
22  * reference to the object (Node, Edge, or EventSequence) that was involved in the
23  * change as well as the graph whose structure was changed.
24  * @author Scott White
25  */
26 public class GraphEvent extends EventObject {
27     private Element mGraphElement;
28  
29     public GraphEvent(ArchetypeGraph g, Element graphElement) {
30120        super(g);
31120        mGraphElement = graphElement;
32120    }
33  
34     public Element getGraphElement() {
35133        return mGraphElement;
36     }
37  
38     public ArchetypeGraph getGraph() {
3924        return (ArchetypeGraph) getSource();
40     }
41  
42     public String toString() {
430        String geType = null;
440        if (mGraphElement instanceof ArchetypeVertex) {
450            geType = "vertex";
460       } else if (mGraphElement instanceof ArchetypeEdge) {
470            geType = "edge";
48        }
490        return "Graph Element type: " + geType;
50     }
51 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.