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