001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 2.0.11
004 *
005 * Do not make changes to this file unless you know what you are doing--modify
006 * the SWIG interface file instead.
007 * ----------------------------------------------------------------------------- */
008
009package org.sbml.libsbml;
010
011public class CubicBezier extends LineSegment {
012   private long swigCPtr;
013
014   protected CubicBezier(long cPtr, boolean cMemoryOwn)
015   {
016     super(libsbmlJNI.CubicBezier_SWIGUpcast(cPtr), cMemoryOwn);
017     swigCPtr = cPtr;
018   }
019
020   protected static long getCPtr(CubicBezier obj)
021   {
022     return (obj == null) ? 0 : obj.swigCPtr;
023   }
024
025   protected static long getCPtrAndDisown (CubicBezier obj)
026   {
027     long ptr = 0;
028
029     if (obj != null)
030     {
031       ptr             = obj.swigCPtr;
032       obj.swigCMemOwn = false;
033     }
034
035     return ptr;
036   }
037
038  protected void finalize() {
039    delete();
040  }
041
042  public synchronized void delete() {
043    if (swigCPtr != 0) {
044      if (swigCMemOwn) {
045        swigCMemOwn = false;
046        libsbmlJNI.delete_CubicBezier(swigCPtr);
047      }
048      swigCPtr = 0;
049    }
050    super.delete();
051  }
052
053  public CubicBezier(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
054    this(libsbmlJNI.new_CubicBezier__SWIG_0(level, version, pkgVersion), true);
055  }
056
057  public CubicBezier(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
058    this(libsbmlJNI.new_CubicBezier__SWIG_1(level, version), true);
059  }
060
061  public CubicBezier(long level) throws org.sbml.libsbml.SBMLConstructorException {
062    this(libsbmlJNI.new_CubicBezier__SWIG_2(level), true);
063  }
064
065  public CubicBezier() throws org.sbml.libsbml.SBMLConstructorException {
066    this(libsbmlJNI.new_CubicBezier__SWIG_3(), true);
067  }
068
069  public CubicBezier(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException {
070    this(libsbmlJNI.new_CubicBezier__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true);
071  }
072
073  public CubicBezier(LayoutPkgNamespaces layoutns, double x1, double y1, double x2, double y2) throws org.sbml.libsbml.SBMLConstructorException {
074    this(libsbmlJNI.new_CubicBezier__SWIG_5(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, x1, y1, x2, y2), true);
075  }
076
077  public CubicBezier(LayoutPkgNamespaces layoutns, double x1, double y1, double z1, double x2, double y2, double z2) throws org.sbml.libsbml.SBMLConstructorException {
078    this(libsbmlJNI.new_CubicBezier__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, x1, y1, z1, x2, y2, z2), true);
079  }
080
081  public CubicBezier(CubicBezier orig) throws org.sbml.libsbml.SBMLConstructorException {
082    this(libsbmlJNI.new_CubicBezier__SWIG_7(CubicBezier.getCPtr(orig), orig), true);
083  }
084
085  public CubicBezier(LayoutPkgNamespaces layoutns, Point start, Point end) throws org.sbml.libsbml.SBMLConstructorException {
086    this(libsbmlJNI.new_CubicBezier__SWIG_8(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, Point.getCPtr(start), start, Point.getCPtr(end), end), true);
087  }
088
089  public CubicBezier(LayoutPkgNamespaces layoutns, Point start, Point base1, Point base2, Point end) throws org.sbml.libsbml.SBMLConstructorException {
090    this(libsbmlJNI.new_CubicBezier__SWIG_9(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, Point.getCPtr(start), start, Point.getCPtr(base1), base1, Point.getCPtr(base2), base2, Point.getCPtr(end), end), true);
091  }
092
093  public CubicBezier(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException {
094    this(libsbmlJNI.new_CubicBezier__SWIG_10(XMLNode.getCPtr(node), node, l2version), true);
095  }
096
097  public CubicBezier(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException {
098    this(libsbmlJNI.new_CubicBezier__SWIG_11(XMLNode.getCPtr(node), node), true);
099  }
100
101  public Point getBasePoint1() {
102    long cPtr = libsbmlJNI.CubicBezier_getBasePoint1(swigCPtr, this);
103    return (cPtr == 0) ? null : new Point(cPtr, false);
104  }
105
106  public void setBasePoint1(Point p) {
107    libsbmlJNI.CubicBezier_setBasePoint1__SWIG_0(swigCPtr, this, Point.getCPtr(p), p);
108  }
109
110  public void setBasePoint1(double x, double y, double z) {
111    libsbmlJNI.CubicBezier_setBasePoint1__SWIG_1(swigCPtr, this, x, y, z);
112  }
113
114  public void setBasePoint1(double x, double y) {
115    libsbmlJNI.CubicBezier_setBasePoint1__SWIG_2(swigCPtr, this, x, y);
116  }
117
118  public Point getBasePoint2() {
119    long cPtr = libsbmlJNI.CubicBezier_getBasePoint2(swigCPtr, this);
120    return (cPtr == 0) ? null : new Point(cPtr, false);
121  }
122
123  public void setBasePoint2(Point p) {
124    libsbmlJNI.CubicBezier_setBasePoint2__SWIG_0(swigCPtr, this, Point.getCPtr(p), p);
125  }
126
127  public void setBasePoint2(double x, double y, double z) {
128    libsbmlJNI.CubicBezier_setBasePoint2__SWIG_1(swigCPtr, this, x, y, z);
129  }
130
131  public void setBasePoint2(double x, double y) {
132    libsbmlJNI.CubicBezier_setBasePoint2__SWIG_2(swigCPtr, this, x, y);
133  }
134
135  public void initDefaults() {
136    libsbmlJNI.CubicBezier_initDefaults(swigCPtr, this);
137  }
138
139  public void straighten() {
140    libsbmlJNI.CubicBezier_straighten(swigCPtr, this);
141  }
142
143  
144/**
145   * Returns the XML element name of this object.
146   * <p>
147   * This is overridden by subclasses to return a string appropriate to the
148   * SBML component.  For example, {@link Model} defines it as returning 
149   * <code>'model'</code>, {@link CompartmentType} defines it as returning <code>'compartmentType'</code>,
150   * and so on.
151   */ public
152 String getElementName() {
153    return libsbmlJNI.CubicBezier_getElementName(swigCPtr, this);
154  }
155
156  
157/**
158   * Creates and returns a deep copy of this {@link SBase} object.
159   * <p>
160   * @return a (deep) copy of this {@link SBase} object.
161   */ public
162 CubicBezier cloneObject() {
163    long cPtr = libsbmlJNI.CubicBezier_cloneObject(swigCPtr, this);
164    return (cPtr == 0) ? null : new CubicBezier(cPtr, true);
165  }
166
167  
168/**
169   * Returns the libSBML type code for this object.
170   * <p>
171   * This method may return the type code of this SBML object, or it may
172   * return {@link  libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN}.  This
173   * is because subclasses of {@link SBase} are not required to implement this
174   * method to return a type code.  This method is meant primarily for the
175   * LibSBML C interface, in which class and subclass information is not
176   * readily available.
177   * <p>
178   * @return the SBML object type code
179   * of this SBML object or
180   * {@link  libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (the default).
181   * <p>
182   * @see #getElementName()
183   * @see #getPackageName()
184   */ public
185 int getTypeCode() {
186    return libsbmlJNI.CubicBezier_getTypeCode(swigCPtr, this);
187  }
188
189  public XMLNode toXML() {
190    return new XMLNode(libsbmlJNI.CubicBezier_toXML(swigCPtr, this), true);
191  }
192
193  
194/**
195   * Sets this SBML object to child SBML objects (if any).
196   * (Creates a child-parent relationship by the parent)
197   * <p>
198   * Subclasses must override this function if they define
199   * one ore more child elements.
200   * Basically, this function needs to be called in
201   * constructor, copy constructor, assignment operator.
202   * <p>
203   * <p>
204   * @internal
205   */ public
206 void connectToChild() {
207    libsbmlJNI.CubicBezier_connectToChild(swigCPtr, this);
208  }
209
210  
211/**
212   * Enables/Disables the given package with this element and child
213   * elements (if any).
214   * (This is an internal implementation for enablePackage function)
215   * <p>
216   * @note Subclasses in which one or more child elements are defined 
217   * must override this function.
218   * <p>
219   * <p>
220   * @see #connectToChild()
221   * @internal
222   */ public
223 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
224    libsbmlJNI.CubicBezier_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
225  }
226
227}