001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.12
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 * Represents a point where the coordinates can be made up of absolute
013 * as well as relative values (
014 * Render objects are often specified relative to the current viewport, i.e. we need
015 * a way to specify relative coordinate values in curves. For this we introduced the {@link RenderPoint}
016 * and the {@link RenderCubicBezier} class in the render extension.
017 * Those two classes are used to specify curve and polygon elements (@see RenderCurve or @see Polygon).
018 <p>
019   * @see RelAbsVector)
020 */
021
022public class RenderPoint extends SBase {
023   private long swigCPtr;
024
025   protected RenderPoint(long cPtr, boolean cMemoryOwn)
026   {
027     super(libsbmlJNI.RenderPoint_SWIGUpcast(cPtr), cMemoryOwn);
028     swigCPtr = cPtr;
029   }
030
031   protected static long getCPtr(RenderPoint obj)
032   {
033     return (obj == null) ? 0 : obj.swigCPtr;
034   }
035
036   protected static long getCPtrAndDisown (RenderPoint obj)
037   {
038     long ptr = 0;
039
040     if (obj != null)
041     {
042       ptr             = obj.swigCPtr;
043       obj.swigCMemOwn = false;
044     }
045
046     return ptr;
047   }
048
049  protected void finalize() {
050    delete();
051  }
052
053  public synchronized void delete() {
054    if (swigCPtr != 0) {
055      if (swigCMemOwn) {
056        swigCMemOwn = false;
057        libsbmlJNI.delete_RenderPoint(swigCPtr);
058      }
059      swigCPtr = 0;
060    }
061    super.delete();
062  }
063
064  
065/**
066   * Creates a new {@link RenderPoint} object with the given SBML level
067   * and SBML version.
068   <p>
069   * @param level SBML level of the new object
070   * @param level SBML version of the new object
071   */ public
072 RenderPoint(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
073    this(libsbmlJNI.new_RenderPoint__SWIG_0(level, version, pkgVersion), true);
074  }
075
076  
077/**
078   * Creates a new {@link RenderPoint} object with the given SBML level
079   * and SBML version.
080   <p>
081   * @param level SBML level of the new object
082   * @param level SBML version of the new object
083   */ public
084 RenderPoint(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
085    this(libsbmlJNI.new_RenderPoint__SWIG_1(level, version), true);
086  }
087
088  
089/**
090   * Creates a new {@link RenderPoint} object with the given SBML level
091   * and SBML version.
092   <p>
093   * @param level SBML level of the new object
094   * @param level SBML version of the new object
095   */ public
096 RenderPoint(long level) throws org.sbml.libsbml.SBMLConstructorException {
097    this(libsbmlJNI.new_RenderPoint__SWIG_2(level), true);
098  }
099
100  
101/**
102   * Creates a new {@link RenderPoint} object with the given SBML level
103   * and SBML version.
104   <p>
105   * @param level SBML level of the new object
106   * @param level SBML version of the new object
107   */ public
108 RenderPoint() throws org.sbml.libsbml.SBMLConstructorException {
109    this(libsbmlJNI.new_RenderPoint__SWIG_3(), true);
110  }
111
112  
113/**
114   * Creates a new {@link RenderPoint} object with the given {@link SBMLNamespaces}.
115   <p>
116   * @param sbmlns The SBML namespace for the object.
117   */ public
118 RenderPoint(RenderPkgNamespaces renderns) throws org.sbml.libsbml.SBMLConstructorException {
119    this(libsbmlJNI.new_RenderPoint__SWIG_4(RenderPkgNamespaces.getCPtr(renderns), renderns), true);
120  }
121
122  
123/**
124   * Copy constructor for {@link RenderPoint} objects.
125   */ public
126 RenderPoint(RenderPoint orig) throws org.sbml.libsbml.SBMLConstructorException {
127    this(libsbmlJNI.new_RenderPoint__SWIG_5(RenderPoint.getCPtr(orig), orig), true);
128  }
129
130  
131/**
132   * Creates a new point with the given ccordinates.
133   <p>
134   * @param x x coordinate of the {@link RenderPoint} object
135   * @param y y coordinate of the {@link RenderPoint} object
136   * @param z z coordinate of the {@link RenderPoint} object
137   * If the z value is omitted, it is set to 0.
138   */ public
139 RenderPoint(RenderPkgNamespaces renderns, RelAbsVector x, RelAbsVector y, RelAbsVector z) throws org.sbml.libsbml.SBMLConstructorException {
140    this(libsbmlJNI.new_RenderPoint__SWIG_6(RenderPkgNamespaces.getCPtr(renderns), renderns, RelAbsVector.getCPtr(x), x, RelAbsVector.getCPtr(y), y, RelAbsVector.getCPtr(z), z), true);
141  }
142
143  
144/**
145   * Creates a new point with the given ccordinates.
146   <p>
147   * @param x x coordinate of the {@link RenderPoint} object
148   * @param y y coordinate of the {@link RenderPoint} object
149   * @param z z coordinate of the {@link RenderPoint} object
150   * If the z value is omitted, it is set to 0.
151   */ public
152 RenderPoint(RenderPkgNamespaces renderns, RelAbsVector x, RelAbsVector y) throws org.sbml.libsbml.SBMLConstructorException {
153    this(libsbmlJNI.new_RenderPoint__SWIG_7(RenderPkgNamespaces.getCPtr(renderns), renderns, RelAbsVector.getCPtr(x), x, RelAbsVector.getCPtr(y), y), true);
154  }
155
156  
157/**
158   * Creates a new {@link RenderPoint} object from the given {@link XMLNode} object.
159   * The {@link XMLNode} object has to contain a valid XML representation of a 
160   * {@link RenderPoint} object as defined in the render extension specification.
161   * This method is normally called when render information is read from a file and 
162   * should normally not have to be called explicitly.
163   <p>
164   * @param node the {@link XMLNode} object reference that describes the {@link RenderPoint}
165   * object to be instantiated.
166   */ public
167 RenderPoint(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException {
168    this(libsbmlJNI.new_RenderPoint__SWIG_8(XMLNode.getCPtr(node), node, l2version), true);
169  }
170
171  
172/**
173   * Creates a new {@link RenderPoint} object from the given {@link XMLNode} object.
174   * The {@link XMLNode} object has to contain a valid XML representation of a 
175   * {@link RenderPoint} object as defined in the render extension specification.
176   * This method is normally called when render information is read from a file and 
177   * should normally not have to be called explicitly.
178   <p>
179   * @param node the {@link XMLNode} object reference that describes the {@link RenderPoint}
180   * object to be instantiated.
181   */ public
182 RenderPoint(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException {
183    this(libsbmlJNI.new_RenderPoint__SWIG_9(XMLNode.getCPtr(node), node), true);
184  }
185
186  
187/**
188   * Returns the x coordinate of the {@link RenderPoint} as a  reference.
189   <p>
190   * @return  reference to x coordinate.
191   */ public
192 RelAbsVector x() {
193    return new RelAbsVector(libsbmlJNI.RenderPoint_x__SWIG_0(swigCPtr, this), false);
194  }
195
196  
197/**
198   * Returns the y coordinate of the {@link RenderPoint} as a  reference.
199   <p>
200   * @return  reference to y coordinate.
201   */ public
202 RelAbsVector y() {
203    return new RelAbsVector(libsbmlJNI.RenderPoint_y__SWIG_0(swigCPtr, this), false);
204  }
205
206  
207/**
208   * Returns the z coordinate of the {@link RenderPoint} as a  reference.
209   <p>
210   * @return  reference to z coordinate.
211   */ public
212 RelAbsVector z() {
213    return new RelAbsVector(libsbmlJNI.RenderPoint_z__SWIG_0(swigCPtr, this), false);
214  }
215
216  
217/**
218   * Sets the x ccordiante of the {@link RenderPoint} object.
219   <p>
220   * @param x x coordinate to be set.
221   */ public
222 void setX(RelAbsVector x) {
223    libsbmlJNI.RenderPoint_setX(swigCPtr, this, RelAbsVector.getCPtr(x), x);
224  }
225
226  
227/**
228   * Sets the y ccordiante of the {@link RenderPoint} object.
229   <p>
230   * @param y y coordinate to be set.
231   */ public
232 void setY(RelAbsVector y) {
233    libsbmlJNI.RenderPoint_setY(swigCPtr, this, RelAbsVector.getCPtr(y), y);
234  }
235
236  
237/**
238   * Sets the z ccordiante of the {@link RenderPoint} object.
239   <p>
240   * @param z z coordinate to be set.
241   */ public
242 void setZ(RelAbsVector z) {
243    libsbmlJNI.RenderPoint_setZ(swigCPtr, this, RelAbsVector.getCPtr(z), z);
244  }
245
246  
247/**
248   * Sets the coordinates of the {@link RenderPoint} to the given values.
249   <p>
250   * @param x x coordinate to be set.
251   * @param y y coordinate to be set.
252   * @param z z coordinate to be set. If the z coordinate is omitted, it is set to 0.
253   */ public
254 void setCoordinates(RelAbsVector x, RelAbsVector y, RelAbsVector z) {
255    libsbmlJNI.RenderPoint_setCoordinates__SWIG_0(swigCPtr, this, RelAbsVector.getCPtr(x), x, RelAbsVector.getCPtr(y), y, RelAbsVector.getCPtr(z), z);
256  }
257
258  
259/**
260   * Sets the coordinates of the {@link RenderPoint} to the given values.
261   <p>
262   * @param x x coordinate to be set.
263   * @param y y coordinate to be set.
264   * @param z z coordinate to be set. If the z coordinate is omitted, it is set to 0.
265   */ public
266 void setCoordinates(RelAbsVector x, RelAbsVector y) {
267    libsbmlJNI.RenderPoint_setCoordinates__SWIG_1(swigCPtr, this, RelAbsVector.getCPtr(x), x, RelAbsVector.getCPtr(y), y);
268  }
269
270  
271/**
272   * Sets the coordinates of the {@link RenderPoint} to the given values.
273   * This method is deprecated, please use setCoordinates. 
274   <p>
275   * @param x x coordinate to be set.
276   * @param y y coordinate to be set.
277   * @param z z coordinate to be set. If the z coordinate is omitted, it is set to 0.
278   */ public
279 void setOffsets(RelAbsVector x, RelAbsVector y, RelAbsVector z) {
280    libsbmlJNI.RenderPoint_setOffsets__SWIG_0(swigCPtr, this, RelAbsVector.getCPtr(x), x, RelAbsVector.getCPtr(y), y, RelAbsVector.getCPtr(z), z);
281  }
282
283  
284/**
285   * Sets the coordinates of the {@link RenderPoint} to the given values.
286   * This method is deprecated, please use setCoordinates. 
287   <p>
288   * @param x x coordinate to be set.
289   * @param y y coordinate to be set.
290   * @param z z coordinate to be set. If the z coordinate is omitted, it is set to 0.
291   */ public
292 void setOffsets(RelAbsVector x, RelAbsVector y) {
293    libsbmlJNI.RenderPoint_setOffsets__SWIG_1(swigCPtr, this, RelAbsVector.getCPtr(x), x, RelAbsVector.getCPtr(y), y);
294  }
295
296  
297/**
298   * Sets the Z offset to 0.0.
299   */ public
300 void initDefaults() {
301    libsbmlJNI.RenderPoint_initDefaults(swigCPtr, this);
302  }
303
304  
305/**
306   * Sets the element name which is returned by getElementName.
307   * {@link RenderPoint} objects can have different element names depending on context.
308   <p>
309   * @param name the string with the element name to be set.
310   */ public
311 void setElementName(String name) {
312    libsbmlJNI.RenderPoint_setElementName(swigCPtr, this, name);
313  }
314
315  
316/**
317   * Returns the XML element name of this object, which for
318   * {@link RenderPoint}, depends on the context.
319   * The name that is returned has to be set with 
320   * setElementName.
321   <p>
322   * @return the name of this element  (@see setElementName)
323   */ public
324 String getElementName() {
325    return libsbmlJNI.RenderPoint_getElementName(swigCPtr, this);
326  }
327
328  
329/**
330   * Creates and returns a deep copy of this {@link RenderPoint} object.
331   <p>
332   * @return a (deep) copy of this {@link RenderPoint} object
333   */ public
334 RenderPoint cloneObject() {
335  return (RenderPoint) libsbml.DowncastSBase(libsbmlJNI.RenderPoint_cloneObject(swigCPtr, this), true);
336}
337
338  
339/**
340   * Returns the libSBML type code for this SBML object.
341   <p>
342   * LibSBML attaches an
343   * identifying code to every kind of SBML object.  These are known as
344   * <em>SBML type codes</em>.  In other languages, the set of type codes
345   * is stored in an enumeration; in the Java language interface for
346   * libSBML, the type codes are defined as static integer constants in
347   * interface class {@link libsbmlConstants}.  The names of the type codes
348   * all begin with the characters <code>SBML_.</code> 
349   <p>
350   * @return the SBML type code for this object, or <code>SBML_UNKNOWN</code> (default).
351   <p>
352   * @see #getElementName()
353   */ public
354 int getTypeCode() {
355    return libsbmlJNI.RenderPoint_getTypeCode(swigCPtr, this);
356  }
357
358  
359/**
360   * Creates an {@link XMLNode} object from this {@link ColorDefinition} object.
361   <p>
362   * @return the {@link XMLNode} with the XML representation for the 
363   * {@link ColorDefinition} object.
364   */ public
365 XMLNode toXML(String name) {
366    return new XMLNode(libsbmlJNI.RenderPoint_toXML(swigCPtr, this, name), true);
367  }
368
369  
370/** * @internal */ public
371 boolean hasRequiredAttributes() {
372    return libsbmlJNI.RenderPoint_hasRequiredAttributes(swigCPtr, this);
373  }
374
375  
376/** * @internal */ public
377 boolean hasRequiredElements() {
378    return libsbmlJNI.RenderPoint_hasRequiredElements(swigCPtr, this);
379  }
380
381}