001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.8 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 <em>species reference</em>. 015 <p> 016 * The SpeciesReferenceGlyph element describes the graphical connection 017 * between a {@link SpeciesGlyph} and a {@link ReactionGlyph} (which would be an arrow or 018 * some curve in most cases). A {@link SpeciesReferenceGlyph} inherits from 019 * {@link GraphicalObject}, and adds a mandatory attribute 'speciesGlyph' and two 020 * optional attributes 'speciesReference' and 'role'. Optionally, the 021 * {@link SpeciesReferenceGlyph} also has a child element 'curve'. 022 <p> 023 * If the curve is specified, it overrides the inherited bounding box. 024 */ 025 026public class SpeciesReferenceGlyph extends GraphicalObject { 027 private long swigCPtr; 028 029 protected SpeciesReferenceGlyph(long cPtr, boolean cMemoryOwn) 030 { 031 super(libsbmlJNI.SpeciesReferenceGlyph_SWIGUpcast(cPtr), cMemoryOwn); 032 swigCPtr = cPtr; 033 } 034 035 protected static long getCPtr(SpeciesReferenceGlyph obj) 036 { 037 return (obj == null) ? 0 : obj.swigCPtr; 038 } 039 040 protected static long getCPtrAndDisown (SpeciesReferenceGlyph obj) 041 { 042 long ptr = 0; 043 044 if (obj != null) 045 { 046 ptr = obj.swigCPtr; 047 obj.swigCMemOwn = false; 048 } 049 050 return ptr; 051 } 052 053 protected void finalize() { 054 delete(); 055 } 056 057 public synchronized void delete() { 058 if (swigCPtr != 0) { 059 if (swigCMemOwn) { 060 swigCMemOwn = false; 061 libsbmlJNI.delete_SpeciesReferenceGlyph(swigCPtr); 062 } 063 swigCPtr = 0; 064 } 065 super.delete(); 066 } 067 068 069/** 070 * Creates a new {@link SpeciesReferenceGlyph} with the given SBML level, version and 071 * package version. The id if the associated species 072 * reference and the id of the associated species glyph are set to the 073 * empty string. The role is set to SPECIES_ROLE_UNDEFINED. 074 */ public 075 SpeciesReferenceGlyph(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 076 this(libsbmlJNI.new_SpeciesReferenceGlyph__SWIG_0(level, version, pkgVersion), true); 077 } 078 079 080/** 081 * Creates a new {@link SpeciesReferenceGlyph} with the given SBML level, version and 082 * package version. The id if the associated species 083 * reference and the id of the associated species glyph are set to the 084 * empty string. The role is set to SPECIES_ROLE_UNDEFINED. 085 */ public 086 SpeciesReferenceGlyph(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 087 this(libsbmlJNI.new_SpeciesReferenceGlyph__SWIG_1(level, version), true); 088 } 089 090 091/** 092 * Creates a new {@link SpeciesReferenceGlyph} with the given SBML level, version and 093 * package version. The id if the associated species 094 * reference and the id of the associated species glyph are set to the 095 * empty string. The role is set to SPECIES_ROLE_UNDEFINED. 096 */ public 097 SpeciesReferenceGlyph(long level) throws org.sbml.libsbml.SBMLConstructorException { 098 this(libsbmlJNI.new_SpeciesReferenceGlyph__SWIG_2(level), true); 099 } 100 101 102/** 103 * Creates a new {@link SpeciesReferenceGlyph} with the given SBML level, version and 104 * package version. The id if the associated species 105 * reference and the id of the associated species glyph are set to the 106 * empty string. The role is set to SPECIES_ROLE_UNDEFINED. 107 */ public 108 SpeciesReferenceGlyph() throws org.sbml.libsbml.SBMLConstructorException { 109 this(libsbmlJNI.new_SpeciesReferenceGlyph__SWIG_3(), true); 110 } 111 112 113/** 114 * Ctor. 115 */ public 116 SpeciesReferenceGlyph(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 117 this(libsbmlJNI.new_SpeciesReferenceGlyph__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 118 } 119 120 121/** 122 * Creates a new {@link SpeciesReferenceGlyph}. The id is given as the first 123 * argument, the id of the associated species glyph is given as the 124 * second argument. The third argument is the id of the associated 125 * species reference and the fourth argument is the role. 126 */ public 127 SpeciesReferenceGlyph(LayoutPkgNamespaces layoutns, String sid, String speciesGlyphId, String speciesReferenceId, int role) throws org.sbml.libsbml.SBMLConstructorException { 128 this(libsbmlJNI.new_SpeciesReferenceGlyph__SWIG_5(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, sid, speciesGlyphId, speciesReferenceId, role), true); 129 } 130 131 132/** 133 * Creates a new {@link SpeciesReferenceGlyph} from the given {@link XMLNode} 134 */ public 135 SpeciesReferenceGlyph(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 136 this(libsbmlJNI.new_SpeciesReferenceGlyph__SWIG_6(XMLNode.getCPtr(node), node, l2version), true); 137 } 138 139 140/** 141 * Creates a new {@link SpeciesReferenceGlyph} from the given {@link XMLNode} 142 */ public 143 SpeciesReferenceGlyph(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 144 this(libsbmlJNI.new_SpeciesReferenceGlyph__SWIG_7(XMLNode.getCPtr(node), node), true); 145 } 146 147 148/** 149 * Copy constructor. 150 */ public 151 SpeciesReferenceGlyph(SpeciesReferenceGlyph source) throws org.sbml.libsbml.SBMLConstructorException { 152 this(libsbmlJNI.new_SpeciesReferenceGlyph__SWIG_8(SpeciesReferenceGlyph.getCPtr(source), source), true); 153 } 154 155 156/** 157 * Returns the id of the associated {@link SpeciesGlyph}. 158 */ public 159 String getSpeciesGlyphId() { 160 return libsbmlJNI.SpeciesReferenceGlyph_getSpeciesGlyphId(swigCPtr, this); 161 } 162 163 164/** 165 * Sets the id of the associated species glyph. 166 */ public 167 void setSpeciesGlyphId(String speciesGlyphId) { 168 libsbmlJNI.SpeciesReferenceGlyph_setSpeciesGlyphId(swigCPtr, this, speciesGlyphId); 169 } 170 171 172/** 173 * Returns the id of the associated species reference. 174 */ public 175 String getSpeciesReferenceId() { 176 return libsbmlJNI.SpeciesReferenceGlyph_getSpeciesReferenceId(swigCPtr, this); 177 } 178 179 180/** 181 * Sets the id of the associated species reference. 182 */ public 183 void setSpeciesReferenceId(String id) { 184 libsbmlJNI.SpeciesReferenceGlyph_setSpeciesReferenceId(swigCPtr, this, id); 185 } 186 187 188/** 189 * Returns a string representation of the role. 190 */ public 191 String getRoleString() { 192 return libsbmlJNI.SpeciesReferenceGlyph_getRoleString(swigCPtr, this); 193 } 194 195 196/** 197 * Returns the role. 198 */ public 199 int getRole() { 200 return libsbmlJNI.SpeciesReferenceGlyph_getRole(swigCPtr, this); 201 } 202 203 204/** 205 * Sets the role based on a string. 206 * The String can be one of: 207 * SUBSTRATE 208 * PRODUCT 209 * SIDESUBSTRATE 210 * SIDEPRODUCT 211 * MODIFIER 212 * ACTIVATOR 213 * INHIBITOR 214 */ public 215 void setRole(String role) { 216 libsbmlJNI.SpeciesReferenceGlyph_setRole__SWIG_0(swigCPtr, this, role); 217 } 218 219 220/** 221 * Sets the role. 222 */ public 223 void setRole(int role) { 224 libsbmlJNI.SpeciesReferenceGlyph_setRole__SWIG_1(swigCPtr, this, role); 225 } 226 227 228/** 229 * <p> 230 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another 231 * value. 232 <p> 233 * <p> 234 * In SBML, object identifiers are of a data type called <code>SId</code>. 235 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 236 * introduced for attribute values that refer to <code>SId</code> values; in 237 * previous Levels of SBML, this data type did not exist and attributes were 238 * simply described to as 'referring to an identifier', but the effective 239 * data type was the same as <code>SIdRef</code>in Level 3. These and 240 * other methods of libSBML refer to the type <code>SIdRef</code> for all 241 * Levels of SBML, even if the corresponding SBML specification did not 242 * explicitly name the data type. 243 <p> 244 * This method works by looking at all attributes and (if appropriate) 245 * mathematical formulas in MathML content, comparing the referenced 246 * identifiers to the value of <code>oldid</code>. If any matches are found, the 247 * matching values are replaced with <code>newid</code>. The method does <em>not</em> 248 * descend into child elements. 249 <p> 250 * @param oldid the old identifier 251 * @param newid the new identifier 252 */ public 253 void renameSIdRefs(String oldid, String newid) { 254 libsbmlJNI.SpeciesReferenceGlyph_renameSIdRefs(swigCPtr, this, oldid, newid); 255 } 256 257 258/** 259 * Returns the curve object for the species reference glyph 260 */ public 261 Curve getCurve() { 262 long cPtr = libsbmlJNI.SpeciesReferenceGlyph_getCurve__SWIG_0(swigCPtr, this); 263 return (cPtr == 0) ? null : new Curve(cPtr, false); 264 } 265 266 267/** 268 * Sets the curve object for the species reference glyph. 269 */ public 270 void setCurve(Curve curve) { 271 libsbmlJNI.SpeciesReferenceGlyph_setCurve(swigCPtr, this, Curve.getCPtr(curve), curve); 272 } 273 274 275/** 276 * Returns true if the curve consists of one or more segments. 277 */ public 278 boolean isSetCurve() { 279 return libsbmlJNI.SpeciesReferenceGlyph_isSetCurve(swigCPtr, this); 280 } 281 282 283/** */ public 284 boolean getCurveExplicitlySet() { 285 return libsbmlJNI.SpeciesReferenceGlyph_getCurveExplicitlySet(swigCPtr, this); 286 } 287 288 289/** 290 * Returns true if the id of the associated species glyph is not the 291 * empty string. 292 */ public 293 boolean isSetSpeciesGlyphId() { 294 return libsbmlJNI.SpeciesReferenceGlyph_isSetSpeciesGlyphId(swigCPtr, this); 295 } 296 297 298/** 299 * Returns true if the id of the associated species reference is not the 300 * empty string. 301 */ public 302 boolean isSetSpeciesReferenceId() { 303 return libsbmlJNI.SpeciesReferenceGlyph_isSetSpeciesReferenceId(swigCPtr, this); 304 } 305 306 307/** 308 * Returns true of role is different from SPECIES_ROLE_UNDEFINED. 309 */ public 310 boolean isSetRole() { 311 return libsbmlJNI.SpeciesReferenceGlyph_isSetRole(swigCPtr, this); 312 } 313 314 315/** 316 * Calls initDefaults on {@link GraphicalObject} and sets role to 317 * SPECIES_ROLE_UNDEFINED. 318 */ public 319 void initDefaults() { 320 libsbmlJNI.SpeciesReferenceGlyph_initDefaults(swigCPtr, this); 321 } 322 323 324/** 325 * Creates a new {@link LineSegment} object, adds it to the end of the list of 326 * curve segment objects of the curve and returns a reference to the 327 * newly created object. 328 */ public 329 LineSegment createLineSegment() { 330 return (LineSegment) libsbml.DowncastSBase(libsbmlJNI.SpeciesReferenceGlyph_createLineSegment(swigCPtr, this), false); 331} 332 333 334/** 335 * Creates a new {@link CubicBezier} object, adds it to the end of the list of 336 * curve segment objects of the curve and returns a reference to the 337 * newly created object. 338 */ public 339 CubicBezier createCubicBezier() { 340 long cPtr = libsbmlJNI.SpeciesReferenceGlyph_createCubicBezier(swigCPtr, this); 341 return (cPtr == 0) ? null : new CubicBezier(cPtr, false); 342 } 343 344 345/** 346 * Returns the XML element name of 347 * this SBML object. 348 <p> 349 * @return the string of the name of this element 350 */ public 351 String getElementName() { 352 return libsbmlJNI.SpeciesReferenceGlyph_getElementName(swigCPtr, this); 353 } 354 355 356/** 357 * Creates and returns a deep copy of this {@link SpeciesReferenceGlyph}. 358 <p> 359 * @return a (deep) copy of this {@link SpeciesReferenceGlyph}. 360 */ public 361 SpeciesReferenceGlyph cloneObject() { 362 long cPtr = libsbmlJNI.SpeciesReferenceGlyph_cloneObject(swigCPtr, this); 363 return (cPtr == 0) ? null : new SpeciesReferenceGlyph(cPtr, true); 364 } 365 366 367/** 368 * Returns the libSBML type code of this object instance. 369 <p> 370 * <p> 371 * LibSBML attaches an identifying code to every kind of SBML object. These 372 * are integer constants known as <em>SBML type codes</em>. The names of all 373 * the codes begin with the characters <code>SBML_</code>. 374 * In the Java language interface for libSBML, the 375 * type codes are defined as static integer constants in the interface class 376 * {@link libsbmlConstants}. Note that different Level 3 377 * package plug-ins may use overlapping type codes; to identify the package 378 * to which a given object belongs, call the <code>getPackageName()</code> 379 * method on the object. 380 <p> 381 * @return the SBML type code for this object: 382 * {@link libsbmlConstants#SBML_LAYOUT_SPECIESREFERENCEGLYPH SBML_LAYOUT_SPECIESREFERENCEGLYPH} 383 <p> 384 * <p> 385 * @warning <span class='warning'>The specific integer values of the possible 386 * type codes may be reused by different Level 3 package plug-ins. 387 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 388 * both getTypeCode() and getPackageName()</strong>.</span> 389 <p> 390 * @see #getElementName() 391 * @see #getPackageName() 392 */ public 393 int getTypeCode() { 394 return libsbmlJNI.SpeciesReferenceGlyph_getTypeCode(swigCPtr, this); 395 } 396 397 398/** 399 * Creates an {@link XMLNode} object from this. 400 */ public 401 XMLNode toXML() { 402 return new XMLNode(libsbmlJNI.SpeciesReferenceGlyph_toXML(swigCPtr, this), true); 403 } 404 405 public void connectToChild() { 406 libsbmlJNI.SpeciesReferenceGlyph_connectToChild(swigCPtr, this); 407 } 408 409 410/** * @internal */ public 411 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 412 libsbmlJNI.SpeciesReferenceGlyph_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 413 } 414 415}