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 Representation of a compartment glyph.
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   * Renames all the <code>SIdRef</code> attributes on this element, including any
212   * found in MathML content (if such exists).
213   <p>
214   * This method works by looking at all attributes and (if appropriate)
215   * mathematical formulas, comparing the identifiers to the value of 
216   * <code>oldid</code>.  If any matches are found, the matching identifiers are replaced
217   * with <code>newid</code>.  The method does <em>not</em> descend into child elements.
218   <p>
219   * @param oldid the old identifier
220   * @param newid the new identifier
221   */ public
222 void renameSIdRefs(String oldid, String newid) {
223    libsbmlJNI.CompartmentGlyph_renameSIdRefs(swigCPtr, this, oldid, newid);
224  }
225
226  
227/**
228   * Calls initDefaults from {@link GraphicalObject}.
229   */ public
230 void initDefaults() {
231    libsbmlJNI.CompartmentGlyph_initDefaults(swigCPtr, this);
232  }
233
234  
235/**
236   * Returns the XML element name of
237   * this SBML object.
238   */ public
239 String getElementName() {
240    return libsbmlJNI.CompartmentGlyph_getElementName(swigCPtr, this);
241  }
242
243  
244/**
245   * Creates and returns a deep copy of this {@link CompartmentGlyph}.
246   <p>
247   * @return a (deep) copy of this {@link CompartmentGlyph}.
248   */ public
249 CompartmentGlyph cloneObject() {
250    long cPtr = libsbmlJNI.CompartmentGlyph_cloneObject(swigCPtr, this);
251    return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, true);
252  }
253
254  
255/**
256   * Returns the libSBML type code of this object instance.
257   <p>
258   * <p>
259 * LibSBML attaches an identifying code to every kind of SBML object.  These
260 * are integer constants known as <em>SBML type codes</em>.  The names of all
261 * the codes begin with the characters &ldquo;<code>SBML_</code>&rdquo;. 
262 * In the Java language interface for libSBML, the
263 * type codes are defined as static integer constants in the interface class
264 * {@link libsbmlConstants}.    Note that different Level&nbsp;3 
265 * package plug-ins may use overlapping type codes; to identify the package
266 * to which a given object belongs, call the <code>getPackageName()</code>
267 * method on the object.
268   <p>
269   * @return the SBML type code for this object:
270   * {@link  libsbmlConstants#SBML_LAYOUT_COMPARTMENTGLYPH SBML_LAYOUT_COMPARTMENTGLYPH}
271   <p>
272   * <p>
273 * @warning <span class='warning'>The specific integer values of the possible
274 * type codes may be reused by different Level&nbsp;3 package plug-ins.
275 * Thus, to identifiy the correct code, <strong>it is necessary to invoke
276 * both getTypeCode() and getPackageName()</strong>.</span>
277   <p>
278   * @see #getElementName()
279   * @see #getPackageName()
280   */ public
281 int getTypeCode() {
282    return libsbmlJNI.CompartmentGlyph_getTypeCode(swigCPtr, this);
283  }
284
285  
286/**
287    * Creates an {@link XMLNode} object from this.
288    */ public
289 XMLNode toXML() {
290    return new XMLNode(libsbmlJNI.CompartmentGlyph_toXML(swigCPtr, this), true);
291  }
292
293}