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 * abstract base class for local and global render information.
013 <p>
014 * In the SBML render extension, local and global render information representations
015 * share many attributes. These are implemented in this abstract base class.
016 <p>
017 * {@link GlobalRenderInformation} and {@link LocalRenderInformation} are the classes that are derived
018 * from this base class.
019 <p>
020 * All render information objects have the following things in common:
021 <p>
022 * a) a set of color definitions
023 * b) a set of gradient definitions
024 * c) a set of line endings
025 <p>
026 * In addition to those, they share attributes for background color and some meta information
027 * as to which program created the render information etc.
028 */
029
030public class RenderInformationBase extends SBase {
031   private long swigCPtr;
032
033   protected RenderInformationBase(long cPtr, boolean cMemoryOwn)
034   {
035     super(libsbmlJNI.RenderInformationBase_SWIGUpcast(cPtr), cMemoryOwn);
036     swigCPtr = cPtr;
037   }
038
039   protected static long getCPtr(RenderInformationBase obj)
040   {
041     return (obj == null) ? 0 : obj.swigCPtr;
042   }
043
044   protected static long getCPtrAndDisown (RenderInformationBase obj)
045   {
046     long ptr = 0;
047
048     if (obj != null)
049     {
050       ptr             = obj.swigCPtr;
051       obj.swigCMemOwn = false;
052     }
053
054     return ptr;
055   }
056
057  protected void finalize() {
058    delete();
059  }
060
061  public synchronized void delete() {
062    if (swigCPtr != 0) {
063      if (swigCMemOwn) {
064        swigCMemOwn = false;
065        libsbmlJNI.delete_RenderInformationBase(swigCPtr);
066      }
067      swigCPtr = 0;
068    }
069    super.delete();
070  }
071
072  
073/**
074   * Returns the program name that created the render information.
075   <p>
076   * @return the name string of the program
077   */ public
078 String getProgramName() {
079    return libsbmlJNI.RenderInformationBase_getProgramName(swigCPtr, this);
080  }
081
082  
083/**
084   * Sets the name of the program that created the render information.
085   <p>
086   * @param name the name of the program
087   */ public
088 void setProgramName(String name) {
089    libsbmlJNI.RenderInformationBase_setProgramName(swigCPtr, this, name);
090  }
091
092  
093/**
094   * Returns the version of the program that created the render information.
095   <p>
096   * @return the version of the program as a string.
097   */ public
098 String getProgramVersion() {
099    return libsbmlJNI.RenderInformationBase_getProgramVersion(swigCPtr, this);
100  }
101
102  
103/**
104   * Sets the version string of the program that created the render information.
105   <p>
106   * @param version version string of the program
107   */ public
108 void setProgramVersion(String version) {
109    libsbmlJNI.RenderInformationBase_setProgramVersion(swigCPtr, this, version);
110  }
111
112  
113/**
114   * Returns the id of the referenced render information object.
115   * Renderinformation objects can reference other render information objects
116   * and information that is not found in the current render information is then
117   * expected to be in the referenced render information object.
118   <p>
119   * Global render information objects can only reference other global 
120   * render information objects, local render information objects can reference other local
121   * render information objects from the same list of local render information or other
122   * global render information.
123   <p>
124   * @return the id of the referenced render information object.
125   */ public
126 String getReferenceRenderInformationId() {
127    return libsbmlJNI.RenderInformationBase_getReferenceRenderInformationId(swigCPtr, this);
128  }
129
130  
131/**
132   * Sets the id of the referenced render information object.
133   * The user has to make sure that render information referencing 
134   * does not create loops.
135   <p>
136   * @param id the id of the referenced render information
137   */ public
138 void setReferenceRenderInformationId(String id) {
139    libsbmlJNI.RenderInformationBase_setReferenceRenderInformationId(swigCPtr, this, id);
140  }
141
142  
143/**
144  * Predicate returning <code>true</code> if this {@link RenderInformationBase}'s
145  * 'referenceRenderInformation' attribute is set.
146  <p>
147  * @return <code>true</code> if this {@link RenderInformationBase}'s
148  * 'referenceRenderInformation' attribute has been set, otherwise <code>false</code> is
149  * returned.
150  */ public
151 boolean isSetReferenceRenderInformation() {
152    return libsbmlJNI.RenderInformationBase_isSetReferenceRenderInformation(swigCPtr, this);
153  }
154
155  
156/**
157  * Unsets the value of the 'referenceRenderInformation' attribute of this
158  * {@link RenderInformationBase}.
159  <p>
160  * <p>
161 * @return integer value indicating success/failure of the
162 * function.   The possible values
163 * returned by this function are:
164  * <ul>
165  * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
166  * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
167  * </ul>
168  */ public
169 int unsetReferenceRenderInformation() {
170    return libsbmlJNI.RenderInformationBase_unsetReferenceRenderInformation(swigCPtr, this);
171  }
172
173  
174/**
175   * Returns the number of color definitions.
176   <p>
177   * @return the number of color definitions in the render information.
178   */ public
179 long getNumColorDefinitions() {
180    return libsbmlJNI.RenderInformationBase_getNumColorDefinitions(swigCPtr, this);
181  }
182
183  
184/**
185   * Returns a pointer to the list of color definitions.
186   <p>
187   * @return pointer to the list of color definitions.
188   */ public
189 ListOfColorDefinitions getListOfColorDefinitions() {
190    long cPtr = libsbmlJNI.RenderInformationBase_getListOfColorDefinitions__SWIG_0(swigCPtr, this);
191    return (cPtr == 0) ? null : new ListOfColorDefinitions(cPtr, false);
192  }
193
194  
195/**
196   * Returns a pointer to the color definition with the given index, or <code>null</code>
197   * if the index is invalid.
198   <p>
199   * @param index of the {@link ColorDefinition} object to be returned
200   <p>
201   * @return pointer to the {@link ColorDefinition} object at the given index or null
202   */ public
203 ColorDefinition getColorDefinition(long index) {
204    long cPtr = libsbmlJNI.RenderInformationBase_getColorDefinition__SWIG_0(swigCPtr, this, index);
205    return (cPtr == 0) ? null : new ColorDefinition(cPtr, false);
206  }
207
208  
209/**
210   * Returns a pointer to the color definition with the given <code>id</code>, or <code>null</code>
211   * if there is no color definition with that id.
212   <p>
213   * @param id of the color definition object to be returned.
214   <p>
215   * @return a pointer to the color definition object with the given <code>id</code> 
216   * or null if there is no color definition with given <code>id</code>
217   */ public
218 ColorDefinition getColorDefinition(String id) {
219    long cPtr = libsbmlJNI.RenderInformationBase_getColorDefinition__SWIG_2(swigCPtr, this, id);
220    return (cPtr == 0) ? null : new ColorDefinition(cPtr, false);
221  }
222
223  
224/**
225   * Creates a new color definition object without an id.
226   * For the object to be valid an id has to be set that is unique
227   * within the list of color definitions and the list of gradients within 
228   * the render information.
229   <p>
230   * The created {@link ColorDefinition} object is added to and owned by the render information.
231   <p>
232   * @return pointer to new {@link ColorDefinition} object
233   */ public
234 ColorDefinition createColorDefinition() {
235    long cPtr = libsbmlJNI.RenderInformationBase_createColorDefinition(swigCPtr, this);
236    return (cPtr == 0) ? null : new ColorDefinition(cPtr, false);
237  }
238
239  
240/**
241   * Removes the color definition with the given index from the list of color definitions.
242   * If the index is valid, the object is removed and a pointer to the removed object 
243   * is returned.
244   * The caller is responsible for deleting thew object.
245   * If the index is invalid, <code>null</code> is returned.
246   <p>
247   * @param index index of the color definition to be removed.
248   <p>
249   * @ return pointer to the removed object
250   */ public
251 ColorDefinition removeColorDefinition(long index) {
252    long cPtr = libsbmlJNI.RenderInformationBase_removeColorDefinition(swigCPtr, this, index);
253    return (cPtr == 0) ? null : new ColorDefinition(cPtr, false);
254  }
255
256  
257/**
258   * Adds a copy of the given color definition to the end of the list of
259   * color definitions.
260   <p>
261   * The color definition has to be valid, i.e. have a unique id and a valid color value.
262   * Otherwise it is not added.
263   <p>
264   * @param cd  pointer to {@link ColorDefinition} object to be added
265   <p>
266   * @return integer value indicating success/failure of the
267   * function.   The possible values
268   * returned by this function are:
269   * <ul>
270   * <li> LIBSBML_OPERATION_SUCCESS
271   * <li> LIBSBML_LEVEL_MISMATCH
272   * <li> LIBSBML_VERSION_MISMATCH
273   * <li> LIBSBML_OPERATION_FAILED
274   *
275   * </ul> <p>
276   * @note This method should be used with some caution.  The fact that
277   * this method <em>copies</em> the object passed to it means that the caller
278   * will be left holding a physically different object instance than the
279   * one contained in this {@link Reaction}.  Changes made to the original object
280   * instance (such as resetting attribute values) will <em>not affect the
281   * instance in the {@link Reaction}</em>.  In addition, the caller should make
282   * sure to free the original object if it is no longer being used, or
283   * else a memory leak will result.  Please see {@link RenderInformationBase#createColorDefinition()}
284   * for a method that does not lead to these issues.
285   <p>
286   * @see #createColorDefinition()
287   */ public
288 int addColorDefinition(ColorDefinition cd) {
289    return libsbmlJNI.RenderInformationBase_addColorDefinition(swigCPtr, this, ColorDefinition.getCPtr(cd), cd);
290  }
291
292  
293/**
294   * Returns the number of gradient definitions in the render information.
295   <p>
296   * @return number of gradient definitions
297   */ public
298 long getNumGradientDefinitions() {
299    return libsbmlJNI.RenderInformationBase_getNumGradientDefinitions(swigCPtr, this);
300  }
301
302  
303/**
304   * Returns a pointer to the list of gradient definitions.
305   <p>
306   * @return pointer to {@link ListOfGradientDefinitions}
307   */ public
308 ListOfGradientDefinitions getListOfGradientDefinitions() {
309    long cPtr = libsbmlJNI.RenderInformationBase_getListOfGradientDefinitions__SWIG_0(swigCPtr, this);
310    return (cPtr == 0) ? null : new ListOfGradientDefinitions(cPtr, false);
311  }
312
313  
314/**
315   * Returns a pointer to the gradient definition with the given index, or <code>null</code>
316   * if the index is invalid.
317   <p>
318   * @param index index of the GradientDefinition object to be returned
319   <p>
320   * @return pointer to the GradientDefinition object with the given index or null 
321   * if the index was invalid.
322   */ public
323 GradientBase getGradientDefinition(long index) {
324  return (GradientBase) libsbml.DowncastSBase(libsbmlJNI.RenderInformationBase_getGradientDefinition__SWIG_0(swigCPtr, this, index), false);
325}
326
327  
328/**
329   * Returns a pointer to the gradient definition with the given <code>id</code>, or <code>null</code>
330   * if there is no gradient definition with that id.
331   <p>
332   * @param id of the gradient definition object to be returned.
333   <p>
334   * @return a pointer to the gradient definition object with the given <code>id</code> 
335   * or null if there is no gradient definition with given <code>id</code>
336   */ public
337 GradientBase getGradientDefinition(String id) {
338  return (GradientBase) libsbml.DowncastSBase(libsbmlJNI.RenderInformationBase_getGradientDefinition__SWIG_2(swigCPtr, this, id), false);
339}
340
341  
342/**
343   * Creates a new linear gradient definition.
344   * The newly created object is added to the render 
345   * information and also owned by it.
346   <p>
347   * Since the newly created object has no id and no gradient stops, 
348   * it is invalid until those things have been added.
349   <p>
350   * @return pointer to newly created {@link LinearGradient} object.
351   */ public
352 LinearGradient createLinearGradientDefinition() {
353    long cPtr = libsbmlJNI.RenderInformationBase_createLinearGradientDefinition(swigCPtr, this);
354    return (cPtr == 0) ? null : new LinearGradient(cPtr, false);
355  }
356
357  
358/**
359   * Creates a new radial gradient definition.
360   * The newly created object is added to the render 
361   * information and also owned by it.
362   <p>
363   * Since the newly created object has no id and no gradient stops, 
364   * it is invalid until those things have been added.
365   <p>
366   * @return pointer to newly created {@link RadialGradient} object.
367   */ public
368 RadialGradient createRadialGradientDefinition() {
369    long cPtr = libsbmlJNI.RenderInformationBase_createRadialGradientDefinition(swigCPtr, this);
370    return (cPtr == 0) ? null : new RadialGradient(cPtr, false);
371  }
372
373  
374/**
375   * Removes the gradient definition with the given index.
376   * If the index is valid, the object is removed and a pointer to the removed object 
377   * is returned.
378   * The caller is responsible for deleting thew object.
379   * If the index is invalid, <code>null</code> is returned.
380   <p>
381   * @param index index of the gradient definition object to be removed.
382   <p>
383   * @ return pointer to the removed object
384   */ public
385 GradientBase removeGradientDefinition(long index) {
386  return (GradientBase) libsbml.DowncastSBase(libsbmlJNI.RenderInformationBase_removeGradientDefinition(swigCPtr, this, index), false);
387}
388
389  
390/**
391   * Adds a copy of the given gradient definition to the end of the list of
392   * gradient definitions.
393   * The Gradient definition has to be valid, so is has to have at least two
394   * gradient stops and an id.
395   <p>
396   * @param gradient GradientDefinition object to be added
397   <p>
398   * @return integer value indicating success/failure of the
399   * function.   The possible values
400   * returned by this function are:
401   * <ul>
402   * <li> LIBSBML_OPERATION_SUCCESS
403   * <li> LIBSBML_LEVEL_MISMATCH
404   * <li> LIBSBML_VERSION_MISMATCH
405   * <li> LIBSBML_OPERATION_FAILED
406   *
407   * </ul> <p>
408   * @note This method should be used with some caution.  The fact that
409   * this method <em>copies</em> the object passed to it means that the caller
410   * will be left holding a physically different object instance than the
411   * one contained in this {@link RenderInformationBase}.  Changes made to the original object
412   * instance (such as resetting attribute values) will <em>not affect the
413   * instance in the {@link RenderInformationBase}</em>.  In addition, the caller should make
414   * sure to free the original object if it is no longer being used, or
415   * else a memory leak will result.  Please see 
416   * {@link RenderInformationBase#createLinearGradientDefinition()} or
417   * {@link RenderInformationBase#createRadialGradientDefinition()}
418   * for methods that does not lead to these issues.
419   <p>
420   * @see #createRadialGradientDefinition()
421   * @see #createLinearGradientDefinition()
422   */ public
423 int addGradientDefinition(GradientBase gradient) {
424    return libsbmlJNI.RenderInformationBase_addGradientDefinition(swigCPtr, this, GradientBase.getCPtr(gradient), gradient);
425  }
426
427  
428/**
429   * Returns the number of line endings for the render information.
430   <p>
431   * @return number of line endings in the render information.
432   */ public
433 long getNumLineEndings() {
434    return libsbmlJNI.RenderInformationBase_getNumLineEndings(swigCPtr, this);
435  }
436
437  
438/**
439   * Returns a pointer to the list of line endings.
440   <p>
441   * @return pointer to the list of line endings.
442   */ public
443 ListOfLineEndings getListOfLineEndings() {
444    long cPtr = libsbmlJNI.RenderInformationBase_getListOfLineEndings__SWIG_0(swigCPtr, this);
445    return (cPtr == 0) ? null : new ListOfLineEndings(cPtr, false);
446  }
447
448  
449/**
450   * Returns a pointer to the line ending with the given index, or <code>null</code>
451   * if the index is invalid.
452   <p>
453   * @param index of the line ending object to be returned.
454   <p>
455   * @return a pointer to the line ending object with the given index 
456   * or null if the index was out of bounds.
457   */ public
458 LineEnding getLineEnding(long index) {
459    long cPtr = libsbmlJNI.RenderInformationBase_getLineEnding__SWIG_0(swigCPtr, this, index);
460    return (cPtr == 0) ? null : new LineEnding(cPtr, false);
461  }
462
463  
464/**
465   * Returns a pointer to the line ending with the given <code>id</code>, or <code>null</code>
466   * if there is no line ending with that id.
467   <p>
468   * @param id of the line ending object to be returned.
469   <p>
470   * @return a pointer to the line ending object with the given <code>id</code> 
471   * or null if there is no line ending with given <code>id</code>
472   */ public
473 LineEnding getLineEnding(String id) {
474    long cPtr = libsbmlJNI.RenderInformationBase_getLineEnding__SWIG_2(swigCPtr, this, id);
475    return (cPtr == 0) ? null : new LineEnding(cPtr, false);
476  }
477
478  
479/**
480   * Creates a new line ending.
481   * The new line ending object is added to and owned by the 
482   * render information. Since it does not have an id or a valid group
483   * or a valid viewport, it should be considered invalid until those
484   * things have been set.
485   <p>
486   * @return pointer to the newlyy created {@link LineEnding} object
487   */ public
488 LineEnding createLineEnding() {
489    long cPtr = libsbmlJNI.RenderInformationBase_createLineEnding(swigCPtr, this);
490    return (cPtr == 0) ? null : new LineEnding(cPtr, false);
491  }
492
493  
494/**
495   * Removes the line ending with the given index.
496   * If the index is valid, the object is removed and a pointer to the removed object 
497   * is returned.
498   * The caller is responsible for deleting thew object.
499   * If the index is invalid, <code>null</code> is returned.
500   <p>
501   * @param index index of the object to be removed.
502   <p>
503   * @ return pointer to the removed object
504   */ public
505 LineEnding removeLineEnding(long index) {
506    long cPtr = libsbmlJNI.RenderInformationBase_removeLineEnding(swigCPtr, this, index);
507    return (cPtr == 0) ? null : new LineEnding(cPtr, false);
508  }
509
510  
511/**
512   * Adds a copy of the given line ending to the end of the list of line
513   * endings.
514   * The new {@link LineEnding} is only added if it is valid.
515   <p>
516   * @param le  pointer to {@link LineEnding} to be added
517   <p>
518   * @return integer value indicating success/failure of the
519   * function.   The possible values
520   * returned by this function are:
521   * <ul>
522   * <li> LIBSBML_OPERATION_SUCCESS
523   * <li> LIBSBML_LEVEL_MISMATCH
524   * <li> LIBSBML_VERSION_MISMATCH
525   * <li> LIBSBML_OPERATION_FAILED
526   *
527   * </ul> <p>
528   * @note This method should be used with some caution.  The fact that
529   * this method <em>copies</em> the object passed to it means that the caller
530   * will be left holding a physically different object instance than the
531   * one contained in this {@link RenderInformationBase}.  Changes made to the original object
532   * instance (such as resetting attribute values) will <em>not affect the
533   * instance in the {@link RenderInformationBase}</em>.  In addition, the caller should make
534   * sure to free the original object if it is no longer being used, or
535   * else a memory leak will result.  Please see {@link RenderInformationBase#createLineEnding()}
536   * for a method that does not lead to these issues.
537   <p>
538   * @see #createLineEnding()
539   */ public
540 int addLineEnding(LineEnding le) {
541    return libsbmlJNI.RenderInformationBase_addLineEnding(swigCPtr, this, LineEnding.getCPtr(le), le);
542  }
543
544  
545/**
546   * Returns the background color which is either the id of a color in the
547   * list of color definitions, or a color value.
548   <p>
549   * @return background color id or value string
550   */ public
551 String getBackgroundColor() {
552    return libsbmlJNI.RenderInformationBase_getBackgroundColor(swigCPtr, this);
553  }
554
555  
556/**
557  * Predicate returning <code>true</code> if this {@link RenderInformationBase}'s
558  * 'backgroundColor' attribute is set.
559  <p>
560  * @return <code>true</code> if this {@link RenderInformationBase}'s 'backgroundColor'
561  * attribute has been set, otherwise <code>false</code> is returned.
562  */ public
563 boolean isSetBackgroundColor() {
564    return libsbmlJNI.RenderInformationBase_isSetBackgroundColor(swigCPtr, this);
565  }
566
567  
568/**
569   * Sets the background color to either the id of a color in the list of
570   * color definitions, or a color value.
571   <p>
572   * @param bg id of a color definition or a valid color value to be used as background color.
573   */ public
574 void setBackgroundColor(String bg) {
575    libsbmlJNI.RenderInformationBase_setBackgroundColor(swigCPtr, this, bg);
576  }
577
578  
579/**
580  * Unsets the value of the 'backgroundColor' attribute of this
581  * {@link RenderInformationBase}.
582  <p>
583  * <p>
584 * @return integer value indicating success/failure of the
585 * function.   The possible values
586 * returned by this function are:
587  * <ul>
588  * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
589  * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
590  * </ul>
591  */ public
592 int unsetBackgroundColor() {
593    return libsbmlJNI.RenderInformationBase_unsetBackgroundColor(swigCPtr, this);
594  }
595
596  
597/**
598   * Returns the value of the 'id' attribute of this {@link RenderInformationBase}.
599   <p>
600   * @return the id of the {@link RenderInformationBase}
601   */ public
602 String getId() {
603    return libsbmlJNI.RenderInformationBase_getId(swigCPtr, this);
604  }
605
606  
607/**
608   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
609   * {@link RenderInformationBase}'s 'id' attribute has been set.
610   <p>
611   * @return returns true or false depending on whether the id on the 
612   * {@link RenderInformationBase} has been set.
613   */ public
614 boolean isSetId() {
615    return libsbmlJNI.RenderInformationBase_isSetId(swigCPtr, this);
616  }
617
618  
619/**
620   * Sets the value of the 'id' attribute of this {@link RenderInformationBase}.
621   <p>
622   * @param id the new id for the {@link RenderInformationBase} 
623   <p>
624   * @return status if the operation succeeded
625   */ public
626 int setId(String id) {
627    return libsbmlJNI.RenderInformationBase_setId(swigCPtr, this, id);
628  }
629
630  
631/**
632   * Unsets the value of the 'id' attribute of this {@link RenderInformationBase}.
633   */ public
634 int unsetId() {
635    return libsbmlJNI.RenderInformationBase_unsetId(swigCPtr, this);
636  }
637
638  
639/**
640   * Returns the value of the 'name' attribute of this {@link RenderInformationBase}.
641   <p>
642   * @return the name of the {@link RenderInformationBase}
643   */ public
644 String getName() {
645    return libsbmlJNI.RenderInformationBase_getName(swigCPtr, this);
646  }
647
648  
649/**
650   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
651   * {@link RenderInformationBase}'s 'name' attribute has been set.
652   <p>
653   * @return returns true or false depending on whether the name on the 
654   * {@link RenderInformationBase} has been set.
655   */ public
656 boolean isSetName() {
657    return libsbmlJNI.RenderInformationBase_isSetName(swigCPtr, this);
658  }
659
660  
661/**
662   * Sets the value of the 'name' attribute of this {@link RenderInformationBase}.
663   <p>
664   * @param name the new name for the {@link RenderInformationBase} 
665   <p>
666   * @return status if the operation succeeded
667   */ public
668 int setName(String name) {
669    return libsbmlJNI.RenderInformationBase_setName(swigCPtr, this, name);
670  }
671
672  
673/**
674   * Unsets the value of the 'name' attribute of this {@link RenderInformationBase}.
675   */ public
676 int unsetName() {
677    return libsbmlJNI.RenderInformationBase_unsetName(swigCPtr, this);
678  }
679
680  public void connectToChild() {
681    libsbmlJNI.RenderInformationBase_connectToChild(swigCPtr, this);
682  }
683
684  
685/** * @internal */ public
686 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
687    libsbmlJNI.RenderInformationBase_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
688  }
689
690}