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 reaction. 015 <p> 016 * Analogous to how a {@link Reaction} object has to at least have one reactant or 017 * product, the {@link ReactionGlyph} has to at least have one {@link SpeciesReferenceGlyph} 018 * stored in the {@link ListOfSpeciesReferenceGlyphs}. Figure 12 on the following 019 * page provides the UML diagram for the class definition. The {@link ReactionGlyph} 020 * inherits from {@link GraphicalObject}. In addition to the attributes inherited 021 * from {@link GraphicalObject}, the {@link ReactionGlyph} is described by an attribute 022 * reaction, a {@link Curve} element and a listOfSpeciesReferenceGlyphs element. The 023 * {@link Curve} describes the center section of a {@link ReactionGlyph}. The center section 024 * is frequently used by tools to separate the point where substrates arcs 025 * come together, from the point where product arcs split off. The {@link Curve} is 026 * optional, and when not present the dimensions of the inherited {@link BoundingBox} 027 * describes the center section, by storing its position and dimension. 028 */ 029 030public class ReactionGlyph extends GraphicalObject { 031 private long swigCPtr; 032 033 protected ReactionGlyph(long cPtr, boolean cMemoryOwn) 034 { 035 super(libsbmlJNI.ReactionGlyph_SWIGUpcast(cPtr), cMemoryOwn); 036 swigCPtr = cPtr; 037 } 038 039 protected static long getCPtr(ReactionGlyph obj) 040 { 041 return (obj == null) ? 0 : obj.swigCPtr; 042 } 043 044 protected static long getCPtrAndDisown (ReactionGlyph 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_ReactionGlyph(swigCPtr); 066 } 067 swigCPtr = 0; 068 } 069 super.delete(); 070 } 071 072 073/** 074 * Creates a new {@link ReactionGlyph}. The list of species reference glyph is 075 * empty and the id of the associated reaction is set to the empty 076 * string. 077 */ public 078 ReactionGlyph(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 079 this(libsbmlJNI.new_ReactionGlyph__SWIG_0(level, version, pkgVersion), true); 080 } 081 082 083/** 084 * Creates a new {@link ReactionGlyph}. The list of species reference glyph is 085 * empty and the id of the associated reaction is set to the empty 086 * string. 087 */ public 088 ReactionGlyph(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 089 this(libsbmlJNI.new_ReactionGlyph__SWIG_1(level, version), true); 090 } 091 092 093/** 094 * Creates a new {@link ReactionGlyph}. The list of species reference glyph is 095 * empty and the id of the associated reaction is set to the empty 096 * string. 097 */ public 098 ReactionGlyph(long level) throws org.sbml.libsbml.SBMLConstructorException { 099 this(libsbmlJNI.new_ReactionGlyph__SWIG_2(level), true); 100 } 101 102 103/** 104 * Creates a new {@link ReactionGlyph}. The list of species reference glyph is 105 * empty and the id of the associated reaction is set to the empty 106 * string. 107 */ public 108 ReactionGlyph() throws org.sbml.libsbml.SBMLConstructorException { 109 this(libsbmlJNI.new_ReactionGlyph__SWIG_3(), true); 110 } 111 112 113/** 114 * Creates a new {@link ReactionGlyph} with the given {@link LayoutPkgNamespaces} object. 115 */ public 116 ReactionGlyph(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 117 this(libsbmlJNI.new_ReactionGlyph__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 118 } 119 120 121/** 122 * Creates a ResctionGlyph with the given {@link LayoutPkgNamespaces} and id. 123 <p> 124 * (FOR BACKWARD COMPATIBILITY) 125 */ public 126 ReactionGlyph(LayoutPkgNamespaces layoutns, String id) throws org.sbml.libsbml.SBMLConstructorException { 127 this(libsbmlJNI.new_ReactionGlyph__SWIG_5(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id), true); 128 } 129 130 131/** 132 * Creates a ResctionGlyph with the given {@link LayoutPkgNamespaces}, id and set the id of the 133 * associated reaction to the second argument. 134 <p> 135 * (FOR BACKWARD COMPATIBILITY) 136 */ public 137 ReactionGlyph(LayoutPkgNamespaces layoutns, String id, String reactionId) throws org.sbml.libsbml.SBMLConstructorException { 138 this(libsbmlJNI.new_ReactionGlyph__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, reactionId), true); 139 } 140 141 142/** 143 * Creates a new {@link ReactionGlyph} from the given {@link XMLNode} 144 <p> 145 * (FOR BACKWARD COMPATIBILITY) 146 */ public 147 ReactionGlyph(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 148 this(libsbmlJNI.new_ReactionGlyph__SWIG_7(XMLNode.getCPtr(node), node, l2version), true); 149 } 150 151 152/** 153 * Creates a new {@link ReactionGlyph} from the given {@link XMLNode} 154 <p> 155 * (FOR BACKWARD COMPATIBILITY) 156 */ public 157 ReactionGlyph(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 158 this(libsbmlJNI.new_ReactionGlyph__SWIG_8(XMLNode.getCPtr(node), node), true); 159 } 160 161 162/** 163 * Copy constructor. 164 */ public 165 ReactionGlyph(ReactionGlyph source) throws org.sbml.libsbml.SBMLConstructorException { 166 this(libsbmlJNI.new_ReactionGlyph__SWIG_9(ReactionGlyph.getCPtr(source), source), true); 167 } 168 169 170/** 171 * Returns the id of the associated reaction. 172 */ public 173 String getReactionId() { 174 return libsbmlJNI.ReactionGlyph_getReactionId(swigCPtr, this); 175 } 176 177 178/** 179 * Sets the id of the associated reaction. 180 */ public 181 int setReactionId(String id) { 182 return libsbmlJNI.ReactionGlyph_setReactionId(swigCPtr, this, id); 183 } 184 185 186/** 187 * Returns true if the id of the associated reaction is not the empty 188 * string. 189 */ public 190 boolean isSetReactionId() { 191 return libsbmlJNI.ReactionGlyph_isSetReactionId(swigCPtr, this); 192 } 193 194 195/** 196 * Returns the {@link ListOf} object that hold the species reference glyphs. 197 */ public 198 ListOfSpeciesReferenceGlyphs getListOfSpeciesReferenceGlyphs() { 199 long cPtr = libsbmlJNI.ReactionGlyph_getListOfSpeciesReferenceGlyphs(swigCPtr, this); 200 return (cPtr == 0) ? null : new ListOfSpeciesReferenceGlyphs(cPtr, false); 201 } 202 203 204/** 205 * Returns the species reference glyph with the given index. 206 * If the index is invalid, <code>null</code> is returned. 207 */ public 208 SpeciesReferenceGlyph getSpeciesReferenceGlyph(long index) { 209 long cPtr = libsbmlJNI.ReactionGlyph_getSpeciesReferenceGlyph__SWIG_0(swigCPtr, this, index); 210 return (cPtr == 0) ? null : new SpeciesReferenceGlyph(cPtr, false); 211 } 212 213 214/** 215 * Adds a new species reference glyph to the list. 216 */ public 217 void addSpeciesReferenceGlyph(SpeciesReferenceGlyph glyph) { 218 libsbmlJNI.ReactionGlyph_addSpeciesReferenceGlyph(swigCPtr, this, SpeciesReferenceGlyph.getCPtr(glyph), glyph); 219 } 220 221 222/** 223 * Returns the number of species reference glyph objects. 224 */ public 225 long getNumSpeciesReferenceGlyphs() { 226 return libsbmlJNI.ReactionGlyph_getNumSpeciesReferenceGlyphs(swigCPtr, this); 227 } 228 229 230/** 231 * Calls initDefaults from {@link GraphicalObject}. 232 */ public 233 void initDefaults() { 234 libsbmlJNI.ReactionGlyph_initDefaults(swigCPtr, this); 235 } 236 237 238/** 239 * <p> 240 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another 241 * value. 242 <p> 243 * <p> 244 * In SBML, object identifiers are of a data type called <code>SId</code>. 245 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 246 * introduced for attribute values that refer to <code>SId</code> values; in 247 * previous Levels of SBML, this data type did not exist and attributes were 248 * simply described to as 'referring to an identifier', but the effective 249 * data type was the same as <code>SIdRef</code>in Level 3. These and 250 * other methods of libSBML refer to the type <code>SIdRef</code> for all 251 * Levels of SBML, even if the corresponding SBML specification did not 252 * explicitly name the data type. 253 <p> 254 * This method works by looking at all attributes and (if appropriate) 255 * mathematical formulas in MathML content, comparing the referenced 256 * identifiers to the value of <code>oldid</code>. If any matches are found, the 257 * matching values are replaced with <code>newid</code>. The method does <em>not</em> 258 * descend into child elements. 259 <p> 260 * @param oldid the old identifier 261 * @param newid the new identifier 262 */ public 263 void renameSIdRefs(String oldid, String newid) { 264 libsbmlJNI.ReactionGlyph_renameSIdRefs(swigCPtr, this, oldid, newid); 265 } 266 267 268/** 269 * Returns the curve object for the reaction glyph 270 */ public 271 Curve getCurve() { 272 long cPtr = libsbmlJNI.ReactionGlyph_getCurve__SWIG_0(swigCPtr, this); 273 return (cPtr == 0) ? null : new Curve(cPtr, false); 274 } 275 276 277/** 278 * Sets the curve object for the reaction glyph. 279 */ public 280 void setCurve(Curve curve) { 281 libsbmlJNI.ReactionGlyph_setCurve(swigCPtr, this, Curve.getCPtr(curve), curve); 282 } 283 284 285/** 286 * Returns true if the curve consists of one or more segments. 287 */ public 288 boolean isSetCurve() { 289 return libsbmlJNI.ReactionGlyph_isSetCurve(swigCPtr, this); 290 } 291 292 293/** */ public 294 boolean getCurveExplicitlySet() { 295 return libsbmlJNI.ReactionGlyph_getCurveExplicitlySet(swigCPtr, this); 296 } 297 298 299/** 300 * Creates a new {@link SpeciesReferenceGlyph} object, adds it to the end of the 301 * list of species reference objects and returns a reference to the newly 302 * created object. 303 */ public 304 SpeciesReferenceGlyph createSpeciesReferenceGlyph() { 305 long cPtr = libsbmlJNI.ReactionGlyph_createSpeciesReferenceGlyph(swigCPtr, this); 306 return (cPtr == 0) ? null : new SpeciesReferenceGlyph(cPtr, false); 307 } 308 309 310/** 311 * Creates a new {@link LineSegment} object, adds it to the end of the list of 312 * curve segment objects of the curve and returns a reference to the 313 * newly created object. 314 */ public 315 LineSegment createLineSegment() { 316 return (LineSegment) libsbml.DowncastSBase(libsbmlJNI.ReactionGlyph_createLineSegment(swigCPtr, this), false); 317} 318 319 320/** 321 * Creates a new {@link CubicBezier} object, adds it to the end of the list of 322 * curve segment objects of the curve and returns a reference to the 323 * newly created object. 324 */ public 325 CubicBezier createCubicBezier() { 326 long cPtr = libsbmlJNI.ReactionGlyph_createCubicBezier(swigCPtr, this); 327 return (cPtr == 0) ? null : new CubicBezier(cPtr, false); 328 } 329 330 331/** 332 * Remove the species reference glyph with the given index. 333 * A pointer to the object is returned. If no object has been removed, null 334 * is returned. 335 */ public 336 SpeciesReferenceGlyph removeSpeciesReferenceGlyph(long index) { 337 long cPtr = libsbmlJNI.ReactionGlyph_removeSpeciesReferenceGlyph__SWIG_0(swigCPtr, this, index); 338 return (cPtr == 0) ? null : new SpeciesReferenceGlyph(cPtr, true); 339 } 340 341 342/** 343 * Remove the species reference glyph with the given <code>id</code>. 344 * A pointer to the object is returned. If no object has been removed, null 345 * is returned. 346 */ public 347 SpeciesReferenceGlyph removeSpeciesReferenceGlyph(String id) { 348 long cPtr = libsbmlJNI.ReactionGlyph_removeSpeciesReferenceGlyph__SWIG_1(swigCPtr, this, id); 349 return (cPtr == 0) ? null : new SpeciesReferenceGlyph(cPtr, true); 350 } 351 352 353/** 354 * Returns the index of the species reference glyph with the given <code>id</code>. 355 * If the reaction glyph does not contain a species reference glyph with this 356 * id, the 357 * value of the maximum long integer is returned as an indicator. 358 */ public 359 long getIndexForSpeciesReferenceGlyph(String id) { 360 return libsbmlJNI.ReactionGlyph_getIndexForSpeciesReferenceGlyph(swigCPtr, this, id); 361 } 362 363 364/** 365 * Returns the XML element name of 366 * this SBML object. 367 <p> 368 * @return the string of the name of this element 369 */ public 370 String getElementName() { 371 return libsbmlJNI.ReactionGlyph_getElementName(swigCPtr, this); 372 } 373 374 375/** 376 * Creates and returns a deep copy of this {@link ReactionGlyph} object. 377 <p> 378 * @return a (deep) copy of this {@link ReactionGlyph}. 379 */ public 380 ReactionGlyph cloneObject() { 381 long cPtr = libsbmlJNI.ReactionGlyph_cloneObject(swigCPtr, this); 382 return (cPtr == 0) ? null : new ReactionGlyph(cPtr, true); 383 } 384 385 386/** 387 * Returns the libSBML type code of this object instance. 388 <p> 389 * <p> 390 * LibSBML attaches an identifying code to every kind of SBML object. These 391 * are integer constants known as <em>SBML type codes</em>. The names of all 392 * the codes begin with the characters <code>SBML_</code>. 393 * In the Java language interface for libSBML, the 394 * type codes are defined as static integer constants in the interface class 395 * {@link libsbmlConstants}. Note that different Level 3 396 * package plug-ins may use overlapping type codes; to identify the package 397 * to which a given object belongs, call the <code>getPackageName()</code> 398 * method on the object. 399 <p> 400 * @return the SBML type code for this object: 401 * {@link libsbmlConstants#SBML_LAYOUT_REACTIONGLYPH SBML_LAYOUT_REACTIONGLYPH} 402 <p> 403 * <p> 404 * @warning <span class='warning'>The specific integer values of the possible 405 * type codes may be reused by different Level 3 package plug-ins. 406 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 407 * both getTypeCode() and getPackageName()</strong>.</span> 408 <p> 409 * @see #getElementName() 410 * @see #getPackageName() 411 */ public 412 int getTypeCode() { 413 return libsbmlJNI.ReactionGlyph_getTypeCode(swigCPtr, this); 414 } 415 416 417/** 418 * Creates an {@link XMLNode} object from this. 419 */ public 420 XMLNode toXML() { 421 return new XMLNode(libsbmlJNI.ReactionGlyph_toXML(swigCPtr, this), true); 422 } 423 424 public void connectToChild() { 425 libsbmlJNI.ReactionGlyph_connectToChild(swigCPtr, this); 426 } 427 428 429/** * @internal */ public 430 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 431 libsbmlJNI.ReactionGlyph_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 432 } 433 434}