[graphl-cvs] graphl/src/org/mediavirus/graphl/graph DefaultElement.java PropertySet.java DefaultEdge
Status: Pre-Alpha
Brought to you by:
flo1
From: Flo L. <fl...@us...> - 2004-09-23 18:21:43
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10300/src/org/mediavirus/graphl/graph Modified Files: DefaultEdge.java GraphElement.java DefaultNode.java Added Files: DefaultElement.java PropertySet.java Log Message: * changed the GraphFacetRegistry to work with configuration nodes, not graphs * introduced new interface PropertySet --- NEW FILE: PropertySet.java --- /* * Created on 21.09.2004 by flo */ package org.mediavirus.graphl.graph; /** * @author flo * created: 21.09.2004 17:02:16 */ public interface PropertySet { String getProperty(String name); String getProperty(String name, String defaultValue); } Index: DefaultNode.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/DefaultNode.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DefaultNode.java 20 Aug 2004 12:38:52 -0000 1.10 --- DefaultNode.java 23 Sep 2004 18:21:33 -0000 1.11 *************** *** 13,17 **** * The default implementation of the node in the graph. */ ! public class DefaultNode implements Node { /** The list of edges from the node. */ protected List edgesFrom; --- 13,17 ---- * The default implementation of the node in the graph. */ ! public class DefaultNode extends DefaultElement implements Node { /** The list of edges from the node. */ protected List edgesFrom; *************** *** 27,32 **** boolean dragging = false; - HashMap properties = new HashMap(); - NodePainter painter = null; NodeLayouter layouter = null; --- 27,30 ---- *************** *** 135,145 **** return null; } ! ! public String getProperty(String name) { ! return (String)properties.get(name); ! } ! ! public void setProperty(String name, String value) { ! properties.put(name, value); } --- 133,139 ---- return null; } ! ! public boolean hasType(String type) { ! return false; } Index: GraphElement.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/GraphElement.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GraphElement.java 1 Jul 2004 18:18:42 -0000 1.3 --- GraphElement.java 23 Sep 2004 18:21:33 -0000 1.4 *************** *** 9,13 **** * created: 27.06.2004 18:40:38 */ ! public interface GraphElement { /** * Returns the value of this element. --- 9,13 ---- * created: 27.06.2004 18:40:38 */ ! public interface GraphElement extends PropertySet { /** * Returns the value of this element. *************** *** 23,28 **** String getType(); ! String getProperty(String name); ! ! void setProperty(String name, String value); } \ No newline at end of file --- 23,29 ---- String getType(); ! boolean hasType(String type); ! ! void setProperty(String name, String value); ! } \ No newline at end of file Index: DefaultEdge.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/DefaultEdge.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DefaultEdge.java 2 Aug 2004 12:36:49 -0000 1.8 --- DefaultEdge.java 23 Sep 2004 18:21:33 -0000 1.9 *************** *** 9,13 **** * The default implementation of the edge. */ ! public class DefaultEdge implements Edge { /** The node from the edge. */ protected Node from; --- 9,13 ---- * The default implementation of the edge. */ ! public class DefaultEdge extends DefaultElement implements Edge { /** The node from the edge. */ protected Node from; *************** *** 88,91 **** --- 88,96 ---- return type; } + + public boolean hasType(String type) { + if (this.type == null) return false; + else return this.type.equals(type); + } /** --- NEW FILE: DefaultElement.java --- /* * Created on 23.09.2004 by flo */ package org.mediavirus.graphl.graph; import java.util.HashMap; /** * @author flo * created: 23.09.2004 17:58:53 */ public abstract class DefaultElement implements GraphElement { HashMap properties = new HashMap(); public String getProperty(String name) { return (String)properties.get(name); } public String getProperty(String name, String defaultValue) { String val = (String)properties.get(name); if (val == null) return defaultValue; return val; } public void setProperty(String name, String value) { properties.put(name, value); } } |