001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.7 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 * container class that stores objects derived from {@link Transformation2D}. 013 <p> 014 * Layouts can contain {@link ListOfDrawables} which holds all 015 * {@link Transformation2D} objects for a certain group. 016 */ 017 018public class ListOfDrawables extends ListOf { 019 private long swigCPtr; 020 021 protected ListOfDrawables(long cPtr, boolean cMemoryOwn) 022 { 023 super(libsbmlJNI.ListOfDrawables_SWIGUpcast(cPtr), cMemoryOwn); 024 swigCPtr = cPtr; 025 } 026 027 protected static long getCPtr(ListOfDrawables obj) 028 { 029 return (obj == null) ? 0 : obj.swigCPtr; 030 } 031 032 protected static long getCPtrAndDisown (ListOfDrawables obj) 033 { 034 long ptr = 0; 035 036 if (obj != null) 037 { 038 ptr = obj.swigCPtr; 039 obj.swigCMemOwn = false; 040 } 041 042 return ptr; 043 } 044 045 protected void finalize() { 046 delete(); 047 } 048 049 public synchronized void delete() { 050 if (swigCPtr != 0) { 051 if (swigCMemOwn) { 052 swigCMemOwn = false; 053 libsbmlJNI.delete_ListOfDrawables(swigCPtr); 054 } 055 swigCPtr = 0; 056 } 057 super.delete(); 058 } 059 060 061/** 062 * Creates and returns a deep copy of the {@link ListOfDrawables} object. 063 <p> 064 * @return a (deep) copy of this {@link ListOfDrawables} 065 */ public 066 ListOfDrawables cloneObject() { 067 long cPtr = libsbmlJNI.ListOfDrawables_cloneObject(swigCPtr, this); 068 return (cPtr == 0) ? null : new ListOfDrawables(cPtr, true); 069 } 070 071 072/** 073 * Constructor which instantiates an empty {@link ListOfDrawables} object. 074 */ public 075 ListOfDrawables(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 076 this(libsbmlJNI.new_ListOfDrawables__SWIG_0(level, version, pkgVersion), true); 077 } 078 079 080/** 081 * Constructor which instantiates an empty {@link ListOfDrawables} object. 082 */ public 083 ListOfDrawables(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 084 this(libsbmlJNI.new_ListOfDrawables__SWIG_1(level, version), true); 085 } 086 087 088/** 089 * Constructor which instantiates an empty {@link ListOfDrawables} object. 090 */ public 091 ListOfDrawables(long level) throws org.sbml.libsbml.SBMLConstructorException { 092 this(libsbmlJNI.new_ListOfDrawables__SWIG_2(level), true); 093 } 094 095 096/** 097 * Constructor which instantiates an empty {@link ListOfDrawables} object. 098 */ public 099 ListOfDrawables() throws org.sbml.libsbml.SBMLConstructorException { 100 this(libsbmlJNI.new_ListOfDrawables__SWIG_3(), true); 101 } 102 103 104/** 105 * Ctor. 106 */ public 107 ListOfDrawables(RenderPkgNamespaces renderns) throws org.sbml.libsbml.SBMLConstructorException { 108 this(libsbmlJNI.new_ListOfDrawables__SWIG_4(RenderPkgNamespaces.getCPtr(renderns), renderns), true); 109 } 110 111 112/** 113 * Copy constructor. Creates a copy of this {@link ListOfDrawables} object. 114 */ public 115 ListOfDrawables(ListOfDrawables source) throws org.sbml.libsbml.SBMLConstructorException { 116 this(libsbmlJNI.new_ListOfDrawables__SWIG_5(ListOfDrawables.getCPtr(source), source), true); 117 } 118 119 120/** 121 * Returns a pointer to the {@link Transformation2D} with the given index or null if 122 * the index is invalid. 123 <p> 124 * @param i index of the {@link Transformation2D} object to be returned 125 <p> 126 * @return pointer to the {@link Transformation2D} at the given index or null. 127 */ public 128 SBase get(long i) { 129 long cPtr = libsbmlJNI.ListOfDrawables_get__SWIG_0(swigCPtr, this, i); 130 return (cPtr == 0) ? null : new Transformation2D(cPtr, false); 131 } 132 133 134/** 135 * Returns a pointer to the {@link Transformation2D} with the given <code>id</code> or <code>null</code> if 136 * the id is invalid. 137 <p> 138 * @param id id of the {@link Transformation2D} object to be returned 139 <p> 140 * @return pointer to the {@link Transformation2D} at the given <code>id</code> or <code>null.</code> 141 */ public 142 Transformation2D get(String id) { 143 long cPtr = libsbmlJNI.ListOfDrawables_get__SWIG_2(swigCPtr, this, id); 144 return (cPtr == 0) ? null : new Transformation2D(cPtr, false); 145 } 146 147 148/** 149 * Removes the nth item from this {@link ListOfDrawables} items and returns a pointer to 150 * it. 151 <p> 152 * The caller owns the returned item and is responsible for deleting it. 153 <p> 154 * @param n the index of the item to remove 155 <p> 156 * @see #size() 157 */ public 158 SBase remove(long n) { 159 long cPtr = libsbmlJNI.ListOfDrawables_remove__SWIG_0(swigCPtr, this, n); 160 return (cPtr == 0) ? null : new Transformation2D(cPtr, true); 161 } 162 163 164/** 165 * Removes item in this {@link ListOfDrawables} items with the given identifier. 166 <p> 167 * The caller owns the returned item and is responsible for deleting it. 168 * If none of the items in this list have the identifier <code>sid</code>, then @c 169 * null is returned. 170 <p> 171 * @param sid the identifier of the item to remove 172 <p> 173 * @return the item removed. As mentioned above, the caller owns the 174 * returned item. 175 */ public 176 Transformation2D remove(String sid) { 177 long cPtr = libsbmlJNI.ListOfDrawables_remove__SWIG_1(swigCPtr, this, sid); 178 return (cPtr == 0) ? null : new Transformation2D(cPtr, true); 179 } 180 181 182/** 183 * Returns the name of this element. 184 <p> 185 * @return the name of the element, in this case 'listOfDrawables' 186 */ public 187 String getElementName() { 188 return libsbmlJNI.ListOfDrawables_getElementName(swigCPtr, this); 189 } 190 191 192/** 193 * Get the type code of the objects contained in this {@link ListOf}. 194 <p> 195 * LibSBML attaches an identifying code to every 196 * kind of SBML object. These are known as <em>SBML type codes</em>. In 197 * other languages, the set of type codes is stored in an enumeration; in 198 * the Java language interface for libSBML, the type codes are defined as 199 * static integer constants in the interface class {@link 200 * libsbmlConstants}. The names of the type codes all begin with the 201 * characters <code>SBML_.</code> 202 <p> 203 * @return the SBML type code for the objects contained in this {@link ListOf} 204 * instance, or {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (default). 205 */ public 206 int getItemTypeCode() { 207 return libsbmlJNI.ListOfDrawables_getItemTypeCode(swigCPtr, this); 208 } 209 210 211/** */ public 212 boolean isValidTypeForList(SBase item) { 213 return libsbmlJNI.ListOfDrawables_isValidTypeForList(swigCPtr, this, SBase.getCPtrAndDisown(item), item); 214 } 215 216}