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 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   */ public
067 SpeciesGlyph(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
068    this(libsbmlJNI.new_SpeciesGlyph__SWIG_0(level, version, pkgVersion), true);
069  }
070
071  
072/**
073   * Creates a new {@link SpeciesGlyph} with the given SBML level, version, and package version
074   * and the id of the associated species set to the empty string.
075   */ public
076 SpeciesGlyph(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
077    this(libsbmlJNI.new_SpeciesGlyph__SWIG_1(level, version), true);
078  }
079
080  
081/**
082   * Creates a new {@link SpeciesGlyph} with the given SBML level, version, and package version
083   * and the id of the associated species set to the empty string.
084   */ public
085 SpeciesGlyph(long level) throws org.sbml.libsbml.SBMLConstructorException {
086    this(libsbmlJNI.new_SpeciesGlyph__SWIG_2(level), true);
087  }
088
089  
090/**
091   * Creates a new {@link SpeciesGlyph} with the given SBML level, version, and package version
092   * and the id of the associated species set to the empty string.
093   */ public
094 SpeciesGlyph() throws org.sbml.libsbml.SBMLConstructorException {
095    this(libsbmlJNI.new_SpeciesGlyph__SWIG_3(), true);
096  }
097
098  
099/**
100   * Ctor.
101   */ public
102 SpeciesGlyph(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException {
103    this(libsbmlJNI.new_SpeciesGlyph__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true);
104  }
105
106  
107/**
108   * Creates a new {@link SpeciesGlyph} with the given <code>id</code>. 
109   <p>
110   * (FOR BACKWARD COMPATIBILITY)
111   */ public
112 SpeciesGlyph(LayoutPkgNamespaces layoutns, String id) throws org.sbml.libsbml.SBMLConstructorException {
113    this(libsbmlJNI.new_SpeciesGlyph__SWIG_5(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id), true);
114  }
115
116  
117/**
118   * Creates a new {@link SpeciesGlyph} with the given <code>id</code> and the id of the
119   * associated species object set to the second argument.
120   <p>
121   * (FOR BACKWARD COMPATIBILITY)
122   */ public
123 SpeciesGlyph(LayoutPkgNamespaces layoutns, String id, String speciesId) throws org.sbml.libsbml.SBMLConstructorException {
124    this(libsbmlJNI.new_SpeciesGlyph__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, speciesId), true);
125  }
126
127  
128/**
129   * Creates a new {@link SpeciesGlyph} from the given {@link XMLNode}
130   */ public
131 SpeciesGlyph(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException {
132    this(libsbmlJNI.new_SpeciesGlyph__SWIG_7(XMLNode.getCPtr(node), node, l2version), true);
133  }
134
135  
136/**
137   * Creates a new {@link SpeciesGlyph} from the given {@link XMLNode}
138   */ public
139 SpeciesGlyph(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException {
140    this(libsbmlJNI.new_SpeciesGlyph__SWIG_8(XMLNode.getCPtr(node), node), true);
141  }
142
143  
144/**
145   * Copy constructor.
146   */ public
147 SpeciesGlyph(SpeciesGlyph source) throws org.sbml.libsbml.SBMLConstructorException {
148    this(libsbmlJNI.new_SpeciesGlyph__SWIG_9(SpeciesGlyph.getCPtr(source), source), true);
149  }
150
151  
152/**
153   * <p>
154 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another
155 * value.
156 <p>
157 * <p>
158 * In SBML, object identifiers are of a data type called <code>SId</code>.
159 * In SBML Level&nbsp;3, an explicit data type called <code>SIdRef</code> was
160 * introduced for attribute values that refer to <code>SId</code> values; in
161 * previous Levels of SBML, this data type did not exist and attributes were
162 * simply described to as 'referring to an identifier', but the effective
163 * data type was the same as <code>SIdRef</code>in Level&nbsp;3.  These and
164 * other methods of libSBML refer to the type <code>SIdRef</code> for all
165 * Levels of SBML, even if the corresponding SBML specification did not
166 * explicitly name the data type.
167 <p>
168 * This method works by looking at all attributes and (if appropriate)
169 * mathematical formulas in MathML content, comparing the referenced
170 * identifiers to the value of <code>oldid</code>.  If any matches are found, the
171 * matching values are replaced with <code>newid</code>.  The method does <em>not</em>
172 * descend into child elements.
173 <p>
174 * @param oldid the old identifier
175 * @param newid the new identifier
176   */ public
177 void renameSIdRefs(String oldid, String newid) {
178    libsbmlJNI.SpeciesGlyph_renameSIdRefs(swigCPtr, this, oldid, newid);
179  }
180
181  
182/**
183   * Returns the id of the associated species object.
184   */ public
185 String getSpeciesId() {
186    return libsbmlJNI.SpeciesGlyph_getSpeciesId(swigCPtr, this);
187  }
188
189  
190/**
191   * Sets the id of the associated species object.
192   */ public
193 void setSpeciesId(String id) {
194    libsbmlJNI.SpeciesGlyph_setSpeciesId(swigCPtr, this, id);
195  }
196
197  
198/**
199   * Returns true if the id of the associated species object is not the
200   * empty string.
201   */ public
202 boolean isSetSpeciesId() {
203    return libsbmlJNI.SpeciesGlyph_isSetSpeciesId(swigCPtr, this);
204  }
205
206  
207/**
208   * Calls initDefaults from {@link GraphicalObject}.
209   */ public
210 void initDefaults() {
211    libsbmlJNI.SpeciesGlyph_initDefaults(swigCPtr, this);
212  }
213
214  
215/**
216   * Returns the XML element name of
217   * this SBML object.
218   <p>
219   * @return the string of the name of this element
220   */ public
221 String getElementName() {
222    return libsbmlJNI.SpeciesGlyph_getElementName(swigCPtr, this);
223  }
224
225  
226/**
227   * Creates and returns a deep copy of this {@link SpeciesGlyph}.
228   <p>
229   * @return a (deep) copy of this {@link SpeciesGlyph}.
230   */ public
231 SpeciesGlyph cloneObject() {
232    long cPtr = libsbmlJNI.SpeciesGlyph_cloneObject(swigCPtr, this);
233    return (cPtr == 0) ? null : new SpeciesGlyph(cPtr, true);
234  }
235
236  
237/**
238   * Returns the libSBML type code of this object instance.
239   <p>
240   * <p>
241 * LibSBML attaches an identifying code to every kind of SBML object.  These
242 * are integer constants known as <em>SBML type codes</em>.  The names of all
243 * the codes begin with the characters <code>SBML_</code>.
244 * In the Java language interface for libSBML, the
245 * type codes are defined as static integer constants in the interface class
246 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
247 * package plug-ins may use overlapping type codes; to identify the package
248 * to which a given object belongs, call the <code>getPackageName()</code>
249 * method on the object.
250   <p>
251   * @return the SBML type code for this object:
252   * {@link libsbmlConstants#SBML_LAYOUT_SPECIESGLYPH SBML_LAYOUT_SPECIESGLYPH}
253   <p>
254   * <p>
255 * @warning <span class='warning'>The specific integer values of the possible
256 * type codes may be reused by different Level&nbsp;3 package plug-ins.
257 * Thus, to identifiy the correct code, <strong>it is necessary to invoke
258 * both getTypeCode() and getPackageName()</strong>.</span>
259   <p>
260   * @see #getElementName()
261   * @see #getPackageName()
262   */ public
263 int getTypeCode() {
264    return libsbmlJNI.SpeciesGlyph_getTypeCode(swigCPtr, this);
265  }
266
267  
268/**
269    * Creates an {@link XMLNode} object from this.
270    */ public
271 XMLNode toXML() {
272    return new XMLNode(libsbmlJNI.SpeciesGlyph_toXML(swigCPtr, this), true);
273  }
274
275}