001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.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 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   <p>
064   * @param level the SBML Level.
065   * @param version the Version within the SBML Level.
066   * @param pkgVersion the version of the package.
067   <p>
068   * <p>
069 * @note Attempting to add an object to an {@link SBMLDocument} having a different
070 * combination of SBML Level, Version and XML namespaces than the object
071 * itself will result in an error at the time a caller attempts to make the
072 * addition.  A parent object must have compatible Level, Version and XML
073 * namespaces.  (Strictly speaking, a parent may also have more XML
074 * namespaces than a child, but the reverse is not permitted.)  The
075 * restriction is necessary to ensure that an SBML model has a consistent
076 * overall structure.  This requires callers to manage their objects
077 * carefully, but the benefit is increased flexibility in how models can be
078 * created by permitting callers to create objects bottom-up if desired.  In
079 * situations where objects are not yet attached to parents (e.g.,
080 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
081 * libSBML determine such things as whether it is valid to assign a
082 * particular value to an attribute.  For packages, this means that the 
083 * parent object to which this package element is being added must have
084 * been created with the package namespace, or that the package namespace
085 * was added to it, even if that parent is not a package object itself.
086   */ public
087 CompartmentGlyph(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
088    this(libsbmlJNI.new_CompartmentGlyph__SWIG_0(level, version, pkgVersion), true);
089  }
090
091  
092/**
093   * Default Constructor which creates a new {@link CompartmentGlyph}.  Id and
094   * associated compartment id are unset.
095   <p>
096   * @param level the SBML Level.
097   * @param version the Version within the SBML Level.
098   * @param pkgVersion the version of the package.
099   <p>
100   * <p>
101 * @note Attempting to add an object to an {@link SBMLDocument} having a different
102 * combination of SBML Level, Version and XML namespaces than the object
103 * itself will result in an error at the time a caller attempts to make the
104 * addition.  A parent object must have compatible Level, Version and XML
105 * namespaces.  (Strictly speaking, a parent may also have more XML
106 * namespaces than a child, but the reverse is not permitted.)  The
107 * restriction is necessary to ensure that an SBML model has a consistent
108 * overall structure.  This requires callers to manage their objects
109 * carefully, but the benefit is increased flexibility in how models can be
110 * created by permitting callers to create objects bottom-up if desired.  In
111 * situations where objects are not yet attached to parents (e.g.,
112 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
113 * libSBML determine such things as whether it is valid to assign a
114 * particular value to an attribute.  For packages, this means that the 
115 * parent object to which this package element is being added must have
116 * been created with the package namespace, or that the package namespace
117 * was added to it, even if that parent is not a package object itself.
118   */ public
119 CompartmentGlyph(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
120    this(libsbmlJNI.new_CompartmentGlyph__SWIG_1(level, version), true);
121  }
122
123  
124/**
125   * Default Constructor which creates a new {@link CompartmentGlyph}.  Id and
126   * associated compartment id are unset.
127   <p>
128   * @param level the SBML Level.
129   * @param version the Version within the SBML Level.
130   * @param pkgVersion the version of the package.
131   <p>
132   * <p>
133 * @note Attempting to add an object to an {@link SBMLDocument} having a different
134 * combination of SBML Level, Version and XML namespaces than the object
135 * itself will result in an error at the time a caller attempts to make the
136 * addition.  A parent object must have compatible Level, Version and XML
137 * namespaces.  (Strictly speaking, a parent may also have more XML
138 * namespaces than a child, but the reverse is not permitted.)  The
139 * restriction is necessary to ensure that an SBML model has a consistent
140 * overall structure.  This requires callers to manage their objects
141 * carefully, but the benefit is increased flexibility in how models can be
142 * created by permitting callers to create objects bottom-up if desired.  In
143 * situations where objects are not yet attached to parents (e.g.,
144 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
145 * libSBML determine such things as whether it is valid to assign a
146 * particular value to an attribute.  For packages, this means that the 
147 * parent object to which this package element is being added must have
148 * been created with the package namespace, or that the package namespace
149 * was added to it, even if that parent is not a package object itself.
150   */ public
151 CompartmentGlyph(long level) throws org.sbml.libsbml.SBMLConstructorException {
152    this(libsbmlJNI.new_CompartmentGlyph__SWIG_2(level), true);
153  }
154
155  
156/**
157   * Default Constructor which creates a new {@link CompartmentGlyph}.  Id and
158   * associated compartment id are unset.
159   <p>
160   * @param level the SBML Level.
161   * @param version the Version within the SBML Level.
162   * @param pkgVersion the version of the package.
163   <p>
164   * <p>
165 * @note Attempting to add an object to an {@link SBMLDocument} having a different
166 * combination of SBML Level, Version and XML namespaces than the object
167 * itself will result in an error at the time a caller attempts to make the
168 * addition.  A parent object must have compatible Level, Version and XML
169 * namespaces.  (Strictly speaking, a parent may also have more XML
170 * namespaces than a child, but the reverse is not permitted.)  The
171 * restriction is necessary to ensure that an SBML model has a consistent
172 * overall structure.  This requires callers to manage their objects
173 * carefully, but the benefit is increased flexibility in how models can be
174 * created by permitting callers to create objects bottom-up if desired.  In
175 * situations where objects are not yet attached to parents (e.g.,
176 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
177 * libSBML determine such things as whether it is valid to assign a
178 * particular value to an attribute.  For packages, this means that the 
179 * parent object to which this package element is being added must have
180 * been created with the package namespace, or that the package namespace
181 * was added to it, even if that parent is not a package object itself.
182   */ public
183 CompartmentGlyph() throws org.sbml.libsbml.SBMLConstructorException {
184    this(libsbmlJNI.new_CompartmentGlyph__SWIG_3(), true);
185  }
186
187  
188/**
189   * Constructor.
190   <p>
191   * <p>
192 * The package namespaces object used in this constructor is derived from a
193 * {@link SBMLNamespaces} object, which encapsulates SBML Level/Version/namespaces
194 * information.  It is used to communicate the SBML Level, Version, and 
195 * package version and name information used in addition to SBML Level&nbsp;3 Core.  A
196 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an
197 * package namespace object somewhere in a program once, then hand that object
198 * as needed to object constructors of that package that accept it as and
199 * argument, such as this one.
200   <p>
201   * @param layoutns the {@link LayoutPkgNamespaces} object.
202   <p>
203   * <p>
204 * @note Attempting to add an object to an {@link SBMLDocument} having a different
205 * combination of SBML Level, Version and XML namespaces than the object
206 * itself will result in an error at the time a caller attempts to make the
207 * addition.  A parent object must have compatible Level, Version and XML
208 * namespaces.  (Strictly speaking, a parent may also have more XML
209 * namespaces than a child, but the reverse is not permitted.)  The
210 * restriction is necessary to ensure that an SBML model has a consistent
211 * overall structure.  This requires callers to manage their objects
212 * carefully, but the benefit is increased flexibility in how models can be
213 * created by permitting callers to create objects bottom-up if desired.  In
214 * situations where objects are not yet attached to parents (e.g.,
215 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
216 * libSBML determine such things as whether it is valid to assign a
217 * particular value to an attribute.  For packages, this means that the 
218 * parent object to which this package element is being added must have
219 * been created with the package namespace, or that the package namespace
220 * was added to it, even if that parent is not a package object itself.
221   */ public
222 CompartmentGlyph(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException {
223    this(libsbmlJNI.new_CompartmentGlyph__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true);
224  }
225
226  
227/**
228   * Constructor which creates a new {@link CompartmentGlyph} with the given <code>id</code>.
229   <p>
230   * (FOR BACKWARD COMPATIBILITY)
231   */ public
232 CompartmentGlyph(LayoutPkgNamespaces layoutns, String id) throws org.sbml.libsbml.SBMLConstructorException {
233    this(libsbmlJNI.new_CompartmentGlyph__SWIG_5(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id), true);
234  }
235
236  
237/**
238   * Constructor which creates a new {@link CompartmentGlyph}.  Id and associated
239   * compartment id are set to copies of the values given as arguments.
240   <p>
241   * (FOR BACKWARD COMPATIBILITY)
242   */ public
243 CompartmentGlyph(LayoutPkgNamespaces layoutns, String id, String compartmentId) throws org.sbml.libsbml.SBMLConstructorException {
244    this(libsbmlJNI.new_CompartmentGlyph__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, compartmentId), true);
245  }
246
247  
248/**
249   * Creates a new {@link CompartmentGlyph} from the given {@link XMLNode}
250   <p>
251   * (FOR BACKWARD COMPATIBILITY)
252   */ public
253 CompartmentGlyph(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException {
254    this(libsbmlJNI.new_CompartmentGlyph__SWIG_7(XMLNode.getCPtr(node), node, l2version), true);
255  }
256
257  
258/**
259   * Creates a new {@link CompartmentGlyph} from the given {@link XMLNode}
260   <p>
261   * (FOR BACKWARD COMPATIBILITY)
262   */ public
263 CompartmentGlyph(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException {
264    this(libsbmlJNI.new_CompartmentGlyph__SWIG_8(XMLNode.getCPtr(node), node), true);
265  }
266
267  
268/**
269   * Copy constructor.
270   <p>
271   * @param source the instance to copy.
272   */ public
273 CompartmentGlyph(CompartmentGlyph source) throws org.sbml.libsbml.SBMLConstructorException {
274    this(libsbmlJNI.new_CompartmentGlyph__SWIG_9(CompartmentGlyph.getCPtr(source), source), true);
275  }
276
277  
278/**
279   * Returns the id of the associated compartment.
280   <p>
281   * @return the value of the 'compartment' attribute.
282   */ public
283 String getCompartmentId() {
284    return libsbmlJNI.CompartmentGlyph_getCompartmentId(swigCPtr, this);
285  }
286
287  
288/**
289   * Sets the id of the associated compartment.
290   <p>
291   * @param id the identifier of a {@link Compartment} object defined elsewhere
292   * in this {@link Model}.
293   <p>
294   * <p>
295 * @return integer value indicating success/failure of the
296 * function.   The possible values
297 * returned by this function are:
298   * <ul>
299   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
300   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
301   * </ul>
302   */ public
303 int setCompartmentId(String id) {
304    return libsbmlJNI.CompartmentGlyph_setCompartmentId(swigCPtr, this, id);
305  }
306
307  
308/**
309   * Returns <code>true</code> if the id of the associated compartment is not the empty
310   * string.
311   <p>
312   * @return <code>true</code> if the 'compartment' attribute of this {@link CompartmentGlyph} is
313   * set, <code>false</code> otherwise.
314   */ public
315 boolean isSetCompartmentId() {
316    return libsbmlJNI.CompartmentGlyph_isSetCompartmentId(swigCPtr, this);
317  }
318
319  
320/**
321   * Returns the compartment order.
322   <p>
323   * @return the value of the 'order' attribute.
324   */ public
325 double getOrder() {
326    return libsbmlJNI.CompartmentGlyph_getOrder(swigCPtr, this);
327  }
328
329  
330/**
331   * Sets the compartment order.
332   <p>
333   * @param order the value to use for the 'order' attribute.
334   <p>
335   * <p>
336 * @return integer value indicating success/failure of the
337 * function.   The possible values
338 * returned by this function are:
339   * <ul>
340   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
341   * </ul>
342   */ public
343 int setOrder(double order) {
344    return libsbmlJNI.CompartmentGlyph_setOrder(swigCPtr, this, order);
345  }
346
347  
348/**
349   * Unsets the compartment order.
350   <p>
351   * <p>
352 * @return integer value indicating success/failure of the
353 * function.   The possible values
354 * returned by this function are:
355   * <ul>
356   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
357   * </ul>
358   */ public
359 int unsetOrder() {
360    return libsbmlJNI.CompartmentGlyph_unsetOrder(swigCPtr, this);
361  }
362
363  
364/**
365   * Returns <code>true</code> if the compartment order has been set.
366   <p>
367   * @return <code>true</code> if the 'order' attribute of this {@link CompartmentGlyph} is
368   * set, <code>false</code> otherwise.
369   */ public
370 boolean isSetOrder() {
371    return libsbmlJNI.CompartmentGlyph_isSetOrder(swigCPtr, this);
372  }
373
374  
375/**
376   * <p>
377 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another
378 * value.
379 <p>
380 * <p>
381 * In SBML, object identifiers are of a data type called <code>SId</code>.
382 * In SBML Level&nbsp;3, an explicit data type called <code>SIdRef</code> was
383 * introduced for attribute values that refer to <code>SId</code> values; in
384 * previous Levels of SBML, this data type did not exist and attributes were
385 * simply described to as 'referring to an identifier', but the effective
386 * data type was the same as <code>SIdRef</code> in Level&nbsp;3.  These and
387 * other methods of libSBML refer to the type <code>SIdRef</code> for all
388 * Levels of SBML, even if the corresponding SBML specification did not
389 * explicitly name the data type.
390 <p>
391 * This method works by looking at all attributes and (if appropriate)
392 * mathematical formulas in MathML content, comparing the referenced
393 * identifiers to the value of <code>oldid</code>.  If any matches are found, the
394 * matching values are replaced with <code>newid</code>.  The method does <em>not</em>
395 * descend into child elements.
396 <p>
397 * @param oldid the old identifier.
398 * @param newid the new identifier.
399   */ public
400 void renameSIdRefs(String oldid, String newid) {
401    libsbmlJNI.CompartmentGlyph_renameSIdRefs(swigCPtr, this, oldid, newid);
402  }
403
404  
405/**
406   * Calls initDefaults from {@link GraphicalObject}.
407   */ public
408 void initDefaults() {
409    libsbmlJNI.CompartmentGlyph_initDefaults(swigCPtr, this);
410  }
411
412  
413/**
414   * Returns the XML element name of
415   * this SBML object.
416   <p>
417   * @return the string of the name of this element.
418   */ public
419 String getElementName() {
420    return libsbmlJNI.CompartmentGlyph_getElementName(swigCPtr, this);
421  }
422
423  
424/**
425   * Creates and returns a deep copy of this {@link CompartmentGlyph}.
426   <p>
427   * @return a (deep) copy of this {@link CompartmentGlyph}.
428   */ public
429 CompartmentGlyph cloneObject() {
430    long cPtr = libsbmlJNI.CompartmentGlyph_cloneObject(swigCPtr, this);
431    return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, true);
432  }
433
434  
435/**
436   * Returns the libSBML type code of this object instance.
437   <p>
438   * <p>
439 * LibSBML attaches an identifying code to every kind of SBML object.  These
440 * are integer constants known as <em>SBML type codes</em>.  The names of all
441 * the codes begin with the characters <code>SBML_</code>.
442 * In the Java language interface for libSBML, the
443 * type codes are defined as static integer constants in the interface class
444 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
445 * package plug-ins may use overlapping type codes; to identify the package
446 * to which a given object belongs, call the 
447 * <code>{@link SBase#getPackageName()}
448 * </code>
449 * method on the object.
450   <p>
451   * @return the SBML type code for this object:
452   * {@link libsbmlConstants#SBML_LAYOUT_COMPARTMENTGLYPH SBML_LAYOUT_COMPARTMENTGLYPH}
453   <p>
454   * <p>
455 * @warning <span class='warning'>The specific integer values of the possible
456 * type codes may be reused by different libSBML plug-ins for SBML Level&nbsp;3.
457 * packages,  To fully identify the correct code, <strong>it is necessary to
458 * invoke both getTypeCode() and getPackageName()</strong>.</span>
459   <p>
460   * @see #getElementName()
461   * @see #getPackageName()
462   */ public
463 int getTypeCode() {
464    return libsbmlJNI.CompartmentGlyph_getTypeCode(swigCPtr, this);
465  }
466
467  
468/**
469    * Creates an {@link XMLNode} object from this {@link CompartmentGlyph}.
470    <p>
471    * @return an {@link XMLNode} object based off of the information in this {@link CompartmentGlyph}.
472    */ public
473 XMLNode toXML() {
474    return new XMLNode(libsbmlJNI.CompartmentGlyph_toXML(swigCPtr, this), true);
475  }
476
477}