001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.10 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 explicitly. 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 explicitly. 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 * This constructor is deprecated. The new libsbml API only has 259 * constructors which take the SBML level and version or one that takes 260 * an {@link SBMLNamespaces} object. 261 */ public 262 Ellipse(RenderPkgNamespaces renderns, String id, RelAbsVector cx, RelAbsVector cy, RelAbsVector rx, RelAbsVector ry) throws org.sbml.libsbml.SBMLConstructorException { 263 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); 264 } 265 266 267/** 268 * Constructor with id, 3D center and radii. 269 * instantiates a new ellipse object with the given <code>id</code>, center and radii. 270 <p> 271 * @param id id for the ellipse 272 * @param cx x value of the center point 273 * @param cy y value of the center point 274 * @param cz z value of the center point 275 * @param rx radius along the x axis 276 * @param ry radius along the y axis 277 <p> 278 * This constructor is deprecated. The new libsbml API only has 279 * constructors which take the SBML level and version or one that takes 280 * an {@link SBMLNamespaces} object. 281 */ public 282 Ellipse(RenderPkgNamespaces renderns, String id, RelAbsVector cx, RelAbsVector cy, RelAbsVector cz, RelAbsVector rx, RelAbsVector ry) throws org.sbml.libsbml.SBMLConstructorException { 283 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); 284 } 285 286 287/** 288 * Returns the x coordinate for the center point as a reference. 289 <p> 290 * @return reference to the x coordinatee of the center point. 291 */ public 292 RelAbsVector getCX() { 293 return new RelAbsVector(libsbmlJNI.Ellipse_getCX__SWIG_0(swigCPtr, this), false); 294 } 295 296 297/** 298 * Returns the y coordinate for the center point as a reference. 299 <p> 300 * @return reference to the y coordinatee of the center point. 301 */ public 302 RelAbsVector getCY() { 303 return new RelAbsVector(libsbmlJNI.Ellipse_getCY__SWIG_0(swigCPtr, this), false); 304 } 305 306 307/** 308 * Returns the z coordinate for the center point as a reference. 309 <p> 310 * @return reference to the z coordinatee of the center point. 311 */ public 312 RelAbsVector getCZ() { 313 return new RelAbsVector(libsbmlJNI.Ellipse_getCZ__SWIG_0(swigCPtr, this), false); 314 } 315 316 317/** 318 * Returns the radius along the x axis as a reference. 319 <p> 320 * @return reference to the radius along the x axis 321 */ public 322 RelAbsVector getRX() { 323 return new RelAbsVector(libsbmlJNI.Ellipse_getRX__SWIG_0(swigCPtr, this), false); 324 } 325 326 327/** 328 * Returns the radius along the y axis as a reference. 329 <p> 330 * @return reference to the radius along the y axis 331 */ public 332 RelAbsVector getRY() { 333 return new RelAbsVector(libsbmlJNI.Ellipse_getRY__SWIG_0(swigCPtr, this), false); 334 } 335 336 337/** 338 * Sets the x coordinates for the center point. 339 <p> 340 * @param cx x value of the center point 341 */ public 342 void setCX(RelAbsVector cx) { 343 libsbmlJNI.Ellipse_setCX(swigCPtr, this, RelAbsVector.getCPtr(cx), cx); 344 } 345 346 347/** 348 * Sets the y coordinates for the center point. 349 <p> 350 * @param cy y value of the center point 351 */ public 352 void setCY(RelAbsVector cy) { 353 libsbmlJNI.Ellipse_setCY(swigCPtr, this, RelAbsVector.getCPtr(cy), cy); 354 } 355 356 357/** 358 * Sets the z coordinates for the center point. 359 <p> 360 * @param cz z value of the center point 361 */ public 362 void setCZ(RelAbsVector cz) { 363 libsbmlJNI.Ellipse_setCZ(swigCPtr, this, RelAbsVector.getCPtr(cz), cz); 364 } 365 366 367/** 368 * Sets the radius along the x axis 369 <p> 370 * @param rx radius along the x axis 371 */ public 372 void setRX(RelAbsVector rx) { 373 libsbmlJNI.Ellipse_setRX(swigCPtr, this, RelAbsVector.getCPtr(rx), rx); 374 } 375 376 377/** 378 * Sets the radius along the y axis 379 <p> 380 * @param ry radius along the y axis 381 */ public 382 void setRY(RelAbsVector ry) { 383 libsbmlJNI.Ellipse_setRY(swigCPtr, this, RelAbsVector.getCPtr(ry), ry); 384 } 385 386 387/** 388 * Sets the 2D coordinates for the center point. 389 * The z coodintate is set to 50% 390 <p> 391 * @param cx x value of the center point 392 * @param cy y value of the center point 393 */ public 394 void setCenter2D(RelAbsVector cx, RelAbsVector cy) { 395 libsbmlJNI.Ellipse_setCenter2D(swigCPtr, this, RelAbsVector.getCPtr(cx), cx, RelAbsVector.getCPtr(cy), cy); 396 } 397 398 399/** 400 * Sets the 3D coordinates for the center point. 401 <p> 402 * @param cx x value of the center point 403 * @param cy y value of the center point 404 * @param cz z value of the center point 405 */ public 406 void setCenter3D(RelAbsVector cx, RelAbsVector cy, RelAbsVector cz) { 407 libsbmlJNI.Ellipse_setCenter3D(swigCPtr, this, RelAbsVector.getCPtr(cx), cx, RelAbsVector.getCPtr(cy), cy, RelAbsVector.getCPtr(cz), cz); 408 } 409 410 411/** 412 * Sets the radii of the ellipse 413 <p> 414 * @param rx radius along the x axis 415 * @param ry radius along the y axis 416 */ public 417 void setRadii(RelAbsVector rx, RelAbsVector ry) { 418 libsbmlJNI.Ellipse_setRadii(swigCPtr, this, RelAbsVector.getCPtr(rx), rx, RelAbsVector.getCPtr(ry), ry); 419 } 420 421 422/** 423 * Returns the XML element name of this object. 424 <p> 425 * This is overridden by subclasses to return a string appropriate to the 426 * SBML component. For example, {@link Ellipse} defines it as returning 'ellipse', 427 */ public 428 String getElementName() { 429 return libsbmlJNI.Ellipse_getElementName(swigCPtr, this); 430 } 431 432 433/** 434 * Creates and returns a deep copy of this {@link Ellipse} object. 435 <p> 436 * @return a (deep) copy of this {@link Ellipse} object 437 */ public 438 Ellipse cloneObject() { 439 long cPtr = libsbmlJNI.Ellipse_cloneObject(swigCPtr, this); 440 return (cPtr == 0) ? null : new Ellipse(cPtr, true); 441 } 442 443 444/** 445 * Returns the libSBML type code for this SBML object. 446 <p> 447 * LibSBML attaches an 448 * identifying code to every kind of SBML object. These are known as 449 * <em>SBML type codes</em>. In other languages, the set of type codes 450 * is stored in an enumeration; in the Java language interface for 451 * libSBML, the type codes are defined as static integer constants in 452 * interface class {@link libsbmlConstants}. The names of the type codes 453 * all begin with the characters <code>SBML_.</code> 454 <p> 455 * @return the SBML type code for this object, or <code>SBML_UNKNOWN</code> (default). 456 <p> 457 * @see #getElementName() 458 */ public 459 int getTypeCode() { 460 return libsbmlJNI.Ellipse_getTypeCode(swigCPtr, this); 461 } 462 463 464/** 465 * Creates an {@link XMLNode} object from this {@link Ellipse} object. 466 <p> 467 * @return the {@link XMLNode} with the XML representation for the 468 * {@link Ellipse} object. 469 */ public 470 XMLNode toXML() { 471 return new XMLNode(libsbmlJNI.Ellipse_toXML(swigCPtr, this), true); 472 } 473 474 475/** * @internal */ public 476 boolean hasRequiredAttributes() { 477 return libsbmlJNI.Ellipse_hasRequiredAttributes(swigCPtr, this); 478 } 479 480 481/** * @internal */ public 482 boolean hasRequiredElements() { 483 return libsbmlJNI.Ellipse_hasRequiredElements(swigCPtr, this); 484 } 485 486}