File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
src/main/java/com/marginallyclever/nodegraphcore Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 44
55 <groupId >com.marginallyclever</groupId >
66 <artifactId >nodegraphcore</artifactId >
7- <version >1.5.12 </version >
7+ <version >1.5.13 </version >
88
99 <name >NodeGraphCore</name >
1010 <description >Flow based programming in Java.</description >
Original file line number Diff line number Diff line change @@ -151,6 +151,19 @@ public void removeConnectionsToNode(Node n) {
151151 connections .removeAll (toRemove );
152152 }
153153
154+ /**
155+ * @param node the subject to check
156+ * @return true if the given {@link Node} has any {@link Connection}s to the {@link Input} ports.
157+ */
158+ public boolean nodeHasInputConnections (Node node ) {
159+ for (Connection c : connections ) {
160+ for (int i = 0 ; i <node .getNumPorts (); ++i ) {
161+ if (c .getInput () == node .getPort (i )) return true ;
162+ }
163+ }
164+ return false ;
165+ }
166+
154167 /**
155168 * Searches this {@link Graph} for an equivalent {@link Connection}.
156169 * @param connection the item to match.
Original file line number Diff line number Diff line change @@ -193,8 +193,8 @@ public JSONObject toJSON() throws JSONException {
193193 public void fromJSON (JSONObject jo ) throws JSONException , ClassCastException {
194194 name = jo .getString ("name" );
195195 setValue (jo .has ("value" )
196- ? ( T ) DAO4JSONFactory .fromJSON (this .type ,jo .get ("value" ))
197- : null );
196+ ? DAO4JSONFactory .fromJSON (this .type ,jo .get ("value" ))
197+ : getValue () );
198198 RectangleDAO4JSON dao = new RectangleDAO4JSON ();
199199 rectangle .setBounds (dao .fromJSON (jo .getJSONObject ("rectangle" )));
200200 }
You can’t perform that action at this time.
0 commit comments