graphl-cvs Mailing List for Graphl - Hybrid graph visualization tool (Page 8)
Status: Pre-Alpha
Brought to you by:
flo1
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(48) |
Sep
(6) |
Oct
(64) |
Nov
(12) |
Dec
(13) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(10) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(34) |
Sep
(31) |
Oct
|
Nov
|
Dec
(25) |
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(43) |
Jul
(16) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Flo L. <fl...@us...> - 2004-11-30 09:38:50
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/vocabulary In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26998/src/org/mediavirus/graphl/vocabulary Modified Files: RDFS.java RDF.java FOAF.java Vocabulary.java Log Message: - FEATURE: added menu to choose/switch configuration at runtime - FEATURE: extension of config.rdf to include two sample configurations - FEATURE: extended built-in vocabularies - FEATURE: RepulsionNodeLayouter has configurable strength - BUG: fixed context menu for macs - BUG: fixed cloning of BoxNodePainter - API: added Edge.invert() - API: added FacetRegistry.updateFacets() - REFACTOR: moved default facet selection to context menu - REFACTOR: removed GraphlPane.getScreenPointForNode() calls (use only graph coords) - MISC: misc. minor bugfixes and restructuring - DOC: added first package.html file Index: FOAF.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/vocabulary/FOAF.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FOAF.java 4 Oct 2004 10:21:01 -0000 1.2 --- FOAF.java 30 Nov 2004 09:38:33 -0000 1.3 *************** *** 25,45 **** description = "Friend-of-a-friend vocabulary"; - addPropertyGroup( new ResourceGroup("Naming Properties", new ResourceDescriptor [] { - new ResourceDescriptor(namespace, "fistname", "First Name"), - new ResourceDescriptor(namespace, "surname", "Surname"), - new ResourceDescriptor(namespace, "givenname", "Given Name"), - new ResourceDescriptor(namespace, "nick", "Nickname"), - })); - addPropertyGroup( new ResourceGroup("Contact Properties", new ResourceDescriptor [] { new ResourceDescriptor(namespace, "mbox", "Email Address"), new ResourceDescriptor(namespace, "homepage", "Homepage"), ! new ResourceDescriptor(namespace, "phone", "Phone #"), })); addPropertyGroup( new ResourceGroup("Networking Properties", new ResourceDescriptor [] { new ResourceDescriptor(namespace, "knows", "knows"), ! new ResourceDescriptor(namespace, "projectHomepage", "Project Homepage"), ! new ResourceDescriptor(namespace, "publications", "Publications"), })); --- 25,84 ---- description = "Friend-of-a-friend vocabulary"; addPropertyGroup( new ResourceGroup("Contact Properties", new ResourceDescriptor [] { + new ResourceDescriptor(namespace, "phone", "Phone #"), new ResourceDescriptor(namespace, "mbox", "Email Address"), new ResourceDescriptor(namespace, "homepage", "Homepage"), ! new ResourceDescriptor(namespace, "workplaceHomepage", "Workplace Homepage"), ! new ResourceDescriptor(namespace, "workInfoHomepage", "Work-info Homepage"), ! new ResourceDescriptor(namespace, "schoolHomepage", "School Homepage"), ! new ResourceDescriptor(namespace, "weblog", "Weblog"), ! new ResourceDescriptor(namespace, "tipjar", "Tipjar Document"), })); + addPropertyGroup( new ResourceGroup("Experience Properties", new ResourceDescriptor [] { + new ResourceDescriptor(namespace, "currentProject", "current Project"), + new ResourceDescriptor(namespace, "pastProject", "past Project"), + new ResourceDescriptor(namespace, "made", "made"), + new ResourceDescriptor(namespace, "maker", "maker"), + new ResourceDescriptor(namespace, "interest", "interested in document"), + new ResourceDescriptor(namespace, "topic_interest", "interested in topic"), + new ResourceDescriptor(namespace, "publications", "publications"), + })); + addPropertyGroup( new ResourceGroup("Networking Properties", new ResourceDescriptor [] { new ResourceDescriptor(namespace, "knows", "knows"), ! new ResourceDescriptor(namespace, "member", "member"), ! new ResourceDescriptor(namespace, "basedNear", "based near"), ! new ResourceDescriptor(namespace, "fundedBy", "funded by"), ! })); ! ! addPropertyGroup( new ResourceGroup("Imaging Properties", new ResourceDescriptor [] { ! new ResourceDescriptor(namespace, "img", "img"), ! new ResourceDescriptor(namespace, "depiction", "depiction"), ! new ResourceDescriptor(namespace, "depicts", "depicts"), ! new ResourceDescriptor(namespace, "thumbnail", "thumbnail"), ! new ResourceDescriptor(namespace, "logo", "logo"), ! })); ! ! addPropertyGroup( new ResourceGroup("Topic Properties", new ResourceDescriptor [] { ! new ResourceDescriptor(namespace, "topic", "topic"), ! new ResourceDescriptor(namespace, "primaryTopic", "primary topic"), ! })); ! ! addResourceGroup( new ResourceGroup("Agent Classes", new ResourceDescriptor [] { ! new ResourceDescriptor(namespace, "Person", "Person"), ! new ResourceDescriptor(namespace, "Agent", "Agent"), ! })); ! ! addResourceGroup( new ResourceGroup("Agent Classes", new ResourceDescriptor [] { ! new ResourceDescriptor(namespace, "Project", "Project"), ! new ResourceDescriptor(namespace, "Group", "Group"), ! new ResourceDescriptor(namespace, "Organization", "Organization"), ! })); ! ! addResourceGroup( new ResourceGroup("Document Classes", new ResourceDescriptor [] { ! new ResourceDescriptor(namespace, "Document", "Document"), ! new ResourceDescriptor(namespace, "Image", "Image"), ! new ResourceDescriptor(namespace, "PersonalProfileDocument", "Personal Profile Document"), })); Index: RDF.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/vocabulary/RDF.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RDF.java 4 Oct 2004 10:21:01 -0000 1.2 --- RDF.java 30 Nov 2004 09:38:33 -0000 1.3 *************** *** 48,51 **** --- 48,62 ---- })); + addResourceGroup( new ResourceGroup("RDF Classes", new ResourceDescriptor [] { + new ResourceDescriptor(namespace, "Statement", "Statement"), + new ResourceDescriptor(namespace, "Property", "Property") + })); + + addResourceGroup( new ResourceGroup("Container Classes", new ResourceDescriptor [] { + new ResourceDescriptor(namespace, "Bag", "Bag"), + new ResourceDescriptor(namespace, "Seq", "Sequence"), + new ResourceDescriptor(namespace, "Alt", "Alternatives") + })); + } Index: Vocabulary.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/vocabulary/Vocabulary.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Vocabulary.java 4 Oct 2004 10:21:01 -0000 1.2 --- Vocabulary.java 30 Nov 2004 09:38:33 -0000 1.3 *************** *** 17,24 **** public Enumeration getPropertyGroups(); - public Enumeration getResourceGroups(); - public String getNamespace(); --- 17,22 ---- Index: RDFS.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/vocabulary/RDFS.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RDFS.java 4 Oct 2004 10:21:01 -0000 1.2 --- RDFS.java 30 Nov 2004 09:38:32 -0000 1.3 *************** *** 49,52 **** --- 49,59 ---- })); + addResourceGroup( new ResourceGroup("RDFS Classes", new ResourceDescriptor [] { + new ResourceDescriptor(namespace, "Class", "Class"), + new ResourceDescriptor(namespace, "Resource", "Resource"), + new ResourceDescriptor(namespace, "Literal", "Literal"), + new ResourceDescriptor(namespace, "Container", "Container") + })); + } |
|
From: Flo L. <fl...@us...> - 2004-11-30 09:38:49
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26998/src/org/mediavirus/graphl/painter Modified Files: StraightLineEdgePainter.java LineEdgePainter.java ManhattanEdgePainter.java AbstractEdgePainter.java BoxNodePainter.java InvisibleEdgePainter.java ShapeNodePainter.java EdgePainter.java ArrowEdgePainter.java Log Message: - FEATURE: added menu to choose/switch configuration at runtime - FEATURE: extension of config.rdf to include two sample configurations - FEATURE: extended built-in vocabularies - FEATURE: RepulsionNodeLayouter has configurable strength - BUG: fixed context menu for macs - BUG: fixed cloning of BoxNodePainter - API: added Edge.invert() - API: added FacetRegistry.updateFacets() - REFACTOR: moved default facet selection to context menu - REFACTOR: removed GraphlPane.getScreenPointForNode() calls (use only graph coords) - MISC: misc. minor bugfixes and restructuring - DOC: added first package.html file Index: LineEdgePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/LineEdgePainter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** LineEdgePainter.java 27 Oct 2004 10:55:40 -0000 1.7 --- LineEdgePainter.java 30 Nov 2004 09:38:34 -0000 1.8 *************** *** 16,20 **** import org.mediavirus.graphl.graph.Edge; import org.mediavirus.graphl.graph.Node; - import org.mediavirus.graphl.graph.rdf.RDFEdge; import org.mediavirus.graphl.view.LabelGenerator; import org.mediavirus.util.ParseUtils; --- 16,19 ---- *************** *** 210,214 **** } ! public abstract boolean isPointInLabel(GraphlPane graphPane, RDFEdge edge, Point point); public abstract String getName(); --- 209,213 ---- } ! public abstract boolean isPointInLabel(GraphlPane graphPane, Edge edge, Point point); public abstract String getName(); Index: ArrowEdgePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/ArrowEdgePainter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ArrowEdgePainter.java 4 Oct 2004 10:21:03 -0000 1.3 --- ArrowEdgePainter.java 30 Nov 2004 09:38:34 -0000 1.4 *************** *** 4,8 **** import java.awt.Graphics2D; import java.awt.Point; - import java.awt.Rectangle; import javax.swing.JComponent; --- 4,7 ---- *************** *** 10,14 **** import org.mediavirus.graphl.GraphlPane; import org.mediavirus.graphl.graph.Edge; ! import org.mediavirus.graphl.graph.rdf.RDFEdge; /** --- 9,13 ---- import org.mediavirus.graphl.GraphlPane; import org.mediavirus.graphl.graph.Edge; ! import org.mediavirus.graphl.graph.Node; /** *************** *** 29,37 **** */ public void paintEdge(GraphlPane graphPane, Graphics2D g, Edge edge, boolean selected, boolean highlighted) { ! Point from=graphPane.getScreenPointForNode(edge.getFrom()); ! Point to=graphPane.getScreenPointForNode(edge.getTo()); Color color=g.getColor(); g.setColor(getEdgeColor(edge, highlighted, selected)); ! paintArrow(g,from.x,from.y,to.x,to.y); g.setColor(color); } --- 28,36 ---- */ public void paintEdge(GraphlPane graphPane, Graphics2D g, Edge edge, boolean selected, boolean highlighted) { ! Node from = edge.getFrom(); ! Node to = edge.getTo(); Color color=g.getColor(); g.setColor(getEdgeColor(edge, highlighted, selected)); ! paintArrow(g,(int)from.getCenterX(),(int)from.getCenterY(),(int)to.getCenterX(),(int)to.getCenterY()); g.setColor(color); } *************** *** 92,101 **** double px=point.x; double py=point.y; ! Point from=graphPane.getScreenPointForNode(edge.getFrom()); ! Point to=graphPane.getScreenPointForNode(edge.getTo()); ! double x1=from.x; ! double y1=from.y; ! double x2=to.x; ! double y2=to.y; if (px<Math.min(x1,x2)-8 || px>Math.max(x1,x2)+8 || py<Math.min(y1,y2)-8 || py>Math.max(y1,y2)+8) return 1000; --- 91,98 ---- double px=point.x; double py=point.y; ! double x1 = edge.getFrom().getCenterX(); ! double y1 = edge.getFrom().getCenterY(); ! double x2 = edge.getTo().getCenterX(); ! double y2 = edge.getTo().getCenterX(); if (px<Math.min(x1,x2)-8 || px>Math.max(x1,x2)+8 || py<Math.min(y1,y2)-8 || py>Math.max(y1,y2)+8) return 1000; *************** *** 107,121 **** return dist; } - /** - * Returns the outer rectangle of the edge on screen. - * @param graphPane The graph pane. - * @param edge The edge. - * @param edgeScreenRectangle The rectangle receiving the edge's coordinates. - */ - public void getEdgeScreenBounds(GraphlPane graphPane, Edge edge, Rectangle edgeScreenRectangle) { - Point from=graphPane.getScreenPointForNode(edge.getFrom()); - Point to=graphPane.getScreenPointForNode(edge.getTo()); - edgeScreenRectangle.setBounds(Math.min(from.x,to.x),Math.min(from.y,to.y),Math.abs(to.x-from.x)+1,Math.abs(to.y-from.y)+1); - } public Object clone() { --- 104,107 ---- *************** *** 152,156 **** * Overrides @see org.mediavirus.graphl.view.EdgePainter#isPointInLabel(org.mediavirus.graphl.GraphlPane, org.mediavirus.graphl.graph.RDFEdge, java.awt.Point) */ ! public boolean isPointInLabel(GraphlPane graphPane, RDFEdge edge, Point point) { return false; } --- 138,142 ---- * Overrides @see org.mediavirus.graphl.view.EdgePainter#isPointInLabel(org.mediavirus.graphl.GraphlPane, org.mediavirus.graphl.graph.RDFEdge, java.awt.Point) */ ! public boolean isPointInLabel(GraphlPane graphPane, Edge edge, Point point) { return false; } Index: ManhattanEdgePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/ManhattanEdgePainter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ManhattanEdgePainter.java 21 Oct 2004 16:00:46 -0000 1.4 --- ManhattanEdgePainter.java 30 Nov 2004 09:38:34 -0000 1.5 *************** *** 111,115 **** * @see org.mediavirus.graphl.view.GraphlEdgePainter#isPointInLabel(org.mediavirus.graphl.GraphlPane, org.mediavirus.graphl.RDFEdge, java.awt.Point) */ ! public boolean isPointInLabel(GraphlPane graphPane, RDFEdge edge, Point point) { return false; } --- 111,115 ---- * @see org.mediavirus.graphl.view.GraphlEdgePainter#isPointInLabel(org.mediavirus.graphl.GraphlPane, org.mediavirus.graphl.RDFEdge, java.awt.Point) */ ! public boolean isPointInLabel(GraphlPane graphPane, Edge edge, Point point) { return false; } Index: StraightLineEdgePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/StraightLineEdgePainter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** StraightLineEdgePainter.java 21 Oct 2004 16:00:46 -0000 1.5 --- StraightLineEdgePainter.java 30 Nov 2004 09:38:33 -0000 1.6 *************** *** 18,22 **** import org.mediavirus.graphl.graph.Edge; import org.mediavirus.graphl.graph.Node; - import org.mediavirus.graphl.graph.rdf.RDFEdge; /** --- 18,21 ---- *************** *** 73,77 **** */ void doPaintEdge(GraphlPane graphPane, Graphics2D g, Edge edge, boolean selected, boolean highlighted) { ! Point from = graphPane.getScreenPointForNode(edge.getFrom()); Point to = graphPane.getScreenPointForNode(edge.getTo()); --- 72,77 ---- */ void doPaintEdge(GraphlPane graphPane, Graphics2D g, Edge edge, boolean selected, boolean highlighted) { ! ! Point from = graphPane.getScreenPointForNode(edge.getFrom()); Point to = graphPane.getScreenPointForNode(edge.getTo()); *************** *** 250,269 **** /* ! * Overrides @see org.mediavirus.graphl.view.GraphlEdgePainter#isPointInLabel(org.mediavirus.graphl.GraphlPane, org.mediavirus.graphl.RDFEdge, java.awt.Point) */ ! public boolean isPointInLabel(GraphlPane graphPane, RDFEdge edge, Point point) { if (isPaintLabel()) { ! // TODO how to get the label string String label = edge.getLabel(); if (label != null){ ! Point from = graphPane.getScreenPointForNode(edge.getFrom()); ! Point to = graphPane.getScreenPointForNode(edge.getTo()); ! int x1 = from.x; ! int y1 = from.y; ! int x2 = to.x; ! int y2 = to.y; // TODO (2): properly calculate label clicking (0.5h) ! if ((point.x > (from.getX()+to.getX())/2-5) && (point.x < (from.getX()+to.getX())/2+5) && (point.y > (from.getY()+to.getY())/2-5) && (point.y < (from.getY()+to.getY())/2+5) ) { return true; } --- 250,267 ---- /* ! * @see org.mediavirus.graphl.view.GraphlEdgePainter#isPointInLabel(org.mediavirus.graphl.GraphlPane, org.mediavirus.graphl.RDFEdge, java.awt.Point) */ ! public boolean isPointInLabel(GraphlPane graphPane, Edge edge, Point point) { if (isPaintLabel()) { ! // TODO (2) how to get the label string String label = edge.getLabel(); if (label != null){ ! double x1 = edge.getFrom().getCenterX(); ! double y1 = edge.getFrom().getCenterY(); ! double x2 = edge.getTo().getCenterX(); ! double y2 = edge.getTo().getCenterX(); // TODO (2): properly calculate label clicking (0.5h) ! if ((point.x > (x1+x2)/2-5) && (point.x < (x1+x2)/2+5) && (point.y > (y1+y2)/2-5) && (point.y < (y1+y2)/2+5) ) { return true; } *************** *** 274,278 **** /* ! * Overrides @see org.mediavirus.graphl.view.GraphlEdgePainter#getStyleName() */ public String getName() { --- 272,276 ---- /* ! * @see org.mediavirus.graphl.view.GraphlEdgePainter#getStyleName() */ public String getName() { Index: AbstractEdgePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/AbstractEdgePainter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractEdgePainter.java 21 Aug 2004 22:31:01 -0000 1.2 --- AbstractEdgePainter.java 30 Nov 2004 09:38:34 -0000 1.3 *************** *** 6,9 **** --- 6,10 ---- import org.mediavirus.graphl.GraphlPane; import org.mediavirus.graphl.graph.Edge; + import org.mediavirus.graphl.graph.Node; import org.mediavirus.graphl.view.AbstractFacet; *************** *** 21,32 **** */ public double screenDistanceFromEdge(GraphlPane graphPane, Edge edge, Point point) { ! double px=point.x; ! double py=point.y; ! Point from=graphPane.getScreenPointForNode(edge.getFrom()); ! Point to=graphPane.getScreenPointForNode(edge.getTo()); ! double x1=from.x; ! double y1=from.y; ! double x2=to.x; ! double y2=to.y; if (px<Math.min(x1,x2)-8 || px>Math.max(x1,x2)+8 || py<Math.min(y1,y2)-8 || py>Math.max(y1,y2)+8) return 1000; --- 22,31 ---- */ public double screenDistanceFromEdge(GraphlPane graphPane, Edge edge, Point point) { ! double px = point.x; ! double py = point.y; ! double x1 = edge.getFrom().getCenterX(); ! double y1 = edge.getFrom().getCenterY(); ! double x2 = edge.getTo().getCenterX(); ! double y2 = edge.getTo().getCenterX(); if (px<Math.min(x1,x2)-8 || px>Math.max(x1,x2)+8 || py<Math.min(y1,y2)-8 || py>Math.max(y1,y2)+8) return 1000; *************** *** 46,52 **** */ public void getEdgeScreenBounds(GraphlPane graphPane,Edge edge,Rectangle edgeScreenRectangle) { ! Point from=graphPane.getScreenPointForNode(edge.getFrom()); ! Point to=graphPane.getScreenPointForNode(edge.getTo()); ! edgeScreenRectangle.setBounds(Math.min(from.x,to.x),Math.min(from.y,to.y),Math.abs(to.x-from.x)+1,Math.abs(to.y-from.y)+1); } --- 45,51 ---- */ public void getEdgeScreenBounds(GraphlPane graphPane,Edge edge,Rectangle edgeScreenRectangle) { ! Node from = edge.getFrom(); ! Node to = edge.getTo(); ! edgeScreenRectangle.setBounds((int)Math.min(from.getCenterX(),to.getCenterX()),(int)Math.min(from.getCenterY(),to.getCenterY()),(int)Math.abs(to.getCenterX()-from.getCenterX())+1,(int)Math.abs(to.getCenterY()-from.getCenterY())+1); } Index: BoxNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/BoxNodePainter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** BoxNodePainter.java 21 Oct 2004 16:00:46 -0000 1.7 --- BoxNodePainter.java 30 Nov 2004 09:38:34 -0000 1.8 *************** *** 48,52 **** labelGenerator = new LabelGenerator(); } ! protected Color getBackgroundColor( boolean isHighlighted, --- 48,52 ---- labelGenerator = new LabelGenerator(); } ! protected Color getBackgroundColor( boolean isHighlighted, *************** *** 54,58 **** boolean isDragging) { ! if (isSelected) return new Color(218,214,144); return baseColor; } --- 54,58 ---- boolean isDragging) { ! if (isSelected) return baseColor.darker(); return baseColor; } *************** *** 306,310 **** public Object clone() { ! return new BoxNodePainter(); } --- 306,321 ---- public Object clone() { ! BoxNodePainter b2 = new BoxNodePainter(); ! b2.setBaseColor(baseColor); ! b2.setBorderColor(borderColor); ! BasicStroke stroke = (BasicStroke)borderStroke; ! b2.setBorderStroke(new BasicStroke(stroke.getLineWidth(), stroke.getEndCap(), stroke.getLineJoin(), stroke.getMiterLimit(), stroke.getDashArray(), stroke.getDashPhase())); ! b2.setCornerRadius(cornerRadius); ! b2.setFont(font); ! b2.setRoundRect(roundRect); ! b2.setTextColor(textColor); ! b2.setTransparency(transparency); ! b2.setUseBorderColor(useBorderColor); ! return b2; } *************** *** 336,339 **** --- 347,353 ---- if (str != null) setRoundRect(str.equalsIgnoreCase("true")); + str = node.getProperty("http://www.mediavirus.org/graphl#useBorderColor"); + if (str != null) setUseBorderColor(str.equalsIgnoreCase("true")); + str = node.getProperty("http://www.mediavirus.org/graphl#cornerRadius"); if (str != null) setCornerRadius(Integer.parseInt(str)); Index: InvisibleEdgePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/InvisibleEdgePainter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** InvisibleEdgePainter.java 4 Oct 2004 10:21:03 -0000 1.3 --- InvisibleEdgePainter.java 30 Nov 2004 09:38:34 -0000 1.4 *************** *** 26,30 **** * Overrides @see org.mediavirus.graphl.view.GraphlEdgePainter#isPointInLabel(org.mediavirus.graphl.GraphlPane, org.mediavirus.graphl.RDFEdge, java.awt.Point) */ ! public boolean isPointInLabel(GraphlPane graphPane, RDFEdge edge, Point point) { return false; } --- 26,30 ---- * Overrides @see org.mediavirus.graphl.view.GraphlEdgePainter#isPointInLabel(org.mediavirus.graphl.GraphlPane, org.mediavirus.graphl.RDFEdge, java.awt.Point) */ ! public boolean isPointInLabel(GraphlPane graphPane, Edge edge, Point point) { return false; } Index: ShapeNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/ShapeNodePainter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ShapeNodePainter.java 21 Oct 2004 16:00:46 -0000 1.4 --- ShapeNodePainter.java 30 Nov 2004 09:38:34 -0000 1.5 *************** *** 135,138 **** --- 135,139 ---- return stroke; } + /** * @param stroke The stroke to set. *************** *** 141,144 **** --- 142,146 ---- this.stroke = stroke; } + /** * @return Returns the borderColor. *************** *** 147,150 **** --- 149,153 ---- return borderColor; } + /** * @param borderColor The borderColor to set. *************** *** 153,156 **** --- 156,160 ---- this.borderColor = borderColor; } + /** * @return Returns the fillColor. *************** *** 159,162 **** --- 163,167 ---- return fillColor; } + /** * @param fillColor The fillColor to set. *************** *** 165,168 **** --- 170,174 ---- this.fillColor = fillColor; } + /** * @return Returns the size. *************** *** 171,174 **** --- 177,181 ---- return size; } + /** * @param size The size to set. *************** *** 177,180 **** --- 184,188 ---- this.size = size; } + /** * @return Returns the shape. *************** *** 205,209 **** if (stroke != null) setStroke(stroke); ! Color col = ParseUtils.parseColor(node.getProperty("http://www.mediavirus.org/graphl#borderColor")); if (col != null) setBorderColor(col); --- 213,217 ---- if (stroke != null) setStroke(stroke); ! Color col = ParseUtils.parseColor(node.getProperty("http://www.mediavirus.org/graphl#color")); if (col != null) setBorderColor(col); Index: EdgePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/EdgePainter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EdgePainter.java 21 Aug 2004 22:31:01 -0000 1.2 --- EdgePainter.java 30 Nov 2004 09:38:34 -0000 1.3 *************** *** 7,11 **** import org.mediavirus.graphl.GraphlPane; import org.mediavirus.graphl.graph.Edge; - import org.mediavirus.graphl.graph.rdf.RDFEdge; import org.mediavirus.graphl.view.Facet; --- 7,10 ---- *************** *** 40,43 **** void getEdgeScreenBounds(GraphlPane graphPane, Edge edge, Rectangle edgeScreenRectangle); ! boolean isPointInLabel(GraphlPane graphPane, RDFEdge edge, Point point); } --- 39,42 ---- void getEdgeScreenBounds(GraphlPane graphPane, Edge edge, Rectangle edgeScreenRectangle); ! boolean isPointInLabel(GraphlPane graphPane, Edge edge, Point point); } |
|
From: Flo L. <fl...@us...> - 2004-11-30 09:38:47
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26998/src/org/mediavirus/graphl Modified Files: GraphlApplication.java GraphlPane.java GraphlPanel.java Added Files: package.html Log Message: - FEATURE: added menu to choose/switch configuration at runtime - FEATURE: extension of config.rdf to include two sample configurations - FEATURE: extended built-in vocabularies - FEATURE: RepulsionNodeLayouter has configurable strength - BUG: fixed context menu for macs - BUG: fixed cloning of BoxNodePainter - API: added Edge.invert() - API: added FacetRegistry.updateFacets() - REFACTOR: moved default facet selection to context menu - REFACTOR: removed GraphlPane.getScreenPointForNode() calls (use only graph coords) - MISC: misc. minor bugfixes and restructuring - DOC: added first package.html file Index: GraphlPanel.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlPanel.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** GraphlPanel.java 21 Oct 2004 16:00:47 -0000 1.17 --- GraphlPanel.java 30 Nov 2004 09:38:34 -0000 1.18 *************** *** 6,10 **** import java.awt.BorderLayout; - import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; --- 6,9 ---- *************** *** 25,36 **** import org.mediavirus.graphl.graph.*; import org.mediavirus.graphl.graph.rdf.RDFGraph; - import org.mediavirus.graphl.gui.GenericDialog; import org.mediavirus.graphl.interaction.GraphlManipulator; - import org.mediavirus.graphl.painter.EdgePainter; - import org.mediavirus.graphl.painter.NodePainter; import org.mediavirus.graphl.selection.SelectionListener; import org.mediavirus.graphl.selection.SelectionModel; - import javax.swing.JLabel; import javax.swing.JPanel; --- 24,31 ---- *************** *** 52,63 **** private JSlider zoomSlider; - private JComboBox nodePainterMenu; - private JComboBox edgePainterMenu; private JPanel topPanel; private JPanel spacerPanel = null; - private JButton nodePainterConfigureButton = null; - private JButton edgePainterConfigureButton = null; private JButton jButton = null; --- 47,54 ---- *************** *** 88,97 **** java.awt.GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); - javax.swing.JLabel defaultEPLabel = new JLabel(); - java.awt.GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); - javax.swing.JLabel defaultNPLabel = new JLabel(); - topPanel = new JPanel(); topPanel.setLayout(new GridBagLayout()); --- 79,84 ---- *************** *** 127,132 **** gridBagConstraints4.weightx = 0.0D; gridBagConstraints4.gridwidth = 2; - defaultNPLabel.setText("Default Node Painter"); - defaultNPLabel.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 9)); gridBagConstraints5.gridx = 2; gridBagConstraints5.gridy = 0; --- 114,117 ---- *************** *** 134,139 **** gridBagConstraints5.gridwidth = 2; gridBagConstraints5.anchor = java.awt.GridBagConstraints.WEST; - defaultEPLabel.setText("Default Edge Painter"); - defaultEPLabel.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 9)); gridBagConstraints6.gridx = 4; gridBagConstraints6.gridy = 1; --- 119,122 ---- *************** *** 154,164 **** topPanel.add(getLayoutBox(), c1); topPanel.add(getZoomSlider(), c2); - topPanel.add(getNodePainterMenu(), c3); - topPanel.add(getEdgePainterMenu(), c4); - topPanel.add(defaultNPLabel, gridBagConstraints4); - topPanel.add(defaultEPLabel, gridBagConstraints5); topPanel.add(getSpacerPanel(), gridBagConstraints6); - topPanel.add(getNodePainterConfigureButton(), gridBagConstraints1); - topPanel.add(getEdgePainterConfigureButton(), gridBagConstraints2); topPanel.add(getJButton(), gridBagConstraints11); } --- 137,141 ---- *************** *** 244,307 **** return graphPane; } - - private JComboBox getNodePainterMenu() { - if (nodePainterMenu == null) { - nodePainterMenu = new JComboBox(); - nodePainterMenu.setFont(new Font(null, Font.PLAIN, 9)); - Vector painters = graphPane.getFacetRegistry().getAvailableNodePainters(); - for (Iterator iter = painters.iterator(); iter.hasNext();) { - NodePainter painter = (NodePainter) iter.next(); - nodePainterMenu.addItem(painter); - } - nodePainterMenu.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - NodePainter p = (NodePainter)nodePainterMenu.getSelectedItem(); - graphPane.getFacetRegistry().setDefaultNodePainter((NodePainter)p.clone()); - getNodePainterConfigureButton().setEnabled(p.hasVisualController()); - graphPane.repaint(); - } - }); - - } - return nodePainterMenu; - } - - private JComboBox getEdgePainterMenu() { - if (edgePainterMenu == null) { - edgePainterMenu = new JComboBox(); - edgePainterMenu.setFont(new Font(null, Font.PLAIN, 9)); - Vector painters = graphPane.getFacetRegistry().getAvailableEdgePainters(); - for (Iterator iter = painters.iterator(); iter.hasNext();) { - EdgePainter painter = (EdgePainter) iter.next(); - edgePainterMenu.addItem(painter); - - } - edgePainterMenu.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - EdgePainter p = (EdgePainter)edgePainterMenu.getSelectedItem(); - graphPane.getFacetRegistry().setDefaultEdgePainter((EdgePainter)p.clone()); - getEdgePainterConfigureButton().setEnabled(p.hasVisualController()); - graphPane.repaint(); - } - }); - - } - return edgePainterMenu; - } - - public void updatePainters() { - getNodePainterMenu().removeAllItems(); - getEdgePainterMenu().removeAllItems(); - Vector painters = graphPane.getFacetRegistry().getAvailableNodePainters(); - for (Iterator iter = painters.iterator(); iter.hasNext();) { - NodePainter painter = (NodePainter) iter.next(); - getNodePainterMenu().addItem(painter); - } - painters = graphPane.getFacetRegistry().getAvailableEdgePainters(); - for (Iterator iter = painters.iterator(); iter.hasNext();) { - EdgePainter painter = (EdgePainter) iter.next(); - getEdgePainterMenu().addItem(painter); - } - } public boolean nodeRemove(Node n) { --- 221,224 ---- *************** *** 394,433 **** } - private JButton getNodePainterConfigureButton() { - if (nodePainterConfigureButton == null) { - nodePainterConfigureButton = new JButton(); - nodePainterConfigureButton.setText("..."); - nodePainterConfigureButton.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 9)); - nodePainterConfigureButton.setPreferredSize(new java.awt.Dimension(16,16)); - nodePainterConfigureButton.setToolTipText("Configure Default Node Painter"); - nodePainterConfigureButton.addActionListener(new java.awt.event.ActionListener() { - - public void actionPerformed(java.awt.event.ActionEvent e) { - int result = GenericDialog.showModalDialog(null, graphPane.getFacetRegistry().getDefaultNodePainter().getVisualController(), "Default Node Painter Properties"); - } - }); - - } - return nodePainterConfigureButton; - } - - private JButton getEdgePainterConfigureButton() { - if (edgePainterConfigureButton == null) { - edgePainterConfigureButton = new JButton(); - edgePainterConfigureButton.setText("..."); - edgePainterConfigureButton.setToolTipText("Configure Default Edge Painter"); - edgePainterConfigureButton.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 9)); - edgePainterConfigureButton.setPreferredSize(new java.awt.Dimension(16,16)); - edgePainterConfigureButton.addActionListener(new java.awt.event.ActionListener() { - - public void actionPerformed(java.awt.event.ActionEvent e) { - int result = GenericDialog.showModalDialog(null, graphPane.getFacetRegistry().getDefaultEdgePainter().getVisualController(), "Default Edge Painter Properties"); - } - }); - - } - return edgePainterConfigureButton; - } - private JButton getJButton() { if (jButton == null) { --- 311,314 ---- --- NEW FILE: package.html --- <html> <body> <h1>Package foo</h1> foo foo foo. blaa blaa blaa. buuu buuu buuu. </body> </html> Index: GraphlApplication.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplication.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** GraphlApplication.java 27 Oct 2004 10:55:40 -0000 1.14 --- GraphlApplication.java 30 Nov 2004 09:38:34 -0000 1.15 *************** *** 21,24 **** --- 21,25 ---- import java.util.List; + import javax.swing.ButtonGroup; import javax.swing.JFileChooser; import javax.swing.JFrame; *************** *** 27,30 **** --- 28,32 ---- import javax.swing.JMenuItem; import javax.swing.JOptionPane; + import javax.swing.JRadioButtonMenuItem; import javax.swing.KeyStroke; *************** *** 33,36 **** --- 35,40 ---- import org.mediavirus.graphl.gui.GenericDialog; import org.mediavirus.graphl.gui.OpenURLPanel; + import org.mediavirus.graphl.painter.NodePainter; + import org.mediavirus.graphl.view.FacetRegistry; import org.mediavirus.graphl.view.GraphFacetRegistry; import org.mediavirus.graphl.vocabulary.DC; *************** *** 61,64 **** --- 65,74 ---- JMenuItem exitItem; + JMenu configMenu; + JMenu configConfigurationMenu; + + Font menuFont = new Font(null, Font.PLAIN, 12); + + private File currentFile; private URL currentURL; *************** *** 66,73 **** private int sleeptime; - private boolean doReload; ! private RDFGraph settings = new RDFGraph(); /** A List with all configuration nodes in the settings graph */ private List configurations = new ArrayList(); --- 76,82 ---- private int sleeptime; private boolean doReload; ! private RDFGraph settingsGraph = new RDFGraph(); /** A List with all configuration nodes in the settings graph */ private List configurations = new ArrayList(); *************** *** 95,99 **** menuBar = new JMenuBar(); - Font menuFont = new Font(null, Font.PLAIN, 12); fileMenu = new JMenu("File"); --- 104,107 ---- *************** *** 165,172 **** menuBar.add(fileMenu); ! this.getContentPane().add(menuBar, BorderLayout.NORTH); ! // TODO (Future): the whole vocab. registration should be defined in RDF files mainPanel.graphPane.getVocabularyRegistry().registerVocabulary(Graphl.getVocabulary()); mainPanel.graphPane.getVocabularyRegistry().registerVocabulary(RDF.getVocabulary()); --- 173,190 ---- menuBar.add(fileMenu); ! ! configMenu = new JMenu("Config"); ! configMenu.setFont(menuFont); ! ! configConfigurationMenu = new JMenu("Active Configuration"); ! configConfigurationMenu.setFont(menuFont); ! ! configMenu.add(configConfigurationMenu); ! ! menuBar.add(configMenu); ! this.getContentPane().add(menuBar, BorderLayout.NORTH); ! // TODO (Future) the whole vocab. registration should be defined in RDF files mainPanel.graphPane.getVocabularyRegistry().registerVocabulary(Graphl.getVocabulary()); mainPanel.graphPane.getVocabularyRegistry().registerVocabulary(RDF.getVocabulary()); *************** *** 175,181 **** mainPanel.graphPane.getVocabularyRegistry().registerVocabulary(FOAF.getVocabulary()); - //mainPanel.graphPane.getPainterRegistry().setEdgePainterForType("http://www.mediavirus.org/graphl#frontLink", new StraightLineEdgePainter(0.7f, LineEdgePainter.DASHED, true, false, 9)); - //mainPanel.graphPane.getPainterRegistry().setEdgePainterForType("http://www.mediavirus.org/graphl#parentOf", new StraightLineEdgePainter(1.2f, LineEdgePainter.SOLID, true, false, 9)); - } --- 193,196 ---- *************** *** 412,431 **** } public void loadSettings(String filename) throws IOException { ! settings.clear(); ! settings.readFromFile(filename); ! for (Iterator nodes = settings.getNodes().iterator(); nodes.hasNext();) { Node node = (Node) nodes.next(); if (node.hasType("http://www.mediavirus.org/graphl#Configuration")) { configurations.add(node); } } if (configurations.size() > 0) { ! mainPanel.graphPane.setFacetRegistry(new GraphFacetRegistry(settings,(Node)configurations.get(0))); } - - mainPanel.updatePainters(); } --- 427,492 ---- } + protected class SettingsAdapter implements ActionListener { + private Node node; + + SettingsAdapter(Node node) { + this.node = node; + } + + public void actionPerformed(ActionEvent e) { + FacetRegistry newRegistry = new GraphFacetRegistry(settingsGraph,node); + setRegistry(newRegistry); + } + } + + protected class NodePainterAdapter implements ActionListener { + private NodePainter painter; + + NodePainterAdapter(NodePainter painter) { + this.painter = painter; + } + + public void actionPerformed(ActionEvent e) { + mainPanel.graphPane.getFacetRegistry().setDefaultNodePainter(painter); + } + } + + public void setRegistry(FacetRegistry registry) { + mainPanel.graphPane.setFacetRegistry(registry); + } + public void loadSettings(String filename) throws IOException { ! settingsGraph.clear(); ! settingsGraph.readFromFile(filename); ! Node defaultConfiguration = null; ! JRadioButtonMenuItem defaultItem = null; ! ButtonGroup settingsGroup = new ButtonGroup(); ! ! for (Iterator nodes = settingsGraph.getNodes().iterator(); nodes.hasNext();) { Node node = (Node) nodes.next(); if (node.hasType("http://www.mediavirus.org/graphl#Configuration")) { configurations.add(node); + JRadioButtonMenuItem item = new JRadioButtonMenuItem(node.getProperty("http://www.mediavirus.org/graphl#name","<unnamed>")); + item.addActionListener(new SettingsAdapter(node)); + item.setFont(menuFont); + configConfigurationMenu.add(item); + settingsGroup.add(item); + if (node.getProperty("http://www.mediavirus.org/graphl#default","").equalsIgnoreCase("true")) { + defaultConfiguration = node; + defaultItem = item; + } } } if (configurations.size() > 0) { ! if (defaultConfiguration != null) { ! setRegistry(new GraphFacetRegistry(settingsGraph,defaultConfiguration)); ! defaultItem.setSelected(true); ! } ! else { ! setRegistry(new GraphFacetRegistry(settingsGraph,(Node)configurations.get(0))); ! } } } Index: GraphlPane.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlPane.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** GraphlPane.java 21 Oct 2004 16:00:47 -0000 1.14 --- GraphlPane.java 30 Nov 2004 09:38:34 -0000 1.15 *************** *** 21,30 **** import java.util.ArrayList; import java.util.Collection; - import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.ListIterator; - import java.util.Map; import java.util.Set; --- 21,28 ---- *************** *** 58,61 **** --- 56,60 ---- private Set registeredEdgeTypes = new HashSet(); + private Set registeredNodeTypes = new HashSet(); private boolean autoRegisterTypes = true; *************** *** 78,88 **** /** The listener for the graph. */ protected GraphListener graphListener; - /** The map of node positions. */ - protected Map nodePositions; /** The array of registered manipulators in the order they were registered. */ protected List manipulators; ! /** The map of rigestered manipulators keyed by their name. */ ! protected Map manipulatorsByName; ! protected SelectionModel selection; --- 77,83 ---- /** The listener for the graph. */ protected GraphListener graphListener; /** The array of registered manipulators in the order they were registered. */ protected List manipulators; ! protected SelectionModel selection; *************** *** 97,103 **** super(null); graphListener=new GraphHandler(); - nodePositions=new HashMap(); manipulators=new ArrayList(); - manipulatorsByName=new HashMap(); setGraph(graph); enableEvents(MouseEvent.MOUSE_EVENT_MASK | MouseEvent.MOUSE_MOTION_EVENT_MASK | KeyEvent.KEY_EVENT_MASK | FocusEvent.FOCUS_EVENT_MASK | ComponentEvent.COMPONENT_EVENT_MASK); --- 92,96 ---- *************** *** 107,112 **** updateTransform(); - graph.addGraphListener(this); - layouter = new Layouter(new GraphlLayoutStrategy(getGraph(), getFacetRegistry())); startLayouter(); --- 100,103 ---- *************** *** 124,127 **** --- 115,120 ---- public void setFacetRegistry(FacetRegistry registry) { this.facetRegistry = registry; + registry.updateFacets(graph); + repaint(); } *************** *** 174,178 **** Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); ! if (transform != null) g2.setTransform(transform); long renderStartTime=System.currentTimeMillis(); --- 167,173 ---- Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); ! if (transform != null) { ! g2.transform(transform); ! } long renderStartTime=System.currentTimeMillis(); *************** *** 199,203 **** getEdgeScreenBounds(edge,bounds); if (clipRectangle.intersects(bounds)) { ! paintEdge(g2,edge); } } --- 194,198 ---- getEdgeScreenBounds(edge,bounds); if (clipRectangle.intersects(bounds)) { ! edge.getCurrentPainter().paintEdge(this, g2, edge, selection.isEdgeSelected(edge), false); } } *************** *** 213,217 **** getNodeScreenBounds(node,bounds); if (clipRectangle.intersects(bounds)) { ! paintNode(g2,node); } } --- 208,212 ---- getNodeScreenBounds(node,bounds); if (clipRectangle.intersects(bounds)) { ! node.getCurrentPainter().paintNode(this, g2, node, selection.isNodeSelected(node), false); } } *************** *** 225,229 **** ((Manipulator)manipulators.get(i)).paint(g2); long renderDuration = System.currentTimeMillis()-renderStartTime; ! if (renderDuration > 0) System.out.println("render time: " + renderDuration + " FPS: " + 1000.0/renderDuration); } } --- 220,224 ---- ((Manipulator)manipulators.get(i)).paint(g2); long renderDuration = System.currentTimeMillis()-renderStartTime; ! //if (renderDuration > 0) System.out.println("render time: " + renderDuration + " FPS: " + 1000.0/renderDuration); } } *************** *** 251,268 **** } } ! /** ! * Converts a given graph point into a point on the screen. ! * ! * @param graphPoint The point in the graph ! * @param point The calculated screen point ! */ ! public void graphToScreenPoint(Point2D graphPoint,Point point) { ! // if (transform == null) ! point.setLocation(graphPoint.getX(),graphPoint.getY()); ! // else { ! // transform.transform(graphPoint, point); ! // } ! } ! public void doLayout() { super.doLayout(); --- 246,250 ---- } } ! public void doLayout() { super.doLayout(); *************** *** 278,281 **** --- 260,267 ---- } + public Set getRegisteredNodeTypes() { + return registeredNodeTypes; + } + public void graphLayoutUpdated(Graph graph) { } *************** *** 283,297 **** public void graphContentsChanged(Graph graph) { ! Iterator nodes = graph.getNodes().iterator(); ! while (nodes.hasNext()) { ! Node node = (Node) nodes.next(); ! facetRegistry.updateNodeFacets(node); ! } ! ! Iterator edges = graph.getEdges().iterator(); ! while (edges.hasNext()) { ! Edge edge = (Edge) edges.next(); ! facetRegistry.updateEdgeFacets(edge); ! } } --- 269,273 ---- public void graphContentsChanged(Graph graph) { ! facetRegistry.updateFacets(graph); } *************** *** 302,306 **** facetRegistry.updateEdgeFacets(edge); if (autoRegisterTypes) { ! registeredEdgeTypes.add(edge.getType()); } } --- 278,282 ---- facetRegistry.updateEdgeFacets(edge); if (autoRegisterTypes) { ! if (edge.getType() != null) registeredEdgeTypes.add(edge.getType()); } } *************** *** 310,313 **** --- 286,292 ---- Node node = (Node) iter.next(); facetRegistry.updateNodeFacets(node); + if (autoRegisterTypes) { + if (node.getType() != null) registeredEdgeTypes.add(node.getType()); + } } } *************** *** 360,392 **** */ public void addManipulator(Manipulator manipulator) { - removeManipulator(manipulator.getName()); manipulators.add(manipulator); - manipulatorsByName.put(manipulator.getName(),manipulator); manipulator.setGraphPane(this); } /** - * Returns a manipulator with given name. - * - * @param name The name of the manpulator - * @return The manipulator with given name (or <code>null</code> if the manipualtor with given name is not registered) - */ - public Manipulator getManipulator(String name) { - return (Manipulator)manipulatorsByName.get(name); - } - /** - * Removes a manipulator with given name. - * - * @param name The name of the manpulator - */ - public void removeManipulator(String name) { - Manipulator manipulator=(Manipulator)manipulatorsByName.remove(name); - if (manipulator!=null) { - manipulators.remove(manipulator); - manipulator.setGraphPane(null); - } - } - - /** * Returns the current graph. * --- 339,347 ---- *************** *** 403,412 **** public void setGraph(Graph graph) { Graph oldGraph = this.graph; ! if (this.graph!=null) this.graph.removeGraphListener(graphListener); this.graph=graph; ! if (this.graph!=null) this.graph.addGraphListener(graphListener); ! nodePositions.clear(); repaint(); selection = new DefaultSelectionModel(graph); --- 358,370 ---- public void setGraph(Graph graph) { Graph oldGraph = this.graph; ! if (this.graph!=null) { this.graph.removeGraphListener(graphListener); + this.graph.removeGraphListener(this); + } this.graph=graph; ! if (this.graph!=null) { this.graph.addGraphListener(graphListener); ! this.graph.addGraphListener(this); ! } repaint(); selection = new DefaultSelectionModel(graph); *************** *** 416,438 **** } - /** - * Paints the edge. - * - * @param g the graphics - * @param edge the edge - */ - protected void paintEdge(Graphics2D g,Edge edge) { - edge.getCurrentPainter().paintEdge(this, g, edge, selection.isEdgeSelected(edge), false); - } - - /** - * Paints the node. - * - * @param g the graphics - * @param node the node - */ - protected void paintNode(Graphics2D g,Node node) { - node.getCurrentPainter().paintNode(this, g, node, selection.isNodeSelected(node), false); - } /** --- 374,377 ---- *************** *** 448,452 **** while (iterator.hasPrevious()) { Node node=(Node)iterator.previous(); ! NodePainter nodePainter=getPainterForNode(node); if (nodePainter.isInNode(this,node,point)) return node; --- 387,391 ---- while (iterator.hasPrevious()) { Node node=(Node)iterator.previous(); ! NodePainter nodePainter = node.getCurrentPainter(); if (nodePainter.isInNode(this,node,point)) return node; *************** *** 506,536 **** */ public Point getScreenPointForNode(Node node) { ! Point point=(Point)nodePositions.get(node); ! if (point==null) { ! point=new Point(); ! graphToScreenPoint(new Point2D.Double(node.getCenterX(),node.getCenterY()),point); ! nodePositions.put(node,point); ! } return point; } ! /** ! * Updates the map of screen positions of nodes. ! */ ! protected void updateNodeScreenPositions() { ! synchronized (graph) { ! Point2D graphPoint=new Point2D.Double(); ! Iterator nodes=graph.getNodes().iterator(); ! while (nodes.hasNext()) { ! Node node=(Node)nodes.next(); ! Point point=(Point)nodePositions.get(node); ! if (point==null) { ! point=new Point(); ! nodePositions.put(node,point); ! } ! graphPoint.setLocation(node.getCenterX(),node.getCenterY()); ! graphToScreenPoint(graphPoint,point); ! } ! } ! } /** * Returns the screen bounds of given node. --- 445,452 ---- */ public Point getScreenPointForNode(Node node) { ! Point point = new Point((int)node.getCenterX(),(int)node.getCenterY()); return point; } ! /** * Returns the screen bounds of given node. *************** *** 580,584 **** protected void processComponentEvent(ComponentEvent e) { super.processComponentEvent(e); - updateNodeScreenPositions(); repaint(); } --- 496,499 ---- *************** *** 688,708 **** */ protected class GraphHandler implements GraphListener { public void graphLayoutUpdated(Graph graph) { ! if (SwingUtilities.isEventDispatchThread()) { ! updateNodeScreenPositions(); ! repaint(); ! } ! else ! SwingUtilities.invokeLater(new Runnable() { ! public void run() { ! updateNodeScreenPositions(); ! repaint(); ! } ! }); } public void graphUpdated(Graph graph) { ! if (SwingUtilities.isEventDispatchThread()) repaint(); ! else SwingUtilities.invokeLater(new Runnable() { public void run() { --- 603,616 ---- */ protected class GraphHandler implements GraphListener { + public void graphLayoutUpdated(Graph graph) { ! repaint(); } + public void graphUpdated(Graph graph) { ! if (SwingUtilities.isEventDispatchThread()) { repaint(); ! } ! else { SwingUtilities.invokeLater(new Runnable() { public void run() { *************** *** 710,716 **** } }); } public void graphContentsChanged(Graph graph) { - nodePositions.clear(); repaint(); } --- 618,624 ---- } }); + } } public void graphContentsChanged(Graph graph) { repaint(); } *************** *** 719,729 **** } public void elementsRemoved(Graph graph,Collection nodes,Collection edges) { - if (nodes!=null) { - Iterator iterator=nodes.iterator(); - while (iterator.hasNext()) { - Node node=(Node)iterator.next(); - nodePositions.remove(node); - } - } repaint(); } --- 627,630 ---- |
|
From: Flo L. <fl...@us...> - 2004-11-30 09:38:47
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26998/src/org/mediavirus/graphl/graph/rdf Modified Files: RDFEdge.java RDFGraph.java Log Message: - FEATURE: added menu to choose/switch configuration at runtime - FEATURE: extension of config.rdf to include two sample configurations - FEATURE: extended built-in vocabularies - FEATURE: RepulsionNodeLayouter has configurable strength - BUG: fixed context menu for macs - BUG: fixed cloning of BoxNodePainter - API: added Edge.invert() - API: added FacetRegistry.updateFacets() - REFACTOR: moved default facet selection to context menu - REFACTOR: removed GraphlPane.getScreenPointForNode() calls (use only graph coords) - MISC: misc. minor bugfixes and restructuring - DOC: added first package.html file Index: RDFEdge.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf/RDFEdge.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RDFEdge.java 14 Oct 2004 13:03:05 -0000 1.3 --- RDFEdge.java 30 Nov 2004 09:38:34 -0000 1.4 *************** *** 59,73 **** if (reificationNode == null) reificationNode = new ReificationNode(this); return reificationNode; ! } ! ! ! /** ! * Inverts the direction of the edge (from and to are swapped). ! */ ! public void invert() { ! Node temp = from; ! from = to; ! to = temp; ! } ! } --- 59,62 ---- if (reificationNode == null) reificationNode = new ReificationNode(this); return reificationNode; ! } } Index: RDFGraph.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf/RDFGraph.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RDFGraph.java 27 Oct 2004 10:55:41 -0000 1.6 --- RDFGraph.java 30 Nov 2004 09:38:34 -0000 1.7 *************** *** 100,104 **** } ! public void readGraph(InputSource input) { RDFParser parser = new RDFParser(); loading = true; --- 100,104 ---- } ! public synchronized void readGraph(InputSource input) { RDFParser parser = new RDFParser(); loading = true; |
|
From: Flo L. <fl...@us...> - 2004-11-30 09:38:45
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26998/src/org/mediavirus/graphl/graph Modified Files: Edge.java DefaultEdge.java Log Message: - FEATURE: added menu to choose/switch configuration at runtime - FEATURE: extension of config.rdf to include two sample configurations - FEATURE: extended built-in vocabularies - FEATURE: RepulsionNodeLayouter has configurable strength - BUG: fixed context menu for macs - BUG: fixed cloning of BoxNodePainter - API: added Edge.invert() - API: added FacetRegistry.updateFacets() - REFACTOR: moved default facet selection to context menu - REFACTOR: removed GraphlPane.getScreenPointForNode() calls (use only graph coords) - MISC: misc. minor bugfixes and restructuring - DOC: added first package.html file Index: Edge.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/Edge.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Edge.java 14 Oct 2004 13:02:58 -0000 1.10 --- Edge.java 30 Nov 2004 09:38:33 -0000 1.11 *************** *** 20,23 **** --- 20,29 ---- */ Node getTo(); + + /** + * Inverts the edge (swaps from and to). + */ + public void invert(); + /** * Returns the length of this edge. Index: DefaultEdge.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/DefaultEdge.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** DefaultEdge.java 14 Oct 2004 13:03:02 -0000 1.11 --- DefaultEdge.java 30 Nov 2004 09:38:33 -0000 1.12 *************** *** 171,174 **** --- 171,184 ---- } + /** + * Inverts the direction of the edge (from and to are swapped). + */ + // TODO (1) also update edge data in the nodes! + public void invert() { + Node temp = from; + from = to; + to = temp; + } + } |
|
From: Flo L. <fl...@us...> - 2004-11-30 09:38:45
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26998/src/org/mediavirus/graphl/gui Modified Files: NodeContextMenu.java OpenURLPanel.java EdgeContextMenu.java Log Message: - FEATURE: added menu to choose/switch configuration at runtime - FEATURE: extension of config.rdf to include two sample configurations - FEATURE: extended built-in vocabularies - FEATURE: RepulsionNodeLayouter has configurable strength - BUG: fixed context menu for macs - BUG: fixed cloning of BoxNodePainter - API: added Edge.invert() - API: added FacetRegistry.updateFacets() - REFACTOR: moved default facet selection to context menu - REFACTOR: removed GraphlPane.getScreenPointForNode() calls (use only graph coords) - MISC: misc. minor bugfixes and restructuring - DOC: added first package.html file Index: EdgeContextMenu.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/EdgeContextMenu.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** EdgeContextMenu.java 21 Oct 2004 16:00:46 -0000 1.14 --- EdgeContextMenu.java 30 Nov 2004 09:38:33 -0000 1.15 *************** *** 31,81 **** */ public class EdgeContextMenu extends JPopupMenu implements ResourceListener { - private final class AssignDefaultListener implements ActionListener { - private boolean applyToEdge = false; - private int controllerType; - - public AssignDefaultListener(boolean applyToEdge, int controllerType) { - this.applyToEdge = applyToEdge; - this.controllerType = controllerType; - } - - public void actionPerformed(ActionEvent e) { - switch (controllerType) { - case DISPLAY: - if (applyToEdge) { - graphlPane.getFacetRegistry().setPainterForEdge(currentEdge, null); - } - else { - graphlPane.getFacetRegistry().setPainterForEdgeType(currentEdge.getType(), null); - } - break; - - case LAYOUT: - if (applyToEdge) { - graphlPane.getFacetRegistry().setLayouterForEdge(currentEdge, null); - } - else { - graphlPane.getFacetRegistry().setLayouterForEdgeType(currentEdge.getType(), null); - } - break; - - default: - break; - } - graphlPane.getGraph().notifyLayoutUpdated(); - graphlPane.repaint(); - } - } private final class AssignControllerListener implements ActionListener { private Facet controller; ! private boolean applyToEdge; private boolean clone = false; ! public AssignControllerListener(Facet controller, boolean applyToEdge, boolean clone) { this.controller = controller; ! this.applyToEdge = applyToEdge; this.clone = clone; } --- 31,57 ---- */ public class EdgeContextMenu extends JPopupMenu implements ResourceListener { + + public static final int ASSIGN_ELEMENT = 0; + public static final int ASSIGN_TYPE = 1; + public static final int ASSIGN_DEFAULT = 2; private final class AssignControllerListener implements ActionListener { private Facet controller; ! private int applyTo; private boolean clone = false; + private boolean showGUI = true; ! public AssignControllerListener(Facet controller, int applyTo, boolean clone) { this.controller = controller; ! this.applyTo = applyTo; ! this.clone = clone; ! } ! ! public AssignControllerListener(Facet controller, int applyTo, boolean clone, boolean showGUI) { ! this.controller = controller; ! this.applyTo = applyTo; this.clone = clone; + this.showGUI = showGUI; } *************** *** 89,114 **** } if (newController instanceof EdgePainter) { EdgePainter painter = (EdgePainter) newController; ! if (applyToEdge) { graphlPane.getFacetRegistry().setPainterForEdge(currentEdge, painter); } ! else { graphlPane.getFacetRegistry().setPainterForEdgeType(currentEdge.getType(), painter); } } else if (newController instanceof EdgeLayouter) { EdgeLayouter layouter = (EdgeLayouter) newController; ! if (applyToEdge) { graphlPane.getFacetRegistry().setLayouterForEdge(currentEdge, layouter); } ! else { graphlPane.getFacetRegistry().setLayouterForEdgeType(currentEdge.getType(), layouter); } } - if (newController.hasVisualController()) { - int result = GenericDialog.showModalDialog(null, newController.getVisualController(), "Controller Properties"); - } graphlPane.getGraph().notifyLayoutUpdated(); graphlPane.repaint(); --- 65,98 ---- } + if (showGUI && newController.hasVisualController()) { + int result = GenericDialog.showModalDialog(null, newController.getVisualController(), "Controller Properties"); + if (result != GenericDialog.OK_OPTION) return; + } + if (newController instanceof EdgePainter) { EdgePainter painter = (EdgePainter) newController; ! if (applyTo == ASSIGN_ELEMENT) { graphlPane.getFacetRegistry().setPainterForEdge(currentEdge, painter); } ! else if (applyTo == ASSIGN_TYPE) { graphlPane.getFacetRegistry().setPainterForEdgeType(currentEdge.getType(), painter); } + else { + graphlPane.getFacetRegistry().setDefaultEdgePainter(painter); + } } else if (newController instanceof EdgeLayouter) { EdgeLayouter layouter = (EdgeLayouter) newController; ! if (applyTo == ASSIGN_ELEMENT) { graphlPane.getFacetRegistry().setLayouterForEdge(currentEdge, layouter); } ! else if (applyTo == ASSIGN_TYPE) { graphlPane.getFacetRegistry().setLayouterForEdgeType(currentEdge.getType(), layouter); } + else { + graphlPane.getFacetRegistry().setDefaultEdgeLayouter(layouter); + } } graphlPane.getGraph().notifyLayoutUpdated(); graphlPane.repaint(); *************** *** 223,227 **** } ! return buildControllerSubMenu(defaultController, currentController, availableControllers, true); } --- 207,211 ---- } ! return buildControllerSubMenu(defaultController, currentController, availableControllers, ASSIGN_ELEMENT); } *************** *** 251,255 **** } ! return buildControllerSubMenu(defaultController, currentController, availableControllers, false); } --- 235,264 ---- } ! return buildControllerSubMenu(defaultController, currentController, availableControllers, ASSIGN_TYPE); ! ! } ! ! private JMenu buildDefaultControllerSubMenu(int controllerType) { ! ! Facet currentController = null; ! Iterator availableControllers = null; ! ! switch (controllerType) { ! case DISPLAY: ! currentController = graphlPane.getFacetRegistry().getDefaultEdgePainter(); ! availableControllers = graphlPane.getFacetRegistry().getAvailableEdgePainters().iterator(); ! break; ! ! case LAYOUT: ! currentController = graphlPane.getFacetRegistry().getDefaultEdgeLayouter(); ! availableControllers = graphlPane.getFacetRegistry().getAvailableEdgeLayouters().iterator(); ! break; ! ! default: ! System.err.println("ERROR: unknown controller type in EdgeContextMenu.buildTypeControllerSubMenu()"); ! return null; ! } ! ! return buildControllerSubMenu(null, currentController, availableControllers, ASSIGN_DEFAULT); } *************** *** 261,276 **** * @return */ ! protected JMenu buildControllerSubMenu(Facet defaultController, Facet currentController, Iterator availableControllers, boolean applyToEdge) { JMenu menu = new JMenu(); - JMenuItem defaultItem = new JRadioButtonMenuItem(); ! defaultItem.setText("Default (" + defaultController.getName() + ")"); ! defaultItem.setSelected(currentController == defaultController); ! int controllerType = DISPLAY; ! if (defaultController instanceof EdgeLayouter) { ! controllerType = LAYOUT; ! } ! defaultItem.addActionListener(new AssignDefaultListener(applyToEdge, controllerType)); ! menu.add(defaultItem); if (currentController != null && currentController != defaultController) { --- 270,284 ---- * @return */ ! protected JMenu buildControllerSubMenu(Facet defaultController, Facet currentController, Iterator availableControllers, int applyTo) { JMenu menu = new JMenu(); ! if (defaultController != null) { ! JMenuItem defaultItem = new JRadioButtonMenuItem(); ! ! defaultItem.setText("Default (" + defaultController.getName() + ")"); ! defaultItem.setSelected((currentController == null) || (currentController == defaultController)); ! defaultItem.addActionListener(new AssignControllerListener(defaultController, applyTo, false, false)); ! menu.add(defaultItem); ! } if (currentController != null && currentController != defaultController) { *************** *** 282,286 **** currentItem.setText(name); currentItem.setSelected(true); ! currentItem.addActionListener(new AssignControllerListener(currentController, applyToEdge, false)); menu.add(currentItem); --- 290,294 ---- currentItem.setText(name); currentItem.setSelected(true); ! currentItem.addActionListener(new AssignControllerListener(currentController, applyTo, false)); menu.add(currentItem); *************** *** 291,295 **** while (availableControllers.hasNext()) { Facet controller = (Facet) availableControllers.next(); ! menu.add(createEdgeControllerMenuItem(controller, applyToEdge)); } --- 299,303 ---- while (availableControllers.hasNext()) { Facet controller = (Facet) availableControllers.next(); ! menu.add(createEdgeControllerMenuItem(controller, applyTo)); } *************** *** 301,305 **** * @return */ ! private JMenuItem createEdgeControllerMenuItem(Facet controller, boolean applyToEdge) { String name = controller.getName(); --- 309,313 ---- * @return */ ! private JMenuItem createEdgeControllerMenuItem(Facet controller, int applyTo) { String name = controller.getName(); *************** *** 309,313 **** JMenuItem item = new JMenuItem(name); ! item.addActionListener(new AssignControllerListener(controller, applyToEdge, true )); return item; --- 317,321 ---- JMenuItem item = new JMenuItem(name); ! item.addActionListener(new AssignControllerListener(controller, applyTo, true )); return item; *************** *** 335,338 **** --- 343,349 ---- menu.add(typeMenu); } + JMenu defaultMenu = buildDefaultControllerSubMenu(controllerType); + defaultMenu.setText("Default"); + menu.add(defaultMenu); return menu; Index: NodeContextMenu.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/NodeContextMenu.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** NodeContextMenu.java 21 Oct 2004 16:00:45 -0000 1.15 --- NodeContextMenu.java 30 Nov 2004 09:38:33 -0000 1.16 *************** *** 32,81 **** public class NodeContextMenu extends JPopupMenu implements ResourceListener { ! private final class AssignDefaultListener implements ActionListener { ! private boolean applyToNode = false; ! private int controllerType; ! ! public AssignDefaultListener(boolean applyToNode, int controllerType) { ! this.applyToNode = applyToNode; ! this.controllerType = controllerType; ! } ! ! public void actionPerformed(ActionEvent e) { ! switch (controllerType) { ! case DISPLAY: ! if (applyToNode) { ! graphlPane.getFacetRegistry().setPainterForNode(currentNode, null); ! } ! else { ! graphlPane.getFacetRegistry().setPainterForNodeType(currentNode.getType(), null); ! } ! break; ! ! case LAYOUT: ! if (applyToNode) { ! graphlPane.getFacetRegistry().setLayouterForNode(currentNode, null); ! } ! else { ! graphlPane.getFacetRegistry().setLayouterForNodeType(currentNode.getType(), null); ! } ! break; ! ! default: ! break; ! } ! graphlPane.getGraph().notifyLayoutUpdated(); ! graphlPane.repaint(); ! } ! } private final class AssignFacetListener implements ActionListener { private Facet facet; ! private boolean applyToNode; private boolean clone = false; ! public AssignFacetListener(Facet facet, boolean applyToNode, boolean clone) { this.facet = facet; ! this.applyToNode = applyToNode; this.clone = clone; } --- 32,55 ---- public class NodeContextMenu extends JPopupMenu implements ResourceListener { ! public static final int ASSIGN_ELEMENT = 0; ! public static final int ASSIGN_TYPE = 1; ! public static final int ASSIGN_DEFAULT = 2; ! private final class AssignFacetListener implements ActionListener { private Facet facet; ! private int applyTo; private boolean clone = false; + private boolean showGUI = true; ! public AssignFacetListener(Facet facet, int applyTo, boolean clone) { ! this(facet, applyTo, clone, true); ! } ! ! public AssignFacetListener(Facet facet, int applyTo, boolean clone, boolean showGUI) { this.facet = facet; ! this.applyTo = applyTo; this.clone = clone; + this.showGUI = showGUI; } *************** *** 89,114 **** } if (newFacet instanceof NodePainter) { NodePainter painter = (NodePainter) newFacet; ! if (applyToNode) { graphlPane.getFacetRegistry().setPainterForNode(currentNode, painter); } ! else { graphlPane.getFacetRegistry().setPainterForNodeType(currentNode.getType(), painter); } } else if (newFacet instanceof NodeLayouter) { NodeLayouter layouter = (NodeLayouter) newFacet; ! if (applyToNode) { graphlPane.getFacetRegistry().setLayouterForNode(currentNode, layouter); } ! else { graphlPane.getFacetRegistry().setLayouterForNodeType(currentNode.getType(), layouter); } } - if (newFacet.hasVisualController()) { - int result = GenericDialog.showModalDialog(null, newFacet.getVisualController(), "Controller Properties"); - } graphlPane.getGraph().notifyLayoutUpdated(); graphlPane.repaint(); --- 63,98 ---- } + if (showGUI && newFacet.hasVisualController()) { + graphlPane.pauseLayouter(); + int result = GenericDialog.showModalDialog(null, newFacet.getVisualController(), "Controller Properties"); + graphlPane.resumeLayouter(); + if (result != GenericDialog.OK_OPTION) return; + } + if (newFacet instanceof NodePainter) { NodePainter painter = (NodePainter) newFacet; ! if (applyTo == ASSIGN_ELEMENT) { graphlPane.getFacetRegistry().setPainterForNode(currentNode, painter); } ! else if (applyTo == ASSIGN_TYPE) { graphlPane.getFacetRegistry().setPainterForNodeType(currentNode.getType(), painter); } + else if (applyTo == ASSIGN_DEFAULT) { + graphlPane.getFacetRegistry().setDefaultNodePainter(painter); + } } else if (newFacet instanceof NodeLayouter) { NodeLayouter layouter = (NodeLayouter) newFacet; ! if (applyTo == ASSIGN_ELEMENT) { graphlPane.getFacetRegistry().setLayouterForNode(currentNode, layouter); } ! else if (applyTo == ASSIGN_TYPE) { graphlPane.getFacetRegistry().setLayouterForNodeType(currentNode.getType(), layouter); } + else if (applyTo == ASSIGN_DEFAULT) { + graphlPane.getFacetRegistry().setDefaultNodeLayouter(layouter); + } } graphlPane.getGraph().notifyLayoutUpdated(); graphlPane.repaint(); *************** *** 154,158 **** // TODO (1) implement node typing mechanism (2h) ! Set types = graphlPane.getRegisteredEdgeTypes(); for (Iterator iter = types.iterator(); iter.hasNext();) { String descriptor = (String) iter.next(); --- 138,142 ---- // TODO (1) implement node typing mechanism (2h) ! Set types = graphlPane.getRegisteredNodeTypes(); for (Iterator iter = types.iterator(); iter.hasNext();) { String descriptor = (String) iter.next(); *************** *** 175,181 **** while (vocabs.hasMoreElements()) { Vocabulary vocab = (Vocabulary) vocabs.nextElement(); ! ResourceMenu vmenu = new ResourceMenu(vocab.getName(), vocab.getPropertyGroups(), node.getType(), this, false); ! typeSubMenu.add(vmenu); ! if (vmenu.isOneSelected()) hasCustomType = false; } --- 159,167 ---- while (vocabs.hasMoreElements()) { Vocabulary vocab = (Vocabulary) vocabs.nextElement(); ! if (vocab.getResourceGroups().hasMoreElements()) { ! ResourceMenu vmenu = new ResourceMenu(vocab.getName(), vocab.getResourceGroups(), node.getType(), this, false); ! typeSubMenu.add(vmenu); ! if (vmenu.isOneSelected()) hasCustomType = false; ! } } *************** *** 224,228 **** } ! return buildControllerSubMenu(defaultController, currentController, availableControllers, true); } --- 210,214 ---- } ! return buildControllerSubMenu(defaultController, currentController, availableControllers, ASSIGN_ELEMENT); } *************** *** 254,258 **** } ! return buildControllerSubMenu(defaultController, currentController, availableControllers, false); } --- 240,269 ---- } ! return buildControllerSubMenu(defaultController, currentController, availableControllers, ASSIGN_TYPE); ! ! } ! ! private JMenu buildDefaultControllerSubMenu(int controllerType) { ! ! Facet currentController = null; ! Iterator availableControllers = null; ! ! switch (controllerType) { ! case DISPLAY: ! currentController = graphlPane.getFacetRegistry().getDefaultNodePainter(); ! availableControllers = graphlPane.getFacetRegistry().getAvailableNodePainters().iterator(); ! break; ! ! case LAYOUT: ! currentController = graphlPane.getFacetRegistry().getDefaultNodeLayouter(); ! availableControllers = graphlPane.getFacetRegistry().getAvailableNodeLayouters().iterator(); ! break; ! ! default: ! System.err.println("ERROR: unknown facet type in NodeContextMenu.buildTypeControllerSubMenu()"); ! return null; ! } ! ! return buildControllerSubMenu(null, currentController, availableControllers, ASSIGN_DEFAULT); } *************** *** 264,279 **** * @return */ ! protected JMenu buildControllerSubMenu(Facet defaultController, Facet currentController, Iterator availableControllers, boolean applyToNode) { JMenu menu = new JMenu(); - JMenuItem defaultItem = new JRadioButtonMenuItem(); ! defaultItem.setText("Default (" + defaultController.getName() + ")"); ! defaultItem.setSelected(currentController == defaultController); ! int controllerType = DISPLAY; ! if (defaultController instanceof NodeLayouter) { ! controllerType = LAYOUT; ! } ! defaultItem.addActionListener(new AssignDefaultListener(applyToNode, controllerType)); ! menu.add(defaultItem); if (currentController != null && currentController != defaultController) { --- 275,289 ---- * @return */ ! protected JMenu buildControllerSubMenu(Facet defaultController, Facet currentController, Iterator availableControllers, int applyTo) { JMenu menu = new JMenu(); ! if (defaultController != null) { ! JMenuItem defaultItem = new JRadioButtonMenuItem(); ! ! defaultItem.setText("Default (" + defaultController.getName() + ")"); ! defaultItem.setSelected((currentController == null) || (currentController == defaultController)); ! defaultItem.addActionListener(new AssignFacetListener(defaultController, applyTo, false, false)); ! menu.add(defaultItem); ! } if (currentController != null && currentController != defaultController) { *************** *** 285,289 **** currentItem.setText(name); currentItem.setSelected(true); ! currentItem.addActionListener(new AssignFacetListener(currentController, applyToNode, false)); menu.add(currentItem); --- 295,299 ---- currentItem.setText(name); currentItem.setSelected(true); ! currentItem.addActionListener(new AssignFacetListener(currentController, applyTo, false)); menu.add(currentItem); *************** *** 294,298 **** while (availableControllers.hasNext()) { Facet controller = (Facet) availableControllers.next(); ! menu.add(createNodeControllerMenuItem(controller, applyToNode)); } --- 304,308 ---- while (availableControllers.hasNext()) { Facet controller = (Facet) availableControllers.next(); ! menu.add(createNodeControllerMenuItem(controller, applyTo)); } *************** *** 304,308 **** * @return */ ! private JMenuItem createNodeControllerMenuItem(Facet controller, boolean applyToNode) { String name = controller.getName(); --- 314,318 ---- * @return */ ! private JMenuItem createNodeControllerMenuItem(Facet controller, int applyTo) { String name = controller.getName(); *************** *** 313,317 **** JMenuItem item = new JMenuItem(name); // TODO (2,3h) implement instantiation of facets in the GUI, so existing facets can be assigned to other elements + types. ! item.addActionListener(new AssignFacetListener(controller, applyToNode, controller.hasVisualController() )); return item; --- 323,327 ---- JMenuItem item = new JMenuItem(name); // TODO (2,3h) implement instantiation of facets in the GUI, so existing facets can be assigned to other elements + types. ! item.addActionListener(new AssignFacetListener(controller, applyTo, controller.hasVisualController() )); return item; *************** *** 339,342 **** --- 349,355 ---- menu.add(typeMenu); } + JMenu defaultMenu = buildDefaultControllerSubMenu(controllerType); + defaultMenu.setText("Default"); + menu.add(defaultMenu); return menu; Index: OpenURLPanel.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/OpenURLPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OpenURLPanel.java 4 Oct 2004 10:21:02 -0000 1.2 --- OpenURLPanel.java 30 Nov 2004 09:38:33 -0000 1.3 *************** *** 49,53 **** consGridBagConstraints5.weightx = 0.0D; consGridBagConstraints5.fill = java.awt.GridBagConstraints.HORIZONTAL; ! consGridBagConstraints5.insets = new java.awt.Insets(0,0,5,0); consGridBagConstraints6.gridx = 4; consGridBagConstraints6.gridy = 1; --- 49,53 ---- consGridBagConstraints5.weightx = 0.0D; consGridBagConstraints5.fill = java.awt.GridBagConstraints.HORIZONTAL; ! consGridBagConstraints5.insets = new java.awt.Insets(5,2,5,2); consGridBagConstraints6.gridx = 4; consGridBagConstraints6.gridy = 1; *************** *** 60,64 **** consGridBagConstraints1.gridy = 0; consGridBagConstraints1.anchor = java.awt.GridBagConstraints.EAST; ! consGridBagConstraints1.insets = new java.awt.Insets(5,5,0,0); consGridBagConstraints2.gridx = 1; consGridBagConstraints2.gridy = 0; --- 60,64 ---- consGridBagConstraints1.gridy = 0; consGridBagConstraints1.anchor = java.awt.GridBagConstraints.EAST; ! consGridBagConstraints1.insets = new java.awt.Insets(5,5,0,2); consGridBagConstraints2.gridx = 1; consGridBagConstraints2.gridy = 0; *************** *** 68,77 **** consGridBagConstraints2.ipadx = 2; consGridBagConstraints2.ipady = 2; ! consGridBagConstraints2.insets = new java.awt.Insets(5,0,0,5); ! consGridBagConstraints4.insets = new java.awt.Insets(0,0,5,0); consGridBagConstraints6.weightx = 1.0D; consGridBagConstraints6.anchor = java.awt.GridBagConstraints.WEST; ! consGridBagConstraints6.insets = new java.awt.Insets(0,0,5,5); ! consGridBagConstraints3.insets = new java.awt.Insets(0,0,5,0); this.setLayout(new java.awt.GridBagLayout()); this.add(getJLabel(), consGridBagConstraints1); --- 68,77 ---- consGridBagConstraints2.ipadx = 2; consGridBagConstraints2.ipady = 2; ! consGridBagConstraints2.insets = new java.awt.Insets(5,4,0,5); ! consGridBagConstraints4.insets = new java.awt.Insets(5,0,5,0); consGridBagConstraints6.weightx = 1.0D; consGridBagConstraints6.anchor = java.awt.GridBagConstraints.WEST; ! consGridBagConstraints6.insets = new java.awt.Insets(5,0,5,5); ! consGridBagConstraints3.insets = new java.awt.Insets(5,0,5,0); this.setLayout(new java.awt.GridBagLayout()); this.add(getJLabel(), consGridBagConstraints1); *************** *** 112,115 **** --- 112,117 ---- urlField = new javax.swing.JTextField(); urlField.setText(""); + urlField.setPreferredSize(new java.awt.Dimension(200,20)); + urlField.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.black,1)); } return urlField; *************** *** 165,169 **** reloadDurationField.setText("20"); reloadDurationField.setColumns(3); ! reloadDurationField.setMinimumSize(new java.awt.Dimension(37,20)); } return reloadDurationField; --- 167,172 ---- reloadDurationField.setText("20"); reloadDurationField.setColumns(3); ! reloadDurationField.setMinimumSize(new java.awt.Dimension(25,20)); ! reloadDurationField.setPreferredSize(new java.awt.Dimension(25,20)); } return reloadDurationField; |
|
From: Flo L. <fl...@us...> - 2004-11-30 09:38:43
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26998/src/org/mediavirus/graphl/view Modified Files: FacetRegistry.java SimpleFacetRegistry.java AbstractFacet.java Facet.java GraphFacetRegistry.java Log Message: - FEATURE: added menu to choose/switch configuration at runtime - FEATURE: extension of config.rdf to include two sample configurations - FEATURE: extended built-in vocabularies - FEATURE: RepulsionNodeLayouter has configurable strength - BUG: fixed context menu for macs - BUG: fixed cloning of BoxNodePainter - API: added Edge.invert() - API: added FacetRegistry.updateFacets() - REFACTOR: moved default facet selection to context menu - REFACTOR: removed GraphlPane.getScreenPointForNode() calls (use only graph coords) - MISC: misc. minor bugfixes and restructuring - DOC: added first package.html file Index: SimpleFacetRegistry.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view/SimpleFacetRegistry.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SimpleFacetRegistry.java 21 Oct 2004 16:00:47 -0000 1.6 --- SimpleFacetRegistry.java 30 Nov 2004 09:38:33 -0000 1.7 *************** *** 265,269 **** /* ! * Overrides @see org.mediavirus.graphl.FacetRegistry#getEdgeLayouterForType(java.lang.String) */ public EdgeLayouter getEdgeLayouterForType(String type) { --- 265,269 ---- /* ! * @see org.mediavirus.graphl.FacetRegistry#getEdgeLayouterForType(java.lang.String) */ public EdgeLayouter getEdgeLayouterForType(String type) { *************** *** 275,279 **** /* ! * Overrides @see org.mediavirus.graphl.FacetRegistry#getDefaultEdgeLayouter() */ public EdgeLayouter getDefaultEdgeLayouter() { --- 275,279 ---- /* ! * @see org.mediavirus.graphl.FacetRegistry#getDefaultEdgeLayouter() */ public EdgeLayouter getDefaultEdgeLayouter() { *************** *** 282,286 **** /* ! * Overrides @see org.mediavirus.graphl.FacetRegistry#registerEdgeLayouter(org.mediavirus.graphl.view.EdgeLayouter) */ public void registerNodeLayouter(NodeLayouter layouter) { --- 282,286 ---- /* ! * @see org.mediavirus.graphl.FacetRegistry#registerEdgeLayouter(org.mediavirus.graphl.view.EdgeLayouter) */ public void registerNodeLayouter(NodeLayouter layouter) { *************** *** 290,294 **** /* ! * Overrides @see org.mediavirus.graphl.FacetRegistry#unregisterNodeLayouter(org.mediavirus.graphl.view.NodeLayouter) */ public void unregisterNodeLayouter(NodeLayouter layouter) { --- 290,294 ---- /* ! * @see org.mediavirus.graphl.FacetRegistry#unregisterNodeLayouter(org.mediavirus.graphl.view.NodeLayouter) */ public void unregisterNodeLayouter(NodeLayouter layouter) { *************** *** 298,302 **** /* ! * Overrides @see org.mediavirus.graphl.FacetRegistry#getAvailableNodeLayouters() */ public Vector getAvailableNodeLayouters() { --- 298,302 ---- /* ! * @see org.mediavirus.graphl.FacetRegistry#getAvailableNodeLayouters() */ public Vector getAvailableNodeLayouters() { *************** *** 306,310 **** /* ! * Overrides @see org.mediavirus.graphl.FacetRegistry#setDefaultNodeLayouter(org.mediavirus.graphl.view.NodeLayouter) */ public void setDefaultNodeLayouter(NodeLayouter layouter) { --- 306,310 ---- /* ! * @see org.mediavirus.graphl.FacetRegistry#setDefaultNodeLayouter(org.mediavirus.graphl.view.NodeLayouter) */ public void setDefaultNodeLayouter(NodeLayouter layouter) { *************** *** 321,325 **** /* ! * Overrides @see org.mediavirus.graphl.FacetRegistry#setNodeLayouterForType(org.mediavirus.graphl.view.NodeLayouter, java.lang.String) */ public void setLayouterForNodeType(String type, NodeLayouter layouter) { --- 321,325 ---- /* ! * @see org.mediavirus.graphl.FacetRegistry#setNodeLayouterForType(org.mediavirus.graphl.view.NodeLayouter, java.lang.String) */ public void setLayouterForNodeType(String type, NodeLayouter layouter) { *************** *** 350,354 **** /* ! * Overrides @see org.mediavirus.graphl.FacetRegistry#getNodeLayouterForType(java.lang.String) */ public NodeLayouter getNodeLayouterForType(String type) { --- 350,354 ---- /* ! * @see org.mediavirus.graphl.FacetRegistry#getNodeLayouterForType(java.lang.String) */ public NodeLayouter getNodeLayouterForType(String type) { *************** *** 361,365 **** /* ! * Overrides @see org.mediavirus.graphl.FacetRegistry#getDefaultNodeLayouter() */ public NodeLayouter getDefaultNodeLayouter() { --- 361,365 ---- /* ! * @see org.mediavirus.graphl.FacetRegistry#getDefaultNodeLayouter() */ public NodeLayouter getDefaultNodeLayouter() { *************** *** 368,372 **** /* ! * Overrides @see org.mediavirus.graphl.FacetRegistry#setPainterForEdge(org.mediavirus.graphl.graph.Edge, org.mediavirus.graphl.view.EdgePainter) */ public void setPainterForEdge(Edge edge, EdgePainter p) { --- 368,372 ---- /* ! * @see org.mediavirus.graphl.FacetRegistry#setPainterForEdge(org.mediavirus.graphl.graph.Edge, org.mediavirus.graphl.view.EdgePainter) */ public void setPainterForEdge(Edge edge, EdgePainter p) { *************** *** 383,387 **** /* ! * Overrides @see org.mediavirus.graphl.FacetRegistry#setPainterForNode(org.mediavirus.graphl.graph.Node, org.mediavirus.graphl.view.NodePainter) */ public void setPainterForNode(Node node, NodePainter p) { --- 383,387 ---- /* ! * @see org.mediavirus.graphl.FacetRegistry#setPainterForNode(org.mediavirus.graphl.graph.Node, org.mediavirus.graphl.view.NodePainter) */ public void setPainterForNode(Node node, NodePainter p) { *************** *** 398,402 **** /* ! * Overrides @see org.mediavirus.graphl.FacetRegistry#setLayouterForEdge(org.mediavirus.graphl.graph.Edge, org.mediavirus.graphl.layout.EdgeLayouter) */ public void setLayouterForEdge(Edge edge, EdgeLayouter layouter) { --- 398,402 ---- /* ! * @see org.mediavirus.graphl.FacetRegistry#setLayouterForEdge(org.mediavirus.graphl.graph.Edge, org.mediavirus.graphl.layout.EdgeLayouter) */ public void setLayouterForEdge(Edge edge, EdgeLayouter layouter) { *************** *** 413,417 **** /* ! * Overrides @see org.mediavirus.graphl.FacetRegistry#setLayouterForNode(org.mediavirus.graphl.graph.Node, org.mediavirus.graphl.layout.NodeLayouter) */ public void setLayouterForNode(Node node, NodeLayouter layouter) { --- 413,417 ---- /* ! * @see org.mediavirus.graphl.FacetRegistry#setLayouterForNode(org.mediavirus.graphl.graph.Node, org.mediavirus.graphl.layout.NodeLayouter) */ public void setLayouterForNode(Node node, NodeLayouter layouter) { *************** *** 428,432 **** /* ! * Overrides @see org.mediavirus.graphl.view.FacetRegistry#updateEdgeFacets(org.mediavirus.graphl.graph.Edge) */ public void updateEdgeFacets(Edge edge) { --- 428,432 ---- /* ! * @see org.mediavirus.graphl.view.FacetRegistry#updateEdgeFacets(org.mediavirus.graphl.graph.Edge) */ public void updateEdgeFacets(Edge edge) { *************** *** 455,459 **** /* ! * Overrides @see org.mediavirus.graphl.view.FacetRegistry#updateNodeFacets(org.mediavirus.graphl.graph.Node) */ public void updateNodeFacets(Node node) { --- 455,459 ---- /* ! * @see org.mediavirus.graphl.view.FacetRegistry#updateNodeFacets(org.mediavirus.graphl.graph.Node) */ public void updateNodeFacets(Node node) { *************** *** 480,482 **** --- 480,491 ---- } } + + public void updateFacets(Graph graph) { + for (Iterator nodes = graph.getNodes().iterator(); nodes.hasNext();) { + updateNodeFacets((Node)nodes.next()); + } + for (Iterator edges = graph.getEdges().iterator(); edges.hasNext();) { + updateEdgeFacets((Edge)edges.next()); + } + } } Index: Facet.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view/Facet.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Facet.java 27 Oct 2004 10:55:41 -0000 1.4 --- Facet.java 30 Nov 2004 09:38:33 -0000 1.5 *************** *** 7,11 **** import java.util.Collection; - import java.util.Set; import javax.swing.JComponent; --- 7,10 ---- Index: FacetRegistry.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view/FacetRegistry.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FacetRegistry.java 21 Oct 2004 16:00:47 -0000 1.4 --- FacetRegistry.java 30 Nov 2004 09:38:33 -0000 1.5 *************** *** 20,24 **** */ public interface FacetRegistry { ! public void registerEdgePainter(EdgePainter painter); --- 20,25 ---- */ public interface FacetRegistry { ! ! public void registerEdgePainter(EdgePainter painter); *************** *** 107,110 **** --- 108,116 ---- public void updateNodeFacets(Node node); + /** + * @param graph + */ + public void updateFacets(Graph graph); + // public NodeLayouter getNodeLayouter(Node node); Index: GraphFacetRegistry.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view/GraphFacetRegistry.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GraphFacetRegistry.java 14 Oct 2004 13:03:02 -0000 1.6 --- GraphFacetRegistry.java 30 Nov 2004 09:38:33 -0000 1.7 *************** *** 49,52 **** --- 49,62 ---- clearRegistry(); if (registryNode != null) { // TODO (3) && graph.containsNode(registryNode) + for (Iterator baseNodes = registryNode.getNeighbours("http://www.mediavirus.org/graphl#basedOn",true).iterator(); baseNodes.hasNext();) { + Node baseNode = (Node) baseNodes.next(); + processRegistryNode(baseNode); + } + processRegistryNode(registryNode); + } + } + + private void processRegistryNode(Node registryNode) { + if (registryNode != null) { if (!registryNode.hasType("http://www.mediavirus.org/graphl#Configuration")) return; Index: AbstractFacet.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view/AbstractFacet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbstractFacet.java 27 Oct 2004 10:55:41 -0000 1.5 --- AbstractFacet.java 30 Nov 2004 09:38:33 -0000 1.6 *************** *** 5,8 **** --- 5,9 ---- package org.mediavirus.graphl.view; + import java.awt.Dimension; import java.awt.Stroke; import java.beans.BeanInfo; *************** *** 81,84 **** --- 82,87 ---- sheet.readFromObject(this); + + sheet.setPreferredSize(new Dimension(300,200)); // everytime a property change, update the button with it |
|
From: Flo L. <fl...@us...> - 2004-11-30 09:38:43
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26998/src/org/mediavirus/graphl/interaction Modified Files: GraphlManipulator.java Log Message: - FEATURE: added menu to choose/switch configuration at runtime - FEATURE: extension of config.rdf to include two sample configurations - FEATURE: extended built-in vocabularies - FEATURE: RepulsionNodeLayouter has configurable strength - BUG: fixed context menu for macs - BUG: fixed cloning of BoxNodePainter - API: added Edge.invert() - API: added FacetRegistry.updateFacets() - REFACTOR: moved default facet selection to context menu - REFACTOR: removed GraphlPane.getScreenPointForNode() calls (use only graph coords) - MISC: misc. minor bugfixes and restructuring - DOC: added first package.html file Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GraphlManipulator.java 21 Oct 2004 16:00:49 -0000 1.6 --- GraphlManipulator.java 30 Nov 2004 09:38:34 -0000 1.7 *************** *** 26,30 **** /** * @author Flo Ledermann <led...@im...> - * */ public class GraphlManipulator extends AbstractManipulator implements NodeEditingController{ --- 26,29 ---- *************** *** 68,72 **** Edge overEdge = graphPane.getNearestEdge(p); ! if (e.getModifiers() == MouseEvent.BUTTON1_MASK) { dragStart = e.getPoint(); --- 67,81 ---- Edge overEdge = graphPane.getNearestEdge(p); ! if (e.isPopupTrigger()) { ! if (overNode != null) { ! graphPane.pauseLayouter(); ! nodeMenu.show(e.getX(), e.getY(), overNode); ! } ! else if(overEdge != null) { ! graphPane.pauseLayouter(); ! edgeMenu.show(e.getX(), e.getY(), overEdge); ! } ! } ! else if (e.getButton() == MouseEvent.BUTTON1) { dragStart = e.getPoint(); *************** *** 84,90 **** dragNode.setDragging(true); lastPosition=e.getPoint(); ! Point nodeScreenPoint=graphPane.getScreenPointForNode(dragNode); ! grabPoint=new Point(p.x-nodeScreenPoint.x,p.y-nodeScreenPoint.y); ! graphCursor=graphPane.getCursor(); graphPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } --- 93,98 ---- dragNode.setDragging(true); lastPosition=e.getPoint(); ! grabPoint = new Point(p.x - (int)dragNode.getCenterX(), p.y - (int)dragNode.getCenterY()); ! graphCursor = graphPane.getCursor(); graphPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } *************** *** 100,113 **** } } - else if (e.getModifiers() == MouseEvent.BUTTON3_MASK) { - if (overNode != null) { - graphPane.pauseLayouter(); - nodeMenu.show(e.getX(), e.getY(), overNode); - } - else if(overEdge != null) { - graphPane.pauseLayouter(); - edgeMenu.show(e.getX(), e.getY(), overEdge); - } - } } --- 108,111 ---- *************** *** 116,122 **** graphPane.screenToGraphPoint(e.getPoint(),p); Node clickNode = graphPane.getNodeAtPoint(p); ! RDFEdge clickEdge = (RDFEdge)graphPane.getNearestEdge(p); ! if ((e.getWhen() - lastClick) < 300) { if ((clickNode == null) && (clickEdge == null)) { clickNode = graphPane.getGraph().createNode(); --- 114,120 ---- graphPane.screenToGraphPoint(e.getPoint(),p); Node clickNode = graphPane.getNodeAtPoint(p); ! Edge clickEdge = graphPane.getNearestEdge(p); ! if ((e.getWhen() - lastClick) < 300) { if ((clickNode == null) && (clickEdge == null)) { clickNode = graphPane.getGraph().createNode(); *************** *** 169,173 **** public void mouseReleased(MouseEvent e) { ! if (dragNode!=null) { moveDraggedNode(e.getPoint()); dragNode.setDragging(false); --- 167,186 ---- public void mouseReleased(MouseEvent e) { ! if (e.isPopupTrigger()) { ! Point p = new Point(); ! graphPane.screenToGraphPoint(e.getPoint(),p); ! Node overNode = graphPane.getNodeAtPoint(p); ! Edge overEdge = graphPane.getNearestEdge(p); ! ! if (overNode != null) { ! graphPane.pauseLayouter(); ! nodeMenu.show(e.getX(), e.getY(), overNode); ! } ! else if(overEdge != null) { ! graphPane.pauseLayouter(); ! edgeMenu.show(e.getX(), e.getY(), overEdge); ! } ! } ! else if (dragNode!=null) { moveDraggedNode(e.getPoint()); dragNode.setDragging(false); |
|
From: Flo L. <fl...@us...> - 2004-11-30 09:38:42
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26998/src/org/mediavirus/graphl/layout Modified Files: RepulsionNodeLayouter.java AbsoluteNodeLayouter.java Layouter.java GraphlLayoutStrategy.java Log Message: - FEATURE: added menu to choose/switch configuration at runtime - FEATURE: extension of config.rdf to include two sample configurations - FEATURE: extended built-in vocabularies - FEATURE: RepulsionNodeLayouter has configurable strength - BUG: fixed context menu for macs - BUG: fixed cloning of BoxNodePainter - API: added Edge.invert() - API: added FacetRegistry.updateFacets() - REFACTOR: moved default facet selection to context menu - REFACTOR: removed GraphlPane.getScreenPointForNode() calls (use only graph coords) - MISC: misc. minor bugfixes and restructuring - DOC: added first package.html file Index: GraphlLayoutStrategy.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/GraphlLayoutStrategy.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GraphlLayoutStrategy.java 21 Oct 2004 16:00:48 -0000 1.9 --- GraphlLayoutStrategy.java 30 Nov 2004 09:38:32 -0000 1.10 *************** *** 96,100 **** } long layoutDuration = System.currentTimeMillis()-layoutStartTime; ! if (layoutDuration > 0) System.out.println("layout time: " + layoutDuration + " FPS: " + 1000.0/layoutDuration); } /** --- 96,100 ---- } long layoutDuration = System.currentTimeMillis()-layoutStartTime; ! //if (layoutDuration > 0) System.out.println("layout time: " + layoutDuration + " FPS: " + 1000.0/layoutDuration); } /** Index: RepulsionNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/RepulsionNodeLayouter.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RepulsionNodeLayouter.java 27 Oct 2004 10:55:40 -0000 1.6 --- RepulsionNodeLayouter.java 30 Nov 2004 09:38:32 -0000 1.7 *************** *** 7,12 **** import java.util.Iterator; - import javax.swing.JComponent; - import org.mediavirus.graphl.graph.Node; import org.mediavirus.graphl.layout.GraphlLayoutStrategy.GraphManager; --- 7,10 ---- *************** *** 20,28 **** public class RepulsionNodeLayouter extends AbstractFacet implements NodeLayouter { ! public static final int CONSTANT = 0; ! public static final int CALCULATED = 1; ! ! private int mode = CONSTANT; ! private double constantRepulsion = 1.0; /* --- 18,22 ---- public class RepulsionNodeLayouter extends AbstractFacet implements NodeLayouter { ! float strength = 1.0f; /* *************** *** 36,40 **** //TODO (2) where do we get the repulsion of 2nd node? ! double factor=100.0*constantRepulsion*constantRepulsion; //*node2.getRepulsion(); //*rigidity; for (Iterator nodes = getAssignedElements().iterator(); nodes.hasNext();) { --- 30,34 ---- //TODO (2) where do we get the repulsion of 2nd node? ! double factor=100.0*strength; //node.getRepulsion()*node2.getRepulsion(); //*rigidity; for (Iterator nodes = getAssignedElements().iterator(); nodes.hasNext();) { *************** *** 95,113 **** /* ! * Overrides @see org.mediavirus.graphl.view.Facet#hasVisualController() */ public boolean hasVisualController() { ! return false; ! } ! ! /* ! * Overrides @see org.mediavirus.graphl.view.Facet#getVisualController() ! */ ! public JComponent getVisualController() { ! return null; } /* ! * Overrides @see org.mediavirus.graphl.view.Facet#isSameClass(java.lang.Object) */ public boolean isSameClass(Object o) { --- 89,100 ---- /* ! * @see org.mediavirus.graphl.view.Facet#hasVisualController() */ public boolean hasVisualController() { ! return true; } /* ! * @see org.mediavirus.graphl.view.Facet#isSameClass(java.lang.Object) */ public boolean isSameClass(Object o) { *************** *** 116,123 **** /* ! * Overrides @see java.lang.Object#clone() */ public Object clone() { ! return new UnconstrainedNodeLayouter(); } --- 103,112 ---- /* ! * @see java.lang.Object#clone() */ public Object clone() { ! RepulsionNodeLayouter l2 = new RepulsionNodeLayouter(); ! l2.setStrength(strength); ! return l2; } *************** *** 131,135 **** /* ! * Overrides @see org.mediavirus.graphl.layout.NodeLayouter#isDraggable() */ public boolean isDraggable() { --- 120,124 ---- /* ! * @see org.mediavirus.graphl.layout.NodeLayouter#isDraggable() */ public boolean isDraggable() { *************** *** 137,139 **** --- 126,151 ---- } + /** + * @return Returns the strength. + */ + public float getStrength() { + return strength; + } + + /** + * @param strength The strength to set. + */ + public void setStrength(float strength) { + this.strength = strength; + } + + /** + * @see org.mediavirus.graphl.view.Facet#setConfigurationNode(org.mediavirus.graphl.graph.Node) + */ + public void setConfigurationNode(Node node) { + String str = node.getProperty("http://www.mediavirus.org/graphl#strength"); + if (str != null) { + setStrength(Float.parseFloat(str)); + } + } } Index: AbsoluteNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/AbsoluteNodeLayouter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AbsoluteNodeLayouter.java 19 Oct 2004 16:16:58 -0000 1.7 --- AbsoluteNodeLayouter.java 30 Nov 2004 09:38:32 -0000 1.8 *************** *** 53,57 **** node.setCenter(r.getCenterX(), r.getCenterY()); node.setSize(r.getWidth(), r.getHeight()); ! // TODO make this configurable node.setZIndex(0); } --- 53,57 ---- node.setCenter(r.getCenterX(), r.getCenterY()); node.setSize(r.getWidth(), r.getHeight()); ! // TODO (2) make this configurable node.setZIndex(0); } *************** *** 67,71 **** node.setCenter(r.getCenterX(), r.getCenterY()); node.setSize(r.getWidth(), r.getHeight()); ! // TODO make this configurable node.setZIndex(0); } --- 67,71 ---- node.setCenter(r.getCenterX(), r.getCenterY()); node.setSize(r.getWidth(), r.getHeight()); ! // TODO (2) make this configurable node.setZIndex(0); } Index: Layouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/Layouter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Layouter.java 12 Jul 2004 11:48:51 -0000 1.3 --- Layouter.java 30 Nov 2004 09:38:32 -0000 1.4 *************** *** 78,87 **** } } ! if (hasMoreSteps) Thread.sleep(50); ! else synchronized (Layouter.this) { Layouter.this.wait(); } } catch (InterruptedException e) { --- 78,89 ---- } } ! if (hasMoreSteps) { Thread.sleep(50); ! } ! else { synchronized (Layouter.this) { Layouter.this.wait(); } + } } catch (InterruptedException e) { |
|
From: Flo L. <fl...@us...> - 2004-10-27 10:55:51
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18264/src/org/mediavirus/graphl/graph/rdf Modified Files: RDFGraph.java Log Message: - FEATURE: finally implemented sortgedNodeLayouter with proportional layout - AbstractFacet.assignedElements is now a list, to be able to sort it - BUG: block graph update events during loading - FEATURE: nodes are placed at deterministic locations initially (loading the same file twice will result in the same layout) - FEATURE: minor performance enhancements for repulsionnodelayouter - renamed "controls" command line option to "toolbar" Index: RDFGraph.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf/RDFGraph.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RDFGraph.java 19 Oct 2004 16:16:59 -0000 1.5 --- RDFGraph.java 27 Oct 2004 10:55:41 -0000 1.6 *************** *** 41,45 **** URL baseURL = null; ! public RDFNode getNodeById(String id){ return (RDFNode)allNodes.get(id); --- 41,49 ---- URL baseURL = null; ! ! private int loadCount = 0; ! ! private float loadAlpha = 0.1f; ! public RDFNode getNodeById(String id){ return (RDFNode)allNodes.get(id); *************** *** 78,112 **** } catch (MalformedURLException e) {} - RDFParser parser = new RDFParser(); InputSource input = new InputSource(new FileReader(filename)); input.setSystemId(""); ! try { ! parser.parse(input,this); ! } ! catch (SAXException se) { ! se.printStackTrace(); ! } ! ! resetDirty(); } public void readFromURL(URL url){ baseURL = url; - RDFParser parser = new RDFParser(); InputSource input; try { input = new InputSource(url.openConnection().getInputStream()); input.setSystemId(url.toString()); ! ! parser.parse(input,this); } catch (IOException e) { e.printStackTrace(); } ! catch (SAXException se) { ! se.printStackTrace(); ! } ! resetDirty(); } --- 82,115 ---- } catch (MalformedURLException e) {} InputSource input = new InputSource(new FileReader(filename)); input.setSystemId(""); ! readGraph(input); } public void readFromURL(URL url){ baseURL = url; InputSource input; try { input = new InputSource(url.openConnection().getInputStream()); input.setSystemId(url.toString()); ! readGraph(input); } catch (IOException e) { e.printStackTrace(); } ! } ! ! public void readGraph(InputSource input) { ! RDFParser parser = new RDFParser(); ! loading = true; ! try { ! parser.parse(input,this); ! } ! catch (Exception e) { ! e.printStackTrace(); ! } ! loading = false; resetDirty(); + fireGraphContentsChanged(); } *************** *** 173,177 **** if (node == null){ node = new RDFNode(this, uri); ! node.setCenter(400*Math.random()-200,400*Math.random()-200); addElements(Collections.singleton(node), null); if (DEBUG) System.out.println("created node " + uri); --- 176,184 ---- if (node == null){ node = new RDFNode(this, uri); ! float r = 20 + loadCount; ! loadAlpha += 30/r; ! node.setCenter(r*Math.sin(loadAlpha), r*Math.cos(loadAlpha)); ! loadCount++; ! //node.setCenter(400*Math.random()-200,400*Math.random()-200); addElements(Collections.singleton(node), null); if (DEBUG) System.out.println("created node " + uri); *************** *** 293,296 **** --- 300,304 ---- allNodes.clear(); super.clear(); + loadCount = 0; } |
|
From: Flo L. <fl...@us...> - 2004-10-27 10:55:51
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18264/src/org/mediavirus/util Modified Files: ParseUtils.java Log Message: - FEATURE: finally implemented sortgedNodeLayouter with proportional layout - AbstractFacet.assignedElements is now a list, to be able to sort it - BUG: block graph update events during loading - FEATURE: nodes are placed at deterministic locations initially (loading the same file twice will result in the same layout) - FEATURE: minor performance enhancements for repulsionnodelayouter - renamed "controls" command line option to "toolbar" Index: ParseUtils.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/util/ParseUtils.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ParseUtils.java 19 Oct 2004 16:17:09 -0000 1.3 --- ParseUtils.java 27 Oct 2004 10:55:41 -0000 1.4 *************** *** 73,78 **** /** ! * @param property ! * @return */ public static Font parseFont(String spec) { --- 73,79 ---- /** ! * @param spec A String containing the specification of the font to use, in the ! * format <familyname>-<variant>-<size>. @see java.awt.Font.decode(String). ! * @return The Font described by the specification String, or <code>null</code> if spec == null. */ public static Font parseFont(String spec) { *************** *** 109,114 **** /** ! * @param str ! * @return */ public static float[] parseMatrix(String str) { --- 110,115 ---- /** ! * @param str A String containing the matrix in space-separated form. ! * @return A float[] containing the 3x3 matrix. */ public static float[] parseMatrix(String str) { |
|
From: Flo L. <fl...@us...> - 2004-10-27 10:55:51
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18264/src/org/mediavirus/graphl/graph Modified Files: DefaultGraph.java Log Message: - FEATURE: finally implemented sortgedNodeLayouter with proportional layout - AbstractFacet.assignedElements is now a list, to be able to sort it - BUG: block graph update events during loading - FEATURE: nodes are placed at deterministic locations initially (loading the same file twice will result in the same layout) - FEATURE: minor performance enhancements for repulsionnodelayouter - renamed "controls" command line option to "toolbar" Index: DefaultGraph.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/DefaultGraph.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DefaultGraph.java 12 Jul 2004 11:48:52 -0000 1.2 --- DefaultGraph.java 27 Oct 2004 10:55:41 -0000 1.3 *************** *** 15,18 **** --- 15,20 ---- /** Edges of the graph. */ protected List m_edges; + + protected boolean loading = false; /** *************** *** 65,69 **** } } ! fireElementsAdded(nodes,edges); } /** --- 67,73 ---- } } ! if (!loading) { ! fireElementsAdded(nodes,edges); ! } } /** |
|
From: Flo L. <fl...@us...> - 2004-10-27 10:55:50
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18264/src/org/mediavirus/graphl/view Modified Files: AbstractFacet.java Facet.java Log Message: - FEATURE: finally implemented sortgedNodeLayouter with proportional layout - AbstractFacet.assignedElements is now a list, to be able to sort it - BUG: block graph update events during loading - FEATURE: nodes are placed at deterministic locations initially (loading the same file twice will result in the same layout) - FEATURE: minor performance enhancements for repulsionnodelayouter - renamed "controls" command line option to "toolbar" Index: Facet.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view/Facet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Facet.java 4 Oct 2004 10:21:04 -0000 1.3 --- Facet.java 27 Oct 2004 10:55:41 -0000 1.4 *************** *** 6,9 **** --- 6,10 ---- + import java.util.Collection; import java.util.Set; *************** *** 58,62 **** * @return A Set of GraphElements that are assigned to this facet. */ ! public Set getAssignedElements(); /** --- 59,63 ---- * @return A Set of GraphElements that are assigned to this facet. */ ! public Collection getAssignedElements(); /** Index: AbstractFacet.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view/AbstractFacet.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AbstractFacet.java 4 Oct 2004 10:21:04 -0000 1.4 --- AbstractFacet.java 27 Oct 2004 10:55:41 -0000 1.5 *************** *** 12,20 **** import java.beans.PropertyChangeListener; import java.beans.SimpleBeanInfo; ! import java.util.HashSet; ! import java.util.Set; import javax.swing.JComponent; - import org.mediavirus.graphl.graph.GraphElement; import org.mediavirus.graphl.graph.Node; --- 12,20 ---- import java.beans.PropertyChangeListener; import java.beans.SimpleBeanInfo; ! import java.util.ArrayList; ! import java.util.Collection; ! import java.util.List; import javax.swing.JComponent; import org.mediavirus.graphl.graph.GraphElement; import org.mediavirus.graphl.graph.Node; *************** *** 31,43 **** public abstract class AbstractFacet implements Facet { ! private Set assignedElements = new HashSet(); /* * Overrides @see org.mediavirus.graphl.view.Facet#getAssignedElements() */ ! public Set getAssignedElements() { // need to return copy, becuase elements might be unassigned by caller // this triggers a ConcurrentModificationException if original set is returned ! return new HashSet(assignedElements); } --- 31,43 ---- public abstract class AbstractFacet implements Facet { ! protected List assignedElements = new ArrayList(); /* * Overrides @see org.mediavirus.graphl.view.Facet#getAssignedElements() */ ! public Collection getAssignedElements() { // need to return copy, becuase elements might be unassigned by caller // this triggers a ConcurrentModificationException if original set is returned ! return new ArrayList(assignedElements); } |
|
From: Flo L. <fl...@us...> - 2004-10-27 10:55:49
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18264/src/org/mediavirus/graphl/painter Modified Files: LineEdgePainter.java Log Message: - FEATURE: finally implemented sortgedNodeLayouter with proportional layout - AbstractFacet.assignedElements is now a list, to be able to sort it - BUG: block graph update events during loading - FEATURE: nodes are placed at deterministic locations initially (loading the same file twice will result in the same layout) - FEATURE: minor performance enhancements for repulsionnodelayouter - renamed "controls" command line option to "toolbar" Index: LineEdgePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/LineEdgePainter.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LineEdgePainter.java 14 Oct 2004 13:03:03 -0000 1.6 --- LineEdgePainter.java 27 Oct 2004 10:55:40 -0000 1.7 *************** *** 128,132 **** } /** ! * @param labelColor The labelColor to set. */ public void setLabelColor(Color textColor) { --- 128,132 ---- } /** ! * @param textColor The text color to set. */ public void setLabelColor(Color textColor) { |
|
From: Flo L. <fl...@us...> - 2004-10-27 10:55:49
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18264/src/org/mediavirus/graphl/layout Modified Files: RepulsionNodeLayouter.java SortedNodeLayouter.java Log Message: - FEATURE: finally implemented sortgedNodeLayouter with proportional layout - AbstractFacet.assignedElements is now a list, to be able to sort it - BUG: block graph update events during loading - FEATURE: nodes are placed at deterministic locations initially (loading the same file twice will result in the same layout) - FEATURE: minor performance enhancements for repulsionnodelayouter - renamed "controls" command line option to "toolbar" Index: RepulsionNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/RepulsionNodeLayouter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RepulsionNodeLayouter.java 14 Oct 2004 13:02:58 -0000 1.5 --- RepulsionNodeLayouter.java 27 Oct 2004 10:55:40 -0000 1.6 *************** *** 27,36 **** /* ! * Overrides @see org.mediavirus.graphl.layout.NodeLayouter#performLayoutStep(org.mediavirus.graphl.graph.Node, org.mediavirus.graphl.layout.GraphlLayoutStrategy.GraphManager) */ public void performLayoutStep(Node node, GraphManager graphManager) { if (!node.isDragging()) { NodeMovement movement = graphManager.getNodeMovement(node); ! for (Iterator nodes = getAssignedElements().iterator(); nodes.hasNext();) { Node node2 = (Node)nodes.next(); --- 27,41 ---- /* ! * @see org.mediavirus.graphl.layout.NodeLayouter#performLayoutStep(org.mediavirus.graphl.graph.Node, org.mediavirus.graphl.layout.GraphlLayoutStrategy.GraphManager) */ public void performLayoutStep(Node node, GraphManager graphManager) { if (!node.isDragging()) { NodeMovement movement = graphManager.getNodeMovement(node); ! double nodeX = node.getCenterX(); ! double nodeY = node.getCenterY(); ! ! //TODO (2) where do we get the repulsion of 2nd node? ! double factor=100.0*constantRepulsion*constantRepulsion; //*node2.getRepulsion(); //*rigidity; ! for (Iterator nodes = getAssignedElements().iterator(); nodes.hasNext();) { Node node2 = (Node)nodes.next(); *************** *** 41,46 **** double dx=0; double dy=0; ! double deltaX=node.getCenterX()-node2.getCenterX(); ! double deltaY=node.getCenterY()-node2.getCenterY(); double currentLengthSquared=deltaX*deltaX+deltaY*deltaY; //so it's length squared if (Math.abs(currentLengthSquared)<0.1) { --- 46,51 ---- double dx=0; double dy=0; ! double deltaX=nodeX-node2.getCenterX(); ! double deltaY=nodeY-node2.getCenterY(); double currentLengthSquared=deltaX*deltaX+deltaY*deltaY; //so it's length squared if (Math.abs(currentLengthSquared)<0.1) { *************** *** 55,60 **** // in the 'force field' } - //TODO (2) where do we get the repulsion of 2nd node? - double factor=100.0*constantRepulsion*constantRepulsion; //*node2.getRepulsion(); //*rigidity; dx*=factor; dy*=factor; --- 60,63 ---- Index: SortedNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/SortedNodeLayouter.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SortedNodeLayouter.java 21 Oct 2004 16:00:47 -0000 1.6 --- SortedNodeLayouter.java 27 Oct 2004 10:55:40 -0000 1.7 *************** *** 5,10 **** --- 5,18 ---- package org.mediavirus.graphl.layout; + import java.awt.geom.Point2D; + import java.text.DateFormat; + import java.text.ParseException; + import java.util.Calendar; + import java.util.Collections; + import java.util.Comparator; + import java.util.Date; import java.util.Iterator; + import org.mediavirus.graphl.graph.GraphElement; import org.mediavirus.graphl.graph.Node; import org.mediavirus.graphl.layout.GraphlLayoutStrategy.GraphManager; *************** *** 18,121 **** public class SortedNodeLayouter extends AbstractFacet implements NodeLayouter { ! public static final int LEFTTORIGHT = 0; ! public static final int RIGHTTOLEFT = 1; ! public static final int TOPTOBOTTOM = 2; ! public static final int BOTTOMTOTOP = 3; ! int orientation = TOPTOBOTTOM; ! boolean align = false; boolean proportional = false; ! float distance = 150.0f; ! String property = null; /* ! * Overrides @see org.mediavirus.graphl.layout.NodeLayouter#performLayoutStep(org.mediavirus.graphl.graph.Node, org.mediavirus.graphl.layout.GraphlLayoutStrategy.GraphManager) */ public void performLayoutStep(Node node, GraphManager graphManager) { - if (!node.isDragging()) { - NodeMovement movement=graphManager.getNodeMovement(node); - - movement.dx=0; - movement.dy=0; ! String val1, val2; ! ! if (property != null) { ! val1 = node.getProperty(property, "").toLowerCase(); ! } ! else { ! val1 = node.getLabel().toLowerCase(); ! } ! ! for (Iterator nodes = getAssignedElements().iterator(); nodes.hasNext();) { ! Node other = (Node) nodes.next(); ! if (property != null) { ! val2 = other.getProperty(property, "").toLowerCase(); ! } ! else { ! val2 = other.getLabel().toLowerCase(); ! } ! ! int comp = val2.compareTo(val1); ! if (orientation == LEFTTORIGHT) { ! if (comp < 0) { ! movement.dx += (other.getCenterX()-node.getCenterX()+30) / 10; ! } ! else if (comp > 0) { ! movement.dx -= (node.getCenterX()+30-other.getCenterX()) / 10; ! } ! if (align) { ! movement.dy += (other.getCenterY() - node.getCenterY()) / 10; ! } ! } ! ! if (orientation == RIGHTTOLEFT) { ! if (comp > 0) { ! movement.dx += (other.getCenterX()-node.getCenterX()+30) / 10; ! } ! else if (comp < 0) { ! movement.dx -= (node.getCenterX()+30-other.getCenterX()) / 10; ! } ! if (align) { ! movement.dy += (other.getCenterY() - node.getCenterY()) / 10; ! } ! } ! ! if (orientation == TOPTOBOTTOM) { ! if (comp < 0) { ! movement.dy += (other.getCenterY()-node.getCenterY()+distance) / 10; ! } ! else if (comp > 0) { ! movement.dy -= (node.getCenterY()-other.getCenterY()+distance) / 10; ! } ! if (align) { ! movement.dx += (other.getCenterX() - node.getCenterX()) / 10; ! } ! } ! ! if (orientation == LEFTTORIGHT) { ! if (comp > 0){ ! movement.dy += (other.getCenterY()-node.getCenterY()+30) / 10; ! } ! else if (comp < 0) { ! movement.dy -= (node.getCenterY()+30-other.getCenterY()) / 10; ! } ! if (align) { ! movement.dx += (other.getCenterX() - node.getCenterX()) / 10; ! } ! } } ! double dx = movement.dx; double dy = movement.dy; ! ! movement.dx=dx/2; ! movement.dy=dy/2; ! double distanceMoved=Math.max(dx,dy); // Don't move faster then 30 units at a time. Important in order to prevent severed nodes from flying away. --- 26,112 ---- public class SortedNodeLayouter extends AbstractFacet implements NodeLayouter { ! public static final int RIGHT = 0; ! public static final int LEFT = 1; ! public static final int DOWN = 2; ! public static final int UP = 3; ! int orientation = DOWN; ! public static final int TIME = 0; ! public static final int DATE = 1; ! public static final int STRING = 2; ! ! int datatype = STRING; ! ! boolean align = true; boolean proportional = false; ! float distance = 20.0f; ! String property = "http://xmlns.com/foaf/0.1/name"; ! ! private boolean sorted = false; ! private SortedNodeLayouterComparator comparator = new SortedNodeLayouterComparator(property); ! private boolean centered = false; ! Point2D centerPoint = new Point2D.Double(); /* ! * @see org.mediavirus.graphl.layout.NodeLayouter#performLayoutStep(org.mediavirus.graphl.graph.Node, org.mediavirus.graphl.layout.GraphlLayoutStrategy.GraphManager) */ public void performLayoutStep(Node node, GraphManager graphManager) { ! NodeMovement movement=graphManager.getNodeMovement(node); ! if (!sorted) { ! sortList(); ! } ! ! int num = assignedElements.size(); ! int pos = Collections.binarySearch(assignedElements, node, comparator); ! ! if (!node.isDragging()) { ! ! if (!centered) { ! center(); ! } ! ! float offset; ! if (proportional) { ! long min = getRelativeValue(((Node)assignedElements.get(0)).getProperty(property)); ! long max = getRelativeValue(((Node)assignedElements.get(assignedElements.size()-1)).getProperty(property)); ! long val = getRelativeValue(node.getProperty(property)); ! offset = (num-1) * distance * (val-min) / (max-min) - (distance * (num-1) / 2); ! } ! else { ! offset = (pos * distance) - (distance * (num-1) / 2); ! } ! switch (orientation) { ! case RIGHT: ! movement.dx = ((centerPoint.getX() + offset) - node.getCenterX()) / 4; ! break; ! case LEFT: ! movement.dx = ((centerPoint.getX() - offset) - node.getCenterX()) / 4; ! break; ! case DOWN: ! movement.dy = ((centerPoint.getY() + offset) - node.getCenterY()) / 4; ! break; ! case UP: ! movement.dy = ((centerPoint.getY() - offset) - node.getCenterY()) / 4; ! break; } ! ! if (align) { ! if (orientation == RIGHT || orientation == LEFT) { ! movement.dy = (centerPoint.getY() - node.getCenterY()) / 4; ! } ! else { ! movement.dx = (centerPoint.getX() - node.getCenterX()) / 4; ! } ! } ! double dx = movement.dx; double dy = movement.dy; ! double distanceMoved=Math.max(dx,dy); // Don't move faster then 30 units at a time. Important in order to prevent severed nodes from flying away. *************** *** 131,142 **** } else { - NodeMovement movement=graphManager.getNodeMovement(node); movement.justChanged=true; movement.dx=0; movement.dy=0; } } ! /* * @see org.mediavirus.graphl.view.Facet#hasVisualController() */ --- 122,195 ---- } else { movement.justChanged=true; movement.dx=0; movement.dy=0; + if (pos == 0 || pos == num-1) { + if (orientation == RIGHT || orientation == LEFT) { + centerPoint.setLocation(node.getCenterX() + (num-1-2*pos) * distance / 2, node.getCenterY()); + } + else { + centerPoint.setLocation(node.getCenterX(),node.getCenterY() + (num-1-2*pos) * distance / 2); + } + } } } + + /** + * + */ + private void center() { + double x=0, y=0; + int num = assignedElements.size(); + + for (Iterator iter = assignedElements.iterator(); iter.hasNext();) { + Node node = (Node) iter.next(); + x += node.getCenterX()/num; + y += node.getCenterY()/num; + } + + centerPoint.setLocation(x,y); + + centered = true; + + } ! long getRelativeValue(String str) { ! long val = 0; ! if ((datatype == TIME) || (datatype == DATE)) { ! Date date; ! try { ! date = DateFormat.getDateInstance().parse(str); ! } ! catch (ParseException pex) { ! return 0; ! } ! ! if (datatype == TIME) { ! return date.getTime(); ! } ! else { ! Calendar cal = Calendar.getInstance(); ! cal.setTime(date); ! return cal.get(Calendar.YEAR) * 365 + cal.get(Calendar.DAY_OF_YEAR); ! } ! } ! else if (datatype == STRING) { ! // TODO (2, 1h) improve this ! val = str.charAt(0) * 256 * 256 + str.charAt(1) * 256 + str.charAt(2); ! } ! ! return val; ! } ! ! /** ! * ! */ ! private void sortList() { ! Collections.sort(assignedElements, comparator); ! sorted = true; ! } ! ! /* * @see org.mediavirus.graphl.view.Facet#hasVisualController() */ *************** *** 152,167 **** } - /** - * @return Returns the align. - */ public boolean isAlign() { return align; } ! /** ! * @param align The align to set. ! */ public void setAlign(boolean align) { this.align = align; } /** * @return Returns the orientation. --- 205,216 ---- } public boolean isAlign() { return align; } ! public void setAlign(boolean align) { this.align = align; } + /** * @return Returns the orientation. *************** *** 176,190 **** this.orientation = orientation; } ! /** ! * @return Returns the proportional. ! */ public boolean isProportional() { return proportional; } ! /** ! * @param proportional The proportional to set. ! */ ! public void setProportional(boolean relative) { ! this.proportional = relative; } /* --- 225,235 ---- this.orientation = orientation; } ! public boolean isProportional() { return proportional; } ! ! public void setProportional(boolean proportional) { ! this.proportional = proportional; } /* *************** *** 222,225 **** --- 267,272 ---- public void setProperty(String property) { this.property = property; + comparator.setProperty(property); + sortList(); } /** *************** *** 229,237 **** return distance; } /** * @param distance The distance to set. */ ! public void setDistance(float scaleFactor) { ! this.distance = scaleFactor; } /** --- 276,304 ---- return distance; } + /** * @param distance The distance to set. */ ! public void setDistance(float distance) { ! this.distance = distance; ! } ! ! /** ! * @see org.mediavirus.graphl.view.Facet#assignElement(org.mediavirus.graphl.graph.GraphElement) ! */ ! ! public void assignElement(GraphElement element) { ! sorted = false; ! centered = false; ! super.assignElement(element); ! } ! ! /** ! * @see org.mediavirus.graphl.view.Facet#unassignElement(org.mediavirus.graphl.graph.GraphElement) ! */ ! ! public void unassignElement(GraphElement element) { ! centered = false; ! super.unassignElement(element); } /** *************** *** 257,273 **** str = node.getProperty("http://www.mediavirus.org/graphl#orientation"); if (str != null) { ! if (str.equalsIgnoreCase("TOPTOBOTTOM")) { ! setOrientation(TOPTOBOTTOM); } ! else if (str.equalsIgnoreCase("BOTTOMTOTOP")) { ! setOrientation(BOTTOMTOTOP); } ! else if (str.equalsIgnoreCase("LEFTTORIGHT")) { ! setOrientation(LEFTTORIGHT); } ! else if (str.equalsIgnoreCase("RIGHTTOLEFT")) { ! setOrientation(RIGHTTOLEFT); } } } } --- 324,377 ---- str = node.getProperty("http://www.mediavirus.org/graphl#orientation"); if (str != null) { ! if (str.equalsIgnoreCase("DOWN")) { ! setOrientation(DOWN); } ! else if (str.equalsIgnoreCase("UP")) { ! setOrientation(UP); } ! else if (str.equalsIgnoreCase("RIGHT")) { ! setOrientation(RIGHT); } ! else if (str.equalsIgnoreCase("LEFT")) { ! setOrientation(LEFT); } } } + + public class SortedNodeLayouterComparator implements Comparator { + + private String property = null; + + public SortedNodeLayouterComparator() {} + + public SortedNodeLayouterComparator(String property) { + this.property = property; + } + + /** + * @return Returns the property. + */ + public String getProperty() { + return property; + } + /** + * @param property The property to set. + */ + public void setProperty(String property) { + this.property = property; + } + + public int compare(Object o1, Object o2) { + Node n1 = (Node)o1; + Node n2 = (Node)o2; + + if (property != null) { + String val1 = n1.getProperty(property, "").toLowerCase(); + String val2 = n2.getProperty(property, "").toLowerCase(); + return val1.compareTo(val2); + } + else return 0; + } + + } } |
|
From: Flo L. <fl...@us...> - 2004-10-27 10:55:49
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18264/src/org/mediavirus/graphl Modified Files: GraphlApplication.java Log Message: - FEATURE: finally implemented sortgedNodeLayouter with proportional layout - AbstractFacet.assignedElements is now a list, to be able to sort it - BUG: block graph update events during loading - FEATURE: nodes are placed at deterministic locations initially (loading the same file twice will result in the same layout) - FEATURE: minor performance enhancements for repulsionnodelayouter - renamed "controls" command line option to "toolbar" Index: GraphlApplication.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplication.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** GraphlApplication.java 21 Oct 2004 16:00:47 -0000 1.13 --- GraphlApplication.java 27 Oct 2004 10:55:40 -0000 1.14 *************** *** 455,460 **** if (args[i].equals("decorations=off")) decorations = false; } ! else if (args[i].startsWith("controls=")) { ! if (args[i].equals("controls=off")) controls = false; } else if (args[i].startsWith("menubar=")) { --- 455,460 ---- if (args[i].equals("decorations=off")) decorations = false; } ! else if (args[i].startsWith("toolbar=")) { ! if (args[i].equals("toolbar=off")) controls = false; } else if (args[i].startsWith("menubar=")) { *************** *** 546,550 **** System.out.println("graphl [size=<width>,<height>] [pos=<x>,<y>] [config=<filename.rdf>]\n" + " [refresh=<seconds>] [decorations={on|off}]\n" + ! " [controls={on|off}] [menubar={on|off}]\n" + " [{<filename>|<url>}]"); System.out.println("-------------------------------------------------------------------"); --- 546,550 ---- System.out.println("graphl [size=<width>,<height>] [pos=<x>,<y>] [config=<filename.rdf>]\n" + " [refresh=<seconds>] [decorations={on|off}]\n" + ! " [toolbar={on|off}] [menubar={on|off}]\n" + " [{<filename>|<url>}]"); System.out.println("-------------------------------------------------------------------"); |
|
From: Flo L. <fl...@us...> - 2004-10-21 16:01:35
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4235/src/org/mediavirus/graphl/view Modified Files: LabelGenerator.java FacetRegistry.java SimpleFacetRegistry.java Log Message: - BUG updating painter list in GraphlPane menus - BUG scale center in center of viewport - FEATURE SortedNodeLayouter sorts on arbitrary property - FEATURE SortedNodeLayouter configurable in GUI + configfile - FEATURE BoxNodePainter: configurable roundedRect + cornerRadius - BUG added beaninfo for manhattanEdgePainter Index: SimpleFacetRegistry.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view/SimpleFacetRegistry.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SimpleFacetRegistry.java 4 Oct 2004 10:21:04 -0000 1.5 --- SimpleFacetRegistry.java 21 Oct 2004 16:00:47 -0000 1.6 *************** *** 20,24 **** */ public class SimpleFacetRegistry implements FacetRegistry { ! private NodePainter defaultNodePainter; private EdgePainter defaultEdgePainter; --- 20,24 ---- */ public class SimpleFacetRegistry implements FacetRegistry { ! private NodePainter defaultNodePainter; private EdgePainter defaultEdgePainter; Index: FacetRegistry.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view/FacetRegistry.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FacetRegistry.java 4 Oct 2004 10:21:04 -0000 1.3 --- FacetRegistry.java 21 Oct 2004 16:00:47 -0000 1.4 *************** *** 21,25 **** public interface FacetRegistry { - public void registerEdgePainter(EdgePainter painter); --- 21,24 ---- Index: LabelGenerator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view/LabelGenerator.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** LabelGenerator.java 19 Oct 2004 16:17:07 -0000 1.8 --- LabelGenerator.java 21 Oct 2004 16:00:46 -0000 1.9 *************** *** 14,19 **** import org.mediavirus.util.ParseUtils; - import edu.unika.aifb.rdf.api.util.RDFUtil; - /** * @author Flo Ledermann <led...@im...> --- 14,17 ---- |
|
From: Flo L. <fl...@us...> - 2004-10-21 16:01:35
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4235/src/org/mediavirus/graphl/painter Modified Files: ImageNodePainter.java AbstractNodePainter.java StraightLineEdgePainter.java ManhattanEdgePainter.java BoxNodePainter.java ShapeNodePainter.java BoxNodePainterBeanInfo.java NodePainter.java InvisibleNodePainter.java Added Files: ManhattanEdgePainterBeanInfo.java Log Message: - BUG updating painter list in GraphlPane menus - BUG scale center in center of viewport - FEATURE SortedNodeLayouter sorts on arbitrary property - FEATURE SortedNodeLayouter configurable in GUI + configfile - FEATURE BoxNodePainter: configurable roundedRect + cornerRadius - BUG added beaninfo for manhattanEdgePainter Index: AbstractNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/AbstractNodePainter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractNodePainter.java 4 Oct 2004 10:21:03 -0000 1.2 --- AbstractNodePainter.java 21 Oct 2004 16:00:46 -0000 1.3 *************** *** 5,8 **** --- 5,13 ---- package org.mediavirus.graphl.painter; + import java.awt.Point; + import java.awt.Rectangle; + + import org.mediavirus.graphl.GraphlPane; + import org.mediavirus.graphl.graph.Node; import org.mediavirus.graphl.view.AbstractFacet; *************** *** 13,15 **** --- 18,34 ---- public abstract class AbstractNodePainter extends AbstractFacet implements NodePainter{ + /** + * Checks whether given point is inside the node. + * + * @param graphPane the graph pane + * @param node the node + * @param point the point + * @return <code>true</code> if the point is in the node + */ + public boolean isInNode(GraphlPane graphPane,Node node,Point point) { + Rectangle nodeScreenRectangle=new Rectangle(); + getNodeScreenBounds(graphPane,node,nodeScreenRectangle); + return nodeScreenRectangle.contains(point); + } + } Index: NodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/NodePainter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NodePainter.java 21 Aug 2004 22:31:01 -0000 1.3 --- NodePainter.java 21 Oct 2004 16:00:46 -0000 1.4 *************** *** 31,34 **** --- 31,35 ---- */ boolean isInNode(GraphlPane graphPane,Node node,Point point); + /** * Returns the outer rectangle of the node on screen. *************** *** 39,51 **** */ void getNodeScreenBounds(GraphlPane graphPane,Node node,Rectangle nodeScreenRectangle); - /** - * Returns the tool-tip for given point. - * - * @param graphPane the graph pane - * @param node the node - * @param point the point - * @return the tool-tip at given point (or <code>null</code>) - */ - String getToolTipText(GraphlPane graphPane,Node node,Point point); public boolean isEdgeDragPoint(GraphlPane graphPane,Node node,Point p); --- 40,43 ---- Index: ShapeNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/ShapeNodePainter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ShapeNodePainter.java 19 Oct 2004 16:17:09 -0000 1.3 --- ShapeNodePainter.java 21 Oct 2004 16:00:46 -0000 1.4 *************** *** 101,109 **** } - public boolean isInNode(GraphlPane graphPane, Node node, Point point) { - // TODO Auto-generated method stub - return false; - } - public void getNodeScreenBounds(GraphlPane graphPane, Node node, Rectangle nodeScreenRectangle) { nodeScreenRectangle.setBounds((int)(node.getCenterX()-size/2),(int)(node.getCenterY()-size/2), (int)size, (int)size); --- 101,104 ---- Index: StraightLineEdgePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/StraightLineEdgePainter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StraightLineEdgePainter.java 14 Oct 2004 13:03:03 -0000 1.4 --- StraightLineEdgePainter.java 21 Oct 2004 16:00:46 -0000 1.5 *************** *** 79,83 **** Node targetNode = edge.getTo(); ! NodePainter targetNodePainter = graphPane.getPainterForNode(targetNode); Rectangle targetNodeRectangle = new Rectangle(); targetNodePainter.getNodeScreenBounds(graphPane, targetNode, targetNodeRectangle); --- 79,83 ---- Node targetNode = edge.getTo(); ! NodePainter targetNodePainter = graphPane.getPainterForNode(targetNode); // targetNode.getCurrentPainter() Rectangle targetNodeRectangle = new Rectangle(); targetNodePainter.getNodeScreenBounds(graphPane, targetNode, targetNodeRectangle); --- NEW FILE: ManhattanEdgePainterBeanInfo.java --- /* * Created on 19.10.2004 by flo */ package org.mediavirus.graphl.painter; import java.beans.BeanDescriptor; import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; import java.beans.SimpleBeanInfo; /** * @author flo * created: 19.10.2004 20:51:48 */ public class ManhattanEdgePainterBeanInfo extends SimpleBeanInfo { private final static Class beanClass = ManhattanEdgePainter.class; public BeanDescriptor getBeanDescriptor() { return new BeanDescriptor(beanClass); } public PropertyDescriptor[] getPropertyDescriptors() { try { PropertyDescriptor rv[] = { new PropertyDescriptor("color", beanClass), new PropertyDescriptor("labelColor", beanClass), new PropertyDescriptor("font", beanClass), new PropertyDescriptor("stroke", beanClass), new PropertyDescriptor("paintArrow", beanClass), new PropertyDescriptor("paintLabel", beanClass) }; return rv; } catch (IntrospectionException e) { throw new Error(e.toString()); } } } Index: BoxNodePainterBeanInfo.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/BoxNodePainterBeanInfo.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BoxNodePainterBeanInfo.java 4 Oct 2004 10:21:03 -0000 1.1 --- BoxNodePainterBeanInfo.java 21 Oct 2004 16:00:46 -0000 1.2 *************** *** 28,31 **** --- 28,33 ---- new PropertyDescriptor("transparency", beanClass), new PropertyDescriptor("font", beanClass), + new PropertyDescriptor("roundRect", beanClass), + new PropertyDescriptor("cornerRadius", beanClass), new PropertyDescriptor("borderStroke", beanClass) }; Index: BoxNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/BoxNodePainter.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** BoxNodePainter.java 19 Oct 2004 16:17:09 -0000 1.6 --- BoxNodePainter.java 21 Oct 2004 16:00:46 -0000 1.7 *************** *** 34,37 **** --- 34,40 ---- float transparency = 0.2f; + boolean roundRect = true; + int cornerRadius = 8; + LabelGenerator labelGenerator; *************** *** 40,48 **** borderStroke = new BasicStroke(1.0f); ! font = new Font("foo", Font.PLAIN, 10); baseColor = new Color(255,250,168); textColor = Color.BLACK; labelGenerator = new LabelGenerator(); - //labelGenerator.setSelectWhich("http://www.mediavirus.org/graphl#hasLabel"); } --- 43,50 ---- borderStroke = new BasicStroke(1.0f); ! font = new Font(null, Font.PLAIN, 10); baseColor = new Color(255,250,168); textColor = Color.BLACK; labelGenerator = new LabelGenerator(); } *************** *** 103,114 **** } - public String getToolTipText( - GraphlPane graphPane, - Node node, - Point point) { - - return node.getId(); - } - /** * @return Returns the baseColor. --- 105,108 ---- *************** *** 178,181 **** --- 172,199 ---- } /** + * @return Returns the cornerRadius. + */ + public int getCornerRadius() { + return cornerRadius; + } + /** + * @param cornerRadius The cornerRadius to set. + */ + public void setCornerRadius(int cornerRadius) { + this.cornerRadius = cornerRadius; + } + /** + * @return Returns the roundRect. + */ + public boolean isRoundRect() { + return roundRect; + } + /** + * @param roundRect The roundRect to set. + */ + public void setRoundRect(boolean roundRect) { + this.roundRect = roundRect; + } + /** * Paints the supplied node. * *************** *** 208,214 **** Color oldColor=g.getColor(); g.setColor(getBackgroundColor(highlighted, selected, false)); ! //TODO (1,0.5h) property for rounded rect ! //g.fillRect(nodePoint.x-width/2,nodePoint.y-height/2,width,height); ! g.fillRoundRect(nodePoint.x-width/2,nodePoint.y-height/2,width,height,8,8); if (label!=null) { Font oldFont=g.getFont(); --- 226,235 ---- Color oldColor=g.getColor(); g.setColor(getBackgroundColor(highlighted, selected, false)); ! if (roundRect) { ! g.fillRoundRect(nodePoint.x-width/2,nodePoint.y-height/2,width,height,cornerRadius, cornerRadius); ! } ! else { ! g.fillRect(nodePoint.x-width/2,nodePoint.y-height/2,width,height); ! } if (label!=null) { Font oldFont=g.getFont(); *************** *** 219,224 **** } g.setColor(getBorderColor(highlighted, selected, false)); ! //g.drawRect(nodePoint.x-width/2,nodePoint.y-height/2,width,height); ! g.drawRoundRect(nodePoint.x-width/2,nodePoint.y-height/2,width,height,8,8); g.setColor(oldColor); } --- 240,249 ---- } g.setColor(getBorderColor(highlighted, selected, false)); ! if (roundRect) { ! g.drawRoundRect(nodePoint.x-width/2,nodePoint.y-height/2,width,height,cornerRadius,cornerRadius); ! } ! else { ! g.drawRect(nodePoint.x-width/2,nodePoint.y-height/2,width,height); ! } g.setColor(oldColor); } *************** *** 260,277 **** } - /** - * Checks whether given point is inside the node. - * - * @param graphPane the graph pane - * @param node the node - * @param point the point - * @return <code>true</code> if the point is in the node - */ - public boolean isInNode(GraphlPane graphPane,Node node,Point point) { - Rectangle nodeScreenRectangle=new Rectangle(); - getNodeScreenBounds(graphPane,node,nodeScreenRectangle); - return nodeScreenRectangle.contains(point); - } - public Point getEdgePin(Node node, Edge edge) { return new Point((int)node.getCenterX(), (int)node.getCenterY()); --- 285,288 ---- *************** *** 295,299 **** public Object clone() { - //return this; return new BoxNodePainter(); } --- 306,309 ---- *************** *** 322,325 **** --- 332,341 ---- Stroke stroke = ParseUtils.parseStroke(node.getProperty("http://www.mediavirus.org/graphl#borderStroke")); if (stroke != null) setBorderStroke(stroke); + + String str = node.getProperty("http://www.mediavirus.org/graphl#roundRect"); + if (str != null) setRoundRect(str.equalsIgnoreCase("true")); + + str = node.getProperty("http://www.mediavirus.org/graphl#cornerRadius"); + if (str != null) setCornerRadius(Integer.parseInt(str)); } Index: ImageNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/ImageNodePainter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ImageNodePainter.java 14 Oct 2004 13:03:03 -0000 1.5 --- ImageNodePainter.java 21 Oct 2004 16:00:46 -0000 1.6 *************** *** 136,145 **** } - public boolean isInNode(GraphlPane graphPane, Node node, Point point) { - Rectangle nodeScreenRectangle=new Rectangle(); - getNodeScreenBounds(graphPane,node,nodeScreenRectangle); - return nodeScreenRectangle.contains(point); - } - public void getNodeScreenBounds(GraphlPane graphPane, Node node, Rectangle nodeScreenRectangle) { Point nodePoint=graphPane.getScreenPointForNode(node); --- 136,139 ---- Index: InvisibleNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/InvisibleNodePainter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** InvisibleNodePainter.java 4 Oct 2004 10:21:03 -0000 1.3 --- InvisibleNodePainter.java 21 Oct 2004 16:00:46 -0000 1.4 *************** *** 53,68 **** } - - /* - * Overrides @see de.fzi.wim.guibase.graphview.view.NodePainter#isInNode(de.fzi.wim.guibase.graphview.view.JGraphPane, de.fzi.wim.guibase.graphview.graph.Node, java.awt.Point) - */ - public boolean isInNode(GraphlPane graphPane, Node node, Point point) { - Rectangle nodeScreenRectangle=new Rectangle(); - Point nodePoint=graphPane.getScreenPointForNode(node); - nodeScreenRectangle.setBounds(nodePoint.x-5,nodePoint.y-5,FOCUS_SIZE,FOCUS_SIZE); - return nodeScreenRectangle.contains(point); - } - - /* * Overrides @see de.fzi.wim.guibase.graphview.view.NodePainter#getNodeScreenBounds(de.fzi.wim.guibase.graphview.view.JGraphPane, de.fzi.wim.guibase.graphview.graph.Node, java.awt.Rectangle) --- 53,56 ---- *************** *** 70,85 **** public void getNodeScreenBounds(GraphlPane graphPane, Node node, Rectangle nodeScreenRectangle) { Point p=graphPane.getScreenPointForNode(node); ! nodeScreenRectangle.setFrame(p.x,p.y,1,1); ! } ! ! ! /* ! * Overrides @see de.fzi.wim.guibase.graphview.view.NodePainter#getToolTipText(de.fzi.wim.guibase.graphview.view.JGraphPane, de.fzi.wim.guibase.graphview.graph.Node, java.awt.Point) ! */ ! public String getToolTipText(GraphlPane graphPane, Node node, Point point) { ! return null; } - /* * Overrides @see org.mediavirus.graphl.view.GraphlNodePainter#getStyleName() --- 58,64 ---- public void getNodeScreenBounds(GraphlPane graphPane, Node node, Rectangle nodeScreenRectangle) { Point p=graphPane.getScreenPointForNode(node); ! nodeScreenRectangle.setFrame(p.x-4,p.y-4,8,8); } /* * Overrides @see org.mediavirus.graphl.view.GraphlNodePainter#getStyleName() *************** *** 96,100 **** } - /* * Overrides @see org.mediavirus.graphl.view.GraphlNodePainter#getVisualController() --- 75,78 ---- Index: ManhattanEdgePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/ManhattanEdgePainter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ManhattanEdgePainter.java 4 Oct 2004 10:21:03 -0000 1.3 --- ManhattanEdgePainter.java 21 Oct 2004 16:00:46 -0000 1.4 *************** *** 109,113 **** /* ! * Overrides @see org.mediavirus.graphl.view.GraphlEdgePainter#isPointInLabel(org.mediavirus.graphl.GraphlPane, org.mediavirus.graphl.RDFEdge, java.awt.Point) */ public boolean isPointInLabel(GraphlPane graphPane, RDFEdge edge, Point point) { --- 109,113 ---- /* ! * @see org.mediavirus.graphl.view.GraphlEdgePainter#isPointInLabel(org.mediavirus.graphl.GraphlPane, org.mediavirus.graphl.RDFEdge, java.awt.Point) */ public boolean isPointInLabel(GraphlPane graphPane, RDFEdge edge, Point point) { *************** *** 116,120 **** /* ! * Overrides @see org.mediavirus.graphl.view.GraphlEdgePainter#getStyleName() */ public String getName() { --- 116,120 ---- /* ! * @see org.mediavirus.graphl.view.GraphlEdgePainter#getStyleName() */ public String getName() { *************** *** 136,140 **** /* ! * Overrides @see org.mediavirus.graphl.view.GraphlEdgePainter#getLength(org.mediavirus.graphl.RDFEdge) */ public double getLength(RDFEdge edge) { --- 136,140 ---- /* ! * @see org.mediavirus.graphl.view.GraphlEdgePainter#getLength(org.mediavirus.graphl.RDFEdge) */ public double getLength(RDFEdge edge) { |
|
From: Flo L. <fl...@us...> - 2004-10-21 16:01:34
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4235/src/org/mediavirus/graphl/gui Modified Files: NodeContextMenu.java EdgeContextMenu.java CustomTypePanel.java Log Message: - BUG updating painter list in GraphlPane menus - BUG scale center in center of viewport - FEATURE SortedNodeLayouter sorts on arbitrary property - FEATURE SortedNodeLayouter configurable in GUI + configfile - FEATURE BoxNodePainter: configurable roundedRect + cornerRadius - BUG added beaninfo for manhattanEdgePainter Index: EdgeContextMenu.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/EdgeContextMenu.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** EdgeContextMenu.java 19 Oct 2004 16:17:06 -0000 1.13 --- EdgeContextMenu.java 21 Oct 2004 16:00:46 -0000 1.14 *************** *** 26,32 **** import org.mediavirus.util.ParseUtils; - import edu.unika.aifb.rdf.api.util.RDFUtil; - - /** * @author Flo Ledermann <led...@im...> --- 26,29 ---- Index: NodeContextMenu.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/NodeContextMenu.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** NodeContextMenu.java 19 Oct 2004 16:17:00 -0000 1.14 --- NodeContextMenu.java 21 Oct 2004 16:00:45 -0000 1.15 *************** *** 26,32 **** import org.mediavirus.util.ParseUtils; - import edu.unika.aifb.rdf.api.util.RDFUtil; - - /** * @author Flo Ledermann <led...@im...> --- 26,29 ---- Index: CustomTypePanel.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/CustomTypePanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CustomTypePanel.java 19 Oct 2004 16:17:06 -0000 1.3 --- CustomTypePanel.java 21 Oct 2004 16:00:46 -0000 1.4 *************** *** 20,26 **** import org.mediavirus.util.ParseUtils; - import edu.unika.aifb.rdf.api.util.RDFUtil; - - /** * @author Flo Ledermann <led...@im...> --- 20,23 ---- |
|
From: Flo L. <fl...@us...> - 2004-10-21 16:00:58
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4235/src/org/mediavirus/graphl/layout Modified Files: SortedNodeLayouter.java SpringEdgeLayouter.java GraphlLayoutStrategy.java Added Files: SortedNodeLayouterBeanInfo.java Log Message: - BUG updating painter list in GraphlPane menus - BUG scale center in center of viewport - FEATURE SortedNodeLayouter sorts on arbitrary property - FEATURE SortedNodeLayouter configurable in GUI + configfile - FEATURE BoxNodePainter: configurable roundedRect + cornerRadius - BUG added beaninfo for manhattanEdgePainter Index: GraphlLayoutStrategy.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/GraphlLayoutStrategy.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GraphlLayoutStrategy.java 14 Oct 2004 13:02:58 -0000 1.8 --- GraphlLayoutStrategy.java 21 Oct 2004 16:00:48 -0000 1.9 *************** *** 89,92 **** --- 89,93 ---- */ public void executeGraphLayoutStep() { + long layoutStartTime=System.currentTimeMillis(); for (int i=0;i<10;i++) { layoutEdges(); *************** *** 94,97 **** --- 95,100 ---- damp(); } + long layoutDuration = System.currentTimeMillis()-layoutStartTime; + if (layoutDuration > 0) System.out.println("layout time: " + layoutDuration + " FPS: " + 1000.0/layoutDuration); } /** Index: SpringEdgeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/SpringEdgeLayouter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SpringEdgeLayouter.java 19 Oct 2004 16:16:58 -0000 1.7 --- SpringEdgeLayouter.java 21 Oct 2004 16:00:48 -0000 1.8 *************** *** 5,10 **** package org.mediavirus.graphl.layout; - import javax.swing.JComponent; - import org.mediavirus.graphl.graph.Edge; import org.mediavirus.graphl.graph.Node; --- 5,8 ---- Index: SortedNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/SortedNodeLayouter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SortedNodeLayouter.java 14 Oct 2004 13:02:58 -0000 1.5 --- SortedNodeLayouter.java 21 Oct 2004 16:00:47 -0000 1.6 *************** *** 7,12 **** import java.util.Iterator; - import javax.swing.JComponent; - import org.mediavirus.graphl.graph.Node; import org.mediavirus.graphl.layout.GraphlLayoutStrategy.GraphManager; --- 7,10 ---- *************** *** 26,30 **** int orientation = TOPTOBOTTOM; ! boolean align = true; /* --- 24,34 ---- int orientation = TOPTOBOTTOM; ! ! boolean align = false; ! boolean proportional = false; ! ! float distance = 150.0f; ! ! String property = null; /* *************** *** 38,50 **** movement.dy=0; for (Iterator nodes = getAssignedElements().iterator(); nodes.hasNext();) { Node other = (Node) nodes.next(); if (orientation == LEFTTORIGHT) { ! // TODO (1, 1h) change all getLabel() calls to generic sorting mechanism ! if ((other.getLabel().compareTo(node.getLabel()) < 0) && (other.getCenterX() > node.getCenterX()-30)) { movement.dx += (other.getCenterX()-node.getCenterX()+30) / 10; } ! else if ((other.getLabel().compareTo(node.getLabel()) > 0) && (other.getCenterX() < node.getCenterX()+30)) { movement.dx -= (node.getCenterX()+30-other.getCenterX()) / 10; } --- 42,71 ---- movement.dy=0; + String val1, val2; + + if (property != null) { + val1 = node.getProperty(property, "").toLowerCase(); + } + else { + val1 = node.getLabel().toLowerCase(); + } + for (Iterator nodes = getAssignedElements().iterator(); nodes.hasNext();) { Node other = (Node) nodes.next(); + + if (property != null) { + val2 = other.getProperty(property, "").toLowerCase(); + } + else { + val2 = other.getLabel().toLowerCase(); + } + int comp = val2.compareTo(val1); + if (orientation == LEFTTORIGHT) { ! if (comp < 0) { movement.dx += (other.getCenterX()-node.getCenterX()+30) / 10; } ! else if (comp > 0) { movement.dx -= (node.getCenterX()+30-other.getCenterX()) / 10; } *************** *** 55,62 **** if (orientation == RIGHTTOLEFT) { ! if ((other.getLabel().compareTo(node.getLabel()) > 0) && (other.getCenterX() > node.getCenterX()-30)) { movement.dx += (other.getCenterX()-node.getCenterX()+30) / 10; } ! else if ((other.getLabel().compareTo(node.getLabel()) < 0) && (other.getCenterX() < node.getCenterX()+30)) { movement.dx -= (node.getCenterX()+30-other.getCenterX()) / 10; } --- 76,83 ---- if (orientation == RIGHTTOLEFT) { ! if (comp > 0) { movement.dx += (other.getCenterX()-node.getCenterX()+30) / 10; } ! else if (comp < 0) { movement.dx -= (node.getCenterX()+30-other.getCenterX()) / 10; } *************** *** 67,75 **** if (orientation == TOPTOBOTTOM) { ! if ((other.getLabel().compareTo(node.getLabel()) < 0) && (other.getCenterY() > node.getCenterY()-30)) { ! movement.dy += (other.getCenterY()-node.getCenterY()+30) / 10; } ! else if ((other.getLabel().compareTo(node.getLabel()) > 0) && (other.getCenterY() < node.getCenterY()+30)) { ! movement.dy -= (node.getCenterY()+30-other.getCenterY()) / 10; } if (align) { --- 88,96 ---- if (orientation == TOPTOBOTTOM) { ! if (comp < 0) { ! movement.dy += (other.getCenterY()-node.getCenterY()+distance) / 10; } ! else if (comp > 0) { ! movement.dy -= (node.getCenterY()-other.getCenterY()+distance) / 10; } if (align) { *************** *** 79,86 **** if (orientation == LEFTTORIGHT) { ! if ((other.getLabel().compareTo(node.getLabel()) > 0) && (other.getCenterY() > node.getCenterY()-30)) { movement.dy += (other.getCenterY()-node.getCenterY()+30) / 10; } ! else if ((other.getLabel().compareTo(node.getLabel()) < 0) && (other.getCenterY() < node.getCenterY()+30)) { movement.dy -= (node.getCenterY()+30-other.getCenterY()) / 10; } --- 100,107 ---- if (orientation == LEFTTORIGHT) { ! if (comp > 0){ movement.dy += (other.getCenterY()-node.getCenterY()+30) / 10; } ! else if (comp < 0) { movement.dy -= (node.getCenterY()+30-other.getCenterY()) / 10; } *************** *** 118,136 **** /* ! * Overrides @see org.mediavirus.graphl.view.Facet#hasVisualController() */ public boolean hasVisualController() { ! return false; ! } ! ! /* ! * Overrides @see org.mediavirus.graphl.view.Facet#getVisualController() ! */ ! public JComponent getVisualController() { ! return null; } /* ! * Overrides @see org.mediavirus.graphl.view.Facet#isSameClass(java.lang.Object) */ public boolean isSameClass(Object o) { --- 139,150 ---- /* ! * @see org.mediavirus.graphl.view.Facet#hasVisualController() */ public boolean hasVisualController() { ! return true; } /* ! * @see org.mediavirus.graphl.view.Facet#isSameClass(java.lang.Object) */ public boolean isSameClass(Object o) { *************** *** 138,141 **** --- 152,191 ---- } + /** + * @return Returns the align. + */ + public boolean isAlign() { + return align; + } + /** + * @param align The align to set. + */ + public void setAlign(boolean align) { + this.align = align; + } + /** + * @return Returns the orientation. + */ + public int getOrientation() { + return orientation; + } + /** + * @param orientation The orientation to set. + */ + public void setOrientation(int orientation) { + this.orientation = orientation; + } + /** + * @return Returns the proportional. + */ + public boolean isProportional() { + return proportional; + } + /** + * @param proportional The proportional to set. + */ + public void setProportional(boolean relative) { + this.proportional = relative; + } /* * Overrides @see java.lang.Object#clone() *************** *** 154,161 **** /* ! * Overrides @see org.mediavirus.graphl.layout.NodeLayouter#isDraggable() */ public boolean isDraggable() { return true; } } --- 204,273 ---- /* ! * @see org.mediavirus.graphl.layout.NodeLayouter#isDraggable() */ public boolean isDraggable() { return true; } + + + /** + * @return Returns the property. + */ + public String getProperty() { + return property; + } + /** + * @param property The property to set. + */ + public void setProperty(String property) { + this.property = property; + } + /** + * @return Returns the distance. + */ + public float getDistance() { + return distance; + } + /** + * @param distance The distance to set. + */ + public void setDistance(float scaleFactor) { + this.distance = scaleFactor; + } + /** + * @see org.mediavirus.graphl.view.Facet#setConfigurationNode(org.mediavirus.graphl.graph.Node) + */ + public void setConfigurationNode(Node node) { + String str = node.getProperty("http://www.mediavirus.org/graphl#distance"); + if (str != null) { + setDistance(Float.parseFloat(str)); + } + str = node.getProperty("http://www.mediavirus.org/graphl#property"); + if ( str != null) { + setProperty(str); + } + str = node.getProperty("http://www.mediavirus.org/graphl#align"); + if (str != null) { + setAlign(str.equalsIgnoreCase("true")); + } + str = node.getProperty("http://www.mediavirus.org/graphl#proportional"); + if (str != null) { + setProportional(str.equalsIgnoreCase("true")); + } + str = node.getProperty("http://www.mediavirus.org/graphl#orientation"); + if (str != null) { + if (str.equalsIgnoreCase("TOPTOBOTTOM")) { + setOrientation(TOPTOBOTTOM); + } + else if (str.equalsIgnoreCase("BOTTOMTOTOP")) { + setOrientation(BOTTOMTOTOP); + } + else if (str.equalsIgnoreCase("LEFTTORIGHT")) { + setOrientation(LEFTTORIGHT); + } + else if (str.equalsIgnoreCase("RIGHTTOLEFT")) { + setOrientation(RIGHTTOLEFT); + } + } + } } --- NEW FILE: SortedNodeLayouterBeanInfo.java --- /* * Created on 19.10.2004 by flo */ package org.mediavirus.graphl.layout; import java.beans.BeanDescriptor; import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; import java.beans.SimpleBeanInfo; /** * @author flo * created: 19.10.2004 19:39:20 */ public class SortedNodeLayouterBeanInfo extends SimpleBeanInfo { private final static Class beanClass = SortedNodeLayouter.class; public BeanDescriptor getBeanDescriptor() { return new BeanDescriptor(beanClass); } public PropertyDescriptor[] getPropertyDescriptors() { try { PropertyDescriptor rv[] = { new PropertyDescriptor("distance", beanClass), new PropertyDescriptor("align", beanClass), new PropertyDescriptor("proportional", beanClass), new PropertyDescriptor("orientation", beanClass), new PropertyDescriptor("property", beanClass) }; return rv; } catch (IntrospectionException e) { throw new Error(e.toString()); } } } |
|
From: Flo L. <fl...@us...> - 2004-10-21 16:00:58
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/vocabulary In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4235/src/org/mediavirus/graphl/vocabulary Modified Files: SimpleVocabularyRegistry.java Log Message: - BUG updating painter list in GraphlPane menus - BUG scale center in center of viewport - FEATURE SortedNodeLayouter sorts on arbitrary property - FEATURE SortedNodeLayouter configurable in GUI + configfile - FEATURE BoxNodePainter: configurable roundedRect + cornerRadius - BUG added beaninfo for manhattanEdgePainter Index: SimpleVocabularyRegistry.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/vocabulary/SimpleVocabularyRegistry.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SimpleVocabularyRegistry.java 19 Oct 2004 16:17:07 -0000 1.4 --- SimpleVocabularyRegistry.java 21 Oct 2004 16:00:49 -0000 1.5 *************** *** 11,16 **** import org.mediavirus.util.ParseUtils; - import edu.unika.aifb.rdf.api.util.RDFUtil; - /** * @author Flo Ledermann <led...@im...> --- 11,14 ---- |
|
From: Flo L. <fl...@us...> - 2004-10-21 16:00:58
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4235/src/org/mediavirus/graphl/interaction Modified Files: GraphlManipulator.java Log Message: - BUG updating painter list in GraphlPane menus - BUG scale center in center of viewport - FEATURE SortedNodeLayouter sorts on arbitrary property - FEATURE SortedNodeLayouter configurable in GUI + configfile - FEATURE BoxNodePainter: configurable roundedRect + cornerRadius - BUG added beaninfo for manhattanEdgePainter Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GraphlManipulator.java 14 Oct 2004 13:03:06 -0000 1.5 --- GraphlManipulator.java 21 Oct 2004 16:00:49 -0000 1.6 *************** *** 237,242 **** } else if (!doDragNode && oldTranslation != null){ ! double dx = mousePos.getX() - dragStart.getX(); ! double dy = mousePos.getY() - dragStart.getY(); graphPane.setTranslation(dx + oldTranslation.getX(), dy + oldTranslation.getY()); } --- 237,242 ---- } else if (!doDragNode && oldTranslation != null){ ! double dx = (mousePos.getX() - dragStart.getX()) / graphPane.getScaleFactor(); ! double dy = (mousePos.getY() - dragStart.getY()) / graphPane.getScaleFactor(); graphPane.setTranslation(dx + oldTranslation.getX(), dy + oldTranslation.getY()); } |
|
From: Flo L. <fl...@us...> - 2004-10-21 16:00:58
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4235/src/org/mediavirus/graphl Modified Files: GraphlApplication.java GraphlPane.java GraphlPanel.java Log Message: - BUG updating painter list in GraphlPane menus - BUG scale center in center of viewport - FEATURE SortedNodeLayouter sorts on arbitrary property - FEATURE SortedNodeLayouter configurable in GUI + configfile - FEATURE BoxNodePainter: configurable roundedRect + cornerRadius - BUG added beaninfo for manhattanEdgePainter Index: GraphlPanel.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlPanel.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** GraphlPanel.java 19 Oct 2004 16:17:08 -0000 1.16 --- GraphlPanel.java 21 Oct 2004 16:00:47 -0000 1.17 *************** *** 181,185 **** public void stateChanged(ChangeEvent e) { ! graphPane.setScale(zoomSlider.getValue()/100.0f); getJButton().setText("Zoom: " + zoomSlider.getValue() + "%"); } --- 181,185 ---- public void stateChanged(ChangeEvent e) { ! graphPane.setScaleFactor(zoomSlider.getValue()/100.0f); getJButton().setText("Zoom: " + zoomSlider.getValue() + "%"); } *************** *** 194,198 **** if (layoutBox == null) { layoutBox = new JCheckBox(); ! layoutBox.setLabel("dynamic Layout"); layoutBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { --- 194,198 ---- if (layoutBox == null) { layoutBox = new JCheckBox(); ! layoutBox.setText("dynamic Layout"); layoutBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { *************** *** 245,249 **** } ! private JComponent getNodePainterMenu() { if (nodePainterMenu == null) { nodePainterMenu = new JComboBox(); --- 245,249 ---- } ! private JComboBox getNodePainterMenu() { if (nodePainterMenu == null) { nodePainterMenu = new JComboBox(); *************** *** 267,271 **** } ! private JComponent getEdgePainterMenu() { if (edgePainterMenu == null) { edgePainterMenu = new JComboBox(); --- 267,271 ---- } ! private JComboBox getEdgePainterMenu() { if (edgePainterMenu == null) { edgePainterMenu = new JComboBox(); *************** *** 290,293 **** --- 290,308 ---- } + public void updatePainters() { + getNodePainterMenu().removeAllItems(); + getEdgePainterMenu().removeAllItems(); + Vector painters = graphPane.getFacetRegistry().getAvailableNodePainters(); + for (Iterator iter = painters.iterator(); iter.hasNext();) { + NodePainter painter = (NodePainter) iter.next(); + getNodePainterMenu().addItem(painter); + } + painters = graphPane.getFacetRegistry().getAvailableEdgePainters(); + for (Iterator iter = painters.iterator(); iter.hasNext();) { + EdgePainter painter = (EdgePainter) iter.next(); + getEdgePainterMenu().addItem(painter); + } + } + public boolean nodeRemove(Node n) { return true; Index: GraphlApplication.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplication.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** GraphlApplication.java 19 Oct 2004 16:17:08 -0000 1.12 --- GraphlApplication.java 21 Oct 2004 16:00:47 -0000 1.13 *************** *** 426,429 **** --- 426,431 ---- mainPanel.graphPane.setFacetRegistry(new GraphFacetRegistry(settings,(Node)configurations.get(0))); } + + mainPanel.updatePainters(); } Index: GraphlPane.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlPane.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** GraphlPane.java 14 Oct 2004 13:03:04 -0000 1.13 --- GraphlPane.java 21 Oct 2004 16:00:47 -0000 1.14 *************** *** 63,70 **** Layouter layouter; ! AffineTransform transform = null; ! AffineTransform translationXF = null; ! AffineTransform scaleXF = null; private Point2D translationPoint = new Point2D.Double(0,0); FacetRegistry facetRegistry = new SimpleFacetRegistry(); --- 63,73 ---- Layouter layouter; ! AffineTransform transform = new AffineTransform(); ! AffineTransform translationXF = new AffineTransform(); ! AffineTransform scaleXF = new AffineTransform(); ! AffineTransform centerXF = new AffineTransform(); ! private Point2D translationPoint = new Point2D.Double(0,0); + float scaleFactor = 1.0f; FacetRegistry facetRegistry = new SimpleFacetRegistry(); *************** *** 129,132 **** --- 132,136 ---- return vocabularyRegistry; } + /** * @param vocabularyRegistry The VocabularyRegistry to set. *************** *** 135,181 **** this.vocabularyRegistry = vocabularyRegistry; } - /** - * @param graph - */ - - // private void setupDefaultPainters() { - // - // // register the available painter classes (for user selection) - // facetRegistry.registerEdgePainter(new StraightLineEdgePainter()); - // facetRegistry.registerEdgePainter(new ManhattanEdgePainter()); - // facetRegistry.registerEdgePainter(new InvisibleEdgePainter()); - // - // facetRegistry.registerNodePainter(new BoxNodePainter()); - // facetRegistry.registerNodePainter(new ImageNodePainter()); - // facetRegistry.registerNodePainter(new InvisibleNodePainter()); - // - // facetRegistry.registerEdgeLayouter(new SpringEdgeLayouter()); - // facetRegistry.registerEdgeLayouter(new NeutralEdgeLayouter()); - // - // facetRegistry.registerNodeLayouter(new UnconstrainedNodeLayouter()); - // facetRegistry.registerNodeLayouter(new RepulsionNodeLayouter()); - // facetRegistry.registerNodeLayouter(new AbsoluteNodeLayouter()); - // facetRegistry.registerNodeLayouter(new SortedNodeLayouter()); - // - // // set default painters - // facetRegistry.setDefaultEdgePainter(new StraightLineEdgePainter()); - // facetRegistry.setDefaultNodePainter(new BoxNodePainter()); - // facetRegistry.setDefaultEdgeLayouter(new SpringEdgeLayouter()); - // facetRegistry.setDefaultNodeLayouter(new RepulsionNodeLayouter()); - // - // } private void updateTransform() { transform = new AffineTransform(); ! if (translationXF != null) { transform.concatenate(translationXF); } ! if (scaleXF != null) { transform.concatenate(scaleXF); } repaint(); } ! public void setScale(float scale) { ! scaleXF = AffineTransform.getScaleInstance(scale, scale); updateTransform(); } public void setTranslation(double xoffset, double yoffset) { translationPoint = new Point2D.Double(xoffset, yoffset); --- 139,164 ---- this.vocabularyRegistry = vocabularyRegistry; } private void updateTransform() { transform = new AffineTransform(); ! transform.concatenate(centerXF); ! transform.concatenate(scaleXF); ! transform.concatenate(translationXF); repaint(); } ! public void setScaleFactor(float scaleFactor) { ! this.scaleFactor = scaleFactor; ! scaleXF = AffineTransform.getScaleInstance(scaleFactor, scaleFactor); updateTransform(); } + /** + * @return Returns the scaleFactor. + */ + public float getScaleFactor() { + return scaleFactor; + } + public void setTranslation(double xoffset, double yoffset) { translationPoint = new Point2D.Double(xoffset, yoffset); *************** *** 193,196 **** --- 176,180 ---- if (transform != null) g2.setTransform(transform); + long renderStartTime=System.currentTimeMillis(); Rectangle clipRectangle=g.getClipBounds(); Color oldColor=g.getColor(); *************** *** 205,209 **** Rectangle bounds=new Rectangle(); Iterator iterator; - long renderStartTime=System.currentTimeMillis(); while (nextZ < Integer.MAX_VALUE) { curZ = nextZ; --- 189,192 ---- *************** *** 241,245 **** for (int i=0;i<manipulators.size();i++) ((Manipulator)manipulators.get(i)).paint(g2); ! //long renderDuration = System.currentTimeMillis()-renderStartTime; } } --- 224,229 ---- for (int i=0;i<manipulators.size();i++) ((Manipulator)manipulators.get(i)).paint(g2); ! long renderDuration = System.currentTimeMillis()-renderStartTime; ! if (renderDuration > 0) System.out.println("render time: " + renderDuration + " FPS: " + 1000.0/renderDuration); } } *************** *** 283,287 **** public void doLayout() { super.doLayout(); ! setTranslation(getWidth()/2, getHeight()/2); } --- 267,272 ---- public void doLayout() { super.doLayout(); ! centerXF = AffineTransform.getTranslateInstance(getWidth()/2, getHeight()/2); ! updateTransform(); } *************** *** 328,332 **** } ! // we have to update all nodes' facets, because new nodes may have changed an existing node's type // TODO (2) implement node and edge change notification in GraphListener // then we can detect type changes properly --- 313,318 ---- } ! // we have to update all nodes' facets, because new nodes may have changed ! // an existing node's type // TODO (2) implement node and edge change notification in GraphListener // then we can detect type changes properly *************** *** 437,442 **** */ protected void paintEdge(Graphics2D g,Edge edge) { ! EdgePainter edgePainter = getPainterForEdge(edge); ! edgePainter.paintEdge(this, g, edge, selection.isEdgeSelected(edge), false); } --- 423,427 ---- */ protected void paintEdge(Graphics2D g,Edge edge) { ! edge.getCurrentPainter().paintEdge(this, g, edge, selection.isEdgeSelected(edge), false); } *************** *** 448,453 **** */ protected void paintNode(Graphics2D g,Node node) { ! NodePainter nodePainter = getPainterForNode(node); ! nodePainter.paintNode(this, g, node, selection.isNodeSelected(node), false); } --- 433,437 ---- */ protected void paintNode(Graphics2D g,Node node) { ! node.getCurrentPainter().paintNode(this, g, node, selection.isNodeSelected(node), false); } *************** *** 556,561 **** */ public void getNodeScreenBounds(Node node,Rectangle nodeScreenRectangle) { ! NodePainter nodePainter = getPainterForNode(node); ! nodePainter.getNodeScreenBounds(this,node,nodeScreenRectangle); } /** --- 540,544 ---- */ public void getNodeScreenBounds(Node node,Rectangle nodeScreenRectangle) { ! node.getCurrentPainter().getNodeScreenBounds(this,node,nodeScreenRectangle); } /** *************** *** 576,581 **** */ public void getEdgeScreenBounds(Edge edge,Rectangle edgeScreenRectangle) { ! EdgePainter edgePainter=getPainterForEdge(edge); ! edgePainter.getEdgeScreenBounds(this,edge,edgeScreenRectangle); } /** --- 559,563 ---- */ public void getEdgeScreenBounds(Edge edge,Rectangle edgeScreenRectangle) { ! edge.getCurrentPainter().getEdgeScreenBounds(this,edge,edgeScreenRectangle); } /** *************** *** 590,610 **** repaint(edgeScreenRectangle); } ! /** ! * Returns the text for the tool-tip. ! * ! * @param event the mouse event ! * @return the text for the tool-tip ! */ ! public String getToolTipText(MouseEvent event) { ! Point point = event.getPoint(); ! Node node = getNodeAtPoint(point); ! if (node != null) { ! NodePainter nodePainter = getPainterForNode(node); ! String toolTipText = nodePainter.getToolTipText(this,node,point); ! if (toolTipText != null) ! return toolTipText; ! } ! return super.getToolTipText(event); ! } /** * Processes the component event. --- 572,576 ---- repaint(edgeScreenRectangle); } ! /** * Processes the component event. |
|
From: Flo L. <fl...@us...> - 2004-10-21 16:00:58
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4235/src/org/mediavirus/graphl/graph/rdf Modified Files: RDFNode.java Log Message: - BUG updating painter list in GraphlPane menus - BUG scale center in center of viewport - FEATURE SortedNodeLayouter sorts on arbitrary property - FEATURE SortedNodeLayouter configurable in GUI + configfile - FEATURE BoxNodePainter: configurable roundedRect + cornerRadius - BUG added beaninfo for manhattanEdgePainter Index: RDFNode.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf/RDFNode.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RDFNode.java 19 Oct 2004 16:16:58 -0000 1.5 --- RDFNode.java 21 Oct 2004 16:00:48 -0000 1.6 *************** *** 13,18 **** import org.mediavirus.util.ParseUtils; - import edu.unika.aifb.rdf.api.util.RDFUtil; - /** * --- 13,16 ---- |
|
From: Flo L. <fl...@us...> - 2004-10-21 15:52:20
|
Update of /cvsroot/graphl/graphl/graphs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2007/graphs Added Files: ff.rdf Log Message: added testcase for geo positioning --- NEW FILE: ff.rdf --- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ff="http://www.funkfeuer.at/vocab#" xmlns:foo="http://www.mediavirus.org/graphl/foo#" xmlns:map="http://fabl.net/vocabularies/geography/map/1.1/" xmlns:geom="http://fabl.net/vocabularies/geometry/1.1/" xmlns:geom2d="http://fabl.net/vocabularies/geometry2d/1.1/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"> <map:Map rdf:nodeID="viennamap"> <map:image rdf:resource="http://localhost/graphl/images/wien_small.png"/> <map:coverage> <geom2d:Box> <geom:xmin>0</geom:xmin> <geom:ymin>0</geom:ymin> <geom:xmax>976</geom:xmax> <geom:ymax>728</geom:ymax> </geom2d:Box> </map:coverage> <ff:transformation> <ff:Matrix3 ff:matrix3="6670.69 -556.921 -81782 -257.162 -8739.2 425918 0 0 1"/> <!-- so bekommt man die matrix: 3 punkte in GPS-coords als spatenvektoren aufschreiben, z=1 3 punkte im target-image (pixelkoordinaten von rechts oben) als spaltenvektoren aufschreiben, z=1 die drei gps-vektoren zu einer 3x3 matrix zusammenfassen (nebeneinanderschreiben) => matrix A detto mit pixelkoords => matrix B gesuchte matrix M = B . A^-1 ausrechen mit z.B. http://www.math.com/students/tools => matrices --> </ff:transformation> </map:Map> <ff:Node rdf:nodeID="vivi" ff:id="vivi"> <ff:wer> <foo:Company foaf:name="ATnet"/> </ff:wer> <ff:ort> <foo:Address foo:streetAddress="Landesgerichtsstrasse 18" foo:postalCode="1010" foo:city="Wien" foo:country="Austria"/> </ff:ort> <ff:location> <geo:Point geo:lat="48.213500" geo:long="16.356444" geo:alt="0"><!-- 491 350 --> <ff:map rdf:nodeID="viennamap"/> </geo:Point> </ff:location> </ff:Node> <ff:Node rdf:nodeID="fl49" ff:id="fl49"> <ff:ort> <foo:Address foo:streetAddress="Floetzersteig 49" foo:postalCode="1160" foo:city="Wien" foo:country="Austria"/> </ff:ort> <ff:location> <geo:Point geo:lat="48.207306" geo:long="16.295778"><!-- 72 433 --> <ff:map rdf:nodeID="viennamap"/> </geo:Point> </ff:location> </ff:Node> <ff:Node rdf:nodeID="pa3" ff:id="pa3"> <ff:wer> <foo:Company foaf:name="ITG"/> </ff:wer> <ff:ort> <foo:Address foo:streetAddress="Panikengasse 3" foo:postalCode="1160" foo:city="Wien" foo:country="Austria"/> </ff:ort> <ff:location> <geo:Point geo:lat="48.206139" geo:long="16.323444"><!-- 277 432 --> <ff:map rdf:nodeID="viennamap"/> </geo:Point> </ff:location> <ff:connectionWith rdf:nodeID="fl49"/> </ff:Node> <ff:Node rdf:nodeID="ma89" ff:id="ma89"> <ff:ort> <foo:Address foo:streetAddress="Mariahilferstrasse 89" foo:postalCode="1060" foo:city="Wien" foo:country="Austria"/> </ff:ort> <ff:location> <geo:Point geo:lat="48.197306" geo:long="16.347861"><!-- 425 507 --> <ff:map rdf:nodeID="viennamap"/> </geo:Point> </ff:location> </ff:Node> <ff:Node rdf:nodeID="oag18" ff:id="oag18"> <ff:wer> <foaf:Person foaf:name="Andreas"/> </ff:wer> <ff:ort> <foo:Address foo:streetAddress="Obere Augartenstrasse 18" foo:postalCode="1020" foo:city="Wien" foo:country="Austria"/> </ff:ort> <ff:location> <geo:Point geo:lat="48.224028" geo:long="16.373028"><!-- 578 267 --> <ff:map rdf:nodeID="viennamap"/> </geo:Point> </ff:location> </ff:Node> <ff:Node rdf:nodeID="ho6" ff:id="ho6"> <ff:wer> <foaf:Person foaf:name="Kolbeck"/> </ff:wer> <ff:ort> <foo:Address foo:streetAddress="Hoerlgasse 6" foo:postalCode="1090" foo:city="Wien" foo:country="Austria"/> </ff:ort> <ff:connectionWith rdf:nodeID="oag18"/> <ff:connectionWith rdf:nodeID="vivi"/> </ff:Node> <ff:Node rdf:nodeID="wuk" ff:id="wuk"> <ff:wer> <foaf:Institution foaf:name="WUK"/> </ff:wer> <ff:ort> <foo:Address foo:streetAddress="Waehringerstrasse 59" foo:postalCode="1090" foo:city="Wien" foo:country="Austria"/> </ff:ort> <ff:connectionWith rdf:nodeID="oag18"/> <ff:connectionWith rdf:nodeID="vivi"/> </ff:Node> <ff:Node rdf:nodeID="kr70" ff:id="kr70"> <ff:wer> <foaf:Institution foaf:name="OHV"/> </ff:wer> <ff:ort> <foo:Address foo:streetAddress="Kreuzgasse 70" foo:postalCode="1170" foo:city="Wien" foo:country="Austria"/> </ff:ort> <ff:connectionWith rdf:nodeID="wuk"/> <ff:connectionWith rdf:nodeID="pa3"/> </ff:Node> <ff:Node rdf:nodeID="ma51" ff:id="ma51"> <ff:wer> <foaf:Institution foaf:name="intermaps"/> </ff:wer> <ff:ort> <foo:Address foo:streetAddress="Mariahilferstrasse 51" foo:postalCode="1060" foo:city="Wien" foo:country="Austria"/> </ff:ort> </ff:Node> <ff:Node rdf:nodeID="og22" ff:id="og22"> <ff:wer> <foaf:Institution foaf:name="TTB"/> </ff:wer> <ff:ort> <foo:Address foo:streetAddress="Operngasse 22" foo:postalCode="1040" foo:city="Wien" foo:country="Austria"/> </ff:ort> <ff:connectionWith rdf:nodeID="ma51"/> </ff:Node> <ff:Node rdf:nodeID="wo7" ff:id="wo7"> <ff:wer> <foaf:Person foaf:name="Dagmar"/> </ff:wer> <ff:ort> <foo:Address foo:streetAddress="Wohllebengasse 7" foo:postalCode="1040" foo:city="Wien" foo:country="Austria"/> </ff:ort> <ff:connectionWith rdf:nodeID="ma51"/> </ff:Node> <ff:Node rdf:nodeID="la17" ff:id="la17"> <ff:wer> <foaf:Person foaf:name="rupee"/> </ff:wer> <ff:ort> <foo:Address foo:streetAddress="Lampigasse 17" foo:postalCode="1020" foo:city="Wien" foo:country="Austria"/> </ff:ort> <ff:connectionWith rdf:nodeID="vivi"/> </ff:Node> <ff:Node rdf:nodeID="kh" ff:id="kh"> <ff:wer> <foaf:Institution foaf:name="Kuenstlerhaus"/> </ff:wer> <ff:ort> <foo:Address foo:streetAddress="Karlsplatz 5" foo:postalCode="1010" foo:city="Wien" foo:country="Austria"/> </ff:ort> </ff:Node> <!-- vivi ATnet - Landesgerichtsstr 18 1010 Wien N 48°12'48.6 E 16°21'23.2 fl49 Floetzersteig 49 1160 Wien N 48°12'26.3 E 16°17'44.8 pa3 ITG - Panikeng 3 1160 Wien N 48°12'22.1 E 16°19'24.4 ma89 Mariahilferstr 89 1060 Wien N 48°11'50.3 E 16°20'52.3 oag18 Andreas Obere Augartenstr 1020 Wien N 48°13'26.5 E 16°22'22.9 ho6 Kolbeck - Hoerlg 6 1090 Wien N ??°??'??.? E ??°??'??.? wuk WUK - Waehringerstr 59 1090 Wien N ??°??'??.? E ??°??'??.? kr70 OHV - Kreuzgasse 70 1170 Wien N ??°??'??.? E ??°??'??.? ma51 intermaps Mariahilfertr 51 1060 Wien N ??°??'??.? E ??°??'??.? og22 TTB - Operngasse 22 1040 Wien N ??°??'??.? E ??°??'??.? wo7? Dagmar Wohllebengasse 7 1040 Wien N ??°??'??.? E ??°??'??.? la17 rupee Lampigasse 17 1020 Wien N ??°??'??.? E ??°??'??.? kh Kuentlerhaus karlsplatz 5 1010 wien kh.funkfeuer.at converted with http://www.fcc.gov/mb/audio/bickel/DDDMMSS-decimal.html http://www.unn.ac.uk/~evgp1/gary/deg2dec.htm --> </rdf:RDF> |