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 compartment.
015 */
016
017public class CompartmentGlyph extends GraphicalObject {
018   private long swigCPtr;
019
020   protected CompartmentGlyph(long cPtr, boolean cMemoryOwn)
021   {
022     super(libsbmlJNI.CompartmentGlyph_SWIGUpcast(cPtr), cMemoryOwn);
023     swigCPtr = cPtr;
024   }
025
026   protected static long getCPtr(CompartmentGlyph obj)
027   {
028     return (obj == null) ? 0 : obj.swigCPtr;
029   }
030
031   protected static long getCPtrAndDisown (CompartmentGlyph obj)
032   {
033     long ptr = 0;
034
035     if (obj != null)
036     {
037       ptr             = obj.swigCPtr;
038       obj.swigCMemOwn = false;
039     }
040
041     return ptr;
042   }
043
044  protected void finalize() {
045    delete();
046  }
047
048  public synchronized void delete() {
049    if (swigCPtr != 0) {
050      if (swigCMemOwn) {
051        swigCMemOwn = false;
052        libsbmlJNI.delete_CompartmentGlyph(swigCPtr);
053      }
054      swigCPtr = 0;
055    }
056    super.delete();
057  }
058
059  
060/**
061   * Default Constructor which creates a new {@link CompartmentGlyph}.  Id and
062   * associated compartment id are unset.
063   */ public
064 CompartmentGlyph(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
065    this(libsbmlJNI.new_CompartmentGlyph__SWIG_0(level, version, pkgVersion), true);
066  }
067
068  
069/**
070   * Default Constructor which creates a new {@link CompartmentGlyph}.  Id and
071   * associated compartment id are unset.
072   */ public
073 CompartmentGlyph(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
074    this(libsbmlJNI.new_CompartmentGlyph__SWIG_1(level, version), true);
075  }
076
077  
078/**
079   * Default Constructor which creates a new {@link CompartmentGlyph}.  Id and
080   * associated compartment id are unset.
081   */ public
082 CompartmentGlyph(long level) throws org.sbml.libsbml.SBMLConstructorException {
083    this(libsbmlJNI.new_CompartmentGlyph__SWIG_2(level), true);
084  }
085
086  
087/**
088   * Default Constructor which creates a new {@link CompartmentGlyph}.  Id and
089   * associated compartment id are unset.
090   */ public
091 CompartmentGlyph() throws org.sbml.libsbml.SBMLConstructorException {
092    this(libsbmlJNI.new_CompartmentGlyph__SWIG_3(), true);
093  }
094
095  
096/**
097   * Ctor.
098   */ public
099 CompartmentGlyph(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException {
100    this(libsbmlJNI.new_CompartmentGlyph__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true);
101  }
102
103  
104/**
105   * Constructor which creates a new {@link CompartmentGlyph} with the given <code>id</code>.
106   <p>
107   * (FOR BACKWARD COMPATIBILITY)
108   */ public
109 CompartmentGlyph(LayoutPkgNamespaces layoutns, String id) throws org.sbml.libsbml.SBMLConstructorException {
110    this(libsbmlJNI.new_CompartmentGlyph__SWIG_5(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id), true);
111  }
112
113  
114/**
115   * Constructor which creates a new {@link CompartmentGlyph}.  Id and associated
116   * compartment id are set to copies of the values given as arguments.
117   <p>
118   * (FOR BACKWARD COMPATIBILITY)
119   */ public
120 CompartmentGlyph(LayoutPkgNamespaces layoutns, String id, String compartmentId) throws org.sbml.libsbml.SBMLConstructorException {
121    this(libsbmlJNI.new_CompartmentGlyph__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, compartmentId), true);
122  }
123
124  
125/**
126   * Creates a new {@link CompartmentGlyph} from the given {@link XMLNode}
127   <p>
128   * (FOR BACKWARD COMPATIBILITY)
129   */ public
130 CompartmentGlyph(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException {
131    this(libsbmlJNI.new_CompartmentGlyph__SWIG_7(XMLNode.getCPtr(node), node, l2version), true);
132  }
133
134  
135/**
136   * Creates a new {@link CompartmentGlyph} from the given {@link XMLNode}
137   <p>
138   * (FOR BACKWARD COMPATIBILITY)
139   */ public
140 CompartmentGlyph(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException {
141    this(libsbmlJNI.new_CompartmentGlyph__SWIG_8(XMLNode.getCPtr(node), node), true);
142  }
143
144  
145/**
146   * Copy constructor.
147   */ public
148 CompartmentGlyph(CompartmentGlyph source) throws org.sbml.libsbml.SBMLConstructorException {
149    this(libsbmlJNI.new_CompartmentGlyph__SWIG_9(CompartmentGlyph.getCPtr(source), source), true);
150  }
151
152  
153/**
154   * Returns the id of the associated compartment.
155   */ public
156 String getCompartmentId() {
157    return libsbmlJNI.CompartmentGlyph_getCompartmentId(swigCPtr, this);
158  }
159
160  
161/**
162   * Sets the id of the associated compartment.
163   */ public
164 int setCompartmentId(String id) {
165    return libsbmlJNI.CompartmentGlyph_setCompartmentId(swigCPtr, this, id);
166  }
167
168  
169/**
170   * Returns true if the id of the associated compartment is not the empty
171   * string.
172   */ public
173 boolean isSetCompartmentId() {
174    return libsbmlJNI.CompartmentGlyph_isSetCompartmentId(swigCPtr, this);
175  }
176
177  
178/**
179   * Returns the compartment order.
180   */ public
181 double getOrder() {
182    return libsbmlJNI.CompartmentGlyph_getOrder(swigCPtr, this);
183  }
184
185  
186/**
187   * Sets the compartment order
188   */ public
189 int setOrder(double order) {
190    return libsbmlJNI.CompartmentGlyph_setOrder(swigCPtr, this, order);
191  }
192
193  
194/**
195   * Sets the compartment order
196   */ public
197 int unsetOrder() {
198    return libsbmlJNI.CompartmentGlyph_unsetOrder(swigCPtr, this);
199  }
200
201  
202/**
203   * Returns true if the compartment order has been set
204   */ public
205 boolean isSetOrder() {
206    return libsbmlJNI.CompartmentGlyph_isSetOrder(swigCPtr, this);
207  }
208
209  
210/**
211   * <p>
212 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another
213 * value.
214 <p>
215 * <p>
216 * In SBML, object identifiers are of a data type called <code>SId</code>.
217 * In SBML Level&nbsp;3, an explicit data type called <code>SIdRef</code> was
218 * introduced for attribute values that refer to <code>SId</code> values; in
219 * previous Levels of SBML, this data type did not exist and attributes were
220 * simply described to as 'referring to an identifier', but the effective
221 * data type was the same as <code>SIdRef</code>in Level&nbsp;3.  These and
222 * other methods of libSBML refer to the type <code>SIdRef</code> for all
223 * Levels of SBML, even if the corresponding SBML specification did not
224 * explicitly name the data type.
225 <p>
226 * This method works by looking at all attributes and (if appropriate)
227 * mathematical formulas in MathML content, comparing the referenced
228 * identifiers to the value of <code>oldid</code>.  If any matches are found, the
229 * matching values are replaced with <code>newid</code>.  The method does <em>not</em>
230 * descend into child elements.
231 <p>
232 * @param oldid the old identifier
233 * @param newid the new identifier
234   */ public
235 void renameSIdRefs(String oldid, String newid) {
236    libsbmlJNI.CompartmentGlyph_renameSIdRefs(swigCPtr, this, oldid, newid);
237  }
238
239  
240/**
241   * Calls initDefaults from {@link GraphicalObject}.
242   */ public
243 void initDefaults() {
244    libsbmlJNI.CompartmentGlyph_initDefaults(swigCPtr, this);
245  }
246
247  
248/**
249   * Returns the XML element name of
250   * this SBML object.
251   <p>
252   * @return the string of the name of this element.
253   */ public
254 String getElementName() {
255    return libsbmlJNI.CompartmentGlyph_getElementName(swigCPtr, this);
256  }
257
258  
259/**
260   * Creates and returns a deep copy of this {@link CompartmentGlyph}.
261   <p>
262   * @return a (deep) copy of this {@link CompartmentGlyph}.
263   */ public
264 CompartmentGlyph cloneObject() {
265    long cPtr = libsbmlJNI.CompartmentGlyph_cloneObject(swigCPtr, this);
266    return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, true);
267  }
268
269  
270/**
271   * Returns the libSBML type code of this object instance.
272   <p>
273   * <p>
274 * LibSBML attaches an identifying code to every kind of SBML object.  These
275 * are integer constants known as <em>SBML type codes</em>.  The names of all
276 * the codes begin with the characters <code>SBML_</code>.
277 * In the Java language interface for libSBML, the
278 * type codes are defined as static integer constants in the interface class
279 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
280 * package plug-ins may use overlapping type codes; to identify the package
281 * to which a given object belongs, call the <code>getPackageName()</code>
282 * method on the object.
283   <p>
284   * @return the SBML type code for this object:
285   * {@link libsbmlConstants#SBML_LAYOUT_COMPARTMENTGLYPH SBML_LAYOUT_COMPARTMENTGLYPH}
286   <p>
287   * <p>
288 * @warning <span class='warning'>The specific integer values of the possible
289 * type codes may be reused by different Level&nbsp;3 package plug-ins.
290 * Thus, to identifiy the correct code, <strong>it is necessary to invoke
291 * both getTypeCode() and getPackageName()</strong>.</span>
292   <p>
293   * @see #getElementName()
294   * @see #getPackageName()
295   */ public
296 int getTypeCode() {
297    return libsbmlJNI.CompartmentGlyph_getTypeCode(swigCPtr, this);
298  }
299
300  
301/**
302    * Creates an {@link XMLNode} object from this.
303    */ public
304 XMLNode toXML() {
305    return new XMLNode(libsbmlJNI.CompartmentGlyph_toXML(swigCPtr, this), true);
306  }
307
308}