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 Spatial dimensions of a 2D or 3D shape. 015 <p> 016 * A dimension is specified via the required attributes width, height and an 017 * optional attribute depth, all of which are of type double. If the 018 * attribute depth is not specified, the object is a two dimensional object. 019 * The width attribute of {@link Dimensions} specifies the size of the object in the 020 * direction of the positive x axis, the height attribute specifies the size 021 * of the object along the positive y axis and the depth attribute specifies 022 * the size of the object along the positive z axis. All sizes for {@link Dimensions} 023 * objects are positive values, and so the attributes are not allowed to take 024 * negative values. The {@link Dimensions} class also has an optional attribute id 025 * of type SId. While not used in the “layout” package, it can be 026 * used by programs to refer to the elements. 027 */ 028 029public class Dimensions extends SBase { 030 private long swigCPtr; 031 032 protected Dimensions(long cPtr, boolean cMemoryOwn) 033 { 034 super(libsbmlJNI.Dimensions_SWIGUpcast(cPtr), cMemoryOwn); 035 swigCPtr = cPtr; 036 } 037 038 protected static long getCPtr(Dimensions obj) 039 { 040 return (obj == null) ? 0 : obj.swigCPtr; 041 } 042 043 protected static long getCPtrAndDisown (Dimensions obj) 044 { 045 long ptr = 0; 046 047 if (obj != null) 048 { 049 ptr = obj.swigCPtr; 050 obj.swigCMemOwn = false; 051 } 052 053 return ptr; 054 } 055 056 protected void finalize() { 057 delete(); 058 } 059 060 public synchronized void delete() { 061 if (swigCPtr != 0) { 062 if (swigCMemOwn) { 063 swigCMemOwn = false; 064 libsbmlJNI.delete_Dimensions(swigCPtr); 065 } 066 swigCPtr = 0; 067 } 068 super.delete(); 069 } 070 071 072/** 073 * Creates a new {@link Dimensions} object with the given level, version, and package version 074 * and with all sizes set to 0.0. 075 */ public 076 Dimensions(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 077 this(libsbmlJNI.new_Dimensions__SWIG_0(level, version, pkgVersion), true); 078 } 079 080 081/** 082 * Creates a new {@link Dimensions} object with the given level, version, and package version 083 * and with all sizes set to 0.0. 084 */ public 085 Dimensions(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 086 this(libsbmlJNI.new_Dimensions__SWIG_1(level, version), true); 087 } 088 089 090/** 091 * Creates a new {@link Dimensions} object with the given level, version, and package version 092 * and with all sizes set to 0.0. 093 */ public 094 Dimensions(long level) throws org.sbml.libsbml.SBMLConstructorException { 095 this(libsbmlJNI.new_Dimensions__SWIG_2(level), true); 096 } 097 098 099/** 100 * Creates a new {@link Dimensions} object with the given level, version, and package version 101 * and with all sizes set to 0.0. 102 */ public 103 Dimensions() throws org.sbml.libsbml.SBMLConstructorException { 104 this(libsbmlJNI.new_Dimensions__SWIG_3(), true); 105 } 106 107 108/** 109 * Creates a new {@link Dimensions} object with the given {@link LayoutPkgNamespaces} object. 110 */ public 111 Dimensions(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 112 this(libsbmlJNI.new_Dimensions__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 113 } 114 115 116/** 117 * Copy constructor. 118 */ public 119 Dimensions(Dimensions orig) throws org.sbml.libsbml.SBMLConstructorException { 120 this(libsbmlJNI.new_Dimensions__SWIG_5(Dimensions.getCPtr(orig), orig), true); 121 } 122 123 124/** 125 * Creates a new {@link Dimensions} object with the given sizes. 126 */ public 127 Dimensions(LayoutPkgNamespaces layoutns, double w, double h, double d) throws org.sbml.libsbml.SBMLConstructorException { 128 this(libsbmlJNI.new_Dimensions__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, w, h, d), true); 129 } 130 131 132/** 133 * Creates a new {@link Dimensions} object with the given sizes. 134 */ public 135 Dimensions(LayoutPkgNamespaces layoutns, double w, double h) throws org.sbml.libsbml.SBMLConstructorException { 136 this(libsbmlJNI.new_Dimensions__SWIG_7(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, w, h), true); 137 } 138 139 140/** 141 * Creates a new {@link Dimensions} object from the given {@link XMLNode} 142 */ public 143 Dimensions(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 144 this(libsbmlJNI.new_Dimensions__SWIG_8(XMLNode.getCPtr(node), node, l2version), true); 145 } 146 147 148/** 149 * Creates a new {@link Dimensions} object from the given {@link XMLNode} 150 */ public 151 Dimensions(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 152 this(libsbmlJNI.new_Dimensions__SWIG_9(XMLNode.getCPtr(node), node), true); 153 } 154 155 156/** 157 * Returns the width. 158 */ public 159 double width() { 160 return libsbmlJNI.Dimensions_width(swigCPtr, this); 161 } 162 163 164/** 165 * Returns the height. 166 */ public 167 double height() { 168 return libsbmlJNI.Dimensions_height(swigCPtr, this); 169 } 170 171 172/** 173 * Returns the depth. 174 */ public 175 double depth() { 176 return libsbmlJNI.Dimensions_depth(swigCPtr, this); 177 } 178 179 180/** 181 * Returns the width. 182 */ public 183 double getWidth() { 184 return libsbmlJNI.Dimensions_getWidth(swigCPtr, this); 185 } 186 187 188/** 189 * Returns the height. 190 */ public 191 double getHeight() { 192 return libsbmlJNI.Dimensions_getHeight(swigCPtr, this); 193 } 194 195 196/** 197 * Returns the depth. 198 */ public 199 double getDepth() { 200 return libsbmlJNI.Dimensions_getDepth(swigCPtr, this); 201 } 202 203 204/** 205 * Sets the width to the given value. 206 */ public 207 void setWidth(double w) { 208 libsbmlJNI.Dimensions_setWidth(swigCPtr, this, w); 209 } 210 211 212/** 213 * Sets the height to the given value. 214 */ public 215 void setHeight(double h) { 216 libsbmlJNI.Dimensions_setHeight(swigCPtr, this, h); 217 } 218 219 220/** 221 * Sets the depth to the given value. 222 */ public 223 void setDepth(double d) { 224 libsbmlJNI.Dimensions_setDepth(swigCPtr, this, d); 225 } 226 227 228/** 229 * Sets all sizes of the {@link Dimensions} object to the given values. 230 */ public 231 void setBounds(double w, double h, double d) { 232 libsbmlJNI.Dimensions_setBounds__SWIG_0(swigCPtr, this, w, h, d); 233 } 234 235 236/** 237 * Sets all sizes of the {@link Dimensions} object to the given values. 238 */ public 239 void setBounds(double w, double h) { 240 libsbmlJNI.Dimensions_setBounds__SWIG_1(swigCPtr, this, w, h); 241 } 242 243 244/** */ public 245 boolean getDExplicitlySet() { 246 return libsbmlJNI.Dimensions_getDExplicitlySet(swigCPtr, this); 247 } 248 249 250/** 251 * Sets the depth to 0.0 252 */ public 253 void initDefaults() { 254 libsbmlJNI.Dimensions_initDefaults(swigCPtr, this); 255 } 256 257 258/** 259 * Returns the value of the 'id' attribute of this {@link Dimensions}. 260 */ public 261 String getId() { 262 return libsbmlJNI.Dimensions_getId(swigCPtr, this); 263 } 264 265 266/** 267 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 268 * {@link Dimensions}'s 'id' attribute has been set. 269 */ public 270 boolean isSetId() { 271 return libsbmlJNI.Dimensions_isSetId(swigCPtr, this); 272 } 273 274 275/** 276 * Sets the value of the 'id' attribute of this {@link Dimensions}. 277 */ public 278 int setId(String id) { 279 return libsbmlJNI.Dimensions_setId(swigCPtr, this, id); 280 } 281 282 283/** 284 * Unsets the value of the 'id' attribute of this {@link Dimensions}. 285 */ public 286 int unsetId() { 287 return libsbmlJNI.Dimensions_unsetId(swigCPtr, this); 288 } 289 290 291/** 292 * Returns the XML element name of 293 * this SBML object. 294 <p> 295 * @return the string of the name of this element 296 */ public 297 String getElementName() { 298 return libsbmlJNI.Dimensions_getElementName(swigCPtr, this); 299 } 300 301 302/** 303 * Creates and returns a deep copy of this {@link Dimensions}. 304 <p> 305 * @return a (deep) copy of this {@link Dimensions} object. 306 */ public 307 Dimensions cloneObject() { 308 long cPtr = libsbmlJNI.Dimensions_cloneObject(swigCPtr, this); 309 return (cPtr == 0) ? null : new Dimensions(cPtr, true); 310 } 311 312 313/** 314 * Returns the libSBML type code of this object instance. 315 <p> 316 * <p> 317 * LibSBML attaches an identifying code to every kind of SBML object. These 318 * are integer constants known as <em>SBML type codes</em>. The names of all 319 * the codes begin with the characters <code>SBML_</code>. 320 * In the Java language interface for libSBML, the 321 * type codes are defined as static integer constants in the interface class 322 * {@link libsbmlConstants}. Note that different Level 3 323 * package plug-ins may use overlapping type codes; to identify the package 324 * to which a given object belongs, call the <code>getPackageName()</code> 325 * method on the object. 326 <p> 327 * @return the SBML type code for this object: 328 * {@link libsbmlConstants#SBML_LAYOUT_DIMENSIONS SBML_LAYOUT_DIMENSIONS} 329 <p> 330 * <p> 331 * @warning <span class='warning'>The specific integer values of the possible 332 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 333 * packages, To fully identify the correct code, <strong>it is necessary to 334 * invoke both getTypeCode() and getPackageName()</strong>.</span> 335 <p> 336 * @see #getElementName() 337 * @see #getPackageName() 338 */ public 339 int getTypeCode() { 340 return libsbmlJNI.Dimensions_getTypeCode(swigCPtr, this); 341 } 342 343 344/** 345 * Creates an {@link XMLNode} object from this. 346 */ public 347 XMLNode toXML() { 348 return new XMLNode(libsbmlJNI.Dimensions_toXML(swigCPtr, this), true); 349 } 350 351}