001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.7
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 Rectangle extends GraphicalPrimitive2D {
012   private long swigCPtr;
013
014   protected Rectangle(long cPtr, boolean cMemoryOwn)
015   {
016     super(libsbmlJNI.Rectangle_SWIGUpcast(cPtr), cMemoryOwn);
017     swigCPtr = cPtr;
018   }
019
020   protected static long getCPtr(Rectangle obj)
021   {
022     return (obj == null) ? 0 : obj.swigCPtr;
023   }
024
025   protected static long getCPtrAndDisown (Rectangle 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_Rectangle(swigCPtr);
047      }
048      swigCPtr = 0;
049    }
050    super.delete();
051  }
052
053  
054/**
055   * Creates a new Rectangle object with the given SBML level
056   * and SBML version.
057   <p>
058   * @param level SBML level of the new object
059   * @param level SBML version of the new object
060   */ public
061 Rectangle(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
062    this(libsbmlJNI.new_Rectangle__SWIG_0(level, version, pkgVersion), true);
063  }
064
065  
066/**
067   * Creates a new Rectangle object with the given SBML level
068   * and SBML version.
069   <p>
070   * @param level SBML level of the new object
071   * @param level SBML version of the new object
072   */ public
073 Rectangle(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
074    this(libsbmlJNI.new_Rectangle__SWIG_1(level, version), true);
075  }
076
077  
078/**
079   * Creates a new Rectangle object with the given SBML level
080   * and SBML version.
081   <p>
082   * @param level SBML level of the new object
083   * @param level SBML version of the new object
084   */ public
085 Rectangle(long level) throws org.sbml.libsbml.SBMLConstructorException {
086    this(libsbmlJNI.new_Rectangle__SWIG_2(level), true);
087  }
088
089  
090/**
091   * Creates a new Rectangle object with the given SBML level
092   * and SBML version.
093   <p>
094   * @param level SBML level of the new object
095   * @param level SBML version of the new object
096   */ public
097 Rectangle() throws org.sbml.libsbml.SBMLConstructorException {
098    this(libsbmlJNI.new_Rectangle__SWIG_3(), true);
099  }
100
101  
102/**
103   * Creates a new Rectangle object with the given {@link SBMLNamespaces}.
104   <p>
105   * @param sbmlns The SBML namespace for the object.
106   */ public
107 Rectangle(RenderPkgNamespaces renderns) throws org.sbml.libsbml.SBMLConstructorException {
108    this(libsbmlJNI.new_Rectangle__SWIG_4(RenderPkgNamespaces.getCPtr(renderns), renderns), true);
109  }
110
111  
112/**
113   * Creates a new Rectangle object from the given {@link XMLNode} object.
114   * The {@link XMLNode} object has to contain a valid XML representation of a 
115   * Rectangle object as defined in the render extension specification.
116   * This method is normally called when render information is read from a file and 
117   * should normally not have to be called explicitly.
118   <p>
119   * @param node the {@link XMLNode} object reference that describes the Rectangle
120   * object to be instantiated.
121   */ public
122 Rectangle(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException {
123    this(libsbmlJNI.new_Rectangle__SWIG_5(XMLNode.getCPtr(node), node, l2version), true);
124  }
125
126  
127/**
128   * Creates a new Rectangle object from the given {@link XMLNode} object.
129   * The {@link XMLNode} object has to contain a valid XML representation of a 
130   * Rectangle object as defined in the render extension specification.
131   * This method is normally called when render information is read from a file and 
132   * should normally not have to be called explicitly.
133   <p>
134   * @param node the {@link XMLNode} object reference that describes the Rectangle
135   * object to be instantiated.
136   */ public
137 Rectangle(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException {
138    this(libsbmlJNI.new_Rectangle__SWIG_6(XMLNode.getCPtr(node), node), true);
139  }
140
141  
142/**
143   * Instantiates a new Rectangle object.
144   * All attributes are set as described for the default constructor
145   * of {@link GraphicalPrimitive2D}.
146   <p>
147   * The id is set to the given string and all rectangle specific attributes are set to 0.
148   <p>
149   * @param id id string for the rectangle
150   <p>
151   * This constructor is deprecated. The new libsbml API only has
152   * constructors which take the SBML level and version or one that takes
153   * an {@link SBMLNamespaces} object.
154   */ public
155 Rectangle(RenderPkgNamespaces renderns, String id) throws org.sbml.libsbml.SBMLConstructorException {
156    this(libsbmlJNI.new_Rectangle__SWIG_7(RenderPkgNamespaces.getCPtr(renderns), renderns, id), true);
157  }
158
159  
160/**
161   * Instantiates a new Rectangle object.
162   * All attributes are set as described for the default constructor
163   * of {@link GraphicalPrimitive2D}.
164   <p>
165   * The id is set to the given string and all rectangle specific attributes
166   * are set to the given values.
167   <p>
168   * @param id id string for the rectangle
169   * @param x x coordinate of the position 
170   * @param y y coordinate of the position 
171   * @param z z coordinate of the position 
172   * @param w w width
173   * @param h h height
174   <p>
175   * This constructor is deprecated. The new libsbml API only has
176   * constructors which take the SBML level and version or one that takes
177   * an {@link SBMLNamespaces} object.
178   */ public
179 Rectangle(RenderPkgNamespaces renderns, String id, RelAbsVector x, RelAbsVector y, RelAbsVector z, RelAbsVector w, RelAbsVector h) throws org.sbml.libsbml.SBMLConstructorException {
180    this(libsbmlJNI.new_Rectangle__SWIG_8(RenderPkgNamespaces.getCPtr(renderns), renderns, id, RelAbsVector.getCPtr(x), x, RelAbsVector.getCPtr(y), y, RelAbsVector.getCPtr(z), z, RelAbsVector.getCPtr(w), w, RelAbsVector.getCPtr(h), h), true);
181  }
182
183  
184/**
185   * Instantiates a new Rectangle object.
186   * All attributes are set as described for the default constructor
187   * of {@link GraphicalPrimitive2D}.
188   <p>
189   * The id is set to the given string and all rectangle specific attributes
190   * are set to the given values. The z coordinate of the position is set to 0.
191   <p>
192   * @param id id string for the rectangle
193   * @param x x coordinate of the position 
194   * @param y y coordinate of the position 
195   * @param w w width
196   * @param h h height
197   <p>
198   * This constructor is deprecated. The new libsbml API only has
199   * constructors which take the SBML level and version or one that takes
200   * an {@link SBMLNamespaces} object.
201   */ public
202 Rectangle(RenderPkgNamespaces renderns, String id, RelAbsVector x, RelAbsVector y, RelAbsVector w, RelAbsVector h) throws org.sbml.libsbml.SBMLConstructorException {
203    this(libsbmlJNI.new_Rectangle__SWIG_9(RenderPkgNamespaces.getCPtr(renderns), renderns, id, RelAbsVector.getCPtr(x), x, RelAbsVector.getCPtr(y), y, RelAbsVector.getCPtr(w), w, RelAbsVector.getCPtr(h), h), true);
204  }
205
206  
207/**
208   * Sets the position and the size of the Rectangle within the viewport.
209   <p>
210   * @param x x coordinate of the position 
211   * @param y y coordinate of the position 
212   * @param z z coordinate of the position 
213   * @param w w width
214   * @param h h height
215   */ public
216 void setCoordinatesAndSize(RelAbsVector x, RelAbsVector y, RelAbsVector z, RelAbsVector w, RelAbsVector h) {
217    libsbmlJNI.Rectangle_setCoordinatesAndSize(swigCPtr, this, RelAbsVector.getCPtr(x), x, RelAbsVector.getCPtr(y), y, RelAbsVector.getCPtr(z), z, RelAbsVector.getCPtr(w), w, RelAbsVector.getCPtr(h), h);
218  }
219
220  
221/**
222   * Sets the position of the Rectangle within the viewport.
223   <p>
224   * @param x x coordinate of the position 
225   * @param y y coordinate of the position 
226   * @param z z coordinate of the position 
227   */ public
228 void setCoordinates(RelAbsVector x, RelAbsVector y, RelAbsVector z) {
229    libsbmlJNI.Rectangle_setCoordinates(swigCPtr, this, RelAbsVector.getCPtr(x), x, RelAbsVector.getCPtr(y), y, RelAbsVector.getCPtr(z), z);
230  }
231
232  
233/**
234   * Sets the size of the Rectangle 
235   <p>
236   * @param w w width
237   * @param h h height
238   */ public
239 void setSize(RelAbsVector w, RelAbsVector h) {
240    libsbmlJNI.Rectangle_setSize(swigCPtr, this, RelAbsVector.getCPtr(w), w, RelAbsVector.getCPtr(h), h);
241  }
242
243  
244/**
245   * Sets the siwidth of the Rectangle 
246   <p>
247   * @param w w width
248   */ public
249 void setWidth(RelAbsVector w) {
250    libsbmlJNI.Rectangle_setWidth(swigCPtr, this, RelAbsVector.getCPtr(w), w);
251  }
252
253  
254/**
255   * Sets the height of the Rectangle 
256   <p>
257   * @param h h height
258   */ public
259 void setHeight(RelAbsVector h) {
260    libsbmlJNI.Rectangle_setHeight(swigCPtr, this, RelAbsVector.getCPtr(h), h);
261  }
262
263  
264/**
265   * Sets the two corner radii of the rectangle
266   <p>
267   * @param rx corner radius along the x axis
268   * @param ry corner radius along the y axis
269   */ public
270 void setRadii(RelAbsVector rx, RelAbsVector ry) {
271    libsbmlJNI.Rectangle_setRadii(swigCPtr, this, RelAbsVector.getCPtr(rx), rx, RelAbsVector.getCPtr(ry), ry);
272  }
273
274  
275/**
276   * Sets the corner radius along the x axis
277   <p>
278   * @param rx corner radius along the x axis
279   */ public
280 void setRadiusX(RelAbsVector rx) {
281    libsbmlJNI.Rectangle_setRadiusX(swigCPtr, this, RelAbsVector.getCPtr(rx), rx);
282  }
283
284  
285/**
286   * Sets the corner radius along the y axis
287   <p>
288   * @param ry corner radius along the y axis
289   */ public
290 void setRadiusY(RelAbsVector ry) {
291    libsbmlJNI.Rectangle_setRadiusY(swigCPtr, this, RelAbsVector.getCPtr(ry), ry);
292  }
293
294  
295/**
296   * Sets the x position of the Rectangle within the viewport.
297   <p>
298   * @param x x coordinate of the position 
299   */ public
300 void setX(RelAbsVector x) {
301    libsbmlJNI.Rectangle_setX(swigCPtr, this, RelAbsVector.getCPtr(x), x);
302  }
303
304  
305/**
306   * Sets the y position of the Rectangle within the viewport.
307   <p>
308   * @param y y coordinate of the position 
309   */ public
310 void setY(RelAbsVector y) {
311    libsbmlJNI.Rectangle_setY(swigCPtr, this, RelAbsVector.getCPtr(y), y);
312  }
313
314  
315/**
316   * Sets the z position of the Rectangle within the viewport.
317   <p>
318   * @param z z coordinate of the position 
319   */ public
320 void setZ(RelAbsVector z) {
321    libsbmlJNI.Rectangle_setZ(swigCPtr, this, RelAbsVector.getCPtr(z), z);
322  }
323
324  
325/**
326   * Returns the x coordinate of the rectangles position
327   <p>
328   * @return  reference to {@link RelAbsVector} that represents the x position
329   */ public
330 RelAbsVector getX() {
331    return new RelAbsVector(libsbmlJNI.Rectangle_getX__SWIG_0(swigCPtr, this), false);
332  }
333
334  
335/**
336   * Returns the y coordinate of the rectangles position
337   <p>
338   * @return  reference to {@link RelAbsVector} that represents the y position
339   */ public
340 RelAbsVector getY() {
341    return new RelAbsVector(libsbmlJNI.Rectangle_getY__SWIG_0(swigCPtr, this), false);
342  }
343
344  
345/**
346   * Returns the z coordinate of the rectangles position
347   <p>
348   * @return  reference to {@link RelAbsVector} that represents the z position
349   */ public
350 RelAbsVector getZ() {
351    return new RelAbsVector(libsbmlJNI.Rectangle_getZ__SWIG_0(swigCPtr, this), false);
352  }
353
354  
355/**
356   * Returns the with of the rectangle
357   <p>
358   * @return  reference to the {@link RelAbsVector} that represents the width
359   */ public
360 RelAbsVector getWidth() {
361    return new RelAbsVector(libsbmlJNI.Rectangle_getWidth__SWIG_0(swigCPtr, this), false);
362  }
363
364  
365/**
366   * Returns the height of the rectangle
367   <p>
368   * @return  reference to the {@link RelAbsVector} that represents the height
369   */ public
370 RelAbsVector getHeight() {
371    return new RelAbsVector(libsbmlJNI.Rectangle_getHeight__SWIG_0(swigCPtr, this), false);
372  }
373
374  
375/**
376   * Returns the corner radius along the x axis
377   <p>
378   * @return  reference to the {@link RelAbsVector} that corner radius along the x axis
379   */ public
380 RelAbsVector getRadiusX() {
381    return new RelAbsVector(libsbmlJNI.Rectangle_getRadiusX__SWIG_0(swigCPtr, this), false);
382  }
383
384  
385/**
386   * Returns the corner radius along the y axis
387   <p>
388   * @return  reference to the {@link RelAbsVector} that corner radius along the y axis
389   */ public
390 RelAbsVector getRadiusY() {
391    return new RelAbsVector(libsbmlJNI.Rectangle_getRadiusY__SWIG_0(swigCPtr, this), false);
392  }
393
394  
395/**
396   * Creates and returns a deep copy of this Rectangle object.
397   <p>
398   * @return a (deep) copy of this Rectangle object
399   */ public
400 Rectangle cloneObject() {
401    long cPtr = libsbmlJNI.Rectangle_cloneObject(swigCPtr, this);
402    return (cPtr == 0) ? null : new Rectangle(cPtr, true);
403  }
404
405  
406/**
407   * Returns the XML element name of this object.
408   <p>
409   * This is overridden by subclasses to return a string appropriate to the
410   * SBML component.  For example, {@link Model} defines it as returning 'model',
411   * {@link CompartmentType} defines it as returning 'compartmentType', etc.
412   */ public
413 String getElementName() {
414    return libsbmlJNI.Rectangle_getElementName(swigCPtr, this);
415  }
416
417  
418/**
419   * Returns the libSBML type code for this SBML object.
420   <p>
421   * LibSBML attaches an
422   * identifying code to every kind of SBML object.  These are known as
423   * <em>SBML type codes</em>.  In other languages, the set of type codes
424   * is stored in an enumeration; in the Java language interface for
425   * libSBML, the type codes are defined as static integer constants in
426   * interface class {@link libsbmlConstants}.  The names of the type codes
427   * all begin with the characters <code>SBML_.</code> 
428   <p>
429   * @return the SBML type code for this object, or <code>SBML_UNKNOWN</code> (default).
430   <p>
431   * @see #getElementName()
432   */ public
433 int getTypeCode() {
434    return libsbmlJNI.Rectangle_getTypeCode(swigCPtr, this);
435  }
436
437  
438/**
439   * Creates an {@link XMLNode} object from this Rectangle object.
440   <p>
441   * @return the {@link XMLNode} with the XML representation for the 
442   * Rectangle object.
443   */ public
444 XMLNode toXML() {
445    return new XMLNode(libsbmlJNI.Rectangle_toXML(swigCPtr, this), true);
446  }
447
448  
449/** * @internal */ public
450 boolean hasRequiredAttributes() {
451    return libsbmlJNI.Rectangle_hasRequiredAttributes(swigCPtr, this);
452  }
453
454  
455/** * @internal */ public
456 boolean hasRequiredElements() {
457    return libsbmlJNI.Rectangle_hasRequiredElements(swigCPtr, this);
458  }
459
460}