001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 2.0.11 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 BoundingBox extends SBase { 012 private long swigCPtr; 013 014 protected BoundingBox(long cPtr, boolean cMemoryOwn) 015 { 016 super(libsbmlJNI.BoundingBox_SWIGUpcast(cPtr), cMemoryOwn); 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(BoundingBox obj) 021 { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected static long getCPtrAndDisown (BoundingBox 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_BoundingBox(swigCPtr); 047 } 048 swigCPtr = 0; 049 } 050 super.delete(); 051 } 052 053 public BoundingBox(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 054 this(libsbmlJNI.new_BoundingBox__SWIG_0(level, version, pkgVersion), true); 055 } 056 057 public BoundingBox(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 058 this(libsbmlJNI.new_BoundingBox__SWIG_1(level, version), true); 059 } 060 061 public BoundingBox(long level) throws org.sbml.libsbml.SBMLConstructorException { 062 this(libsbmlJNI.new_BoundingBox__SWIG_2(level), true); 063 } 064 065 public BoundingBox() throws org.sbml.libsbml.SBMLConstructorException { 066 this(libsbmlJNI.new_BoundingBox__SWIG_3(), true); 067 } 068 069 public BoundingBox(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 070 this(libsbmlJNI.new_BoundingBox__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 071 } 072 073 public BoundingBox(BoundingBox orig) throws org.sbml.libsbml.SBMLConstructorException { 074 this(libsbmlJNI.new_BoundingBox__SWIG_5(BoundingBox.getCPtr(orig), orig), true); 075 } 076 077 public BoundingBox(LayoutPkgNamespaces layoutns, String id) throws org.sbml.libsbml.SBMLConstructorException { 078 this(libsbmlJNI.new_BoundingBox__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id), true); 079 } 080 081 public BoundingBox(LayoutPkgNamespaces layoutns, String id, double x, double y, double width, double height) throws org.sbml.libsbml.SBMLConstructorException { 082 this(libsbmlJNI.new_BoundingBox__SWIG_7(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, x, y, width, height), true); 083 } 084 085 public BoundingBox(LayoutPkgNamespaces layoutns, String id, double x, double y, double z, double width, double height, double depth) throws org.sbml.libsbml.SBMLConstructorException { 086 this(libsbmlJNI.new_BoundingBox__SWIG_8(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, x, y, z, width, height, depth), true); 087 } 088 089 public BoundingBox(LayoutPkgNamespaces layoutns, String id, Point p, Dimensions d) throws org.sbml.libsbml.SBMLConstructorException { 090 this(libsbmlJNI.new_BoundingBox__SWIG_9(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, Point.getCPtr(p), p, Dimensions.getCPtr(d), d), true); 091 } 092 093 public BoundingBox(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 094 this(libsbmlJNI.new_BoundingBox__SWIG_10(XMLNode.getCPtr(node), node, l2version), true); 095 } 096 097 public BoundingBox(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 098 this(libsbmlJNI.new_BoundingBox__SWIG_11(XMLNode.getCPtr(node), node), true); 099 } 100 101 102/** 103 * Returns the value of the 'metaid' attribute of this object. 104 * <p> 105 * The optional attribute named 'metaid', present on every major SBML 106 * component type, is for supporting metadata annotations using RDF 107 * (Resource Description Format). The attribute value has the data type 108 * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML 109 * identifier type, which means each 'metaid' value must be globally 110 * unique within an SBML file. (Importantly, this uniqueness criterion 111 * applies across any attribute with type <a 112 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the 113 * 'metaid' attribute used by SBML—something to be aware of if your 114 * application-specific XML content inside the 'annotation' subelement 115 * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) 116 * The 'metaid' value serves to identify a model 117 * component for purposes such as referencing that component from 118 * metadata placed within 'annotation' subelements. 119 * <p> 120 * @return the meta-identifier of this SBML object, as a string. 121 * <p> 122 * @see #isSetMetaId() 123 * @see #setMetaId(String metaid) 124 * @internal 125 */ public 126 String getId() { 127 return libsbmlJNI.BoundingBox_getId(swigCPtr, this); 128 } 129 130 131/** 132 * Predicate returning <code>true</code> if this object's 'metaid' attribute is set. 133 * <p> 134 * The optional attribute named 'metaid', present on every major SBML 135 * component type, is for supporting metadata annotations using RDF 136 * (Resource Description Format). The attribute value has the data type 137 * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML 138 * identifier type, which means each 'metaid' value must be globally 139 * unique within an SBML file. (Importantly, this uniqueness criterion 140 * applies across any attribute with type <a 141 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the 142 * 'metaid' attribute used by SBML—something to be aware of if your 143 * application-specific XML content inside the 'annotation' subelement 144 * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) 145 * The 'metaid' value serves to identify a model component for purposes 146 * such as referencing that component from metadata placed within 147 * 'annotation' subelements. 148 * <p> 149 * @return <code>true</code> if the 'metaid' attribute of this SBML object is 150 * set, <code>false</code> otherwise. 151 * <p> 152 * @see #getMetaId() 153 * @see #setMetaId(String metaid) 154 * @internal 155 */ public 156 boolean isSetId() { 157 return libsbmlJNI.BoundingBox_isSetId(swigCPtr, this); 158 } 159 160 161/** 162 * Predicate returning <code>true</code> if this 163 * object has a {@link ModelHistory} object attached to it. 164 * <p> 165 * @return <code>true</code> if the {@link ModelHistory} of this object is set, 166 * <code>false</code> otherwise. 167 * <p> 168 * @note In SBML Level 2, model history annotations were only 169 * permitted on the {@link Model} element. In SBML Level 3, they are 170 * permitted on all SBML components derived from {@link SBase}. 171 * @internal 172 */ public 173 int setId(String id) { 174 return libsbmlJNI.BoundingBox_setId(swigCPtr, this, id); 175 } 176 177 178/** 179 * Unsets the value of the 'id' attribute of this SBML object. 180 * <p> 181 * Most (but not all) objects in SBML include two common attributes: 'id' 182 * and 'name'. The identifier given by an object's 'id' attribute value 183 * is used to identify the object within the SBML model definition. 184 * Other objects can refer to the component using this identifier. The 185 * data type of 'id' is always either <code>Sid</code> or 186 * <code>UnitSId</code>, depending on the object in question. Both 187 * data types are defined as follows: 188 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 189 * letter .= 'a'..'z','A'..'Z' 190 * digit .= '0'..'9' 191 * idChar .= letter | digit | '_' 192 * SId .= ( letter | '_' ) idChar* 193 * </pre> 194 * <p> 195 * The equality of <code>SId</code> and <code>UnitSId</code> type values 196 * in SBML is determined by an exact character sequence match; i.e., 197 * comparisons of these identifiers must be performed in a case-sensitive 198 * manner. This applies to all uses of <code>SId</code> and 199 * <code>UnitSId</code>. 200 * <p> 201 * @return integer value indicating success/failure of the 202 * function. The possible values returned by this function are: 203 * <ul> 204 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 205 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 206 * </ul> 207 */ public 208 int unsetId() { 209 return libsbmlJNI.BoundingBox_unsetId(swigCPtr, this); 210 } 211 212 public Point getPosition() { 213 long cPtr = libsbmlJNI.BoundingBox_getPosition(swigCPtr, this); 214 return (cPtr == 0) ? null : new Point(cPtr, false); 215 } 216 217 public Dimensions getDimensions() { 218 long cPtr = libsbmlJNI.BoundingBox_getDimensions(swigCPtr, this); 219 return (cPtr == 0) ? null : new Dimensions(cPtr, false); 220 } 221 222 public void setPosition(Point p) { 223 libsbmlJNI.BoundingBox_setPosition(swigCPtr, this, Point.getCPtr(p), p); 224 } 225 226 public void setDimensions(Dimensions d) { 227 libsbmlJNI.BoundingBox_setDimensions(swigCPtr, this, Dimensions.getCPtr(d), d); 228 } 229 230 public void initDefaults() { 231 libsbmlJNI.BoundingBox_initDefaults(swigCPtr, this); 232 } 233 234 public double x() { 235 return libsbmlJNI.BoundingBox_x(swigCPtr, this); 236 } 237 238 public double y() { 239 return libsbmlJNI.BoundingBox_y(swigCPtr, this); 240 } 241 242 public double z() { 243 return libsbmlJNI.BoundingBox_z(swigCPtr, this); 244 } 245 246 public double width() { 247 return libsbmlJNI.BoundingBox_width(swigCPtr, this); 248 } 249 250 public double height() { 251 return libsbmlJNI.BoundingBox_height(swigCPtr, this); 252 } 253 254 public double depth() { 255 return libsbmlJNI.BoundingBox_depth(swigCPtr, this); 256 } 257 258 public void setX(double x) { 259 libsbmlJNI.BoundingBox_setX(swigCPtr, this, x); 260 } 261 262 public void setY(double y) { 263 libsbmlJNI.BoundingBox_setY(swigCPtr, this, y); 264 } 265 266 public void setZ(double z) { 267 libsbmlJNI.BoundingBox_setZ(swigCPtr, this, z); 268 } 269 270 public void setWidth(double width) { 271 libsbmlJNI.BoundingBox_setWidth(swigCPtr, this, width); 272 } 273 274 public void setHeight(double height) { 275 libsbmlJNI.BoundingBox_setHeight(swigCPtr, this, height); 276 } 277 278 public void setDepth(double depth) { 279 libsbmlJNI.BoundingBox_setDepth(swigCPtr, this, depth); 280 } 281 282 283/** 284 * Returns the XML element name of this object. 285 * <p> 286 * This is overridden by subclasses to return a string appropriate to the 287 * SBML component. For example, {@link Model} defines it as returning 288 * <code>'model'</code>, {@link CompartmentType} defines it as returning <code>'compartmentType'</code>, 289 * and so on. 290 */ public 291 String getElementName() { 292 return libsbmlJNI.BoundingBox_getElementName(swigCPtr, this); 293 } 294 295 296/** 297 * Creates and returns a deep copy of this {@link SBase} object. 298 * <p> 299 * @return a (deep) copy of this {@link SBase} object. 300 */ public 301 BoundingBox cloneObject() { 302 long cPtr = libsbmlJNI.BoundingBox_cloneObject(swigCPtr, this); 303 return (cPtr == 0) ? null : new BoundingBox(cPtr, true); 304 } 305 306 307/** 308 * Returns the libSBML type code for this object. 309 * <p> 310 * This method may return the type code of this SBML object, or it may 311 * return {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN}. This 312 * is because subclasses of {@link SBase} are not required to implement this 313 * method to return a type code. This method is meant primarily for the 314 * LibSBML C interface, in which class and subclass information is not 315 * readily available. 316 * <p> 317 * @return the SBML object type code 318 * of this SBML object or 319 * {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (the default). 320 * <p> 321 * @see #getElementName() 322 * @see #getPackageName() 323 */ public 324 int getTypeCode() { 325 return libsbmlJNI.BoundingBox_getTypeCode(swigCPtr, this); 326 } 327 328 public XMLNode toXML() { 329 return new XMLNode(libsbmlJNI.BoundingBox_toXML(swigCPtr, this), true); 330 } 331 332 333/** 334 * Sets this SBML object to child SBML objects (if any). 335 * (Creates a child-parent relationship by the parent) 336 * <p> 337 * Subclasses must override this function if they define 338 * one ore more child elements. 339 * Basically, this function needs to be called in 340 * constructor, copy constructor, assignment operator. 341 * <p> 342 * <p> 343 * @internal 344 */ public 345 void connectToChild() { 346 libsbmlJNI.BoundingBox_connectToChild(swigCPtr, this); 347 } 348 349 350/** 351 * Enables/Disables the given package with this element and child 352 * elements (if any). 353 * (This is an internal implementation for enablePackage function) 354 * <p> 355 * @note Subclasses in which one or more child elements are defined 356 * must override this function. 357 * <p> 358 * <p> 359 * @see #connectToChild() 360 * @internal 361 */ public 362 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 363 libsbmlJNI.BoundingBox_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 364 } 365 366}