001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 2.0.11 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 LayoutModelPlugin extends SBasePlugin { 012 private long swigCPtr; 013 014 protected LayoutModelPlugin(long cPtr, boolean cMemoryOwn) 015 { 016 super(libsbmlJNI.LayoutModelPlugin_SWIGUpcast(cPtr), cMemoryOwn); 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(LayoutModelPlugin obj) 021 { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected static long getCPtrAndDisown (LayoutModelPlugin 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_LayoutModelPlugin(swigCPtr); 047 } 048 swigCPtr = 0; 049 } 050 super.delete(); 051 } 052 053 public LayoutModelPlugin(String uri, String prefix, LayoutPkgNamespaces layoutns) { 054 this(libsbmlJNI.new_LayoutModelPlugin__SWIG_0(uri, prefix, LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 055 } 056 057 public LayoutModelPlugin(LayoutModelPlugin orig) { 058 this(libsbmlJNI.new_LayoutModelPlugin__SWIG_1(LayoutModelPlugin.getCPtr(orig), orig), true); 059 } 060 061 062/** 063 * Creates and returns a deep copy of this {@link SBasePlugin} object. 064 * <p> 065 * @return a (deep) copy of this {@link SBase} object 066 */ public 067 SBasePlugin cloneObject() { 068 long cPtr = libsbmlJNI.LayoutModelPlugin_cloneObject(swigCPtr, this); 069 return (cPtr == 0) ? null : new LayoutModelPlugin(cPtr, true); 070 } 071 072 public ListOfLayouts getListOfLayouts() { 073 long cPtr = libsbmlJNI.LayoutModelPlugin_getListOfLayouts__SWIG_0(swigCPtr, this); 074 return (cPtr == 0) ? null : new ListOfLayouts(cPtr, false); 075 } 076 077 public Layout getLayout(long index) { 078 long cPtr = libsbmlJNI.LayoutModelPlugin_getLayout__SWIG_0(swigCPtr, this, index); 079 return (cPtr == 0) ? null : new Layout(cPtr, false); 080 } 081 082 public Layout getLayout(String sid) { 083 long cPtr = libsbmlJNI.LayoutModelPlugin_getLayout__SWIG_2(swigCPtr, this, sid); 084 return (cPtr == 0) ? null : new Layout(cPtr, false); 085 } 086 087 public int addLayout(Layout layout) { 088 return libsbmlJNI.LayoutModelPlugin_addLayout(swigCPtr, this, Layout.getCPtr(layout), layout); 089 } 090 091 public Layout createLayout() { 092 long cPtr = libsbmlJNI.LayoutModelPlugin_createLayout(swigCPtr, this); 093 return (cPtr == 0) ? null : new Layout(cPtr, false); 094 } 095 096 public Layout removeLayout(long n) { 097 long cPtr = libsbmlJNI.LayoutModelPlugin_removeLayout(swigCPtr, this, n); 098 return (cPtr == 0) ? null : new Layout(cPtr, false); 099 } 100 101 public int getNumLayouts() { 102 return libsbmlJNI.LayoutModelPlugin_getNumLayouts(swigCPtr, this); 103 } 104 105 106/** 107 * Sets the parent SBML object of this plugin object to 108 * this object and child elements (if any). 109 * (Creates a child-parent relationship by this plugin object) 110 * <p> 111 * This function is called when this object is created by 112 * the parent element. 113 * Subclasses must override this this function if they have one 114 * or more child elements. Also, {@link SBasePlugin#connectToParent(SBase sbase)} 115 * must be called in the overridden function. 116 * <p> 117 * @param sbase the {@link SBase} object to use 118 * <p> 119 * @see setSBMLDocument 120 * @see enablePackageInternal 121 * @internal 122 */ public 123 void connectToParent(SBase sbase) { 124 libsbmlJNI.LayoutModelPlugin_connectToParent(swigCPtr, this, SBase.getCPtr(sbase), sbase); 125 } 126 127 128/** 129 * Enables/Disables the given package with child elements in this plugin 130 * object (if any). 131 * (This is an internal implementation invoked from 132 * {@link SBase#enablePackageInternal()} function) 133 * <p> 134 * Subclasses which contain one or more {@link SBase} derived elements should 135 * override this function if elements defined in them can be extended by 136 * some other package extension. 137 * <p> 138 * @see setSBMLDocument 139 * @see connectToParent 140 * @internal 141 */ public 142 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 143 libsbmlJNI.LayoutModelPlugin_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 144 } 145 146}