Class ShapeType

java.lang.Object
org.pathvisio.libgpml.model.type.ShapeType
All Implemented Interfaces:
IShape

public class ShapeType
extends java.lang.Object
implements IShape
This enum class contains extensible enum for Shape type property.
Author:
unknown, finterly
  • Field Details

    • rectangle

      private static java.awt.Shape rectangle
    • ellipse

      private static java.awt.Shape ellipse
    • SHAPETYPE_MAP

      private static final java.util.Map<java.lang.String,​ShapeType> SHAPETYPE_MAP
    • VISIBLE_VALUES

      private static final java.util.List<ShapeType> VISIBLE_VALUES
    • NONE

      public static final ShapeType NONE
    • RECTANGLE

      public static final ShapeType RECTANGLE
    • ROUNDED_RECTANGLE

      public static final ShapeType ROUNDED_RECTANGLE
    • OVAL

      public static final ShapeType OVAL
    • TRIANGLE

      public static final ShapeType TRIANGLE
    • PENTAGON

      public static final ShapeType PENTAGON
    • HEXAGON

      public static final ShapeType HEXAGON
    • OCTAGON

      public static final ShapeType OCTAGON
    • EDGE

      public static final ShapeType EDGE
    • ARC

      public static final ShapeType ARC
    • BRACE

      public static final ShapeType BRACE
    • MITOCHONDRIA

      public static final ShapeType MITOCHONDRIA
    • SARCOPLASMIC_RETICULUM

      public static final ShapeType SARCOPLASMIC_RETICULUM
    • ENDOPLASMIC_RETICULUM

      public static final ShapeType ENDOPLASMIC_RETICULUM
    • GOLGI_APPARATUS

      public static final ShapeType GOLGI_APPARATUS
    • EXTRACELLULAR_REGION

      public static final ShapeType EXTRACELLULAR_REGION
    • CELL

      public static final ShapeType CELL
    • NUCLEUS

      public static final ShapeType NUCLEUS
    • ORGANELLE

      public static final ShapeType ORGANELLE
    • VESICLE

      public static final ShapeType VESICLE
    • CORONAVIRUS_ICON

      public static final ShapeType CORONAVIRUS_ICON
    • DNA_ICON

      public static final ShapeType DNA_ICON
    • RNA_ICON

      public static final ShapeType RNA_ICON
    • CELL_ICON

      public static final ShapeType CELL_ICON
    • MEMBRANE_ICON

      public static final ShapeType MEMBRANE_ICON
    • DEGRADATION

      public static final ShapeType DEGRADATION
    • name

      private final java.lang.String name
    • shape

      private final java.awt.Shape shape
    • isResizeable

      private final boolean isResizeable
    • isRotatable

      private final boolean isRotatable
  • Constructor Details

    • ShapeType

      private ShapeType​(java.lang.String name, java.awt.Shape shape, boolean isResizeable, boolean isRotatable)
      The constructor is private. ShapeType cannot be directly instantiated. Use create() method to instantiate ShapeType.
      Parameters:
      name - the string key of this ShapeType.
      shape - the shape.
      isResizeable - if true object is resizeable.
      isRotatable - if true object is rotatable.
      Throws:
      java.lang.NullPointerException - if name is null.
    • ShapeType

      private ShapeType​(java.lang.String name, java.awt.Shape shape)
      The constructor is private. ShapeType is resizeable and rotatable by default.
      Parameters:
      name - the string key of this ShapeType.
      shape - the shape.
  • Method Details

    • register

      public static ShapeType register​(java.lang.String name, java.awt.Shape shape)
      Returns a ShapeType from a given string identifier name. If the ShapeType doesn't exist yet, it is created to extend the enum. The method makes sure that the same object is not added twice.
      Parameters:
      name - the string key.
      shape - the shape.
      Returns:
      the ShapeType for given name. If name does not exist, creates and returns a new ShapeType.
    • getName

      public java.lang.String getName()
      Returns the name key for this ShapeType.
      Specified by:
      getName in interface IShape
      Returns:
      name the key for this ShapeType.
    • getShape

      public java.awt.Shape getShape​(double w, double h)
      Returns the shape resized given width and height.
      Specified by:
      getShape in interface IShape
      Parameters:
      w - the width.
      h - the height.
      Returns:
      the shape resized.
    • isResizeable

      public boolean isResizeable()
      Returns boolean for whether shape is resizeable.
      Specified by:
      isResizeable in interface IShape
      Returns:
      isResizeable if true shape is resizeable.
    • isRotatable

      public boolean isRotatable()
      Returns boolean for whether shape is rotatable.
      Specified by:
      isRotatable in interface IShape
      Returns:
      isRotatable if true shape is rotatable.
    • fromName

      public static ShapeType fromName​(java.lang.String name)
      Returns the ShapeType from given string name.
      Parameters:
      name - the string.
      Returns:
      the ShapeType with given string name.
    • getNames

      public static java.lang.String[] getNames()
      Returns the names of all registered ShapeTypes as a list.
      Returns:
      names the names of all registered ShapeTypes in the order of insertion.
    • getValues

      public static ShapeType[] getValues()
      Returns the data node type values of all ShapeTypes as a list.
      Returns:
      shapeTypes the list of all registered ShapeTypes.
    • getVisibleNames

      public static java.lang.String[] getVisibleNames()
      Returns the names of visible registered ShapeTypes as a list.
      Returns:
      result the names of registered ShapeTypes.
    • getVisibleValues

      public static ShapeType[] getVisibleValues()
      Returns the data node type values of visible ShapeTypes as a list.
      Returns:
      shapeTypes the list of registered ShapeTypes.
    • toString

      public java.lang.String toString()
      Returns a string representation of this ShapeType.
      Overrides:
      toString in class java.lang.Object
      Returns:
      name the identifier of this ShapeType.