001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.10 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 miscellaneous items. 015 <p> 016 * The {@link GeneralGlyph} is used to facilitate the representation of elements 017 * other than {@link Compartment}, {@link Species} and {@link Reaction} and thus can be used for the 018 * display of relationships of {@link Rule} or elements defined by other SBML 019 * packages. It closely follows the structure of the {@link ReactionGlyph}. 020 * {@link GeneralGlyph} is defined to have an optional attribute reference as well as 021 * the elements curve, listOfReferenceGlyphs and listOfSubGlyphs. 022 */ 023 024public class GeneralGlyph extends GraphicalObject { 025 private long swigCPtr; 026 027 protected GeneralGlyph(long cPtr, boolean cMemoryOwn) 028 { 029 super(libsbmlJNI.GeneralGlyph_SWIGUpcast(cPtr), cMemoryOwn); 030 swigCPtr = cPtr; 031 } 032 033 protected static long getCPtr(GeneralGlyph obj) 034 { 035 return (obj == null) ? 0 : obj.swigCPtr; 036 } 037 038 protected static long getCPtrAndDisown (GeneralGlyph obj) 039 { 040 long ptr = 0; 041 042 if (obj != null) 043 { 044 ptr = obj.swigCPtr; 045 obj.swigCMemOwn = false; 046 } 047 048 return ptr; 049 } 050 051 protected void finalize() { 052 delete(); 053 } 054 055 public synchronized void delete() { 056 if (swigCPtr != 0) { 057 if (swigCMemOwn) { 058 swigCMemOwn = false; 059 libsbmlJNI.delete_GeneralGlyph(swigCPtr); 060 } 061 swigCPtr = 0; 062 } 063 super.delete(); 064 } 065 066 067/** 068 * Creates a new {@link GeneralGlyph}. The list of reference glyph and subglyphs is 069 * empty and the id of the associated element is set to the empty 070 * string. 071 */ public 072 GeneralGlyph(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 073 this(libsbmlJNI.new_GeneralGlyph__SWIG_0(level, version, pkgVersion), true); 074 } 075 076 077/** 078 * Creates a new {@link GeneralGlyph}. The list of reference glyph and subglyphs is 079 * empty and the id of the associated element is set to the empty 080 * string. 081 */ public 082 GeneralGlyph(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 083 this(libsbmlJNI.new_GeneralGlyph__SWIG_1(level, version), true); 084 } 085 086 087/** 088 * Creates a new {@link GeneralGlyph}. The list of reference glyph and subglyphs is 089 * empty and the id of the associated element is set to the empty 090 * string. 091 */ public 092 GeneralGlyph(long level) throws org.sbml.libsbml.SBMLConstructorException { 093 this(libsbmlJNI.new_GeneralGlyph__SWIG_2(level), true); 094 } 095 096 097/** 098 * Creates a new {@link GeneralGlyph}. The list of reference glyph and subglyphs is 099 * empty and the id of the associated element is set to the empty 100 * string. 101 */ public 102 GeneralGlyph() throws org.sbml.libsbml.SBMLConstructorException { 103 this(libsbmlJNI.new_GeneralGlyph__SWIG_3(), true); 104 } 105 106 107/** 108 * Creates a new {@link GeneralGlyph} with the given {@link LayoutPkgNamespaces} object. 109 */ public 110 GeneralGlyph(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 111 this(libsbmlJNI.new_GeneralGlyph__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 112 } 113 114 115/** 116 * Creates a glyph with the given {@link LayoutPkgNamespaces} and id. 117 <p> 118 * (FOR BACKWARD COMPATIBILITY) 119 */ public 120 GeneralGlyph(LayoutPkgNamespaces layoutns, String id) throws org.sbml.libsbml.SBMLConstructorException { 121 this(libsbmlJNI.new_GeneralGlyph__SWIG_5(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id), true); 122 } 123 124 125/** 126 * Creates a glyph with the given {@link LayoutPkgNamespaces}, id and set the id of the 127 * associated element to the second argument. 128 <p> 129 * (FOR BACKWARD COMPATIBILITY) 130 */ public 131 GeneralGlyph(LayoutPkgNamespaces layoutns, String id, String referenceId) throws org.sbml.libsbml.SBMLConstructorException { 132 this(libsbmlJNI.new_GeneralGlyph__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, referenceId), true); 133 } 134 135 136/** 137 * Creates a new {@link GeneralGlyph} from the given {@link XMLNode} 138 <p> 139 * (FOR BACKWARD COMPATIBILITY) 140 */ public 141 GeneralGlyph(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 142 this(libsbmlJNI.new_GeneralGlyph__SWIG_7(XMLNode.getCPtr(node), node, l2version), true); 143 } 144 145 146/** 147 * Creates a new {@link GeneralGlyph} from the given {@link XMLNode} 148 <p> 149 * (FOR BACKWARD COMPATIBILITY) 150 */ public 151 GeneralGlyph(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 152 this(libsbmlJNI.new_GeneralGlyph__SWIG_8(XMLNode.getCPtr(node), node), true); 153 } 154 155 156/** 157 * Copy constructor. 158 */ public 159 GeneralGlyph(GeneralGlyph source) throws org.sbml.libsbml.SBMLConstructorException { 160 this(libsbmlJNI.new_GeneralGlyph__SWIG_9(GeneralGlyph.getCPtr(source), source), true); 161 } 162 163 164/** 165 * <p> 166 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another 167 * value. 168 <p> 169 * <p> 170 * In SBML, object identifiers are of a data type called <code>SId</code>. 171 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 172 * introduced for attribute values that refer to <code>SId</code> values; in 173 * previous Levels of SBML, this data type did not exist and attributes were 174 * simply described to as 'referring to an identifier', but the effective 175 * data type was the same as <code>SIdRef</code>in Level 3. These and 176 * other methods of libSBML refer to the type <code>SIdRef</code> for all 177 * Levels of SBML, even if the corresponding SBML specification did not 178 * explicitly name the data type. 179 <p> 180 * This method works by looking at all attributes and (if appropriate) 181 * mathematical formulas in MathML content, comparing the referenced 182 * identifiers to the value of <code>oldid</code>. If any matches are found, the 183 * matching values are replaced with <code>newid</code>. The method does <em>not</em> 184 * descend into child elements. 185 <p> 186 * @param oldid the old identifier 187 * @param newid the new identifier 188 */ public 189 void renameSIdRefs(String oldid, String newid) { 190 libsbmlJNI.GeneralGlyph_renameSIdRefs(swigCPtr, this, oldid, newid); 191 } 192 193 194/** 195 * Returns the id of the associated element. 196 */ public 197 String getReferenceId() { 198 return libsbmlJNI.GeneralGlyph_getReferenceId(swigCPtr, this); 199 } 200 201 202/** 203 * Sets the id of the associated element. 204 */ public 205 int setReferenceId(String id) { 206 return libsbmlJNI.GeneralGlyph_setReferenceId(swigCPtr, this, id); 207 } 208 209 210/** 211 * Returns true if the id of the associated element is not the empty 212 * string. 213 */ public 214 boolean isSetReferenceId() { 215 return libsbmlJNI.GeneralGlyph_isSetReferenceId(swigCPtr, this); 216 } 217 218 219/** 220 * Returns the {@link ListOf} object that hold the reference glyphs. 221 */ public 222 ListOfReferenceGlyphs getListOfReferenceGlyphs() { 223 long cPtr = libsbmlJNI.GeneralGlyph_getListOfReferenceGlyphs__SWIG_0(swigCPtr, this); 224 return (cPtr == 0) ? null : new ListOfReferenceGlyphs(cPtr, false); 225 } 226 227 228/** 229 * Returns the {@link ListOf} object that hold the sub glyphs. 230 */ public 231 ListOfGraphicalObjects getListOfSubGlyphs() { 232 long cPtr = libsbmlJNI.GeneralGlyph_getListOfSubGlyphs__SWIG_0(swigCPtr, this); 233 return (cPtr == 0) ? null : new ListOfGraphicalObjects(cPtr, false); 234 } 235 236 237/** 238 * Returns the reference glyph with the given index. 239 * If the index is invalid, <code>null</code> is returned. 240 */ public 241 ReferenceGlyph getReferenceGlyph(long index) { 242 long cPtr = libsbmlJNI.GeneralGlyph_getReferenceGlyph__SWIG_0(swigCPtr, this, index); 243 return (cPtr == 0) ? null : new ReferenceGlyph(cPtr, false); 244 } 245 246 247/** 248 * Returns the sub glyph with the given index. 249 * If the index is invalid, <code>null</code> is returned. 250 */ public 251 GraphicalObject getSubGlyph(long index) { 252 return (GraphicalObject) libsbml.DowncastSBase(libsbmlJNI.GeneralGlyph_getSubGlyph__SWIG_0(swigCPtr, this, index), false); 253} 254 255 256/** 257 * Adds a new reference glyph to the list. 258 */ public 259 void addReferenceGlyph(ReferenceGlyph glyph) { 260 libsbmlJNI.GeneralGlyph_addReferenceGlyph(swigCPtr, this, ReferenceGlyph.getCPtr(glyph), glyph); 261 } 262 263 264/** 265 * Adds a new subglyph to the list. 266 */ public 267 void addSubGlyph(GraphicalObject glyph) { 268 libsbmlJNI.GeneralGlyph_addSubGlyph(swigCPtr, this, GraphicalObject.getCPtr(glyph), glyph); 269 } 270 271 272/** 273 * Returns the number of reference glyph objects. 274 */ public 275 long getNumReferenceGlyphs() { 276 return libsbmlJNI.GeneralGlyph_getNumReferenceGlyphs(swigCPtr, this); 277 } 278 279 280/** 281 * Returns the number of subglyph objects. 282 */ public 283 long getNumSubGlyphs() { 284 return libsbmlJNI.GeneralGlyph_getNumSubGlyphs(swigCPtr, this); 285 } 286 287 288/** 289 * Calls initDefaults from {@link GraphicalObject}. 290 */ public 291 void initDefaults() { 292 libsbmlJNI.GeneralGlyph_initDefaults(swigCPtr, this); 293 } 294 295 296/** 297 * Returns the curve object for the reaction glyph 298 */ public 299 Curve getCurve() { 300 long cPtr = libsbmlJNI.GeneralGlyph_getCurve__SWIG_0(swigCPtr, this); 301 return (cPtr == 0) ? null : new Curve(cPtr, false); 302 } 303 304 305/** 306 * Sets the curve object for the reaction glyph. 307 */ public 308 void setCurve(Curve curve) { 309 libsbmlJNI.GeneralGlyph_setCurve(swigCPtr, this, Curve.getCPtr(curve), curve); 310 } 311 312 313/** 314 * Returns true if the curve consists of one or more segments. 315 */ public 316 boolean isSetCurve() { 317 return libsbmlJNI.GeneralGlyph_isSetCurve(swigCPtr, this); 318 } 319 320 321/** */ public 322 boolean getCurveExplicitlySet() { 323 return libsbmlJNI.GeneralGlyph_getCurveExplicitlySet(swigCPtr, this); 324 } 325 326 327/** 328 * Creates a new {@link ReferenceGlyph} object, adds it to the end of the 329 * list of reference objects and returns a reference to the newly 330 * created object. 331 */ public 332 ReferenceGlyph createReferenceGlyph() { 333 long cPtr = libsbmlJNI.GeneralGlyph_createReferenceGlyph(swigCPtr, this); 334 return (cPtr == 0) ? null : new ReferenceGlyph(cPtr, false); 335 } 336 337 338/** 339 * Creates a new {@link LineSegment} object, adds it to the end of the list of 340 * curve segment objects of the curve and returns a reference to the 341 * newly created object. 342 */ public 343 LineSegment createLineSegment() { 344 return (LineSegment) libsbml.DowncastSBase(libsbmlJNI.GeneralGlyph_createLineSegment(swigCPtr, this), false); 345} 346 347 348/** 349 * Creates a new {@link CubicBezier} object, adds it to the end of the list of 350 * curve segment objects of the curve and returns a reference to the 351 * newly created object. 352 */ public 353 CubicBezier createCubicBezier() { 354 long cPtr = libsbmlJNI.GeneralGlyph_createCubicBezier(swigCPtr, this); 355 return (cPtr == 0) ? null : new CubicBezier(cPtr, false); 356 } 357 358 359/** 360 * Remove the reference glyph with the given index. 361 * A pointer to the object is returned. If no object has been removed, null 362 * is returned. 363 */ public 364 ReferenceGlyph removeReferenceGlyph(long index) { 365 long cPtr = libsbmlJNI.GeneralGlyph_removeReferenceGlyph__SWIG_0(swigCPtr, this, index); 366 return (cPtr == 0) ? null : new ReferenceGlyph(cPtr, false); 367 } 368 369 370/** 371 * Remove the subglyph with the given index. 372 * A pointer to the object is returned. If no object has been removed, null 373 * is returned. 374 */ public 375 GraphicalObject removeSubGlyph(long index) { 376 return (GraphicalObject) libsbml.DowncastSBase(libsbmlJNI.GeneralGlyph_removeSubGlyph__SWIG_0(swigCPtr, this, index), false); 377} 378 379 380/** 381 * Remove the reference glyph with the given <code>id</code>. 382 * A pointer to the object is returned. If no object has been removed, null 383 * is returned. 384 */ public 385 ReferenceGlyph removeReferenceGlyph(String id) { 386 long cPtr = libsbmlJNI.GeneralGlyph_removeReferenceGlyph__SWIG_1(swigCPtr, this, id); 387 return (cPtr == 0) ? null : new ReferenceGlyph(cPtr, false); 388 } 389 390 391/** 392 * Remove the subglyph with the given <code>id</code>. 393 * A pointer to the object is returned. If no object has been removed, null 394 * is returned. 395 */ public 396 GraphicalObject removeSubGlyph(String id) { 397 return (GraphicalObject) libsbml.DowncastSBase(libsbmlJNI.GeneralGlyph_removeSubGlyph__SWIG_1(swigCPtr, this, id), false); 398} 399 400 401/** 402 * Returns the index of the reference glyph with the given <code>id</code>. 403 * If the glyph does not contain a reference glyph with this 404 * id, cpp the 405 * value of the maximum long integer is returned as an indicator. 406 */ public 407 long getIndexForReferenceGlyph(String id) { 408 return libsbmlJNI.GeneralGlyph_getIndexForReferenceGlyph(swigCPtr, this, id); 409 } 410 411 412/** 413 * Returns the index of the subglyph with the given <code>id</code>. 414 * If the glyph does not contain a subglyph with this 415 * id, cpp the 416 * value of the maximum long integer is returned as an indicator. 417 */ public 418 long getIndexForSubGlyph(String id) { 419 return libsbmlJNI.GeneralGlyph_getIndexForSubGlyph(swigCPtr, this, id); 420 } 421 422 423/** 424 * Returns the XML element name of 425 * this SBML object. 426 <p> 427 * @return the string of the name of this element 428 */ public 429 String getElementName() { 430 return libsbmlJNI.GeneralGlyph_getElementName(swigCPtr, this); 431 } 432 433 434/** 435 * Creates and returns a deep copy of this {@link GeneralGlyph}. 436 <p> 437 * @return a (deep) copy of this {@link GeneralGlyph}. 438 */ public 439 GeneralGlyph cloneObject() { 440 long cPtr = libsbmlJNI.GeneralGlyph_cloneObject(swigCPtr, this); 441 return (cPtr == 0) ? null : new GeneralGlyph(cPtr, true); 442 } 443 444 445/** 446 * Returns the libSBML type code of this object instance. 447 <p> 448 * <p> 449 * LibSBML attaches an identifying code to every kind of SBML object. These 450 * are integer constants known as <em>SBML type codes</em>. The names of all 451 * the codes begin with the characters <code>SBML_</code>. 452 * In the Java language interface for libSBML, the 453 * type codes are defined as static integer constants in the interface class 454 * {@link libsbmlConstants}. Note that different Level 3 455 * package plug-ins may use overlapping type codes; to identify the package 456 * to which a given object belongs, call the <code>getPackageName()</code> 457 * method on the object. 458 <p> 459 * @return the SBML type code for this object: 460 * {@link libsbmlConstants#SBML_LAYOUT_GENERALGLYPH SBML_LAYOUT_GENERALGLYPH} 461 <p> 462 * <p> 463 * @warning <span class='warning'>The specific integer values of the possible 464 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 465 * packages, To fully identify the correct code, <strong>it is necessary to 466 * invoke both getTypeCode() and getPackageName()</strong>.</span> 467 <p> 468 * @see #getElementName() 469 * @see #getPackageName() 470 */ public 471 int getTypeCode() { 472 return libsbmlJNI.GeneralGlyph_getTypeCode(swigCPtr, this); 473 } 474 475 476/** 477 * Creates an {@link XMLNode} object from this. 478 */ public 479 XMLNode toXML() { 480 return new XMLNode(libsbmlJNI.GeneralGlyph_toXML(swigCPtr, this), true); 481 } 482 483 public void connectToChild() { 484 libsbmlJNI.GeneralGlyph_connectToChild(swigCPtr, this); 485 } 486 487 488/** * @internal */ public 489 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 490 libsbmlJNI.GeneralGlyph_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 491 } 492 493}