File tree Expand file tree Collapse file tree 10 files changed +54
-4
lines changed
src/main/java/com/marginallyclever/nodegraphcore Expand file tree Collapse file tree 10 files changed +54
-4
lines changed Original file line number Diff line number Diff line change 1313import java .awt .*;
1414import java .util .ArrayList ;
1515import java .util .List ;
16+ import java .util .Objects ;
1617import java .util .UUID ;
1718import java .util .concurrent .atomic .AtomicInteger ;
1819
@@ -420,6 +421,6 @@ public void setComplete(int percent) {
420421 * @return an icon for this node or null if no icon is defined.
421422 */
422423 public Icon getIcon () {
423- return new ImageIcon ("com/marginallyclever/nodegraphcore/ icons8-question-mark-16.png" );
424+ return new ImageIcon (Objects . requireNonNull ( Node . class . getResource ( " icons8-question-mark-16.png")) );
424425 }
425426}
Original file line number Diff line number Diff line change 44import com .marginallyclever .nodegraphcore .port .Input ;
55import com .marginallyclever .nodegraphcore .port .Output ;
66
7+ import javax .swing .*;
78import javax .tools .*;
89import java .io .*;
910import java .lang .reflect .Method ;
1011import java .util .HashMap ;
1112import java .util .List ;
1213import java .util .Map ;
14+ import java .util .Objects ;
1315
1416/**
1517 * Interpret a Java source file. The source file must contain a single public class called <code>InterpretJava</code>
@@ -144,4 +146,9 @@ public byte[] getBytes() {
144146 return outputStream .toByteArray ();
145147 }
146148 }
149+
150+ @ Override
151+ public Icon getIcon () {
152+ return new ImageIcon (Objects .requireNonNull (InterpretJava .class .getResource ("icons8-java-48.png" )));
153+ }
147154}
Original file line number Diff line number Diff line change 44import com .marginallyclever .nodegraphcore .port .Input ;
55import com .marginallyclever .nodegraphcore .port .Output ;
66
7+ import javax .swing .*;
8+ import java .util .Objects ;
9+
710/**
811 * Node for a {@link Boolean}.
912 * @author Dan Royer
@@ -26,4 +29,9 @@ public LoadBoolean() {
2629 public void update () {
2730 output .setValue (value .getValue ());
2831 }
32+
33+ @ Override
34+ public Icon getIcon () {
35+ return new ImageIcon (Objects .requireNonNull (LoadBoolean .class .getResource ("icons8-boolean-48.png" )));
36+ }
2937}
Original file line number Diff line number Diff line change 44import com .marginallyclever .nodegraphcore .port .Input ;
55import com .marginallyclever .nodegraphcore .port .Output ;
66
7+ import javax .swing .*;
8+ import java .util .Objects ;
9+
710/**
811 * {@link Node} for a {@link Number}.
912 * @author Dan Royer
@@ -31,4 +34,9 @@ public LoadNumber(Number number) {
3134 public void update () {
3235 output .setValue (value .getValue ());
3336 }
37+
38+ @ Override
39+ public Icon getIcon () {
40+ return new ImageIcon (Objects .requireNonNull (LoadNumber .class .getResource ("icons8-number-48.png" )));
41+ }
3442}
Original file line number Diff line number Diff line change 44import com .marginallyclever .nodegraphcore .port .Input ;
55import com .marginallyclever .nodegraphcore .port .Output ;
66
7+ import javax .swing .*;
8+ import java .util .Objects ;
9+
710/**
811 * {@link Node} for a {@link String}.
912 * @author Dan Royer
@@ -26,4 +29,9 @@ public LoadString() {
2629 public void update () {
2730 output .setValue (value .getValue ());
2831 }
32+
33+ @ Override
34+ public Icon getIcon () {
35+ return new ImageIcon (Objects .requireNonNull (LoadString .class .getResource ("icons8-string-48.png" )));
36+ }
2937}
Original file line number Diff line number Diff line change 33import com .marginallyclever .nodegraphcore .Node ;
44import com .marginallyclever .nodegraphcore .port .Input ;
55
6+ import javax .swing .*;
7+ import java .util .Objects ;
8+
69/**
710 * sends A as a string to <pre>System.out.println()</pre>.
811 * @author Dan Royer
@@ -25,4 +28,9 @@ public void update() {
2528 String output = (var !=null ) ? var .toString () : "null" ;
2629 System .out .println (getUniqueID ()+": " +output );
2730 }
31+
32+ @ Override
33+ public Icon getIcon () {
34+ return new ImageIcon (Objects .requireNonNull (PrintToStdOut .class .getResource ("icons8-print-48.png" )));
35+ }
2836}
Original file line number Diff line number Diff line change 33import com .marginallyclever .nodegraphcore .port .Output ;
44import com .marginallyclever .nodegraphcore .Node ;
55
6+ import javax .swing .*;
7+ import java .util .Objects ;
8+
69/**
710 * Counts the number of ticks since the program started.
811 * @author Dan Royer
@@ -30,4 +33,11 @@ public void update() {
3033 public void reset () {
3134 super .reset ();
3235 }
36+
37+
38+
39+ @ Override
40+ public Icon getIcon () {
41+ return new ImageIcon (Objects .requireNonNull (TickCount .class .getResource ("icons8-stopwatch-48.png" )));
42+ }
3343}
Original file line number Diff line number Diff line change @@ -36,6 +36,6 @@ public void update() {
3636
3737 @ Override
3838 public Icon getIcon () {
39- return new ImageIcon (Objects .requireNonNull (getClass () .getResource ("icons8-add-16.png" )));
39+ return new ImageIcon (Objects .requireNonNull (Add . class .getResource ("icons8-add-16.png" )));
4040 }
4141}
Original file line number Diff line number Diff line change @@ -34,6 +34,6 @@ public void update() {
3434
3535 @ Override
3636 public Icon getIcon () {
37- return new ImageIcon (Objects .requireNonNull (getClass () .getResource ("icons8-multiply-16.png" )));
37+ return new ImageIcon (Objects .requireNonNull (Multiply . class .getResource ("icons8-multiply-16.png" )));
3838 }
3939}
Original file line number Diff line number Diff line change @@ -34,6 +34,6 @@ public void update() {
3434
3535 @ Override
3636 public Icon getIcon () {
37- return new ImageIcon (Objects .requireNonNull (getClass () .getResource ("icons8-subtract-16.png" )));
37+ return new ImageIcon (Objects .requireNonNull (Subtract . class .getResource ("icons8-subtract-16.png" )));
3838 }
3939}
You can’t perform that action at this time.
0 commit comments