55import javafx .geometry .Bounds ;
66import javafx .scene .layout .StackPane ;
77import javafx .scene .shape .Ellipse ;
8+ import javafx .scene .shape .Shape ;
89import javafx .scene .text .Text ;
910import javafx .util .Pair ;
1011
@@ -52,7 +53,6 @@ public class UndefinedElementTypeException extends Exception {
5253 private ArrayList <Edge > incomingEdges , outgoingEdges ;
5354 private boolean isBlankNode ;
5455 private boolean isIri ;
55- private boolean isPlaceholder = false ;
5656 private String typeDefinition ;
5757
5858 private String rdfsLabel , rdfsComment ;
@@ -65,14 +65,11 @@ public class UndefinedElementTypeException extends Exception {
6565 * @throws OutsideElementException if the container is not castable to a stackpane (aka it is outside the canvas.
6666 * @throws UndefinedElementTypeException if the name of the Vertex does not correspond to any of the GraphElemTypes.
6767 */
68- public Vertex (EventTarget element , String rdfsLabel , String rdfsComment , boolean isPlaceholder )
68+ public Vertex (EventTarget element , String rdfsLabel , String rdfsComment )
6969 throws OutsideElementException , UndefinedElementTypeException {
7070 this (element );
7171 this .rdfsLabel = rdfsLabel ;
7272 this .rdfsComment = rdfsComment ;
73- this .isPlaceholder = isPlaceholder ;
74-
75- if (this .isPlaceholder ) this .elementType = GraphElemType .INSTANCE_CLASS ;
7673 }
7774
7875 /**
@@ -98,7 +95,9 @@ public Vertex(EventTarget element) throws OutsideElementException, UndefinedElem
9895 throw new OutsideElementException ();
9996 }
10097
101- this .name = ((Text ) container .getChildren ().get (1 )).getText ();
98+ Shape shape = (Shape ) container .getChildren ().get (0 );
99+ Text name = (Text ) container .getChildren ().get (1 );
100+ this .name = name .getText ();
102101
103102 // determine if the Vertex is a Blank Node or fully qualified IRI.
104103 if (this .name .charAt (0 ) == '_' ) {
@@ -114,7 +113,9 @@ public Vertex(EventTarget element) throws OutsideElementException, UndefinedElem
114113 }
115114
116115 // determine whether the Vertex is a class, global literal or instance literal.
117- if (container .getChildren ().get (0 ) instanceof Ellipse ) this .elementType = GraphElemType .GLOBAL_CLASS ;
116+ if (shape instanceof Ellipse && shape .getStrokeDashArray ().size () == 0 )
117+ this .elementType = GraphElemType .GLOBAL_CLASS ;
118+ else if (shape instanceof Ellipse ) this .elementType = GraphElemType .INSTANCE_CLASS ;
118119 else if (this .name .matches (globalLiteralRegex )) this .elementType = GraphElemType .GLOBAL_LITERAL ;
119120 else if (this .name .matches (instanceLiteralRegex )) this .elementType = GraphElemType .INSTANCE_LITERAL ;
120121 else throw new UndefinedElementTypeException ();
@@ -323,8 +324,6 @@ public void addOutgoingEdge(Edge e){
323324
324325 public boolean isIri () { return isIri ; }
325326
326- public boolean isPlaceholder () { return isPlaceholder ; }
327-
328327 public static char getNextBlankNodeName () {
329328 nextBlankNodeName += 1 ;
330329 blankNodeNames .add (nextBlankNodeName );
0 commit comments