[graphl-cvs] graphl/src/org/mediavirus/graphl/painter ImageNodePainter.java BoxNodePainter.java Sh
Status: Pre-Alpha
Brought to you by:
flo1
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv17343/src/org/mediavirus/graphl/painter Modified Files: ImageNodePainter.java BoxNodePainter.java ShapeNodePainter.java InvisibleNodePainter.java LineEdgePainter.java ReificationNodePainter.java NodePainter.java Log Message: a lot of changes done a long time ago... changelog has to be updated another time :( Index: LineEdgePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/LineEdgePainter.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** LineEdgePainter.java 18 Dec 2005 11:11:40 -0000 1.10 --- LineEdgePainter.java 8 Jun 2006 13:14:58 -0000 1.11 *************** *** 14,22 **** import java.util.HashMap; - import org.apache.commons.jxpath.ClassFunctions; import org.apache.commons.jxpath.JXPathContext; import org.mediavirus.graphl.GraphlPane; import org.mediavirus.graphl.graph.Edge; import org.mediavirus.graphl.graph.Node; import org.mediavirus.graphl.vocabulary.NS; import org.mediavirus.util.ParseUtils; --- 14,22 ---- import java.util.HashMap; import org.apache.commons.jxpath.JXPathContext; import org.mediavirus.graphl.GraphlPane; import org.mediavirus.graphl.graph.Edge; import org.mediavirus.graphl.graph.Node; + import org.mediavirus.graphl.jxpath.JXPathFactory; import org.mediavirus.graphl.vocabulary.NS; import org.mediavirus.util.ParseUtils; *************** *** 77,82 **** Stroke dynStroke = strokeCache.get(edge); if (dynStroke == null) { ! JXPathContext context = JXPathContext.newContext(edge); ! context.setLenient(true); Object widthO = context.getValue(widthExpr); try { --- 77,81 ---- Stroke dynStroke = strokeCache.get(edge); if (dynStroke == null) { ! JXPathContext context = JXPathFactory.createContext(edge); Object widthO = context.getValue(widthExpr); try { *************** *** 254,263 **** if (label == null) { if (labelExpr != null) { ! JXPathContext context = JXPathContext.newContext(edge); ! context.setFunctions(new ClassFunctions(ParseUtils.class, "graphl")); ! context.setLenient(true); Object labelO = context.getValue(labelExpr); ! if (labelO instanceof String) { ! label = (String) labelO; } } --- 253,264 ---- if (label == null) { if (labelExpr != null) { ! JXPathContext context = JXPathFactory.createContext(edge); Object labelO = context.getValue(labelExpr); ! if (labelO != null) { ! label = labelO.toString(); ! labelCache.put(edge, label); ! } ! else { ! labelCache.put(edge,""); } } *************** *** 320,322 **** --- 321,329 ---- this.widthExpr = widthExpr; } + + public void refresh() { + strokeCache.clear(); + labelCache.clear(); + } + } Index: ReificationNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/ReificationNodePainter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ReificationNodePainter.java 4 Oct 2004 10:21:03 -0000 1.3 --- ReificationNodePainter.java 8 Jun 2006 13:14:58 -0000 1.4 *************** *** 81,83 **** --- 81,87 ---- } + public String getLabel(Node node) { + return null; + } + } Index: ImageNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/ImageNodePainter.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ImageNodePainter.java 18 Dec 2005 11:11:40 -0000 1.8 --- ImageNodePainter.java 8 Jun 2006 13:14:57 -0000 1.9 *************** *** 59,63 **** URL baseURL = null; try { ! baseURL = new URL(node.getFirstNeighbour(NS.graphl + "loadedFrom", true).getId()); } catch (Exception ex) { --- 59,63 ---- URL baseURL = null; try { ! baseURL = new URL(node.getFirstNeighbour(NS.graphl + "loadedFrom", Node.FORWARD).getId()); } catch (Exception ex) { *************** *** 95,99 **** String href = node.getProperty(property); if (href == null) { ! Node propertyNode = node.getFirstNeighbour(property, true); if (propertyNode != null) href = propertyNode.getId(); } --- 95,99 ---- String href = node.getProperty(property); if (href == null) { ! Node propertyNode = node.getFirstNeighbour(property, Node.FORWARD); if (propertyNode != null) href = propertyNode.getId(); } *************** *** 150,154 **** URL baseURL = null; try { ! baseURL = new URL(node.getFirstNeighbour(NS.graphl + "loadedFrom", true).getId()); } catch (Exception ex) { --- 150,154 ---- URL baseURL = null; try { ! baseURL = new URL(node.getFirstNeighbour(NS.graphl + "loadedFrom", Node.FORWARD).getId()); } catch (Exception ex) { *************** *** 358,361 **** --- 358,365 ---- } + + public String getLabel(Node node) { + return null; + } } Index: InvisibleNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/InvisibleNodePainter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** InvisibleNodePainter.java 21 Oct 2004 16:00:46 -0000 1.4 --- InvisibleNodePainter.java 8 Jun 2006 13:14:58 -0000 1.5 *************** *** 98,100 **** --- 98,105 ---- } + + public String getLabel(Node node) { + return null; + } + } Index: NodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/NodePainter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NodePainter.java 21 Oct 2004 16:00:46 -0000 1.4 --- NodePainter.java 8 Jun 2006 13:14:58 -0000 1.5 *************** *** 53,56 **** public Point getEdgePin(Node node, Edge edge); ! } --- 53,56 ---- public Point getEdgePin(Node node, Edge edge); ! public String getLabel(Node node); } Index: ShapeNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/ShapeNodePainter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ShapeNodePainter.java 18 Dec 2005 11:11:40 -0000 1.7 --- ShapeNodePainter.java 8 Jun 2006 13:14:58 -0000 1.8 *************** *** 225,227 **** --- 225,231 ---- } + + public String getLabel(Node node) { + return null; + } } Index: BoxNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/BoxNodePainter.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** BoxNodePainter.java 18 Dec 2005 11:11:40 -0000 1.11 --- BoxNodePainter.java 8 Jun 2006 13:14:57 -0000 1.12 *************** *** 16,24 **** import java.util.Map; - import org.apache.commons.jxpath.ClassFunctions; import org.apache.commons.jxpath.JXPathContext; import org.mediavirus.graphl.GraphlPane; import org.mediavirus.graphl.graph.Edge; import org.mediavirus.graphl.graph.Node; import org.mediavirus.graphl.vocabulary.NS; import org.mediavirus.util.ParseUtils; --- 16,24 ---- import java.util.Map; import org.apache.commons.jxpath.JXPathContext; import org.mediavirus.graphl.GraphlPane; import org.mediavirus.graphl.graph.Edge; import org.mediavirus.graphl.graph.Node; + import org.mediavirus.graphl.jxpath.JXPathFactory; import org.mediavirus.graphl.vocabulary.NS; import org.mediavirus.util.ParseUtils; *************** *** 293,303 **** } ! private String getLabel(Node node) { String label = labelCache.get(node); if (label == null) { if (labelExpr != null) { ! JXPathContext context = JXPathContext.newContext(node); ! context.setFunctions(new ClassFunctions(ParseUtils.class, "graphl")); ! context.setLenient(true); Object labelO = context.getValue(labelExpr); if (labelO instanceof String) { --- 293,302 ---- } ! public String getLabel(Node node) { String label = labelCache.get(node); if (label == null) { + label = "XXX"; if (labelExpr != null) { ! JXPathContext context = JXPathFactory.createContext(node); Object labelO = context.getValue(labelExpr); if (labelO instanceof String) { *************** *** 305,308 **** --- 304,308 ---- } } + labelCache.put(node, label); } return label; |