001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.8
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
011/** 
012 * <span class="pkg-marker pkg-color-layout"><a href="group__layout.html">layout</a></span>
013
014 Representation of a point.
015 <p>
016 * A point is specified via the required attributes 'x', 'y' and an optional
017 * attribute 'z', all of which are of type double. If the attribute z is not
018 * specified, the object is a two dimensional object.  The {@link Point} class also
019 * has an optional attribute id of type SId. While not used in the
020 * &ldquo;layout&rdquo; package, it can be used by programs to refer to the
021 * elements.
022 */
023
024public class Point extends SBase {
025   private long swigCPtr;
026
027   protected Point(long cPtr, boolean cMemoryOwn)
028   {
029     super(libsbmlJNI.Point_SWIGUpcast(cPtr), cMemoryOwn);
030     swigCPtr = cPtr;
031   }
032
033   protected static long getCPtr(Point obj)
034   {
035     return (obj == null) ? 0 : obj.swigCPtr;
036   }
037
038   protected static long getCPtrAndDisown (Point obj)
039   {
040     long ptr = 0;
041
042     if (obj != null)
043     {
044       ptr             = obj.swigCPtr;
045       obj.swigCMemOwn = false;
046     }
047
048     return ptr;
049   }
050
051  protected void finalize() {
052    delete();
053  }
054
055  public synchronized void delete() {
056    if (swigCPtr != 0) {
057      if (swigCMemOwn) {
058        swigCMemOwn = false;
059        libsbmlJNI.delete_Point(swigCPtr);
060      }
061      swigCPtr = 0;
062    }
063    super.delete();
064  }
065
066  
067/**
068   * Creates a new point with x,y and z set to 0.0.
069   */ public
070 Point(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
071    this(libsbmlJNI.new_Point__SWIG_0(level, version, pkgVersion), true);
072  }
073
074  
075/**
076   * Creates a new point with x,y and z set to 0.0.
077   */ public
078 Point(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
079    this(libsbmlJNI.new_Point__SWIG_1(level, version), true);
080  }
081
082  
083/**
084   * Creates a new point with x,y and z set to 0.0.
085   */ public
086 Point(long level) throws org.sbml.libsbml.SBMLConstructorException {
087    this(libsbmlJNI.new_Point__SWIG_2(level), true);
088  }
089
090  
091/**
092   * Creates a new point with x,y and z set to 0.0.
093   */ public
094 Point() throws org.sbml.libsbml.SBMLConstructorException {
095    this(libsbmlJNI.new_Point__SWIG_3(), true);
096  }
097
098  
099/**
100   * Ctor.
101   */ public
102 Point(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException {
103    this(libsbmlJNI.new_Point__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true);
104  }
105
106  
107/**
108   * Copy constructor.
109   */ public
110 Point(Point orig) throws org.sbml.libsbml.SBMLConstructorException {
111    this(libsbmlJNI.new_Point__SWIG_5(Point.getCPtr(orig), orig), true);
112  }
113
114  
115/**
116   * Creates a new point with the given coordinates.
117   */ public
118 Point(LayoutPkgNamespaces layoutns, double x, double y, double z) throws org.sbml.libsbml.SBMLConstructorException {
119    this(libsbmlJNI.new_Point__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, x, y, z), true);
120  }
121
122  
123/**
124   * Creates a new point with the given coordinates.
125   */ public
126 Point(LayoutPkgNamespaces layoutns, double x, double y) throws org.sbml.libsbml.SBMLConstructorException {
127    this(libsbmlJNI.new_Point__SWIG_7(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, x, y), true);
128  }
129
130  
131/**
132   * Creates a new {@link Point} from the given {@link XMLNode}
133   */ public
134 Point(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException {
135    this(libsbmlJNI.new_Point__SWIG_8(XMLNode.getCPtr(node), node, l2version), true);
136  }
137
138  
139/**
140   * Creates a new {@link Point} from the given {@link XMLNode}
141   */ public
142 Point(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException {
143    this(libsbmlJNI.new_Point__SWIG_9(XMLNode.getCPtr(node), node), true);
144  }
145
146  
147/**
148   * Returns the x offset.
149   */ public
150 double x() {
151    return libsbmlJNI.Point_x(swigCPtr, this);
152  }
153
154  
155/**
156   * Returns the y offset.
157   */ public
158 double y() {
159    return libsbmlJNI.Point_y(swigCPtr, this);
160  }
161
162  
163/**
164   * Returns the z offset.
165   */ public
166 double z() {
167    return libsbmlJNI.Point_z(swigCPtr, this);
168  }
169
170  
171/**
172   * Returns the x offset.
173   */ public
174 double getXOffset() {
175    return libsbmlJNI.Point_getXOffset(swigCPtr, this);
176  }
177
178  
179/**
180   * Returns the y offset.
181   */ public
182 double getYOffset() {
183    return libsbmlJNI.Point_getYOffset(swigCPtr, this);
184  }
185
186  
187/**
188   * Returns the z offset.
189   */ public
190 double getZOffset() {
191    return libsbmlJNI.Point_getZOffset(swigCPtr, this);
192  }
193
194  
195/**
196   * Sets the x offset.
197   */ public
198 void setX(double x) {
199    libsbmlJNI.Point_setX(swigCPtr, this, x);
200  }
201
202  
203/**
204   * Sets the y offset.
205   */ public
206 void setY(double y) {
207    libsbmlJNI.Point_setY(swigCPtr, this, y);
208  }
209
210  
211/**
212   * Sets the z offset.
213   */ public
214 void setZ(double z) {
215    libsbmlJNI.Point_setZ(swigCPtr, this, z);
216  }
217
218  
219/**
220   * Sets the x offset.
221   */ public
222 void setXOffset(double x) {
223    libsbmlJNI.Point_setXOffset(swigCPtr, this, x);
224  }
225
226  
227/**
228   * Sets the y offset.
229   */ public
230 void setYOffset(double y) {
231    libsbmlJNI.Point_setYOffset(swigCPtr, this, y);
232  }
233
234  
235/**
236   * Sets the z offset.
237   */ public
238 void setZOffset(double z) {
239    libsbmlJNI.Point_setZOffset(swigCPtr, this, z);
240  }
241
242  
243/**
244   * Sets the coordinates to the given values.
245   */ public
246 void setOffsets(double x, double y, double z) {
247    libsbmlJNI.Point_setOffsets__SWIG_0(swigCPtr, this, x, y, z);
248  }
249
250  
251/**
252   * Sets the coordinates to the given values.
253   */ public
254 void setOffsets(double x, double y) {
255    libsbmlJNI.Point_setOffsets__SWIG_1(swigCPtr, this, x, y);
256  }
257
258  
259/** */ public
260 boolean getZOffsetExplicitlySet() {
261    return libsbmlJNI.Point_getZOffsetExplicitlySet(swigCPtr, this);
262  }
263
264  
265/**
266   * Sets the Z offset to 0.0.
267   */ public
268 void initDefaults() {
269    libsbmlJNI.Point_initDefaults(swigCPtr, this);
270  }
271
272  
273/**
274   * Returns the value of the 'id' attribute of this {@link Point}.
275   */ public
276 String getId() {
277    return libsbmlJNI.Point_getId(swigCPtr, this);
278  }
279
280  
281/**
282   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
283   * {@link Point}'s 'id' attribute has been set.
284   */ public
285 boolean isSetId() {
286    return libsbmlJNI.Point_isSetId(swigCPtr, this);
287  }
288
289  
290/**
291   * Sets the value of the 'id' attribute of this {@link Point}.
292   */ public
293 int setId(String id) {
294    return libsbmlJNI.Point_setId(swigCPtr, this, id);
295  }
296
297  
298/**
299   * Unsets the value of the 'id' attribute of this {@link Point}.
300   */ public
301 int unsetId() {
302    return libsbmlJNI.Point_unsetId(swigCPtr, this);
303  }
304
305  
306/**
307   * Sets the element name to be returned by getElementName().
308   */ public
309 void setElementName(String name) {
310    libsbmlJNI.Point_setElementName(swigCPtr, this, name);
311  }
312
313  
314/**
315   * Returns the XML element name of
316   * this SBML object.
317   <p>
318   * @return the string of the name of this element
319   */ public
320 String getElementName() {
321    return libsbmlJNI.Point_getElementName(swigCPtr, this);
322  }
323
324  
325/**
326   * Creates and returns a deep copy of this {@link Point}.
327   <p>
328   * @return a (deep) copy of this {@link Point}.
329   */ public
330 Point cloneObject() {
331    long cPtr = libsbmlJNI.Point_cloneObject(swigCPtr, this);
332    return (cPtr == 0) ? null : new Point(cPtr, true);
333  }
334
335  
336/**
337   * Returns the libSBML type code of this object instance.
338   <p>
339   * <p>
340 * LibSBML attaches an identifying code to every kind of SBML object.  These
341 * are integer constants known as <em>SBML type codes</em>.  The names of all
342 * the codes begin with the characters <code>SBML_</code>.
343 * In the Java language interface for libSBML, the
344 * type codes are defined as static integer constants in the interface class
345 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
346 * package plug-ins may use overlapping type codes; to identify the package
347 * to which a given object belongs, call the <code>getPackageName()</code>
348 * method on the object.
349   <p>
350   * @return the SBML type code for this object:
351   * {@link libsbmlConstants#SBML_LAYOUT_POINT SBML_LAYOUT_POINT}
352   <p>
353   * <p>
354 * @warning <span class='warning'>The specific integer values of the possible
355 * type codes may be reused by different Level&nbsp;3 package plug-ins.
356 * Thus, to identifiy the correct code, <strong>it is necessary to invoke
357 * both getTypeCode() and getPackageName()</strong>.</span>
358   <p>
359   * @see #getElementName()
360   * @see #getPackageName()
361   */ public
362 int getTypeCode() {
363    return libsbmlJNI.Point_getTypeCode(swigCPtr, this);
364  }
365
366  
367/**
368    * Creates an {@link XMLNode} object from this.
369    */ public
370 XMLNode toXML(String name) {
371    return new XMLNode(libsbmlJNI.Point_toXML(swigCPtr, this, name), true);
372  }
373
374}