001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 2.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 The SpeciesGlyph represents a {@link Species} in the 015 * “layout” package. 016 <p> 017 * In addition to the attributes it inherits from {@link GraphicalObject}, the 018 * {@link SpeciesGlyph} object has an optional 'species' attribute. 019 */ 020 021public class SpeciesGlyph extends GraphicalObject { 022 private long swigCPtr; 023 024 protected SpeciesGlyph(long cPtr, boolean cMemoryOwn) 025 { 026 super(libsbmlJNI.SpeciesGlyph_SWIGUpcast(cPtr), cMemoryOwn); 027 swigCPtr = cPtr; 028 } 029 030 protected static long getCPtr(SpeciesGlyph obj) 031 { 032 return (obj == null) ? 0 : obj.swigCPtr; 033 } 034 035 protected static long getCPtrAndDisown (SpeciesGlyph obj) 036 { 037 long ptr = 0; 038 039 if (obj != null) 040 { 041 ptr = obj.swigCPtr; 042 obj.swigCMemOwn = false; 043 } 044 045 return ptr; 046 } 047 048 protected void finalize() { 049 delete(); 050 } 051 052 public synchronized void delete() { 053 if (swigCPtr != 0) { 054 if (swigCMemOwn) { 055 swigCMemOwn = false; 056 libsbmlJNI.delete_SpeciesGlyph(swigCPtr); 057 } 058 swigCPtr = 0; 059 } 060 super.delete(); 061 } 062 063 064/** 065 * Creates a new {@link SpeciesGlyph} with the given SBML level, version, and package version 066 * and the id of the associated species set to the empty string. 067 */ public 068 SpeciesGlyph(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 069 this(libsbmlJNI.new_SpeciesGlyph__SWIG_0(level, version, pkgVersion), true); 070 } 071 072 073/** 074 * Creates a new {@link SpeciesGlyph} with the given SBML level, version, and package version 075 * and the id of the associated species set to the empty string. 076 */ public 077 SpeciesGlyph(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 078 this(libsbmlJNI.new_SpeciesGlyph__SWIG_1(level, version), true); 079 } 080 081 082/** 083 * Creates a new {@link SpeciesGlyph} with the given SBML level, version, and package version 084 * and the id of the associated species set to the empty string. 085 */ public 086 SpeciesGlyph(long level) throws org.sbml.libsbml.SBMLConstructorException { 087 this(libsbmlJNI.new_SpeciesGlyph__SWIG_2(level), true); 088 } 089 090 091/** 092 * Creates a new {@link SpeciesGlyph} with the given SBML level, version, and package version 093 * and the id of the associated species set to the empty string. 094 */ public 095 SpeciesGlyph() throws org.sbml.libsbml.SBMLConstructorException { 096 this(libsbmlJNI.new_SpeciesGlyph__SWIG_3(), true); 097 } 098 099 100/** 101 * Ctor. 102 */ public 103 SpeciesGlyph(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 104 this(libsbmlJNI.new_SpeciesGlyph__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 105 } 106 107 108/** 109 * Creates a new {@link SpeciesGlyph} with the given <code>id</code>. 110 <p> 111 * (FOR BACKWARD COMPATIBILITY) 112 */ public 113 SpeciesGlyph(LayoutPkgNamespaces layoutns, String id) throws org.sbml.libsbml.SBMLConstructorException { 114 this(libsbmlJNI.new_SpeciesGlyph__SWIG_5(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id), true); 115 } 116 117 118/** 119 * Creates a new {@link SpeciesGlyph} with the given <code>id</code> and the id of the 120 * associated species object set to the second argument. 121 <p> 122 * (FOR BACKWARD COMPATIBILITY) 123 */ public 124 SpeciesGlyph(LayoutPkgNamespaces layoutns, String id, String speciesId) throws org.sbml.libsbml.SBMLConstructorException { 125 this(libsbmlJNI.new_SpeciesGlyph__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, speciesId), true); 126 } 127 128 129/** 130 * Creates a new {@link SpeciesGlyph} from the given {@link XMLNode} 131 */ public 132 SpeciesGlyph(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 133 this(libsbmlJNI.new_SpeciesGlyph__SWIG_7(XMLNode.getCPtr(node), node, l2version), true); 134 } 135 136 137/** 138 * Creates a new {@link SpeciesGlyph} from the given {@link XMLNode} 139 */ public 140 SpeciesGlyph(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 141 this(libsbmlJNI.new_SpeciesGlyph__SWIG_8(XMLNode.getCPtr(node), node), true); 142 } 143 144 145/** 146 * Copy constructor. 147 */ public 148 SpeciesGlyph(SpeciesGlyph source) throws org.sbml.libsbml.SBMLConstructorException { 149 this(libsbmlJNI.new_SpeciesGlyph__SWIG_9(SpeciesGlyph.getCPtr(source), source), true); 150 } 151 152 153/** 154 * Renames all the <code>SIdRef</code> attributes on this element, including any 155 * found in MathML content (if such exists). 156 <p> 157 * This method works by looking at all attributes and (if appropriate) 158 * mathematical formulas, comparing the identifiers to the value of 159 * <code>oldid</code>. If any matches are found, the matching identifiers are replaced 160 * with <code>newid</code>. The method does <em>not</em> descend into child elements. 161 <p> 162 * @param oldid the old identifier 163 * @param newid the new identifier 164 */ public 165 void renameSIdRefs(String oldid, String newid) { 166 libsbmlJNI.SpeciesGlyph_renameSIdRefs(swigCPtr, this, oldid, newid); 167 } 168 169 170/** 171 * Returns the id of the associated species object. 172 */ public 173 String getSpeciesId() { 174 return libsbmlJNI.SpeciesGlyph_getSpeciesId(swigCPtr, this); 175 } 176 177 178/** 179 * Sets the id of the associated species object. 180 */ public 181 void setSpeciesId(String id) { 182 libsbmlJNI.SpeciesGlyph_setSpeciesId(swigCPtr, this, id); 183 } 184 185 186/** 187 * Returns true if the id of the associated species object is not the 188 * empty string. 189 */ public 190 boolean isSetSpeciesId() { 191 return libsbmlJNI.SpeciesGlyph_isSetSpeciesId(swigCPtr, this); 192 } 193 194 195/** 196 * Calls initDefaults from {@link GraphicalObject}. 197 */ public 198 void initDefaults() { 199 libsbmlJNI.SpeciesGlyph_initDefaults(swigCPtr, this); 200 } 201 202 203/** 204 * Returns the XML element name of 205 * this SBML object. 206 */ public 207 String getElementName() { 208 return libsbmlJNI.SpeciesGlyph_getElementName(swigCPtr, this); 209 } 210 211 212/** 213 * Creates and returns a deep copy of this {@link SpeciesGlyph}. 214 <p> 215 * @return a (deep) copy of this {@link SpeciesGlyph}. 216 */ public 217 SpeciesGlyph cloneObject() { 218 long cPtr = libsbmlJNI.SpeciesGlyph_cloneObject(swigCPtr, this); 219 return (cPtr == 0) ? null : new SpeciesGlyph(cPtr, true); 220 } 221 222 223/** 224 * Returns the libSBML type code of this object instance. 225 <p> 226 * <p> 227 * LibSBML attaches an identifying code to every kind of SBML object. These 228 * are integer constants known as <em>SBML type codes</em>. The names of all 229 * the codes begin with the characters “<code>SBML_</code>”. 230 * In the Java language interface for libSBML, the 231 * type codes are defined as static integer constants in the interface class 232 * {@link libsbmlConstants}. Note that different Level 3 233 * package plug-ins may use overlapping type codes; to identify the package 234 * to which a given object belongs, call the <code>getPackageName()</code> 235 * method on the object. 236 <p> 237 * @return the SBML type code for this object: 238 * {@link libsbmlConstants#SBML_LAYOUT_SPECIESGLYPH SBML_LAYOUT_SPECIESGLYPH} 239 <p> 240 * <p> 241 * @warning <span class='warning'>The specific integer values of the possible 242 * type codes may be reused by different Level 3 package plug-ins. 243 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 244 * both getTypeCode() and getPackageName()</strong>.</span> 245 <p> 246 * @see #getElementName() 247 * @see #getPackageName() 248 */ public 249 int getTypeCode() { 250 return libsbmlJNI.SpeciesGlyph_getTypeCode(swigCPtr, this); 251 } 252 253 254/** 255 * Creates an {@link XMLNode} object from this. 256 */ public 257 XMLNode toXML() { 258 return new XMLNode(libsbmlJNI.SpeciesGlyph_toXML(swigCPtr, this), true); 259 } 260 261}