001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 2.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 * graphical representation of an ellipse from the SBML render extension 013 <p> 014 * The ellipse class is derived from {@link GraphicalPrimitive2D}, so it inherits all its attributes 015 * and methods. Therefore ellipses can have a transformation, a stroke and a stroke with to draw the edge 016 * as well as a fill style and fill style related settings. 017 <p> 018 * Besides those inherited attributes, an ellipse if defined by its center point which can be specified 019 * as a combination of absolute and relative values and its radii for the two axes. The radii can also be 020 * specified in terms absolute and/or relative values. 021 */ 022 023public class Ellipse extends GraphicalPrimitive2D { 024 private long swigCPtr; 025 026 protected Ellipse(long cPtr, boolean cMemoryOwn) 027 { 028 super(libsbmlJNI.Ellipse_SWIGUpcast(cPtr), cMemoryOwn); 029 swigCPtr = cPtr; 030 } 031 032 protected static long getCPtr(Ellipse obj) 033 { 034 return (obj == null) ? 0 : obj.swigCPtr; 035 } 036 037 protected static long getCPtrAndDisown (Ellipse obj) 038 { 039 long ptr = 0; 040 041 if (obj != null) 042 { 043 ptr = obj.swigCPtr; 044 obj.swigCMemOwn = false; 045 } 046 047 return ptr; 048 } 049 050 protected void finalize() { 051 delete(); 052 } 053 054 public synchronized void delete() { 055 if (swigCPtr != 0) { 056 if (swigCMemOwn) { 057 swigCMemOwn = false; 058 libsbmlJNI.delete_Ellipse(swigCPtr); 059 } 060 swigCPtr = 0; 061 } 062 super.delete(); 063 } 064 065 066/** 067 * Creates a new {@link Ellipse} 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 Ellipse(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 074 this(libsbmlJNI.new_Ellipse__SWIG_0(level, version, pkgVersion), true); 075 } 076 077 078/** 079 * Creates a new {@link Ellipse} 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 Ellipse(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 086 this(libsbmlJNI.new_Ellipse__SWIG_1(level, version), true); 087 } 088 089 090/** 091 * Creates a new {@link Ellipse} 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 Ellipse(long level) throws org.sbml.libsbml.SBMLConstructorException { 098 this(libsbmlJNI.new_Ellipse__SWIG_2(level), true); 099 } 100 101 102/** 103 * Creates a new {@link Ellipse} object with the given SBML level 104 * and SBML version. 105 <p> 106 * @param level SBML level of the new object 107 * @param level SBML version of the new object 108 */ public 109 Ellipse() throws org.sbml.libsbml.SBMLConstructorException { 110 this(libsbmlJNI.new_Ellipse__SWIG_3(), true); 111 } 112 113 114/** 115 * Creates a new {@link Ellipse} object with the given {@link SBMLNamespaces}. 116 <p> 117 * @param sbmlns The SBML namespace for the object. 118 */ public 119 Ellipse(RenderPkgNamespaces renderns) throws org.sbml.libsbml.SBMLConstructorException { 120 this(libsbmlJNI.new_Ellipse__SWIG_4(RenderPkgNamespaces.getCPtr(renderns), renderns), true); 121 } 122 123 124/** 125 * Creates a new {@link RadialGradient} object from the given {@link XMLNode} object. 126 * The {@link XMLNode} object has to contain a valid XML representation of a 127 * {@link RadialGradient} object as defined in the render extension specification. 128 * This method is normally called when render information is read from a file and 129 * should normally not have to be called explicitely. 130 <p> 131 * @param node the {@link XMLNode} object reference that describes the {@link RadialGradient} 132 * object to be instantiated. 133 <p> 134 * This constructor is deprecated. The new libsbml API only has 135 * constructors which take the SBML level and version or one that takes 136 * an {@link SBMLNamespaces} object. 137 */ public 138 Ellipse(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 139 this(libsbmlJNI.new_Ellipse__SWIG_5(XMLNode.getCPtr(node), node, l2version), true); 140 } 141 142 143/** 144 * Creates a new {@link RadialGradient} object from the given {@link XMLNode} object. 145 * The {@link XMLNode} object has to contain a valid XML representation of a 146 * {@link RadialGradient} object as defined in the render extension specification. 147 * This method is normally called when render information is read from a file and 148 * should normally not have to be called explicitely. 149 <p> 150 * @param node the {@link XMLNode} object reference that describes the {@link RadialGradient} 151 * object to be instantiated. 152 <p> 153 * This constructor is deprecated. The new libsbml API only has 154 * constructors which take the SBML level and version or one that takes 155 * an {@link SBMLNamespaces} object. 156 */ public 157 Ellipse(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 158 this(libsbmlJNI.new_Ellipse__SWIG_6(XMLNode.getCPtr(node), node), true); 159 } 160 161 162/** 163 * Instantiates a new ellipse object with the center set to 0,0,0 164 * and the radii also set to 0. 165 * The id is set to the given string. 166 <p> 167 * @param id the id of the ellipse. 168 <p> 169 * This constructor is deprecated. The new libsbml API only has 170 * constructors which take the SBML level and version or one that takes 171 * an {@link SBMLNamespaces} object. 172 */ public 173 Ellipse(RenderPkgNamespaces renderns, String id) throws org.sbml.libsbml.SBMLConstructorException { 174 this(libsbmlJNI.new_Ellipse__SWIG_7(RenderPkgNamespaces.getCPtr(renderns), renderns, id), true); 175 } 176 177 178/** 179 * Constructor with 2D center and radius. 180 * instantiates a new ellipse object with the center. 181 * The z coordinate of the center is set to 0. 182 * The id is unset and both radii are set to the given radius. 183 <p> 184 * @param cx x value of the center point 185 * @param cy y value of the center point 186 * @param r radius along both axis 187 <p> 188 * This constructor is deprecated. The new libsbml API only has 189 * constructors which take the SBML level and version or one that takes 190 * an {@link SBMLNamespaces} object. 191 */ public 192 Ellipse(RenderPkgNamespaces renderns, RelAbsVector cx, RelAbsVector cy, RelAbsVector r) throws org.sbml.libsbml.SBMLConstructorException { 193 this(libsbmlJNI.new_Ellipse__SWIG_8(RenderPkgNamespaces.getCPtr(renderns), renderns, RelAbsVector.getCPtr(cx), cx, RelAbsVector.getCPtr(cy), cy, RelAbsVector.getCPtr(r), r), true); 194 } 195 196 197/** 198 * Constructor with 2D center and radii. 199 <p> 200 * This constructor is deprecated. The new libsbml API only has 201 * constructors which take the SBML level and version or one that takes 202 * an {@link SBMLNamespaces} object. 203 */ public 204 Ellipse(RenderPkgNamespaces renderns, RelAbsVector cx, RelAbsVector cy, RelAbsVector rx, RelAbsVector ry) throws org.sbml.libsbml.SBMLConstructorException { 205 this(libsbmlJNI.new_Ellipse__SWIG_9(RenderPkgNamespaces.getCPtr(renderns), renderns, RelAbsVector.getCPtr(cx), cx, RelAbsVector.getCPtr(cy), cy, RelAbsVector.getCPtr(rx), rx, RelAbsVector.getCPtr(ry), ry), true); 206 } 207 208 209/** 210 * Constructor with 3D center and radii. 211 * instantiates a new ellipse object with the center and radii. 212 * The id is unset. 213 <p> 214 * @param cx x value of the center point 215 * @param cy y value of the center point 216 * @param cz z value of the center point 217 * @param rx radius along the x axis 218 * @param ry radius along the y axis 219 <p> 220 * This constructor is deprecated. The new libsbml API only has 221 * constructors which take the SBML level and version or one that takes 222 * an {@link SBMLNamespaces} object. 223 */ public 224 Ellipse(RenderPkgNamespaces renderns, RelAbsVector cx, RelAbsVector cy, RelAbsVector cz, RelAbsVector rx, RelAbsVector ry) throws org.sbml.libsbml.SBMLConstructorException { 225 this(libsbmlJNI.new_Ellipse__SWIG_10(RenderPkgNamespaces.getCPtr(renderns), renderns, RelAbsVector.getCPtr(cx), cx, RelAbsVector.getCPtr(cy), cy, RelAbsVector.getCPtr(cz), cz, RelAbsVector.getCPtr(rx), rx, RelAbsVector.getCPtr(ry), ry), true); 226 } 227 228 229/** 230 * Constructor with id, 2D center and radius. 231 * instantiates a new ellipse object with the given <code>id</code> and center. 232 * Both radii are set to the given radius r. This actually yields a circle. 233 <p> 234 * @param id id for the ellipse 235 * @param cx x value of the center point 236 * @param cy y value of the center point 237 * @param r radius along both axis 238 <p> 239 * This constructor is deprecated. The new libsbml API only has 240 * constructors which take the SBML level and version or one that takes 241 * an {@link SBMLNamespaces} object. 242 */ public 243 Ellipse(RenderPkgNamespaces renderns, String id, RelAbsVector cx, RelAbsVector cy, RelAbsVector r) throws org.sbml.libsbml.SBMLConstructorException { 244 this(libsbmlJNI.new_Ellipse__SWIG_11(RenderPkgNamespaces.getCPtr(renderns), renderns, id, RelAbsVector.getCPtr(cx), cx, RelAbsVector.getCPtr(cy), cy, RelAbsVector.getCPtr(r), r), true); 245 } 246 247 248/** 249 * Constructor with id, 2D center and radii. 250 * instantiates a new ellipse object with the given <code>id</code>, center and radii. 251 <p> 252 * @param id id for the ellipse 253 * @param cx x value of the center point 254 * @param cy y value of the center point 255 * @param rx radius along the x axis 256 * @param ry radius along the y axis 257 <p> 258 <p> 259 * This constructor is deprecated. The new libsbml API only has 260 * constructors which take the SBML level and version or one that takes 261 * an {@link SBMLNamespaces} object. 262 */ public 263 Ellipse(RenderPkgNamespaces renderns, String id, RelAbsVector cx, RelAbsVector cy, RelAbsVector rx, RelAbsVector ry) throws org.sbml.libsbml.SBMLConstructorException { 264 this(libsbmlJNI.new_Ellipse__SWIG_12(RenderPkgNamespaces.getCPtr(renderns), renderns, id, RelAbsVector.getCPtr(cx), cx, RelAbsVector.getCPtr(cy), cy, RelAbsVector.getCPtr(rx), rx, RelAbsVector.getCPtr(ry), ry), true); 265 } 266 267 268/** 269 * Constructor with id, 3D center and radii. 270 * instantiates a new ellipse object with the given <code>id</code>, center and radii. 271 <p> 272 * @param id id for the ellipse 273 * @param cx x value of the center point 274 * @param cy y value of the center point 275 * @param cz z value of the center point 276 * @param rx radius along the x axis 277 * @param ry radius along the y axis 278 <p> 279 <p> 280 * This constructor is deprecated. The new libsbml API only has 281 * constructors which take the SBML level and version or one that takes 282 * an {@link SBMLNamespaces} object. 283 */ public 284 Ellipse(RenderPkgNamespaces renderns, String id, RelAbsVector cx, RelAbsVector cy, RelAbsVector cz, RelAbsVector rx, RelAbsVector ry) throws org.sbml.libsbml.SBMLConstructorException { 285 this(libsbmlJNI.new_Ellipse__SWIG_13(RenderPkgNamespaces.getCPtr(renderns), renderns, id, RelAbsVector.getCPtr(cx), cx, RelAbsVector.getCPtr(cy), cy, RelAbsVector.getCPtr(cz), cz, RelAbsVector.getCPtr(rx), rx, RelAbsVector.getCPtr(ry), ry), true); 286 } 287 288 289/** 290 * Returns the x coordinate for the center point as a const reference. 291 <p> 292 * @return const reference to the x coordinatee of the center point. 293 */ public 294 RelAbsVector getCX() { 295 return new RelAbsVector(libsbmlJNI.Ellipse_getCX__SWIG_0(swigCPtr, this), false); 296 } 297 298 299/** 300 * Returns the y coordinate for the center point as a const reference. 301 <p> 302 * @return const reference to the y coordinatee of the center point. 303 */ public 304 RelAbsVector getCY() { 305 return new RelAbsVector(libsbmlJNI.Ellipse_getCY__SWIG_0(swigCPtr, this), false); 306 } 307 308 309/** 310 * Returns the z coordinate for the center point as a const reference. 311 <p> 312 * @return const reference to the z coordinatee of the center point. 313 */ public 314 RelAbsVector getCZ() { 315 return new RelAbsVector(libsbmlJNI.Ellipse_getCZ__SWIG_0(swigCPtr, this), false); 316 } 317 318 319/** 320 * Returns the radius along the x axis as a const reference. 321 <p> 322 * @return const reference to the radius along the x axis 323 */ public 324 RelAbsVector getRX() { 325 return new RelAbsVector(libsbmlJNI.Ellipse_getRX__SWIG_0(swigCPtr, this), false); 326 } 327 328 329/** 330 * Returns the radius along the y axis as a const reference. 331 <p> 332 * @return const reference to the radius along the y axis 333 */ public 334 RelAbsVector getRY() { 335 return new RelAbsVector(libsbmlJNI.Ellipse_getRY__SWIG_0(swigCPtr, this), false); 336 } 337 338 339/** 340 * Sets the x coordinates for the center point. 341 <p> 342 * @param cx x value of the center point 343 */ public 344 void setCX(RelAbsVector cx) { 345 libsbmlJNI.Ellipse_setCX(swigCPtr, this, RelAbsVector.getCPtr(cx), cx); 346 } 347 348 349/** 350 * Sets the y coordinates for the center point. 351 <p> 352 * @param cy y value of the center point 353 */ public 354 void setCY(RelAbsVector cy) { 355 libsbmlJNI.Ellipse_setCY(swigCPtr, this, RelAbsVector.getCPtr(cy), cy); 356 } 357 358 359/** 360 * Sets the z coordinates for the center point. 361 <p> 362 * @param cz z value of the center point 363 */ public 364 void setCZ(RelAbsVector cz) { 365 libsbmlJNI.Ellipse_setCZ(swigCPtr, this, RelAbsVector.getCPtr(cz), cz); 366 } 367 368 369/** 370 * Sets the radius along the x axis 371 <p> 372 * @param rx radius along the x axis 373 */ public 374 void setRX(RelAbsVector rx) { 375 libsbmlJNI.Ellipse_setRX(swigCPtr, this, RelAbsVector.getCPtr(rx), rx); 376 } 377 378 379/** 380 * Sets the radius along the y axis 381 <p> 382 * @param ry radius along the y axis 383 */ public 384 void setRY(RelAbsVector ry) { 385 libsbmlJNI.Ellipse_setRY(swigCPtr, this, RelAbsVector.getCPtr(ry), ry); 386 } 387 388 389/** 390 * Sets the 2D coordinates for the center point. 391 * The z coodintate is set to 50% 392 <p> 393 * @param cx x value of the center point 394 * @param cy y value of the center point 395 */ public 396 void setCenter2D(RelAbsVector cx, RelAbsVector cy) { 397 libsbmlJNI.Ellipse_setCenter2D(swigCPtr, this, RelAbsVector.getCPtr(cx), cx, RelAbsVector.getCPtr(cy), cy); 398 } 399 400 401/** 402 * Sets the 3D coordinates for the center point. 403 <p> 404 * @param cx x value of the center point 405 * @param cy y value of the center point 406 * @param cz z value of the center point 407 */ public 408 void setCenter3D(RelAbsVector cx, RelAbsVector cy, RelAbsVector cz) { 409 libsbmlJNI.Ellipse_setCenter3D(swigCPtr, this, RelAbsVector.getCPtr(cx), cx, RelAbsVector.getCPtr(cy), cy, RelAbsVector.getCPtr(cz), cz); 410 } 411 412 413/** 414 * Sets the radii of the ellipse 415 <p> 416 * @param rx radius along the x axis 417 * @param ry radius along the y axis 418 */ public 419 void setRadii(RelAbsVector rx, RelAbsVector ry) { 420 libsbmlJNI.Ellipse_setRadii(swigCPtr, this, RelAbsVector.getCPtr(rx), rx, RelAbsVector.getCPtr(ry), ry); 421 } 422 423 424/** 425 * Returns the XML element name of this object. 426 <p> 427 * This is overridden by subclasses to return a string appropriate to the 428 * SBML component. For example, {@link Ellipse} defines it as returning 'ellipse', 429 */ public 430 String getElementName() { 431 return libsbmlJNI.Ellipse_getElementName(swigCPtr, this); 432 } 433 434 435/** 436 * Creates and returns a deep copy of this {@link Ellipse} object. 437 <p> 438 * @return a (deep) copy of this {@link Ellipse} object 439 */ public 440 Ellipse cloneObject() { 441 long cPtr = libsbmlJNI.Ellipse_cloneObject(swigCPtr, this); 442 return (cPtr == 0) ? null : new Ellipse(cPtr, true); 443 } 444 445 446/** 447 * Returns the libSBML type code for this SBML object. 448 <p> 449 * LibSBML attaches an 450 * identifying code to every kind of SBML object. These are known as 451 * <em>SBML type codes</em>. In other languages, the set of type codes 452 * is stored in an enumeration; in the Java language interface for 453 * libSBML, the type codes are defined as static integer constants in 454 * interface class {@link libsbmlConstants}. The names of the type codes 455 * all begin with the characters <code>SBML_.</code> 456 <p> 457 * @return the SBML type code for this object, or <code>SBML_UNKNOWN</code> (default). 458 <p> 459 * @see #getElementName() 460 */ public 461 int getTypeCode() { 462 return libsbmlJNI.Ellipse_getTypeCode(swigCPtr, this); 463 } 464 465 466/** 467 * Creates an {@link XMLNode} object from this {@link Ellipse} object. 468 <p> 469 * @return the {@link XMLNode} with the XML representation for the 470 * {@link Ellipse} object. 471 */ public 472 XMLNode toXML() { 473 return new XMLNode(libsbmlJNI.Ellipse_toXML(swigCPtr, this), true); 474 } 475 476 477/** * @internal */ public 478 boolean hasRequiredAttributes() { 479 return libsbmlJNI.Ellipse_hasRequiredAttributes(swigCPtr, this); 480 } 481 482 483/** * @internal */ public 484 boolean hasRequiredElements() { 485 return libsbmlJNI.Ellipse_hasRequiredElements(swigCPtr, this); 486 } 487 488}