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 GraphicalObject extends SBase { 012 private long swigCPtr; 013 014 protected GraphicalObject(long cPtr, boolean cMemoryOwn) 015 { 016 super(libsbmlJNI.GraphicalObject_SWIGUpcast(cPtr), cMemoryOwn); 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(GraphicalObject obj) 021 { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected static long getCPtrAndDisown (GraphicalObject 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_GraphicalObject(swigCPtr); 047 } 048 swigCPtr = 0; 049 } 050 super.delete(); 051 } 052 053 public GraphicalObject(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 054 this(libsbmlJNI.new_GraphicalObject__SWIG_0(level, version, pkgVersion), true); 055 } 056 057 public GraphicalObject(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 058 this(libsbmlJNI.new_GraphicalObject__SWIG_1(level, version), true); 059 } 060 061 public GraphicalObject(long level) throws org.sbml.libsbml.SBMLConstructorException { 062 this(libsbmlJNI.new_GraphicalObject__SWIG_2(level), true); 063 } 064 065 public GraphicalObject() throws org.sbml.libsbml.SBMLConstructorException { 066 this(libsbmlJNI.new_GraphicalObject__SWIG_3(), true); 067 } 068 069 public GraphicalObject(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 070 this(libsbmlJNI.new_GraphicalObject__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 071 } 072 073 public GraphicalObject(LayoutPkgNamespaces layoutns, String id) throws org.sbml.libsbml.SBMLConstructorException { 074 this(libsbmlJNI.new_GraphicalObject__SWIG_5(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id), true); 075 } 076 077 public GraphicalObject(LayoutPkgNamespaces layoutns, String id, double x, double y, double w, double h) throws org.sbml.libsbml.SBMLConstructorException { 078 this(libsbmlJNI.new_GraphicalObject__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, x, y, w, h), true); 079 } 080 081 public GraphicalObject(LayoutPkgNamespaces layoutns, String id, double x, double y, double z, double w, double h, double d) throws org.sbml.libsbml.SBMLConstructorException { 082 this(libsbmlJNI.new_GraphicalObject__SWIG_7(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, x, y, z, w, h, d), true); 083 } 084 085 public GraphicalObject(LayoutPkgNamespaces layoutns, String id, Point p, Dimensions d) throws org.sbml.libsbml.SBMLConstructorException { 086 this(libsbmlJNI.new_GraphicalObject__SWIG_8(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, Point.getCPtr(p), p, Dimensions.getCPtr(d), d), true); 087 } 088 089 public GraphicalObject(LayoutPkgNamespaces layoutns, String id, BoundingBox bb) throws org.sbml.libsbml.SBMLConstructorException { 090 this(libsbmlJNI.new_GraphicalObject__SWIG_9(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, BoundingBox.getCPtr(bb), bb), true); 091 } 092 093 public GraphicalObject(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 094 this(libsbmlJNI.new_GraphicalObject__SWIG_10(XMLNode.getCPtr(node), node, l2version), true); 095 } 096 097 public GraphicalObject(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 098 this(libsbmlJNI.new_GraphicalObject__SWIG_11(XMLNode.getCPtr(node), node), true); 099 } 100 101 public GraphicalObject(GraphicalObject source) throws org.sbml.libsbml.SBMLConstructorException { 102 this(libsbmlJNI.new_GraphicalObject__SWIG_12(GraphicalObject.getCPtr(source), source), true); 103 } 104 105 public void initDefaults() { 106 libsbmlJNI.GraphicalObject_initDefaults(swigCPtr, this); 107 } 108 109 110/** 111 * Returns the value of the 'metaid' attribute of this object. 112 * <p> 113 * The optional attribute named 'metaid', present on every major SBML 114 * component type, is for supporting metadata annotations using RDF 115 * (Resource Description Format). The attribute value has the data type 116 * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML 117 * identifier type, which means each 'metaid' value must be globally 118 * unique within an SBML file. (Importantly, this uniqueness criterion 119 * applies across any attribute with type <a 120 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the 121 * 'metaid' attribute used by SBML—something to be aware of if your 122 * application-specific XML content inside the 'annotation' subelement 123 * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) 124 * The 'metaid' value serves to identify a model 125 * component for purposes such as referencing that component from 126 * metadata placed within 'annotation' subelements. 127 * <p> 128 * @return the meta-identifier of this SBML object, as a string. 129 * <p> 130 * @see #isSetMetaId() 131 * @see #setMetaId(String metaid) 132 * @internal 133 */ public 134 String getId() { 135 return libsbmlJNI.GraphicalObject_getId(swigCPtr, this); 136 } 137 138 139/** 140 * Predicate returning <code>true</code> if this object's 'metaid' attribute is set. 141 * <p> 142 * The optional attribute named 'metaid', present on every major SBML 143 * component type, is for supporting metadata annotations using RDF 144 * (Resource Description Format). The attribute value has the data type 145 * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML 146 * identifier type, which means each 'metaid' value must be globally 147 * unique within an SBML file. (Importantly, this uniqueness criterion 148 * applies across any attribute with type <a 149 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the 150 * 'metaid' attribute used by SBML—something to be aware of if your 151 * application-specific XML content inside the 'annotation' subelement 152 * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) 153 * The 'metaid' value serves to identify a model component for purposes 154 * such as referencing that component from metadata placed within 155 * 'annotation' subelements. 156 * <p> 157 * @return <code>true</code> if the 'metaid' attribute of this SBML object is 158 * set, <code>false</code> otherwise. 159 * <p> 160 * @see #getMetaId() 161 * @see #setMetaId(String metaid) 162 * @internal 163 */ public 164 boolean isSetId() { 165 return libsbmlJNI.GraphicalObject_isSetId(swigCPtr, this); 166 } 167 168 169/** 170 * Predicate returning <code>true</code> if this 171 * object has a {@link ModelHistory} object attached to it. 172 * <p> 173 * @return <code>true</code> if the {@link ModelHistory} of this object is set, 174 * <code>false</code> otherwise. 175 * <p> 176 * @note In SBML Level 2, model history annotations were only 177 * permitted on the {@link Model} element. In SBML Level 3, they are 178 * permitted on all SBML components derived from {@link SBase}. 179 * @internal 180 */ public 181 int setId(String id) { 182 return libsbmlJNI.GraphicalObject_setId(swigCPtr, this, id); 183 } 184 185 186/** 187 * Unsets the value of the 'id' attribute of this SBML object. 188 * <p> 189 * Most (but not all) objects in SBML include two common attributes: 'id' 190 * and 'name'. The identifier given by an object's 'id' attribute value 191 * is used to identify the object within the SBML model definition. 192 * Other objects can refer to the component using this identifier. The 193 * data type of 'id' is always either <code>Sid</code> or 194 * <code>UnitSId</code>, depending on the object in question. Both 195 * data types are defined as follows: 196 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 197 * letter .= 'a'..'z','A'..'Z' 198 * digit .= '0'..'9' 199 * idChar .= letter | digit | '_' 200 * SId .= ( letter | '_' ) idChar* 201 * </pre> 202 * <p> 203 * The equality of <code>SId</code> and <code>UnitSId</code> type values 204 * in SBML is determined by an exact character sequence match; i.e., 205 * comparisons of these identifiers must be performed in a case-sensitive 206 * manner. This applies to all uses of <code>SId</code> and 207 * <code>UnitSId</code>. 208 * <p> 209 * @return integer value indicating success/failure of the 210 * function. The possible values returned by this function are: 211 * <ul> 212 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 213 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 214 * </ul> 215 */ public 216 int unsetId() { 217 return libsbmlJNI.GraphicalObject_unsetId(swigCPtr, this); 218 } 219 220 public String getMetaIdRef() { 221 return libsbmlJNI.GraphicalObject_getMetaIdRef(swigCPtr, this); 222 } 223 224 public boolean isSetMetaIdRef() { 225 return libsbmlJNI.GraphicalObject_isSetMetaIdRef(swigCPtr, this); 226 } 227 228 public int setMetaIdRef(String metaid) { 229 return libsbmlJNI.GraphicalObject_setMetaIdRef(swigCPtr, this, metaid); 230 } 231 232 public int unsetMetaIdRef() { 233 return libsbmlJNI.GraphicalObject_unsetMetaIdRef(swigCPtr, this); 234 } 235 236 public void setBoundingBox(BoundingBox bb) { 237 libsbmlJNI.GraphicalObject_setBoundingBox(swigCPtr, this, BoundingBox.getCPtr(bb), bb); 238 } 239 240 public BoundingBox getBoundingBox() { 241 long cPtr = libsbmlJNI.GraphicalObject_getBoundingBox(swigCPtr, this); 242 return (cPtr == 0) ? null : new BoundingBox(cPtr, false); 243 } 244 245 246/** 247 * Returns the XML element name of this object. 248 * <p> 249 * This is overridden by subclasses to return a string appropriate to the 250 * SBML component. For example, {@link Model} defines it as returning 251 * <code>'model'</code>, {@link CompartmentType} defines it as returning <code>'compartmentType'</code>, 252 * and so on. 253 */ public 254 String getElementName() { 255 return libsbmlJNI.GraphicalObject_getElementName(swigCPtr, this); 256 } 257 258 259/** 260 * Creates and returns a deep copy of this {@link SBase} object. 261 * <p> 262 * @return a (deep) copy of this {@link SBase} object. 263 */ public 264 GraphicalObject cloneObject() { 265 return (GraphicalObject) libsbml.DowncastSBase(libsbmlJNI.GraphicalObject_cloneObject(swigCPtr, this), true); 266} 267 268 269/** 270 * Returns the libSBML type code for this object. 271 * <p> 272 * This method may return the type code of this SBML object, or it may 273 * return {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN}. This 274 * is because subclasses of {@link SBase} are not required to implement this 275 * method to return a type code. This method is meant primarily for the 276 * LibSBML C interface, in which class and subclass information is not 277 * readily available. 278 * <p> 279 * @return the SBML object type code 280 * of this SBML object or 281 * {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (the default). 282 * <p> 283 * @see #getElementName() 284 * @see #getPackageName() 285 */ public 286 int getTypeCode() { 287 return libsbmlJNI.GraphicalObject_getTypeCode(swigCPtr, this); 288 } 289 290 public XMLNode toXML() { 291 return new XMLNode(libsbmlJNI.GraphicalObject_toXML(swigCPtr, this), true); 292 } 293 294 295/** 296 * Sets this SBML object to child SBML objects (if any). 297 * (Creates a child-parent relationship by the parent) 298 * <p> 299 * Subclasses must override this function if they define 300 * one ore more child elements. 301 * Basically, this function needs to be called in 302 * constructor, copy constructor, assignment operator. 303 * <p> 304 * <p> 305 * @internal 306 */ public 307 void connectToChild() { 308 libsbmlJNI.GraphicalObject_connectToChild(swigCPtr, this); 309 } 310 311 312/** 313 * Enables/Disables the given package with this element and child 314 * elements (if any). 315 * (This is an internal implementation for enablePackage function) 316 * <p> 317 * @note Subclasses in which one or more child elements are defined 318 * must override this function. 319 * <p> 320 * <p> 321 * @see #connectToChild() 322 * @internal 323 */ public 324 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 325 libsbmlJNI.GraphicalObject_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 326 } 327 328}