001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.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 A glyph for an SBML species. 015 <p> 016 * In addition to the attributes it inherits from {@link GraphicalObject}, the 017 * {@link SpeciesGlyph} object has an optional 'species' attribute. 018 */ 019 020public class SpeciesGlyph extends GraphicalObject { 021 private long swigCPtr; 022 023 protected SpeciesGlyph(long cPtr, boolean cMemoryOwn) 024 { 025 super(libsbmlJNI.SpeciesGlyph_SWIGUpcast(cPtr), cMemoryOwn); 026 swigCPtr = cPtr; 027 } 028 029 protected static long getCPtr(SpeciesGlyph obj) 030 { 031 return (obj == null) ? 0 : obj.swigCPtr; 032 } 033 034 protected static long getCPtrAndDisown (SpeciesGlyph obj) 035 { 036 long ptr = 0; 037 038 if (obj != null) 039 { 040 ptr = obj.swigCPtr; 041 obj.swigCMemOwn = false; 042 } 043 044 return ptr; 045 } 046 047 protected void finalize() { 048 delete(); 049 } 050 051 public synchronized void delete() { 052 if (swigCPtr != 0) { 053 if (swigCMemOwn) { 054 swigCMemOwn = false; 055 libsbmlJNI.delete_SpeciesGlyph(swigCPtr); 056 } 057 swigCPtr = 0; 058 } 059 super.delete(); 060 } 061 062 063/** 064 * Creates a new {@link SpeciesGlyph} with the given SBML level, version, and package version 065 * and the id of the associated species set to the empty string. 066 <p> 067 * @param level the SBML Level. 068 * @param version the Version within the SBML Level. 069 * @param pkgVersion the version of the package. 070 <p> 071 * <p> 072 * @note Attempting to add an object to an {@link SBMLDocument} having a different 073 * combination of SBML Level, Version and XML namespaces than the object 074 * itself will result in an error at the time a caller attempts to make the 075 * addition. A parent object must have compatible Level, Version and XML 076 * namespaces. (Strictly speaking, a parent may also have more XML 077 * namespaces than a child, but the reverse is not permitted.) The 078 * restriction is necessary to ensure that an SBML model has a consistent 079 * overall structure. This requires callers to manage their objects 080 * carefully, but the benefit is increased flexibility in how models can be 081 * created by permitting callers to create objects bottom-up if desired. In 082 * situations where objects are not yet attached to parents (e.g., 083 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 084 * libSBML determine such things as whether it is valid to assign a 085 * particular value to an attribute. For packages, this means that the 086 * parent object to which this package element is being added must have 087 * been created with the package namespace, or that the package namespace 088 * was added to it, even if that parent is not a package object itself. 089 */ public 090 SpeciesGlyph(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 091 this(libsbmlJNI.new_SpeciesGlyph__SWIG_0(level, version, pkgVersion), true); 092 } 093 094 095/** 096 * Creates a new {@link SpeciesGlyph} with the given SBML level, version, and package version 097 * and the id of the associated species set to the empty string. 098 <p> 099 * @param level the SBML Level. 100 * @param version the Version within the SBML Level. 101 * @param pkgVersion the version of the package. 102 <p> 103 * <p> 104 * @note Attempting to add an object to an {@link SBMLDocument} having a different 105 * combination of SBML Level, Version and XML namespaces than the object 106 * itself will result in an error at the time a caller attempts to make the 107 * addition. A parent object must have compatible Level, Version and XML 108 * namespaces. (Strictly speaking, a parent may also have more XML 109 * namespaces than a child, but the reverse is not permitted.) The 110 * restriction is necessary to ensure that an SBML model has a consistent 111 * overall structure. This requires callers to manage their objects 112 * carefully, but the benefit is increased flexibility in how models can be 113 * created by permitting callers to create objects bottom-up if desired. In 114 * situations where objects are not yet attached to parents (e.g., 115 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 116 * libSBML determine such things as whether it is valid to assign a 117 * particular value to an attribute. For packages, this means that the 118 * parent object to which this package element is being added must have 119 * been created with the package namespace, or that the package namespace 120 * was added to it, even if that parent is not a package object itself. 121 */ public 122 SpeciesGlyph(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 123 this(libsbmlJNI.new_SpeciesGlyph__SWIG_1(level, version), true); 124 } 125 126 127/** 128 * Creates a new {@link SpeciesGlyph} with the given SBML level, version, and package version 129 * and the id of the associated species set to the empty string. 130 <p> 131 * @param level the SBML Level. 132 * @param version the Version within the SBML Level. 133 * @param pkgVersion the version of the package. 134 <p> 135 * <p> 136 * @note Attempting to add an object to an {@link SBMLDocument} having a different 137 * combination of SBML Level, Version and XML namespaces than the object 138 * itself will result in an error at the time a caller attempts to make the 139 * addition. A parent object must have compatible Level, Version and XML 140 * namespaces. (Strictly speaking, a parent may also have more XML 141 * namespaces than a child, but the reverse is not permitted.) The 142 * restriction is necessary to ensure that an SBML model has a consistent 143 * overall structure. This requires callers to manage their objects 144 * carefully, but the benefit is increased flexibility in how models can be 145 * created by permitting callers to create objects bottom-up if desired. In 146 * situations where objects are not yet attached to parents (e.g., 147 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 148 * libSBML determine such things as whether it is valid to assign a 149 * particular value to an attribute. For packages, this means that the 150 * parent object to which this package element is being added must have 151 * been created with the package namespace, or that the package namespace 152 * was added to it, even if that parent is not a package object itself. 153 */ public 154 SpeciesGlyph(long level) throws org.sbml.libsbml.SBMLConstructorException { 155 this(libsbmlJNI.new_SpeciesGlyph__SWIG_2(level), true); 156 } 157 158 159/** 160 * Creates a new {@link SpeciesGlyph} with the given SBML level, version, and package version 161 * and the id of the associated species set to the empty string. 162 <p> 163 * @param level the SBML Level. 164 * @param version the Version within the SBML Level. 165 * @param pkgVersion the version of the package. 166 <p> 167 * <p> 168 * @note Attempting to add an object to an {@link SBMLDocument} having a different 169 * combination of SBML Level, Version and XML namespaces than the object 170 * itself will result in an error at the time a caller attempts to make the 171 * addition. A parent object must have compatible Level, Version and XML 172 * namespaces. (Strictly speaking, a parent may also have more XML 173 * namespaces than a child, but the reverse is not permitted.) The 174 * restriction is necessary to ensure that an SBML model has a consistent 175 * overall structure. This requires callers to manage their objects 176 * carefully, but the benefit is increased flexibility in how models can be 177 * created by permitting callers to create objects bottom-up if desired. In 178 * situations where objects are not yet attached to parents (e.g., 179 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 180 * libSBML determine such things as whether it is valid to assign a 181 * particular value to an attribute. For packages, this means that the 182 * parent object to which this package element is being added must have 183 * been created with the package namespace, or that the package namespace 184 * was added to it, even if that parent is not a package object itself. 185 */ public 186 SpeciesGlyph() throws org.sbml.libsbml.SBMLConstructorException { 187 this(libsbmlJNI.new_SpeciesGlyph__SWIG_3(), true); 188 } 189 190 191/** 192 * Constructor. 193 <p> 194 * <p> 195 * The package namespaces object used in this constructor is derived from a 196 * {@link SBMLNamespaces} object, which encapsulates SBML Level/Version/namespaces 197 * information. It is used to communicate the SBML Level, Version, and 198 * package version and name information used in addition to SBML Level 3 Core. A 199 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 200 * package namespace object somewhere in a program once, then hand that object 201 * as needed to object constructors of that package that accept it as and 202 * argument, such as this one. 203 <p> 204 * @param layoutns the {@link LayoutPkgNamespaces} object. 205 <p> 206 * <p> 207 * @note Attempting to add an object to an {@link SBMLDocument} having a different 208 * combination of SBML Level, Version and XML namespaces than the object 209 * itself will result in an error at the time a caller attempts to make the 210 * addition. A parent object must have compatible Level, Version and XML 211 * namespaces. (Strictly speaking, a parent may also have more XML 212 * namespaces than a child, but the reverse is not permitted.) The 213 * restriction is necessary to ensure that an SBML model has a consistent 214 * overall structure. This requires callers to manage their objects 215 * carefully, but the benefit is increased flexibility in how models can be 216 * created by permitting callers to create objects bottom-up if desired. In 217 * situations where objects are not yet attached to parents (e.g., 218 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 219 * libSBML determine such things as whether it is valid to assign a 220 * particular value to an attribute. For packages, this means that the 221 * parent object to which this package element is being added must have 222 * been created with the package namespace, or that the package namespace 223 * was added to it, even if that parent is not a package object itself. 224 */ public 225 SpeciesGlyph(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 226 this(libsbmlJNI.new_SpeciesGlyph__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 227 } 228 229 230/** 231 * Creates a new {@link SpeciesGlyph} with the given <code>id</code>. 232 <p> 233 * (FOR BACKWARD COMPATIBILITY) 234 */ public 235 SpeciesGlyph(LayoutPkgNamespaces layoutns, String id) throws org.sbml.libsbml.SBMLConstructorException { 236 this(libsbmlJNI.new_SpeciesGlyph__SWIG_5(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id), true); 237 } 238 239 240/** 241 * Creates a new {@link SpeciesGlyph} with the given <code>id</code> and the id of the 242 * associated species object set to the second argument. 243 <p> 244 * (FOR BACKWARD COMPATIBILITY) 245 */ public 246 SpeciesGlyph(LayoutPkgNamespaces layoutns, String id, String speciesId) throws org.sbml.libsbml.SBMLConstructorException { 247 this(libsbmlJNI.new_SpeciesGlyph__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, speciesId), true); 248 } 249 250 251/** 252 * Creates a new {@link SpeciesGlyph} from the given {@link XMLNode} 253 */ public 254 SpeciesGlyph(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 255 this(libsbmlJNI.new_SpeciesGlyph__SWIG_7(XMLNode.getCPtr(node), node, l2version), true); 256 } 257 258 259/** 260 * Creates a new {@link SpeciesGlyph} from the given {@link XMLNode} 261 */ public 262 SpeciesGlyph(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 263 this(libsbmlJNI.new_SpeciesGlyph__SWIG_8(XMLNode.getCPtr(node), node), true); 264 } 265 266 267/** 268 * Copy constructor. 269 <p> 270 * @param source the instance to copy. 271 */ public 272 SpeciesGlyph(SpeciesGlyph source) throws org.sbml.libsbml.SBMLConstructorException { 273 this(libsbmlJNI.new_SpeciesGlyph__SWIG_9(SpeciesGlyph.getCPtr(source), source), true); 274 } 275 276 277/** 278 * <p> 279 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another 280 * value. 281 <p> 282 * <p> 283 * In SBML, object identifiers are of a data type called <code>SId</code>. 284 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 285 * introduced for attribute values that refer to <code>SId</code> values; in 286 * previous Levels of SBML, this data type did not exist and attributes were 287 * simply described to as 'referring to an identifier', but the effective 288 * data type was the same as <code>SIdRef</code> in Level 3. These and 289 * other methods of libSBML refer to the type <code>SIdRef</code> for all 290 * Levels of SBML, even if the corresponding SBML specification did not 291 * explicitly name the data type. 292 <p> 293 * This method works by looking at all attributes and (if appropriate) 294 * mathematical formulas in MathML content, comparing the referenced 295 * identifiers to the value of <code>oldid</code>. If any matches are found, the 296 * matching values are replaced with <code>newid</code>. The method does <em>not</em> 297 * descend into child elements. 298 <p> 299 * @param oldid the old identifier. 300 * @param newid the new identifier. 301 */ public 302 void renameSIdRefs(String oldid, String newid) { 303 libsbmlJNI.SpeciesGlyph_renameSIdRefs(swigCPtr, this, oldid, newid); 304 } 305 306 307/** 308 * Returns the id of the associated species object. 309 */ public 310 String getSpeciesId() { 311 return libsbmlJNI.SpeciesGlyph_getSpeciesId(swigCPtr, this); 312 } 313 314 315/** 316 * Sets the id of the associated species object. 317 */ public 318 void setSpeciesId(String id) { 319 libsbmlJNI.SpeciesGlyph_setSpeciesId(swigCPtr, this, id); 320 } 321 322 323/** 324 * Returns <code>true</code> if the id of the associated species object is not the 325 * empty string. 326 */ public 327 boolean isSetSpeciesId() { 328 return libsbmlJNI.SpeciesGlyph_isSetSpeciesId(swigCPtr, this); 329 } 330 331 332/** 333 * Calls initDefaults from {@link GraphicalObject}. 334 */ public 335 void initDefaults() { 336 libsbmlJNI.SpeciesGlyph_initDefaults(swigCPtr, this); 337 } 338 339 340/** 341 * Returns the XML element name of 342 * this SBML object. 343 <p> 344 * @return the string of the name of this element. 345 */ public 346 String getElementName() { 347 return libsbmlJNI.SpeciesGlyph_getElementName(swigCPtr, this); 348 } 349 350 351/** 352 * Creates and returns a deep copy of this {@link SpeciesGlyph}. 353 <p> 354 * @return a (deep) copy of this {@link SpeciesGlyph}. 355 */ public 356 SpeciesGlyph cloneObject() { 357 long cPtr = libsbmlJNI.SpeciesGlyph_cloneObject(swigCPtr, this); 358 return (cPtr == 0) ? null : new SpeciesGlyph(cPtr, true); 359 } 360 361 362/** 363 * Returns the libSBML type code of this object instance. 364 <p> 365 * <p> 366 * LibSBML attaches an identifying code to every kind of SBML object. These 367 * are integer constants known as <em>SBML type codes</em>. The names of all 368 * the codes begin with the characters <code>SBML_</code>. 369 * In the Java language interface for libSBML, the 370 * type codes are defined as static integer constants in the interface class 371 * {@link libsbmlConstants}. Note that different Level 3 372 * package plug-ins may use overlapping type codes; to identify the package 373 * to which a given object belongs, call the 374 * <code>{@link SBase#getPackageName()} 375 * </code> 376 * method on the object. 377 <p> 378 * @return the SBML type code for this object: 379 * {@link libsbmlConstants#SBML_LAYOUT_SPECIESGLYPH SBML_LAYOUT_SPECIESGLYPH}. 380 <p> 381 * <p> 382 * @warning <span class='warning'>The specific integer values of the possible 383 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 384 * packages, To fully identify the correct code, <strong>it is necessary to 385 * invoke both getTypeCode() and getPackageName()</strong>.</span> 386 <p> 387 * @see #getElementName() 388 * @see #getPackageName() 389 */ public 390 int getTypeCode() { 391 return libsbmlJNI.SpeciesGlyph_getTypeCode(swigCPtr, this); 392 } 393 394 395/** 396 * Creates an {@link XMLNode} object from this. 397 */ public 398 XMLNode toXML() { 399 return new XMLNode(libsbmlJNI.SpeciesGlyph_toXML(swigCPtr, this), true); 400 } 401 402}