/*This code was generated using the UMPLE modeling language!
 Date of generation: 2008/07/31 09:07:56*/
/*This class drives: */

package Shapes.core;

import Shapes.*;
import Shapes.json.*;

public class SimplePolygon extends Polygon {
  //Class datatypes
  private String orientation;

  //Class association variables

  //Registry of our system.
  ShapesRegistry registry = ShapesRegistry.getInstance();

  //Constructor
  public SimplePolygon(String aCenter, String aOrientation) {
    super(aCenter);
    orientation = aOrientation;
  }

  public boolean setOrientation(String aOrientation) {
    orientation = aOrientation;
    return true;
  }

  public String getOrientation() {
    return orientation;
  }

  public void delete() {
  }

  public boolean areManyEndsNull() {
    return true;
  }

  /***********************************
   * Returns the attribute list along with the  
   * class ID in JSON format.
   ***********************************/
  public JSONObject getAttributes() throws JSONException {
    JSONObject obj = new JSONObject();
    obj.put("CLASS_ID", registry.getKey(this));
    obj.put("orientation", getOrientation());
    return obj;
  }

}