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 * <span class="pkg-marker pkg-color-layout"><a href="group__layout.html">layout</a></span> 013 014 A bounding box for an item in a diagram. 015 */ 016 017public class BoundingBox extends SBase { 018 private long swigCPtr; 019 020 protected BoundingBox(long cPtr, boolean cMemoryOwn) 021 { 022 super(libsbmlJNI.BoundingBox_SWIGUpcast(cPtr), cMemoryOwn); 023 swigCPtr = cPtr; 024 } 025 026 protected static long getCPtr(BoundingBox obj) 027 { 028 return (obj == null) ? 0 : obj.swigCPtr; 029 } 030 031 protected static long getCPtrAndDisown (BoundingBox obj) 032 { 033 long ptr = 0; 034 035 if (obj != null) 036 { 037 ptr = obj.swigCPtr; 038 obj.swigCMemOwn = false; 039 } 040 041 return ptr; 042 } 043 044 protected void finalize() { 045 delete(); 046 } 047 048 public synchronized void delete() { 049 if (swigCPtr != 0) { 050 if (swigCMemOwn) { 051 swigCMemOwn = false; 052 libsbmlJNI.delete_BoundingBox(swigCPtr); 053 } 054 swigCPtr = 0; 055 } 056 super.delete(); 057 } 058 059 060/** 061 * Default Constructor set position and dimensions to (0.0,0.0,0.0) and 062 * the id to an empty string. 063 */ public 064 BoundingBox(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 065 this(libsbmlJNI.new_BoundingBox__SWIG_0(level, version, pkgVersion), true); 066 } 067 068 069/** 070 * Default Constructor set position and dimensions to (0.0,0.0,0.0) and 071 * the id to an empty string. 072 */ public 073 BoundingBox(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 074 this(libsbmlJNI.new_BoundingBox__SWIG_1(level, version), true); 075 } 076 077 078/** 079 * Default Constructor set position and dimensions to (0.0,0.0,0.0) and 080 * the id to an empty string. 081 */ public 082 BoundingBox(long level) throws org.sbml.libsbml.SBMLConstructorException { 083 this(libsbmlJNI.new_BoundingBox__SWIG_2(level), true); 084 } 085 086 087/** 088 * Default Constructor set position and dimensions to (0.0,0.0,0.0) and 089 * the id to an empty string. 090 */ public 091 BoundingBox() throws org.sbml.libsbml.SBMLConstructorException { 092 this(libsbmlJNI.new_BoundingBox__SWIG_3(), true); 093 } 094 095 096/** 097 * Creates a new {@link BoundingBox} object with the given {@link LayoutPkgNamespaces} object. 098 */ public 099 BoundingBox(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 100 this(libsbmlJNI.new_BoundingBox__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 101 } 102 103 104/** 105 * Copy constructor. 106 */ public 107 BoundingBox(BoundingBox orig) throws org.sbml.libsbml.SBMLConstructorException { 108 this(libsbmlJNI.new_BoundingBox__SWIG_5(BoundingBox.getCPtr(orig), orig), true); 109 } 110 111 112/** 113 * Constructor set position and dimensions to (0.0,0.0,0.0) and the id to 114 * a copy of the given string. 115 <p> 116 * (FOR BACKWARD COMPATIBILITY) 117 */ public 118 BoundingBox(LayoutPkgNamespaces layoutns, String id) throws org.sbml.libsbml.SBMLConstructorException { 119 this(libsbmlJNI.new_BoundingBox__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id), true); 120 } 121 122 123/** 124 * Constructor which sets the id, the coordinates and the dimensions to 125 * the given 2D values. 126 <p> 127 * (FOR BACKWARD COMPATIBILITY) 128 */ public 129 BoundingBox(LayoutPkgNamespaces layoutns, String id, double x, double y, double width, double height) throws org.sbml.libsbml.SBMLConstructorException { 130 this(libsbmlJNI.new_BoundingBox__SWIG_7(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, x, y, width, height), true); 131 } 132 133 134/** 135 * Constructor which sets the id, the coordinates and the dimensions to 136 * the given 3D values. 137 <p> 138 * (FOR BACKWARD COMPATIBILITY) 139 */ public 140 BoundingBox(LayoutPkgNamespaces layoutns, String id, double x, double y, double z, double width, double height, double depth) throws org.sbml.libsbml.SBMLConstructorException { 141 this(libsbmlJNI.new_BoundingBox__SWIG_8(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, x, y, z, width, height, depth), true); 142 } 143 144 145/** 146 * Constructor which sets the id, the coordinates and the dimensions to 147 * the given values. 148 <p> 149 * (FOR BACKWARD COMPATIBILITY) 150 */ public 151 BoundingBox(LayoutPkgNamespaces layoutns, String id, Point p, Dimensions d) throws org.sbml.libsbml.SBMLConstructorException { 152 this(libsbmlJNI.new_BoundingBox__SWIG_9(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, Point.getCPtr(p), p, Dimensions.getCPtr(d), d), true); 153 } 154 155 156/** 157 * Creates a new {@link BoundingBox} from the given {@link XMLNode} 158 <p> 159 * (FOR BACKWARD COMPATIBILITY) 160 */ public 161 BoundingBox(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 162 this(libsbmlJNI.new_BoundingBox__SWIG_10(XMLNode.getCPtr(node), node, l2version), true); 163 } 164 165 166/** 167 * Creates a new {@link BoundingBox} from the given {@link XMLNode} 168 <p> 169 * (FOR BACKWARD COMPATIBILITY) 170 */ public 171 BoundingBox(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 172 this(libsbmlJNI.new_BoundingBox__SWIG_11(XMLNode.getCPtr(node), node), true); 173 } 174 175 176/** 177 * Returns the value of the 'id' attribute of this {@link BoundingBox}. 178 */ public 179 String getId() { 180 return libsbmlJNI.BoundingBox_getId(swigCPtr, this); 181 } 182 183 184/** 185 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 186 * {@link BoundingBox}'s 'id' attribute has been set. 187 */ public 188 boolean isSetId() { 189 return libsbmlJNI.BoundingBox_isSetId(swigCPtr, this); 190 } 191 192 193/** 194 * Sets the value of the 'id' attribute of this {@link BoundingBox}. 195 */ public 196 int setId(String id) { 197 return libsbmlJNI.BoundingBox_setId(swigCPtr, this, id); 198 } 199 200 201/** 202 * Unsets the value of the 'id' attribute of this {@link BoundingBox}. 203 */ public 204 int unsetId() { 205 return libsbmlJNI.BoundingBox_unsetId(swigCPtr, this); 206 } 207 208 209/** 210 * Returns the position of the {@link BoundingBox} as referece to a {@link Point} object. 211 */ public 212 Point getPosition() { 213 long cPtr = libsbmlJNI.BoundingBox_getPosition(swigCPtr, this); 214 return (cPtr == 0) ? null : new Point(cPtr, false); 215 } 216 217 218/** 219 * Returns the dimensions of the {@link BoundingBox} as referece to a {@link Dimensions} 220 * object. 221 */ public 222 Dimensions getDimensions() { 223 long cPtr = libsbmlJNI.BoundingBox_getDimensions(swigCPtr, this); 224 return (cPtr == 0) ? null : new Dimensions(cPtr, false); 225 } 226 227 228/** 229 * Sets the position to a copy of the {@link Point} object given. 230 */ public 231 void setPosition(Point p) { 232 libsbmlJNI.BoundingBox_setPosition(swigCPtr, this, Point.getCPtr(p), p); 233 } 234 235 236/** 237 * Sets the dimensions to a copy of the {@link Dimensions} object given. 238 */ public 239 void setDimensions(Dimensions d) { 240 libsbmlJNI.BoundingBox_setDimensions(swigCPtr, this, Dimensions.getCPtr(d), d); 241 } 242 243 244/** 245 * Return true or false based on whether {@link Dimensions} have been set 246 */ public 247 boolean getDimensionsExplicitlySet() { 248 return libsbmlJNI.BoundingBox_getDimensionsExplicitlySet(swigCPtr, this); 249 } 250 251 252/** 253 * Return true or false based on whether {@link Dimensions} have been set 254 */ public 255 boolean getPositionExplicitlySet() { 256 return libsbmlJNI.BoundingBox_getPositionExplicitlySet(swigCPtr, this); 257 } 258 259 260/** 261 * Does nothing yet since there are no defaults fo a {@link BoundingBox}. 262 */ public 263 void initDefaults() { 264 libsbmlJNI.BoundingBox_initDefaults(swigCPtr, this); 265 } 266 267 268/** 269 * Get the x offset of the bounding box. 270 */ public 271 double x() { 272 return libsbmlJNI.BoundingBox_x(swigCPtr, this); 273 } 274 275 276/** 277 * Get the y offset of the bounding box. 278 */ public 279 double y() { 280 return libsbmlJNI.BoundingBox_y(swigCPtr, this); 281 } 282 283 284/** 285 * Get the z offset of the bounding box. 286 */ public 287 double z() { 288 return libsbmlJNI.BoundingBox_z(swigCPtr, this); 289 } 290 291 292/** 293 * Get the width of the bounding box. 294 */ public 295 double width() { 296 return libsbmlJNI.BoundingBox_width(swigCPtr, this); 297 } 298 299 300/** 301 * Get the height of the bounding box. 302 */ public 303 double height() { 304 return libsbmlJNI.BoundingBox_height(swigCPtr, this); 305 } 306 307 308/** 309 * Get the depth of the bounding box. 310 */ public 311 double depth() { 312 return libsbmlJNI.BoundingBox_depth(swigCPtr, this); 313 } 314 315 316/** 317 * Set x offset of the bounding box 318 */ public 319 void setX(double x) { 320 libsbmlJNI.BoundingBox_setX(swigCPtr, this, x); 321 } 322 323 324/** 325 * Set y offset of the bounding box 326 */ public 327 void setY(double y) { 328 libsbmlJNI.BoundingBox_setY(swigCPtr, this, y); 329 } 330 331 332/** 333 * Set z offset of the bounding box 334 */ public 335 void setZ(double z) { 336 libsbmlJNI.BoundingBox_setZ(swigCPtr, this, z); 337 } 338 339 340/** 341 * Set width of the bounding box 342 */ public 343 void setWidth(double width) { 344 libsbmlJNI.BoundingBox_setWidth(swigCPtr, this, width); 345 } 346 347 348/** 349 * Set height of the bounding box 350 */ public 351 void setHeight(double height) { 352 libsbmlJNI.BoundingBox_setHeight(swigCPtr, this, height); 353 } 354 355 356/** 357 * Set depth of the bounding box 358 */ public 359 void setDepth(double depth) { 360 libsbmlJNI.BoundingBox_setDepth(swigCPtr, this, depth); 361 } 362 363 364/** 365 * Returns the XML element name of 366 * this SBML object. 367 <p> 368 * @return the string of the name of this element. 369 */ public 370 String getElementName() { 371 return libsbmlJNI.BoundingBox_getElementName(swigCPtr, this); 372 } 373 374 375/** 376 * Creates and returns a deep copy of this {@link BoundingBox}. 377 <p> 378 * @return a (deep) copy of this {@link BoundingBox}. 379 */ public 380 BoundingBox cloneObject() { 381 long cPtr = libsbmlJNI.BoundingBox_cloneObject(swigCPtr, this); 382 return (cPtr == 0) ? null : new BoundingBox(cPtr, true); 383 } 384 385 386/** 387 * Returns the libSBML type code of this object instance. 388 <p> 389 * <p> 390 * LibSBML attaches an identifying code to every kind of SBML object. These 391 * are integer constants known as <em>SBML type codes</em>. The names of all 392 * the codes begin with the characters <code>SBML_</code>. 393 * In the Java language interface for libSBML, the 394 * type codes are defined as static integer constants in the interface class 395 * {@link libsbmlConstants}. Note that different Level 3 396 * package plug-ins may use overlapping type codes; to identify the package 397 * to which a given object belongs, call the <code>getPackageName()</code> 398 * method on the object. 399 <p> 400 * @return the SBML type code for this object: 401 * {@link libsbmlConstants#SBML_LAYOUT_BOUNDINGBOX SBML_LAYOUT_BOUNDINGBOX} 402 <p> 403 * <p> 404 * @warning <span class='warning'>The specific integer values of the possible 405 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 406 * packages, To fully identify the correct code, <strong>it is necessary to 407 * invoke both getTypeCode() and getPackageName()</strong>.</span> 408 <p> 409 * @see #getElementName() 410 * @see #getPackageName() 411 */ public 412 int getTypeCode() { 413 return libsbmlJNI.BoundingBox_getTypeCode(swigCPtr, this); 414 } 415 416 417/** 418 * Creates an {@link XMLNode} object from this. 419 */ public 420 XMLNode toXML() { 421 return new XMLNode(libsbmlJNI.BoundingBox_toXML(swigCPtr, this), true); 422 } 423 424 public void connectToChild() { 425 libsbmlJNI.BoundingBox_connectToChild(swigCPtr, this); 426 } 427 428 429/** * @internal */ public 430 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 431 libsbmlJNI.BoundingBox_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 432 } 433 434}