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
011public class RenderLayoutPlugin extends SBasePlugin {
012   private long swigCPtr;
013
014   protected RenderLayoutPlugin(long cPtr, boolean cMemoryOwn)
015   {
016     super(libsbmlJNI.RenderLayoutPlugin_SWIGUpcast(cPtr), cMemoryOwn);
017     swigCPtr = cPtr;
018   }
019
020   protected static long getCPtr(RenderLayoutPlugin obj)
021   {
022     return (obj == null) ? 0 : obj.swigCPtr;
023   }
024
025   protected static long getCPtrAndDisown (RenderLayoutPlugin obj)
026   {
027     long ptr = 0;
028
029     if (obj != null)
030     {
031       ptr             = obj.swigCPtr;
032       obj.swigCMemOwn = false;
033     }
034
035     return ptr;
036   }
037
038  protected void finalize() {
039    delete();
040  }
041
042  public synchronized void delete() {
043    if (swigCPtr != 0) {
044      if (swigCMemOwn) {
045        swigCMemOwn = false;
046        libsbmlJNI.delete_RenderLayoutPlugin(swigCPtr);
047      }
048      swigCPtr = 0;
049    }
050    super.delete();
051  }
052
053  
054/**
055   * Constructor
056   */ public
057 RenderLayoutPlugin(String uri, String prefix, RenderPkgNamespaces groupsns) {
058    this(libsbmlJNI.new_RenderLayoutPlugin__SWIG_0(uri, prefix, RenderPkgNamespaces.getCPtr(groupsns), groupsns), true);
059  }
060
061  
062/**
063   * Copy constructor. Creates a copy of this {@link SBase} object.
064   */ public
065 RenderLayoutPlugin(RenderLayoutPlugin orig) {
066    this(libsbmlJNI.new_RenderLayoutPlugin__SWIG_1(RenderLayoutPlugin.getCPtr(orig), orig), true);
067  }
068
069  
070/**
071   * Creates and returns a deep copy of this RenderLayoutPlugin  object.
072   <p>
073   * @return a (deep) copy of this RenderLayoutPlugin object
074   */ public
075 SBasePlugin cloneObject() {
076    long cPtr = libsbmlJNI.RenderLayoutPlugin_cloneObject(swigCPtr, this);
077    return (cPtr == 0) ? null : new RenderLayoutPlugin(cPtr, true);
078  }
079
080  
081/**
082   * Returns a pointer to the list object that contains local render information.
083   */ public
084 ListOfLocalRenderInformation getListOfLocalRenderInformation() {
085    long cPtr = libsbmlJNI.RenderLayoutPlugin_getListOfLocalRenderInformation__SWIG_0(swigCPtr, this);
086    return (cPtr == 0) ? null : new ListOfLocalRenderInformation(cPtr, false);
087  }
088
089  
090/**
091   * Returns the number of local render information objects.
092   */ public
093 long getNumLocalRenderInformationObjects() {
094    return libsbmlJNI.RenderLayoutPlugin_getNumLocalRenderInformationObjects(swigCPtr, this);
095  }
096
097  
098/**
099   * Returns a pointer to the local render information object with the given
100   * index.
101   * If the index is invalid, <code>null</code> is returned.
102   */ public
103 LocalRenderInformation getRenderInformation(long index) {
104    long cPtr = libsbmlJNI.RenderLayoutPlugin_getRenderInformation__SWIG_0(swigCPtr, this, index);
105    return (cPtr == 0) ? null : new LocalRenderInformation(cPtr, false);
106  }
107
108  
109/**
110   * Returns a pointer to the local render information object with the given
111   * id.
112   * If no object with the given <code>id</code> exists, <code>null</code> is returned.
113   */ public
114 LocalRenderInformation getRenderInformation(String id) {
115    long cPtr = libsbmlJNI.RenderLayoutPlugin_getRenderInformation__SWIG_2(swigCPtr, this, id);
116    return (cPtr == 0) ? null : new LocalRenderInformation(cPtr, false);
117  }
118
119  
120/**
121   * Adds a copy of the given local render information object to the list of
122   * local render information objects.
123   * If an object with the same id exists, it is replaced.
124   */ public
125 void addLocalRenderInformation(LocalRenderInformation pLRI) {
126    libsbmlJNI.RenderLayoutPlugin_addLocalRenderInformation(swigCPtr, this, LocalRenderInformation.getCPtr(pLRI), pLRI);
127  }
128
129  
130/**
131   * Creates a new local render information object and adds it to the list.
132   * The created object does not have a id and it is the responsibility of
133   * the calling code to ensure that it gets one.
134   * For constraints on the id, please consult the render information document.
135   */ public
136 LocalRenderInformation createLocalRenderInformation() {
137    long cPtr = libsbmlJNI.RenderLayoutPlugin_createLocalRenderInformation(swigCPtr, this);
138    return (cPtr == 0) ? null : new LocalRenderInformation(cPtr, false);
139  }
140
141  
142/**
143   * Removed the render information with the given index from the list.
144   * The removed object is returned. It is the responsibility of the calling
145   * code to delete the object.
146   * If the index is not valid, <code>null</code> is returned.
147   */ public
148 LocalRenderInformation removeLocalRenderInformation(long index) {
149    long cPtr = libsbmlJNI.RenderLayoutPlugin_removeLocalRenderInformation__SWIG_0(swigCPtr, this, index);
150    return (cPtr == 0) ? null : new LocalRenderInformation(cPtr, false);
151  }
152
153  
154/**
155   * Removed the render information with the given <code>id</code> from the list.
156   * The removed object is returned. It is the responsibility of the calling
157   * code to delete the object.
158   * If an object with the given <code>id</code> does not exist, <code>null</code> is returned.
159   */ public
160 LocalRenderInformation removeLocalRenderInformation(String id) {
161    long cPtr = libsbmlJNI.RenderLayoutPlugin_removeLocalRenderInformation__SWIG_1(swigCPtr, this, id);
162    return (cPtr == 0) ? null : new LocalRenderInformation(cPtr, false);
163  }
164
165  
166/**
167   * Subclasses must override this method to create, store, and then
168   * return an SBML object corresponding to the next {@link XMLToken} in the
169   * {@link XMLInputStream} if they have their specific elements.
170   <p>
171   * @return the SBML object corresponding to next {@link XMLToken} in the
172   * {@link XMLInputStream} or null if the token was not recognized.
173   * @internal
174   */ public
175 SBase createObject(XMLInputStream stream) {
176  return libsbml.DowncastSBase(libsbmlJNI.RenderLayoutPlugin_createObject(swigCPtr, this, XMLInputStream.getCPtr(stream), stream), false);
177}
178
179  
180/**
181   * Serialize the render information as L2 annotation
182   * @internal
183   */ public
184 void writeAttributes(XMLOutputStream stream) {
185    libsbmlJNI.RenderLayoutPlugin_writeAttributes(swigCPtr, this, XMLOutputStream.getCPtr(stream), stream);
186  }
187
188  
189/**
190   * Checks if this plugin object has all the required elements.
191   <p>
192   * Subclasses should override this function if they have their specific
193   * elements.
194   <p>
195   * @return true if this pugin object has all the required elements,
196   * otherwise false will be returned.
197   * @internal
198   */ public
199 boolean hasRequiredElements() {
200    return libsbmlJNI.RenderLayoutPlugin_hasRequiredElements(swigCPtr, this);
201  }
202
203  
204/**
205   * Sets the parent SBML object of this plugin object to
206   * this object and child elements (if any).
207   * (Creates a child-parent relationship by this plugin object)
208   <p>
209   * This function is called when this object is created by
210   * the parent element.
211   * Subclasses must override this this function if they have one
212   * or more child elements.Also, {@link SBasePlugin#connectToParent()}
213   * must be called in the overridden function.
214   <p>
215   * @param sbase the {@link SBase} object to use
216   <p>
217   * @see setSBMLDocument
218   * @see enablePackageInternal
219   * @internal
220   */ public
221 void connectToParent(SBase sbase) {
222    libsbmlJNI.RenderLayoutPlugin_connectToParent(swigCPtr, this, SBase.getCPtr(sbase), sbase);
223  }
224
225  
226/**
227   * Enables/Disables the given package with child elements in this plugin
228   * object (if any).
229   * (This is an internal implementation invoked from
230   *  {@link SBase#enablePakcageInternal()} function)
231   <p>
232   * @note Subclasses in which one or more {@link SBase} derived elements are
233   * defined must override this function.
234   <p>
235   * @see setSBMLDocument
236   * @see connectToParent
237   * @internal
238   */ public
239 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
240    libsbmlJNI.RenderLayoutPlugin_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
241  }
242
243}