Package mgui.geometry.util
Class NodeShape
java.lang.Object
mgui.geometry.util.NodeShape
- All Implemented Interfaces:
NamedObject
public class NodeShape extends java.lang.Object implements NamedObject
Wraps a
java.awt.geom.Shape used to render graph or 2D shape nodes.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description protected booleanis_fillableprotected java.lang.Stringnameprotected java.util.ArrayList<java.awt.Shape>shapes -
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidaddShape(java.awt.Shape shape)java.lang.StringgetName()Gets the name for this object.java.awt.ShapegetShape()Gets the shape for this node shape, or the first if there are multiple shapes.java.util.ArrayList<java.awt.Shape>getShapes()Returns a list of all shapes to be renderedbooleanisFillable()Determines whether this shape should be filledvoidsetFillable(boolean fillable)Sets whether this shape should be filledvoidsetName(java.lang.String name)Sets the name for this object.voidsetShape(java.awt.Shape shape)Sets this node shape to a single shapevoidsetShapes(java.util.ArrayList<java.awt.Shape> shapes)Sets the list of shapesjava.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
shapes
protected java.util.ArrayList<java.awt.Shape> shapes -
name
protected java.lang.String name -
is_fillable
protected boolean is_fillable
-
-
Constructor Details
-
NodeShape
public NodeShape() -
NodeShape
public NodeShape(java.lang.String name, java.awt.Shape shape, boolean is_fillable) -
NodeShape
public NodeShape(java.lang.String name, java.util.ArrayList<java.awt.Shape> shapes, boolean is_fillable)
-
-
Method Details
-
getShape
public java.awt.Shape getShape()Gets the shape for this node shape, or the first if there are multiple shapes.- Returns:
-
setShape
public void setShape(java.awt.Shape shape)Sets this node shape to a single shape- Parameters:
shape-
-
addShape
public void addShape(java.awt.Shape shape) -
getShapes
public java.util.ArrayList<java.awt.Shape> getShapes()Returns a list of all shapes to be rendered- Returns:
-
setShapes
public void setShapes(java.util.ArrayList<java.awt.Shape> shapes)Sets the list of shapes- Parameters:
shapes-
-
isFillable
public boolean isFillable()Determines whether this shape should be filled- Returns:
-
setFillable
public void setFillable(boolean fillable)Sets whether this shape should be filled- Parameters:
fillable-
-
getName
public java.lang.String getName()Description copied from interface:NamedObjectGets the name for this object.- Specified by:
getNamein interfaceNamedObject- Returns:
-
setName
public void setName(java.lang.String name)Description copied from interface:NamedObjectSets the name for this object.- Specified by:
setNamein interfaceNamedObject
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-