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 GeneralGlyph extends GraphicalObject { 012 private long swigCPtr; 013 014 protected GeneralGlyph(long cPtr, boolean cMemoryOwn) 015 { 016 super(libsbmlJNI.GeneralGlyph_SWIGUpcast(cPtr), cMemoryOwn); 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(GeneralGlyph obj) 021 { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected static long getCPtrAndDisown (GeneralGlyph 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_GeneralGlyph(swigCPtr); 047 } 048 swigCPtr = 0; 049 } 050 super.delete(); 051 } 052 053 public GeneralGlyph(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 054 this(libsbmlJNI.new_GeneralGlyph__SWIG_0(level, version, pkgVersion), true); 055 } 056 057 public GeneralGlyph(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 058 this(libsbmlJNI.new_GeneralGlyph__SWIG_1(level, version), true); 059 } 060 061 public GeneralGlyph(long level) throws org.sbml.libsbml.SBMLConstructorException { 062 this(libsbmlJNI.new_GeneralGlyph__SWIG_2(level), true); 063 } 064 065 public GeneralGlyph() throws org.sbml.libsbml.SBMLConstructorException { 066 this(libsbmlJNI.new_GeneralGlyph__SWIG_3(), true); 067 } 068 069 public GeneralGlyph(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 070 this(libsbmlJNI.new_GeneralGlyph__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 071 } 072 073 public GeneralGlyph(LayoutPkgNamespaces layoutns, String id) throws org.sbml.libsbml.SBMLConstructorException { 074 this(libsbmlJNI.new_GeneralGlyph__SWIG_5(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id), true); 075 } 076 077 public GeneralGlyph(LayoutPkgNamespaces layoutns, String id, String referenceId) throws org.sbml.libsbml.SBMLConstructorException { 078 this(libsbmlJNI.new_GeneralGlyph__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, referenceId), true); 079 } 080 081 public GeneralGlyph(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 082 this(libsbmlJNI.new_GeneralGlyph__SWIG_7(XMLNode.getCPtr(node), node, l2version), true); 083 } 084 085 public GeneralGlyph(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 086 this(libsbmlJNI.new_GeneralGlyph__SWIG_8(XMLNode.getCPtr(node), node), true); 087 } 088 089 public GeneralGlyph(GeneralGlyph source) throws org.sbml.libsbml.SBMLConstructorException { 090 this(libsbmlJNI.new_GeneralGlyph__SWIG_9(GeneralGlyph.getCPtr(source), source), true); 091 } 092 093 public String getReferenceId() { 094 return libsbmlJNI.GeneralGlyph_getReferenceId(swigCPtr, this); 095 } 096 097 public int setReferenceId(String id) { 098 return libsbmlJNI.GeneralGlyph_setReferenceId(swigCPtr, this, id); 099 } 100 101 public boolean isSetReferenceId() { 102 return libsbmlJNI.GeneralGlyph_isSetReferenceId(swigCPtr, this); 103 } 104 105 public ListOfReferenceGlyphs getListOfReferenceGlyphs() { 106 long cPtr = libsbmlJNI.GeneralGlyph_getListOfReferenceGlyphs__SWIG_0(swigCPtr, this); 107 return (cPtr == 0) ? null : new ListOfReferenceGlyphs(cPtr, false); 108 } 109 110 public ListOfGraphicalObjects getListOfSubGlyphs() { 111 long cPtr = libsbmlJNI.GeneralGlyph_getListOfSubGlyphs__SWIG_0(swigCPtr, this); 112 return (cPtr == 0) ? null : new ListOfGraphicalObjects(cPtr, false); 113 } 114 115 public ReferenceGlyph getReferenceGlyph(long index) { 116 long cPtr = libsbmlJNI.GeneralGlyph_getReferenceGlyph__SWIG_0(swigCPtr, this, index); 117 return (cPtr == 0) ? null : new ReferenceGlyph(cPtr, false); 118 } 119 120 public GraphicalObject getSubGlyph(long index) { 121 return (GraphicalObject) libsbml.DowncastSBase(libsbmlJNI.GeneralGlyph_getSubGlyph__SWIG_0(swigCPtr, this, index), false); 122} 123 124 public void addReferenceGlyph(ReferenceGlyph glyph) { 125 libsbmlJNI.GeneralGlyph_addReferenceGlyph(swigCPtr, this, ReferenceGlyph.getCPtr(glyph), glyph); 126 } 127 128 public void addSubGlyph(GraphicalObject glyph) { 129 libsbmlJNI.GeneralGlyph_addSubGlyph(swigCPtr, this, GraphicalObject.getCPtr(glyph), glyph); 130 } 131 132 public long getNumReferenceGlyphs() { 133 return libsbmlJNI.GeneralGlyph_getNumReferenceGlyphs(swigCPtr, this); 134 } 135 136 public long getNumSubGlyphs() { 137 return libsbmlJNI.GeneralGlyph_getNumSubGlyphs(swigCPtr, this); 138 } 139 140 public void initDefaults() { 141 libsbmlJNI.GeneralGlyph_initDefaults(swigCPtr, this); 142 } 143 144 public Curve getCurve() { 145 long cPtr = libsbmlJNI.GeneralGlyph_getCurve__SWIG_0(swigCPtr, this); 146 return (cPtr == 0) ? null : new Curve(cPtr, false); 147 } 148 149 public void setCurve(Curve curve) { 150 libsbmlJNI.GeneralGlyph_setCurve(swigCPtr, this, Curve.getCPtr(curve), curve); 151 } 152 153 public boolean isSetCurve() { 154 return libsbmlJNI.GeneralGlyph_isSetCurve(swigCPtr, this); 155 } 156 157 public ReferenceGlyph createReferenceGlyph() { 158 long cPtr = libsbmlJNI.GeneralGlyph_createReferenceGlyph(swigCPtr, this); 159 return (cPtr == 0) ? null : new ReferenceGlyph(cPtr, false); 160 } 161 162 public LineSegment createLineSegment() { 163 return (LineSegment) libsbml.DowncastSBase(libsbmlJNI.GeneralGlyph_createLineSegment(swigCPtr, this), false); 164} 165 166 public CubicBezier createCubicBezier() { 167 long cPtr = libsbmlJNI.GeneralGlyph_createCubicBezier(swigCPtr, this); 168 return (cPtr == 0) ? null : new CubicBezier(cPtr, false); 169 } 170 171 public ReferenceGlyph removeReferenceGlyph(long index) { 172 long cPtr = libsbmlJNI.GeneralGlyph_removeReferenceGlyph__SWIG_0(swigCPtr, this, index); 173 return (cPtr == 0) ? null : new ReferenceGlyph(cPtr, false); 174 } 175 176 public GraphicalObject removeSubGlyph(long index) { 177 return (GraphicalObject) libsbml.DowncastSBase(libsbmlJNI.GeneralGlyph_removeSubGlyph__SWIG_0(swigCPtr, this, index), false); 178} 179 180 public ReferenceGlyph removeReferenceGlyph(String id) { 181 long cPtr = libsbmlJNI.GeneralGlyph_removeReferenceGlyph__SWIG_1(swigCPtr, this, id); 182 return (cPtr == 0) ? null : new ReferenceGlyph(cPtr, false); 183 } 184 185 public GraphicalObject removeSubGlyph(String id) { 186 return (GraphicalObject) libsbml.DowncastSBase(libsbmlJNI.GeneralGlyph_removeSubGlyph__SWIG_1(swigCPtr, this, id), false); 187} 188 189 public long getIndexForReferenceGlyph(String id) { 190 return libsbmlJNI.GeneralGlyph_getIndexForReferenceGlyph(swigCPtr, this, id); 191 } 192 193 public long getIndexForSubGlyph(String id) { 194 return libsbmlJNI.GeneralGlyph_getIndexForSubGlyph(swigCPtr, this, id); 195 } 196 197 198/** 199 * Returns the XML element name of this object. 200 * <p> 201 * This is overridden by subclasses to return a string appropriate to the 202 * SBML component. For example, {@link Model} defines it as returning 203 * <code>'model'</code>, {@link CompartmentType} defines it as returning <code>'compartmentType'</code>, 204 * and so on. 205 */ public 206 String getElementName() { 207 return libsbmlJNI.GeneralGlyph_getElementName(swigCPtr, this); 208 } 209 210 211/** 212 * Creates and returns a deep copy of this {@link SBase} object. 213 * <p> 214 * @return a (deep) copy of this {@link SBase} object. 215 */ public 216 GeneralGlyph cloneObject() { 217 long cPtr = libsbmlJNI.GeneralGlyph_cloneObject(swigCPtr, this); 218 return (cPtr == 0) ? null : new GeneralGlyph(cPtr, true); 219 } 220 221 222/** 223 * Returns the libSBML type code for this object. 224 * <p> 225 * This method may return the type code of this SBML object, or it may 226 * return {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN}. This 227 * is because subclasses of {@link SBase} are not required to implement this 228 * method to return a type code. This method is meant primarily for the 229 * LibSBML C interface, in which class and subclass information is not 230 * readily available. 231 * <p> 232 * @return the SBML object type code 233 * of this SBML object or 234 * {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (the default). 235 * <p> 236 * @see #getElementName() 237 * @see #getPackageName() 238 */ public 239 int getTypeCode() { 240 return libsbmlJNI.GeneralGlyph_getTypeCode(swigCPtr, this); 241 } 242 243 public XMLNode toXML() { 244 return new XMLNode(libsbmlJNI.GeneralGlyph_toXML(swigCPtr, this), true); 245 } 246 247 248/** 249 * Sets this SBML object to child SBML objects (if any). 250 * (Creates a child-parent relationship by the parent) 251 * <p> 252 * Subclasses must override this function if they define 253 * one ore more child elements. 254 * Basically, this function needs to be called in 255 * constructor, copy constructor, assignment operator. 256 * <p> 257 * <p> 258 * @internal 259 */ public 260 void connectToChild() { 261 libsbmlJNI.GeneralGlyph_connectToChild(swigCPtr, this); 262 } 263 264 265/** 266 * Enables/Disables the given package with this element and child 267 * elements (if any). 268 * (This is an internal implementation for enablePackage function) 269 * <p> 270 * @note Subclasses in which one or more child elements are defined 271 * must override this function. 272 * <p> 273 * <p> 274 * @see #connectToChild() 275 * @internal 276 */ public 277 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 278 libsbmlJNI.GeneralGlyph_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 279 } 280 281}