001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.8 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 * <span class="pkg-marker pkg-color-layout"><a href="group__layout.html">layout</a></span> 013 014 A glyph for a text label. 015 <p> 016 * The TextGlyph class describes the position and dimension of text labels 017 * in the “layout” package. It inherits from {@link GraphicalObject} and 018 * adds the attributes graphicalObject, text and originOfText. 019 */ 020 021public class TextGlyph extends GraphicalObject { 022 private long swigCPtr; 023 024 protected TextGlyph(long cPtr, boolean cMemoryOwn) 025 { 026 super(libsbmlJNI.TextGlyph_SWIGUpcast(cPtr), cMemoryOwn); 027 swigCPtr = cPtr; 028 } 029 030 protected static long getCPtr(TextGlyph obj) 031 { 032 return (obj == null) ? 0 : obj.swigCPtr; 033 } 034 035 protected static long getCPtrAndDisown (TextGlyph obj) 036 { 037 long ptr = 0; 038 039 if (obj != null) 040 { 041 ptr = obj.swigCPtr; 042 obj.swigCMemOwn = false; 043 } 044 045 return ptr; 046 } 047 048 protected void finalize() { 049 delete(); 050 } 051 052 public synchronized void delete() { 053 if (swigCPtr != 0) { 054 if (swigCMemOwn) { 055 swigCMemOwn = false; 056 libsbmlJNI.delete_TextGlyph(swigCPtr); 057 } 058 swigCPtr = 0; 059 } 060 super.delete(); 061 } 062 063 064/** 065 * Creates a new {@link TextGlyph} with the given SBML level, versin and package 066 * version. The ids of the associated {@link GraphicalObject} and 067 * the originOfText are set to the empty string. The actual text is set 068 * to the empty string as well. 069 */ public 070 TextGlyph(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 071 this(libsbmlJNI.new_TextGlyph__SWIG_0(level, version, pkgVersion), true); 072 } 073 074 075/** 076 * Creates a new {@link TextGlyph} with the given SBML level, versin and package 077 * version. The ids of the associated {@link GraphicalObject} and 078 * the originOfText are set to the empty string. The actual text is set 079 * to the empty string as well. 080 */ public 081 TextGlyph(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 082 this(libsbmlJNI.new_TextGlyph__SWIG_1(level, version), true); 083 } 084 085 086/** 087 * Creates a new {@link TextGlyph} with the given SBML level, versin and package 088 * version. The ids of the associated {@link GraphicalObject} and 089 * the originOfText are set to the empty string. The actual text is set 090 * to the empty string as well. 091 */ public 092 TextGlyph(long level) throws org.sbml.libsbml.SBMLConstructorException { 093 this(libsbmlJNI.new_TextGlyph__SWIG_2(level), true); 094 } 095 096 097/** 098 * Creates a new {@link TextGlyph} with the given SBML level, versin and package 099 * version. The ids of the associated {@link GraphicalObject} and 100 * the originOfText are set to the empty string. The actual text is set 101 * to the empty string as well. 102 */ public 103 TextGlyph() throws org.sbml.libsbml.SBMLConstructorException { 104 this(libsbmlJNI.new_TextGlyph__SWIG_3(), true); 105 } 106 107 108/** 109 * Ctor. 110 */ public 111 TextGlyph(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 112 this(libsbmlJNI.new_TextGlyph__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 113 } 114 115 116/** 117 * Creates a new {@link TextGlyph}. The id is given as the first argument. 118 <p> 119 * (FOR BACKWARD COMPATIBILITY) 120 */ public 121 TextGlyph(LayoutPkgNamespaces layoutns, String id) throws org.sbml.libsbml.SBMLConstructorException { 122 this(libsbmlJNI.new_TextGlyph__SWIG_5(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id), true); 123 } 124 125 126/** 127 * Creates a new {@link TextGlyph}. The id is given as the first argument, the 128 * text to be displayed as the second. All other attirbutes are set to 129 * the empty string. 130 <p> 131 * (FOR BACKWARD COMPATIBILITY) 132 */ public 133 TextGlyph(LayoutPkgNamespaces layoutns, String id, String text) throws org.sbml.libsbml.SBMLConstructorException { 134 this(libsbmlJNI.new_TextGlyph__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, id, text), true); 135 } 136 137 138/** 139 * Creates a new {@link TextGlyph} from the given {@link XMLNode} 140 <p> 141 * (FOR BACKWARD COMPATIBILITY) 142 */ public 143 TextGlyph(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 144 this(libsbmlJNI.new_TextGlyph__SWIG_7(XMLNode.getCPtr(node), node, l2version), true); 145 } 146 147 148/** 149 * Creates a new {@link TextGlyph} from the given {@link XMLNode} 150 <p> 151 * (FOR BACKWARD COMPATIBILITY) 152 */ public 153 TextGlyph(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 154 this(libsbmlJNI.new_TextGlyph__SWIG_8(XMLNode.getCPtr(node), node), true); 155 } 156 157 158/** 159 * Copy constructor. 160 */ public 161 TextGlyph(TextGlyph source) throws org.sbml.libsbml.SBMLConstructorException { 162 this(libsbmlJNI.new_TextGlyph__SWIG_9(TextGlyph.getCPtr(source), source), true); 163 } 164 165 166/** 167 * <p> 168 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another 169 * value. 170 <p> 171 * <p> 172 * In SBML, object identifiers are of a data type called <code>SId</code>. 173 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 174 * introduced for attribute values that refer to <code>SId</code> values; in 175 * previous Levels of SBML, this data type did not exist and attributes were 176 * simply described to as 'referring to an identifier', but the effective 177 * data type was the same as <code>SIdRef</code>in Level 3. These and 178 * other methods of libSBML refer to the type <code>SIdRef</code> for all 179 * Levels of SBML, even if the corresponding SBML specification did not 180 * explicitly name the data type. 181 <p> 182 * This method works by looking at all attributes and (if appropriate) 183 * mathematical formulas in MathML content, comparing the referenced 184 * identifiers to the value of <code>oldid</code>. If any matches are found, the 185 * matching values are replaced with <code>newid</code>. The method does <em>not</em> 186 * descend into child elements. 187 <p> 188 * @param oldid the old identifier 189 * @param newid the new identifier 190 */ public 191 void renameSIdRefs(String oldid, String newid) { 192 libsbmlJNI.TextGlyph_renameSIdRefs(swigCPtr, this, oldid, newid); 193 } 194 195 196/** 197 * Returns the text to be displayed by the text glyph. 198 */ public 199 String getText() { 200 return libsbmlJNI.TextGlyph_getText(swigCPtr, this); 201 } 202 203 204/** 205 * Sets the text to be displayed by the text glyph. 206 */ public 207 void setText(String text) { 208 libsbmlJNI.TextGlyph_setText(swigCPtr, this, text); 209 } 210 211 212/** 213 * Returns the id of the associated graphical object. 214 */ public 215 String getGraphicalObjectId() { 216 return libsbmlJNI.TextGlyph_getGraphicalObjectId(swigCPtr, this); 217 } 218 219 220/** 221 * Sets the id of the associated graphical object. 222 */ public 223 int setGraphicalObjectId(String id) { 224 return libsbmlJNI.TextGlyph_setGraphicalObjectId(swigCPtr, this, id); 225 } 226 227 228/** 229 * Returns the id of the origin of text. 230 */ public 231 String getOriginOfTextId() { 232 return libsbmlJNI.TextGlyph_getOriginOfTextId(swigCPtr, this); 233 } 234 235 236/** 237 * Sets the id of the origin of text. 238 */ public 239 int setOriginOfTextId(String orig) { 240 return libsbmlJNI.TextGlyph_setOriginOfTextId(swigCPtr, this, orig); 241 } 242 243 244/** 245 * Returns true if the text is not the empty string. 246 */ public 247 boolean isSetText() { 248 return libsbmlJNI.TextGlyph_isSetText(swigCPtr, this); 249 } 250 251 252/** 253 * Returns true if the id of the origin of text is not the empty string. 254 */ public 255 boolean isSetOriginOfTextId() { 256 return libsbmlJNI.TextGlyph_isSetOriginOfTextId(swigCPtr, this); 257 } 258 259 260/** 261 * Returns true if the id of the associated graphical object is not the 262 * empty string. 263 */ public 264 boolean isSetGraphicalObjectId() { 265 return libsbmlJNI.TextGlyph_isSetGraphicalObjectId(swigCPtr, this); 266 } 267 268 269/** 270 * Calls initDefaults from {@link GraphicalObject}. 271 */ public 272 void initDefaults() { 273 libsbmlJNI.TextGlyph_initDefaults(swigCPtr, this); 274 } 275 276 277/** 278 * Returns the XML element name of 279 * this SBML object. 280 <p> 281 * @return the string of the name of this element 282 */ public 283 String getElementName() { 284 return libsbmlJNI.TextGlyph_getElementName(swigCPtr, this); 285 } 286 287 288/** 289 * Creates and returns a deep copy of this {@link TextGlyph}. 290 <p> 291 * @return a (deep) copy of this {@link TextGlyph}. 292 */ public 293 TextGlyph cloneObject() { 294 long cPtr = libsbmlJNI.TextGlyph_cloneObject(swigCPtr, this); 295 return (cPtr == 0) ? null : new TextGlyph(cPtr, true); 296 } 297 298 299/** 300 * Returns the libSBML type code of this object instance. 301 <p> 302 * <p> 303 * LibSBML attaches an identifying code to every kind of SBML object. These 304 * are integer constants known as <em>SBML type codes</em>. The names of all 305 * the codes begin with the characters <code>SBML_</code>. 306 * In the Java language interface for libSBML, the 307 * type codes are defined as static integer constants in the interface class 308 * {@link libsbmlConstants}. Note that different Level 3 309 * package plug-ins may use overlapping type codes; to identify the package 310 * to which a given object belongs, call the <code>getPackageName()</code> 311 * method on the object. 312 <p> 313 * @return the SBML type code for this object: 314 * {@link libsbmlConstants#SBML_LAYOUT_TEXTGLYPH SBML_LAYOUT_TEXTGLYPH} 315 <p> 316 * <p> 317 * @warning <span class='warning'>The specific integer values of the possible 318 * type codes may be reused by different Level 3 package plug-ins. 319 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 320 * both getTypeCode() and getPackageName()</strong>.</span> 321 <p> 322 * @see #getElementName() 323 * @see #getPackageName() 324 */ public 325 int getTypeCode() { 326 return libsbmlJNI.TextGlyph_getTypeCode(swigCPtr, this); 327 } 328 329 330/** 331 * Creates an {@link XMLNode} object from this. 332 */ public 333 XMLNode toXML() { 334 return new XMLNode(libsbmlJNI.TextGlyph_toXML(swigCPtr, this), true); 335 } 336 337}