001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.12 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 * a {@link LineEnding} is a decoration element for the start and/or end 013 * of curves in the SBML render extension, e.g. arrow heads 014 <p> 015 * LineEndings in the SBML render extension are used to apply certain decorations 016 * to the end of curves. Since many curves in layout diagrams use the same decoration 017 * for the beginnings and start of a line, it would be highly redundant to encode 018 * those decorations with each line. Therefor {@link LineEnding} objects can be defined which are 019 * then applied to the beginning or the ends of several curve objects. 020 <p> 021 * A {@link LineEnding} contains an id by which it can be referenced from curve styles, it contains 022 * a visual representation of the decoration in the form of a render extension {@link Group} object 023 * and it has some attributes that define the viewport and how the {@link LineEnding} is to be applied 024 * to a curve. 025 <p> 026 * A {@link LineEnding} object is only valid if it has an id, a viewport that has an area which is not 0 027 * and a valid group object. 028 */ 029 030public class LineEnding extends GraphicalPrimitive2D { 031 private long swigCPtr; 032 033 protected LineEnding(long cPtr, boolean cMemoryOwn) 034 { 035 super(libsbmlJNI.LineEnding_SWIGUpcast(cPtr), cMemoryOwn); 036 swigCPtr = cPtr; 037 } 038 039 protected static long getCPtr(LineEnding obj) 040 { 041 return (obj == null) ? 0 : obj.swigCPtr; 042 } 043 044 protected static long getCPtrAndDisown (LineEnding obj) 045 { 046 long ptr = 0; 047 048 if (obj != null) 049 { 050 ptr = obj.swigCPtr; 051 obj.swigCMemOwn = false; 052 } 053 054 return ptr; 055 } 056 057 protected void finalize() { 058 delete(); 059 } 060 061 public synchronized void delete() { 062 if (swigCPtr != 0) { 063 if (swigCMemOwn) { 064 swigCMemOwn = false; 065 libsbmlJNI.delete_LineEnding(swigCPtr); 066 } 067 swigCPtr = 0; 068 } 069 super.delete(); 070 } 071 072 073/** 074 * Creates a new {@link LineEnding} object with the given SBML level 075 * and SBML version. 076 <p> 077 * @param level SBML level of the new object 078 * @param level SBML version of the new object 079 */ public 080 LineEnding(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 081 this(libsbmlJNI.new_LineEnding__SWIG_0(level, version, pkgVersion), true); 082 } 083 084 085/** 086 * Creates a new {@link LineEnding} object with the given SBML level 087 * and SBML version. 088 <p> 089 * @param level SBML level of the new object 090 * @param level SBML version of the new object 091 */ public 092 LineEnding(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 093 this(libsbmlJNI.new_LineEnding__SWIG_1(level, version), true); 094 } 095 096 097/** 098 * Creates a new {@link LineEnding} object with the given SBML level 099 * and SBML version. 100 <p> 101 * @param level SBML level of the new object 102 * @param level SBML version of the new object 103 */ public 104 LineEnding(long level) throws org.sbml.libsbml.SBMLConstructorException { 105 this(libsbmlJNI.new_LineEnding__SWIG_2(level), true); 106 } 107 108 109/** 110 * Creates a new {@link LineEnding} object with the given SBML level 111 * and SBML version. 112 <p> 113 * @param level SBML level of the new object 114 * @param level SBML version of the new object 115 */ public 116 LineEnding() throws org.sbml.libsbml.SBMLConstructorException { 117 this(libsbmlJNI.new_LineEnding__SWIG_3(), true); 118 } 119 120 121/** 122 * Creates a new {@link LineEnding} object with the given {@link SBMLNamespaces}. 123 <p> 124 * @param sbmlns The SBML namespace for the object. 125 */ public 126 LineEnding(RenderPkgNamespaces renderns) throws org.sbml.libsbml.SBMLConstructorException { 127 this(libsbmlJNI.new_LineEnding__SWIG_4(RenderPkgNamespaces.getCPtr(renderns), renderns), true); 128 } 129 130 131/** 132 * Creates a new {@link LineEnding} object from the given {@link XMLNode} object. 133 * The {@link XMLNode} object has to contain a valid XML representation of a 134 * {@link LineEnding} object as defined in the render extension specification. 135 * This method is normally called when render information is read from a file and 136 * should normally not have to be called explicitly. 137 <p> 138 * @param node the {@link XMLNode} object reference that describes the {@link LineEnding} 139 * object to be instantiated. 140 */ public 141 LineEnding(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 142 this(libsbmlJNI.new_LineEnding__SWIG_5(XMLNode.getCPtr(node), node, l2version), true); 143 } 144 145 146/** 147 * Copy constructor. 148 */ public 149 LineEnding(LineEnding other) throws org.sbml.libsbml.SBMLConstructorException { 150 this(libsbmlJNI.new_LineEnding__SWIG_6(LineEnding.getCPtr(other), other), true); 151 } 152 153 154/** 155 * Constructor which creates a {@link LineEnding} with an empty group object, 156 * and a viewport with a size of 0. 157 * The id is set to the given value. 158 * In order to get a valid object, the group object has to be valid, 159 * the group object has to have descendants other than groups and 160 * the viewport has to have a positive size. 161 <p> 162 * @param id The id for the {@link LineEnding}. 163 <p> 164 * This constructor is deprecated. The new libsbml API only has 165 * constructors which take the SBML level and version or one that takes 166 * an {@link SBMLNamespaces} object. 167 */ public 168 LineEnding(RenderPkgNamespaces renderns, String id) throws org.sbml.libsbml.SBMLConstructorException { 169 this(libsbmlJNI.new_LineEnding__SWIG_7(RenderPkgNamespaces.getCPtr(renderns), renderns, id), true); 170 } 171 172 173/** 174 * Sets whether rotational mapping is to be done or not. 175 * This flag determines whether the {@link LineEnding} is rotated 176 * according to the direction of the curve when it is applied. 177 * For details on this, see the render extension specification. 178 <p> 179 * @param enable Boolean flag that specifies whether rotational mapping 180 * for the line ending is to be enabled or not. 181 */ public 182 void setEnableRotationalMapping(boolean enable) { 183 libsbmlJNI.LineEnding_setEnableRotationalMapping(swigCPtr, this, enable); 184 } 185 186 187/** 188 * Returns whether rotational mapping is enabled or not. 189 <p> 190 * @return boolean value that specifies if rotational mapping is 191 * enabled for the {@link LineEnding} or not. 192 */ public 193 boolean getIsEnabledRotationalMapping() { 194 return libsbmlJNI.LineEnding_getIsEnabledRotationalMapping(swigCPtr, this); 195 } 196 197 198/** 199 * Sets the viewport for the {@link LineEnding}. 200 <p> 201 * @param box The viewport bounding box for the {@link LineEnding}. 202 */ public 203 void setBoundingBox(BoundingBox box) { 204 libsbmlJNI.LineEnding_setBoundingBox(swigCPtr, this, BoundingBox.getCPtr(box), box); 205 } 206 207 208/** 209 * Returns a pointer to the viewport bounding box. 210 <p> 211 * @return pointer to the viewport bounding box. 212 */ public 213 BoundingBox getBoundingBox() { 214 long cPtr = libsbmlJNI.LineEnding_getBoundingBox__SWIG_0(swigCPtr, this); 215 return (cPtr == 0) ? null : new BoundingBox(cPtr, false); 216 } 217 218 219/** 220 * Sets the group of the {@link LineEnding} to a copy of the given group. 221 <p> 222 * @param group pointer to the group to be set for the bounding box. 223 * The group object is copied. 224 */ public 225 void setGroup(RenderGroup group) { 226 libsbmlJNI.LineEnding_setGroup(swigCPtr, this, RenderGroup.getCPtr(group), group); 227 } 228 229 230/** 231 * Returns a pointer to the group object. 232 <p> 233 * @return pointer to the group object 234 */ public 235 RenderGroup getGroup() { 236 long cPtr = libsbmlJNI.LineEnding_getGroup__SWIG_0(swigCPtr, this); 237 return (cPtr == 0) ? null : new RenderGroup(cPtr, false); 238 } 239 240 241/** 242 * Creates and returns a deep copy of this {@link LineEnding} object. 243 <p> 244 * @return a (deep) copy of this {@link LineEnding} object 245 */ public 246 LineEnding cloneObject() { 247 long cPtr = libsbmlJNI.LineEnding_cloneObject(swigCPtr, this); 248 return (cPtr == 0) ? null : new LineEnding(cPtr, true); 249 } 250 251 252/** 253 * Returns the XML element name of this object. 254 <p> 255 * This is overridden by subclasses to return a string appropriate to the 256 * SBML component. For example, {@link Model} defines it as returning 'model', 257 * {@link CompartmentType} defines it as returning 'compartmentType', etc. 258 */ public 259 String getElementName() { 260 return libsbmlJNI.LineEnding_getElementName(swigCPtr, this); 261 } 262 263 264/** 265 * Creates an {@link XMLNode} object from this {@link LineEnding} object. 266 <p> 267 * @return the {@link XMLNode} with the XML representation for the 268 * {@link LineEnding} object. 269 */ public 270 XMLNode toXML() { 271 return new XMLNode(libsbmlJNI.LineEnding_toXML(swigCPtr, this), true); 272 } 273 274 public void connectToChild() { 275 libsbmlJNI.LineEnding_connectToChild(swigCPtr, this); 276 } 277 278 279/** * @internal */ public 280 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 281 libsbmlJNI.LineEnding_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 282 } 283 284 285/** 286 * Returns the libSBML type code for this SBML object. 287 <p> 288 * LibSBML attaches an 289 * identifying code to every kind of SBML object. These are known as 290 * <em>SBML type codes</em>. In other languages, the set of type codes 291 * is stored in an enumeration; in the Java language interface for 292 * libSBML, the type codes are defined as static integer constants in 293 * interface class {@link libsbmlConstants}. The names of the type codes 294 * all begin with the characters <code>SBML_.</code> 295 <p> 296 * @return the SBML type code for this object, or <code>SBML_UNKNOWN</code> (default). 297 <p> 298 * @see #getElementName() 299 */ public 300 int getTypeCode() { 301 return libsbmlJNI.LineEnding_getTypeCode(swigCPtr, this); 302 } 303 304 305/** 306 * Returns the value of the 'id' attribute of this GraphicalPrimitive. 307 <p> 308 * @return the id of the GraphicalPrimitive 309 */ public 310 String getId() { 311 return libsbmlJNI.LineEnding_getId(swigCPtr, this); 312 } 313 314 315/** 316 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 317 * GraphicalPrimitive's 'id' attribute has been set. 318 <p> 319 * @return returns true or false depending on whether the id on the 320 * GraphicalPrimitive has been set. 321 */ public 322 boolean isSetId() { 323 return libsbmlJNI.LineEnding_isSetId(swigCPtr, this); 324 } 325 326 327/** 328 * Sets the value of the 'id' attribute of this GraphicalPrimitive. 329 <p> 330 * @param id the new id for the GraphicalPrimitive 331 <p> 332 * @return status if the operation succeeded 333 */ public 334 int setId(String id) { 335 return libsbmlJNI.LineEnding_setId(swigCPtr, this, id); 336 } 337 338 339/** 340 * Unsets the value of the 'id' attribute of this GraphicalPrimitive. 341 */ public 342 int unsetId() { 343 return libsbmlJNI.LineEnding_unsetId(swigCPtr, this); 344 } 345 346 347/** * @internal */ public 348 boolean hasRequiredAttributes() { 349 return libsbmlJNI.LineEnding_hasRequiredAttributes(swigCPtr, this); 350 } 351 352 353/** * @internal */ public 354 boolean hasRequiredElements() { 355 return libsbmlJNI.LineEnding_hasRequiredElements(swigCPtr, this); 356 } 357 358}