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 Layout extends SBase { 012 private long swigCPtr; 013 014 protected Layout(long cPtr, boolean cMemoryOwn) 015 { 016 super(libsbmlJNI.Layout_SWIGUpcast(cPtr), cMemoryOwn); 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(Layout obj) 021 { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected static long getCPtrAndDisown (Layout 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_Layout(swigCPtr); 047 } 048 swigCPtr = 0; 049 } 050 super.delete(); 051 } 052 053 public Layout(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 054 this(libsbmlJNI.new_Layout__SWIG_0(level, version, pkgVersion), true); 055 } 056 057 public Layout(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 058 this(libsbmlJNI.new_Layout__SWIG_1(level, version), true); 059 } 060 061 public Layout(long level) throws org.sbml.libsbml.SBMLConstructorException { 062 this(libsbmlJNI.new_Layout__SWIG_2(level), true); 063 } 064 065 public Layout() throws org.sbml.libsbml.SBMLConstructorException { 066 this(libsbmlJNI.new_Layout__SWIG_3(), true); 067 } 068 069 public Layout(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 070 this(libsbmlJNI.new_Layout__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 071 } 072 073 public Layout(LayoutPkgNamespaces layoutns, String id, Dimensions dimensions) throws org.sbml.libsbml.SBMLConstructorException { 074 this(libsbmlJNI.new_Layout__SWIG_5(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, Dimensions.getCPtr(dimensions), dimensions), true); 075 } 076 077 public Layout(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 078 this(libsbmlJNI.new_Layout__SWIG_6(XMLNode.getCPtr(node), node, l2version), true); 079 } 080 081 public Layout(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 082 this(libsbmlJNI.new_Layout__SWIG_7(XMLNode.getCPtr(node), node), true); 083 } 084 085 public Layout(Layout source) throws org.sbml.libsbml.SBMLConstructorException { 086 this(libsbmlJNI.new_Layout__SWIG_8(Layout.getCPtr(source), source), true); 087 } 088 089 public void initDefaults() { 090 libsbmlJNI.Layout_initDefaults(swigCPtr, this); 091 } 092 093 094/** 095 * Returns the value of the 'metaid' attribute of this object. 096 * <p> 097 * The optional attribute named 'metaid', present on every major SBML 098 * component type, is for supporting metadata annotations using RDF 099 * (Resource Description Format). The attribute value has the data type 100 * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML 101 * identifier type, which means each 'metaid' value must be globally 102 * unique within an SBML file. (Importantly, this uniqueness criterion 103 * applies across any attribute with type <a 104 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the 105 * 'metaid' attribute used by SBML—something to be aware of if your 106 * application-specific XML content inside the 'annotation' subelement 107 * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) 108 * The 'metaid' value serves to identify a model 109 * component for purposes such as referencing that component from 110 * metadata placed within 'annotation' subelements. 111 * <p> 112 * @return the meta-identifier of this SBML object, as a string. 113 * <p> 114 * @see #isSetMetaId() 115 * @see #setMetaId(String metaid) 116 * @internal 117 */ public 118 String getId() { 119 return libsbmlJNI.Layout_getId(swigCPtr, this); 120 } 121 122 123/** 124 * Predicate returning <code>true</code> if this object's 'metaid' attribute is set. 125 * <p> 126 * The optional attribute named 'metaid', present on every major SBML 127 * component type, is for supporting metadata annotations using RDF 128 * (Resource Description Format). The attribute value has the data type 129 * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML 130 * identifier type, which means each 'metaid' value must be globally 131 * unique within an SBML file. (Importantly, this uniqueness criterion 132 * applies across any attribute with type <a 133 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the 134 * 'metaid' attribute used by SBML—something to be aware of if your 135 * application-specific XML content inside the 'annotation' subelement 136 * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) 137 * The 'metaid' value serves to identify a model component for purposes 138 * such as referencing that component from metadata placed within 139 * 'annotation' subelements. 140 * <p> 141 * @return <code>true</code> if the 'metaid' attribute of this SBML object is 142 * set, <code>false</code> otherwise. 143 * <p> 144 * @see #getMetaId() 145 * @see #setMetaId(String metaid) 146 * @internal 147 */ public 148 boolean isSetId() { 149 return libsbmlJNI.Layout_isSetId(swigCPtr, this); 150 } 151 152 153/** 154 * Predicate returning <code>true</code> if this 155 * object has a {@link ModelHistory} object attached to it. 156 * <p> 157 * @return <code>true</code> if the {@link ModelHistory} of this object is set, 158 * <code>false</code> otherwise. 159 * <p> 160 * @note In SBML Level 2, model history annotations were only 161 * permitted on the {@link Model} element. In SBML Level 3, they are 162 * permitted on all SBML components derived from {@link SBase}. 163 * @internal 164 */ public 165 int setId(String id) { 166 return libsbmlJNI.Layout_setId(swigCPtr, this, id); 167 } 168 169 170/** 171 * Unsets the value of the 'id' attribute of this SBML object. 172 * <p> 173 * Most (but not all) objects in SBML include two common attributes: 'id' 174 * and 'name'. The identifier given by an object's 'id' attribute value 175 * is used to identify the object within the SBML model definition. 176 * Other objects can refer to the component using this identifier. The 177 * data type of 'id' is always either <code>Sid</code> or 178 * <code>UnitSId</code>, depending on the object in question. Both 179 * data types are defined as follows: 180 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 181 * letter .= 'a'..'z','A'..'Z' 182 * digit .= '0'..'9' 183 * idChar .= letter | digit | '_' 184 * SId .= ( letter | '_' ) idChar* 185 * </pre> 186 * <p> 187 * The equality of <code>SId</code> and <code>UnitSId</code> type values 188 * in SBML is determined by an exact character sequence match; i.e., 189 * comparisons of these identifiers must be performed in a case-sensitive 190 * manner. This applies to all uses of <code>SId</code> and 191 * <code>UnitSId</code>. 192 * <p> 193 * @return integer value indicating success/failure of the 194 * function. The possible values returned by this function are: 195 * <ul> 196 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 197 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 198 * </ul> 199 */ public 200 int unsetId() { 201 return libsbmlJNI.Layout_unsetId(swigCPtr, this); 202 } 203 204 public Dimensions getDimensions() { 205 long cPtr = libsbmlJNI.Layout_getDimensions(swigCPtr, this); 206 return (cPtr == 0) ? null : new Dimensions(cPtr, false); 207 } 208 209 public void setDimensions(Dimensions dimensions) { 210 libsbmlJNI.Layout_setDimensions(swigCPtr, this, Dimensions.getCPtr(dimensions), dimensions); 211 } 212 213 public ListOfCompartmentGlyphs getListOfCompartmentGlyphs() { 214 long cPtr = libsbmlJNI.Layout_getListOfCompartmentGlyphs(swigCPtr, this); 215 return (cPtr == 0) ? null : new ListOfCompartmentGlyphs(cPtr, false); 216 } 217 218 public ListOfSpeciesGlyphs getListOfSpeciesGlyphs() { 219 long cPtr = libsbmlJNI.Layout_getListOfSpeciesGlyphs(swigCPtr, this); 220 return (cPtr == 0) ? null : new ListOfSpeciesGlyphs(cPtr, false); 221 } 222 223 public ListOfReactionGlyphs getListOfReactionGlyphs() { 224 long cPtr = libsbmlJNI.Layout_getListOfReactionGlyphs(swigCPtr, this); 225 return (cPtr == 0) ? null : new ListOfReactionGlyphs(cPtr, false); 226 } 227 228 public ListOfTextGlyphs getListOfTextGlyphs() { 229 long cPtr = libsbmlJNI.Layout_getListOfTextGlyphs(swigCPtr, this); 230 return (cPtr == 0) ? null : new ListOfTextGlyphs(cPtr, false); 231 } 232 233 public ListOfGraphicalObjects getListOfAdditionalGraphicalObjects() { 234 long cPtr = libsbmlJNI.Layout_getListOfAdditionalGraphicalObjects(swigCPtr, this); 235 return (cPtr == 0) ? null : new ListOfGraphicalObjects(cPtr, false); 236 } 237 238 public CompartmentGlyph getCompartmentGlyph(long index) { 239 long cPtr = libsbmlJNI.Layout_getCompartmentGlyph__SWIG_0(swigCPtr, this, index); 240 return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, false); 241 } 242 243 public SpeciesGlyph getSpeciesGlyph(long index) { 244 long cPtr = libsbmlJNI.Layout_getSpeciesGlyph__SWIG_0(swigCPtr, this, index); 245 return (cPtr == 0) ? null : new SpeciesGlyph(cPtr, false); 246 } 247 248 public ReactionGlyph getReactionGlyph(long index) { 249 long cPtr = libsbmlJNI.Layout_getReactionGlyph__SWIG_0(swigCPtr, this, index); 250 return (cPtr == 0) ? null : new ReactionGlyph(cPtr, false); 251 } 252 253 public TextGlyph getTextGlyph(long index) { 254 long cPtr = libsbmlJNI.Layout_getTextGlyph__SWIG_0(swigCPtr, this, index); 255 return (cPtr == 0) ? null : new TextGlyph(cPtr, false); 256 } 257 258 public GraphicalObject getAdditionalGraphicalObject(long index) { 259 return (GraphicalObject) libsbml.DowncastSBase(libsbmlJNI.Layout_getAdditionalGraphicalObject__SWIG_0(swigCPtr, this, index), false); 260} 261 262 public GeneralGlyph getGeneralGlyph(long index) { 263 long cPtr = libsbmlJNI.Layout_getGeneralGlyph__SWIG_0(swigCPtr, this, index); 264 return (cPtr == 0) ? null : new GeneralGlyph(cPtr, false); 265 } 266 267 public CompartmentGlyph getCompartmentGlyph(String id) { 268 long cPtr = libsbmlJNI.Layout_getCompartmentGlyph__SWIG_2(swigCPtr, this, id); 269 return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, false); 270 } 271 272 public SpeciesGlyph getSpeciesGlyph(String id) { 273 long cPtr = libsbmlJNI.Layout_getSpeciesGlyph__SWIG_2(swigCPtr, this, id); 274 return (cPtr == 0) ? null : new SpeciesGlyph(cPtr, false); 275 } 276 277 public ReactionGlyph getReactionGlyph(String id) { 278 long cPtr = libsbmlJNI.Layout_getReactionGlyph__SWIG_2(swigCPtr, this, id); 279 return (cPtr == 0) ? null : new ReactionGlyph(cPtr, false); 280 } 281 282 public TextGlyph getTextGlyph(String id) { 283 long cPtr = libsbmlJNI.Layout_getTextGlyph__SWIG_2(swigCPtr, this, id); 284 return (cPtr == 0) ? null : new TextGlyph(cPtr, false); 285 } 286 287 public GraphicalObject getAdditionalGraphicalObject(String id) { 288 return (GraphicalObject) libsbml.DowncastSBase(libsbmlJNI.Layout_getAdditionalGraphicalObject__SWIG_2(swigCPtr, this, id), false); 289} 290 291 public GeneralGlyph getGeneralGlyph(String id) { 292 long cPtr = libsbmlJNI.Layout_getGeneralGlyph__SWIG_2(swigCPtr, this, id); 293 return (cPtr == 0) ? null : new GeneralGlyph(cPtr, false); 294 } 295 296 public void addCompartmentGlyph(CompartmentGlyph glyph) { 297 libsbmlJNI.Layout_addCompartmentGlyph(swigCPtr, this, CompartmentGlyph.getCPtr(glyph), glyph); 298 } 299 300 public void addSpeciesGlyph(SpeciesGlyph glyph) { 301 libsbmlJNI.Layout_addSpeciesGlyph(swigCPtr, this, SpeciesGlyph.getCPtr(glyph), glyph); 302 } 303 304 public void addReactionGlyph(ReactionGlyph glyph) { 305 libsbmlJNI.Layout_addReactionGlyph(swigCPtr, this, ReactionGlyph.getCPtr(glyph), glyph); 306 } 307 308 public void addTextGlyph(TextGlyph glyph) { 309 libsbmlJNI.Layout_addTextGlyph(swigCPtr, this, TextGlyph.getCPtr(glyph), glyph); 310 } 311 312 public void addAdditionalGraphicalObject(GraphicalObject glyph) { 313 libsbmlJNI.Layout_addAdditionalGraphicalObject(swigCPtr, this, GraphicalObject.getCPtr(glyph), glyph); 314 } 315 316 public void addGeneralGlyph(GeneralGlyph glyph) { 317 libsbmlJNI.Layout_addGeneralGlyph(swigCPtr, this, GeneralGlyph.getCPtr(glyph), glyph); 318 } 319 320 public long getNumCompartmentGlyphs() { 321 return libsbmlJNI.Layout_getNumCompartmentGlyphs(swigCPtr, this); 322 } 323 324 public long getNumSpeciesGlyphs() { 325 return libsbmlJNI.Layout_getNumSpeciesGlyphs(swigCPtr, this); 326 } 327 328 public long getNumReactionGlyphs() { 329 return libsbmlJNI.Layout_getNumReactionGlyphs(swigCPtr, this); 330 } 331 332 public long getNumTextGlyphs() { 333 return libsbmlJNI.Layout_getNumTextGlyphs(swigCPtr, this); 334 } 335 336 public long getNumAdditionalGraphicalObjects() { 337 return libsbmlJNI.Layout_getNumAdditionalGraphicalObjects(swigCPtr, this); 338 } 339 340 public long getNumGeneralGlyphs() { 341 return libsbmlJNI.Layout_getNumGeneralGlyphs(swigCPtr, this); 342 } 343 344 public CompartmentGlyph createCompartmentGlyph() { 345 long cPtr = libsbmlJNI.Layout_createCompartmentGlyph(swigCPtr, this); 346 return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, false); 347 } 348 349 public SpeciesGlyph createSpeciesGlyph() { 350 long cPtr = libsbmlJNI.Layout_createSpeciesGlyph(swigCPtr, this); 351 return (cPtr == 0) ? null : new SpeciesGlyph(cPtr, false); 352 } 353 354 public ReactionGlyph createReactionGlyph() { 355 long cPtr = libsbmlJNI.Layout_createReactionGlyph(swigCPtr, this); 356 return (cPtr == 0) ? null : new ReactionGlyph(cPtr, false); 357 } 358 359 public GeneralGlyph createGeneralGlyph() { 360 long cPtr = libsbmlJNI.Layout_createGeneralGlyph(swigCPtr, this); 361 return (cPtr == 0) ? null : new GeneralGlyph(cPtr, false); 362 } 363 364 public TextGlyph createTextGlyph() { 365 long cPtr = libsbmlJNI.Layout_createTextGlyph(swigCPtr, this); 366 return (cPtr == 0) ? null : new TextGlyph(cPtr, false); 367 } 368 369 public GraphicalObject createAdditionalGraphicalObject() { 370 return (GraphicalObject) libsbml.DowncastSBase(libsbmlJNI.Layout_createAdditionalGraphicalObject(swigCPtr, this), false); 371} 372 373 public SpeciesReferenceGlyph createSpeciesReferenceGlyph() { 374 long cPtr = libsbmlJNI.Layout_createSpeciesReferenceGlyph(swigCPtr, this); 375 return (cPtr == 0) ? null : new SpeciesReferenceGlyph(cPtr, false); 376 } 377 378 public LineSegment createLineSegment() { 379 return (LineSegment) libsbml.DowncastSBase(libsbmlJNI.Layout_createLineSegment(swigCPtr, this), false); 380} 381 382 public CubicBezier createCubicBezier() { 383 long cPtr = libsbmlJNI.Layout_createCubicBezier(swigCPtr, this); 384 return (cPtr == 0) ? null : new CubicBezier(cPtr, false); 385 } 386 387 public CompartmentGlyph removeCompartmentGlyph(long index) { 388 long cPtr = libsbmlJNI.Layout_removeCompartmentGlyph__SWIG_0(swigCPtr, this, index); 389 return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, true); 390 } 391 392 public SpeciesGlyph removeSpeciesGlyph(long index) { 393 long cPtr = libsbmlJNI.Layout_removeSpeciesGlyph__SWIG_0(swigCPtr, this, index); 394 return (cPtr == 0) ? null : new SpeciesGlyph(cPtr, true); 395 } 396 397 public ReactionGlyph removeReactionGlyph(long index) { 398 long cPtr = libsbmlJNI.Layout_removeReactionGlyph__SWIG_0(swigCPtr, this, index); 399 return (cPtr == 0) ? null : new ReactionGlyph(cPtr, true); 400 } 401 402 public TextGlyph removeTextGlyph(long index) { 403 long cPtr = libsbmlJNI.Layout_removeTextGlyph__SWIG_0(swigCPtr, this, index); 404 return (cPtr == 0) ? null : new TextGlyph(cPtr, true); 405 } 406 407 public GraphicalObject removeAdditionalGraphicalObject(long index) { 408 return (GraphicalObject) libsbml.DowncastSBase(libsbmlJNI.Layout_removeAdditionalGraphicalObject__SWIG_0(swigCPtr, this, index), true); 409} 410 411 public CompartmentGlyph removeCompartmentGlyph(String id) { 412 long cPtr = libsbmlJNI.Layout_removeCompartmentGlyph__SWIG_1(swigCPtr, this, id); 413 return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, true); 414 } 415 416 public SpeciesGlyph removeSpeciesGlyph(String id) { 417 long cPtr = libsbmlJNI.Layout_removeSpeciesGlyph__SWIG_1(swigCPtr, this, id); 418 return (cPtr == 0) ? null : new SpeciesGlyph(cPtr, true); 419 } 420 421 public ReactionGlyph removeReactionGlyph(String id) { 422 long cPtr = libsbmlJNI.Layout_removeReactionGlyph__SWIG_1(swigCPtr, this, id); 423 return (cPtr == 0) ? null : new ReactionGlyph(cPtr, true); 424 } 425 426 public SpeciesReferenceGlyph removeSpeciesReferenceGlyph(String id) { 427 long cPtr = libsbmlJNI.Layout_removeSpeciesReferenceGlyph(swigCPtr, this, id); 428 return (cPtr == 0) ? null : new SpeciesReferenceGlyph(cPtr, true); 429 } 430 431 public TextGlyph removeTextGlyph(String id) { 432 long cPtr = libsbmlJNI.Layout_removeTextGlyph__SWIG_1(swigCPtr, this, id); 433 return (cPtr == 0) ? null : new TextGlyph(cPtr, true); 434 } 435 436 public GraphicalObject removeAdditionalGraphicalObject(String id) { 437 return (GraphicalObject) libsbml.DowncastSBase(libsbmlJNI.Layout_removeAdditionalGraphicalObject__SWIG_1(swigCPtr, this, id), true); 438} 439 440 441/** 442 * Returns the XML element name of this object. 443 * <p> 444 * This is overridden by subclasses to return a string appropriate to the 445 * SBML component. For example, {@link Model} defines it as returning 446 * <code>'model'</code>, {@link CompartmentType} defines it as returning <code>'compartmentType'</code>, 447 * and so on. 448 */ public 449 String getElementName() { 450 return libsbmlJNI.Layout_getElementName(swigCPtr, this); 451 } 452 453 454/** 455 * Creates and returns a deep copy of this {@link SBase} object. 456 * <p> 457 * @return a (deep) copy of this {@link SBase} object. 458 */ public 459 Layout cloneObject() { 460 long cPtr = libsbmlJNI.Layout_cloneObject(swigCPtr, this); 461 return (cPtr == 0) ? null : new Layout(cPtr, true); 462 } 463 464 465/** 466 * Returns the libSBML type code for this object. 467 * <p> 468 * This method may return the type code of this SBML object, or it may 469 * return {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN}. This 470 * is because subclasses of {@link SBase} are not required to implement this 471 * method to return a type code. This method is meant primarily for the 472 * LibSBML C interface, in which class and subclass information is not 473 * readily available. 474 * <p> 475 * @return the SBML object type code 476 * of this SBML object or 477 * {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (the default). 478 * <p> 479 * @see #getElementName() 480 * @see #getPackageName() 481 */ public 482 int getTypeCode() { 483 return libsbmlJNI.Layout_getTypeCode(swigCPtr, this); 484 } 485 486 public XMLNode toXML() { 487 return new XMLNode(libsbmlJNI.Layout_toXML(swigCPtr, this), true); 488 } 489 490 491/** 492 * Sets this SBML object to child SBML objects (if any). 493 * (Creates a child-parent relationship by the parent) 494 * <p> 495 * Subclasses must override this function if they define 496 * one ore more child elements. 497 * Basically, this function needs to be called in 498 * constructor, copy constructor, assignment operator. 499 * <p> 500 * <p> 501 * @internal 502 */ public 503 void connectToChild() { 504 libsbmlJNI.Layout_connectToChild(swigCPtr, this); 505 } 506 507 508/** 509 * Enables/Disables the given package with this element and child 510 * elements (if any). 511 * (This is an internal implementation for enablePackage function) 512 * <p> 513 * @note Subclasses in which one or more child elements are defined 514 * must override this function. 515 * <p> 516 * <p> 517 * @see #connectToChild() 518 * @internal 519 */ public 520 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 521 libsbmlJNI.Layout_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 522 } 523 524}