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 boolean is_fillable  
    protected java.lang.String name  
    protected java.util.ArrayList<java.awt.Shape> shapes  
  • Constructor Summary

    Constructors
    Constructor Description
    NodeShape()  
    NodeShape​(java.lang.String name, java.awt.Shape shape, boolean is_fillable)  
    NodeShape​(java.lang.String name, java.util.ArrayList<java.awt.Shape> shapes, boolean is_fillable)  
  • Method Summary

    Modifier and Type Method Description
    void addShape​(java.awt.Shape shape)  
    java.lang.String getName()
    Gets the name for this object.
    java.awt.Shape getShape()
    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 rendered
    boolean isFillable()
    Determines whether this shape should be filled
    void setFillable​(boolean fillable)
    Sets whether this shape should be filled
    void setName​(java.lang.String name)
    Sets the name for this object.
    void setShape​(java.awt.Shape shape)
    Sets this node shape to a single shape
    void setShapes​(java.util.ArrayList<java.awt.Shape> shapes)
    Sets the list of shapes
    java.lang.String toString()  

    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: NamedObject
      Gets the name for this object.
      Specified by:
      getName in interface NamedObject
      Returns:
    • setName

      public void setName​(java.lang.String name)
      Description copied from interface: NamedObject
      Sets the name for this object.
      Specified by:
      setName in interface NamedObject
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object