diff --git a/core/src/main/java/edu/umd/cs/piccolo/PNode.java b/core/src/main/java/edu/umd/cs/piccolo/PNode.java index ecba108..bf73332 100644 --- a/core/src/main/java/edu/umd/cs/piccolo/PNode.java +++ b/core/src/main/java/edu/umd/cs/piccolo/PNode.java @@ -241,6 +241,24 @@ private boolean childBoundsInvalid; private boolean occluded; + private String name; + + public void setName(final String name) { + this.name = name; + } + + public String getName() { + return name; + } + + /** + * Calls {@link PNode} followed by {@link PNode#setName(String)}. + */ + public PNode(final String name) { + this(); + setName(name); + } + /** * Constructs a new PNode. *