001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 2.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 * <span class="pkg-marker pkg-color-layout"><a href="group__layout.html">layout</a></span> 013 014 The representation of a point in the 015 * “layout” package. 016 <p> 017 * A point is specified via the required attributes 'x', 'y' and an optional 018 * attribute 'z', all of which are of type double. If the attribute z is not 019 * specified, the object is a two dimensional object. The {@link Point} class also 020 * has an optional attribute id of type SId. While not used in the 021 * “layout” package, it can be used by programs to refer to the 022 * elements. 023 */ 024 025public class Point extends SBase { 026 private long swigCPtr; 027 028 protected Point(long cPtr, boolean cMemoryOwn) 029 { 030 super(libsbmlJNI.Point_SWIGUpcast(cPtr), cMemoryOwn); 031 swigCPtr = cPtr; 032 } 033 034 protected static long getCPtr(Point obj) 035 { 036 return (obj == null) ? 0 : obj.swigCPtr; 037 } 038 039 protected static long getCPtrAndDisown (Point obj) 040 { 041 long ptr = 0; 042 043 if (obj != null) 044 { 045 ptr = obj.swigCPtr; 046 obj.swigCMemOwn = false; 047 } 048 049 return ptr; 050 } 051 052 protected void finalize() { 053 delete(); 054 } 055 056 public synchronized void delete() { 057 if (swigCPtr != 0) { 058 if (swigCMemOwn) { 059 swigCMemOwn = false; 060 libsbmlJNI.delete_Point(swigCPtr); 061 } 062 swigCPtr = 0; 063 } 064 super.delete(); 065 } 066 067 068/** 069 * Creates a new point with x,y and z set to 0.0. 070 */ public 071 Point(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 072 this(libsbmlJNI.new_Point__SWIG_0(level, version, pkgVersion), true); 073 } 074 075 076/** 077 * Creates a new point with x,y and z set to 0.0. 078 */ public 079 Point(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 080 this(libsbmlJNI.new_Point__SWIG_1(level, version), true); 081 } 082 083 084/** 085 * Creates a new point with x,y and z set to 0.0. 086 */ public 087 Point(long level) throws org.sbml.libsbml.SBMLConstructorException { 088 this(libsbmlJNI.new_Point__SWIG_2(level), true); 089 } 090 091 092/** 093 * Creates a new point with x,y and z set to 0.0. 094 */ public 095 Point() throws org.sbml.libsbml.SBMLConstructorException { 096 this(libsbmlJNI.new_Point__SWIG_3(), true); 097 } 098 099 100/** 101 * Ctor. 102 */ public 103 Point(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 104 this(libsbmlJNI.new_Point__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 105 } 106 107 108/** 109 * Copy constructor. 110 */ public 111 Point(Point orig) throws org.sbml.libsbml.SBMLConstructorException { 112 this(libsbmlJNI.new_Point__SWIG_5(Point.getCPtr(orig), orig), true); 113 } 114 115 116/** 117 * Creates a new point with the given ccordinates. 118 */ public 119 Point(LayoutPkgNamespaces layoutns, double x, double y, double z) throws org.sbml.libsbml.SBMLConstructorException { 120 this(libsbmlJNI.new_Point__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, x, y, z), true); 121 } 122 123 124/** 125 * Creates a new point with the given ccordinates. 126 */ public 127 Point(LayoutPkgNamespaces layoutns, double x, double y) throws org.sbml.libsbml.SBMLConstructorException { 128 this(libsbmlJNI.new_Point__SWIG_7(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, x, y), true); 129 } 130 131 132/** 133 * Creates a new {@link Point} from the given {@link XMLNode} 134 */ public 135 Point(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 136 this(libsbmlJNI.new_Point__SWIG_8(XMLNode.getCPtr(node), node, l2version), true); 137 } 138 139 140/** 141 * Creates a new {@link Point} from the given {@link XMLNode} 142 */ public 143 Point(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 144 this(libsbmlJNI.new_Point__SWIG_9(XMLNode.getCPtr(node), node), true); 145 } 146 147 148/** 149 * Returns the x offset. 150 */ public 151 double x() { 152 return libsbmlJNI.Point_x(swigCPtr, this); 153 } 154 155 156/** 157 * Returns the y offset. 158 */ public 159 double y() { 160 return libsbmlJNI.Point_y(swigCPtr, this); 161 } 162 163 164/** 165 * Returns the z offset. 166 */ public 167 double z() { 168 return libsbmlJNI.Point_z(swigCPtr, this); 169 } 170 171 172/** 173 * Returns the x offset. 174 */ public 175 double getXOffset() { 176 return libsbmlJNI.Point_getXOffset(swigCPtr, this); 177 } 178 179 180/** 181 * Returns the y offset. 182 */ public 183 double getYOffset() { 184 return libsbmlJNI.Point_getYOffset(swigCPtr, this); 185 } 186 187 188/** 189 * Returns the z offset. 190 */ public 191 double getZOffset() { 192 return libsbmlJNI.Point_getZOffset(swigCPtr, this); 193 } 194 195 196/** 197 * Sets the x offset. 198 */ public 199 void setX(double x) { 200 libsbmlJNI.Point_setX(swigCPtr, this, x); 201 } 202 203 204/** 205 * Sets the y offset. 206 */ public 207 void setY(double y) { 208 libsbmlJNI.Point_setY(swigCPtr, this, y); 209 } 210 211 212/** 213 * Sets the z offset. 214 */ public 215 void setZ(double z) { 216 libsbmlJNI.Point_setZ(swigCPtr, this, z); 217 } 218 219 220/** 221 * Sets the x offset. 222 */ public 223 void setXOffset(double x) { 224 libsbmlJNI.Point_setXOffset(swigCPtr, this, x); 225 } 226 227 228/** 229 * Sets the y offset. 230 */ public 231 void setYOffset(double y) { 232 libsbmlJNI.Point_setYOffset(swigCPtr, this, y); 233 } 234 235 236/** 237 * Sets the z offset. 238 */ public 239 void setZOffset(double z) { 240 libsbmlJNI.Point_setZOffset(swigCPtr, this, z); 241 } 242 243 244/** 245 * Sets the coordinates to the given values. 246 */ public 247 void setOffsets(double x, double y, double z) { 248 libsbmlJNI.Point_setOffsets__SWIG_0(swigCPtr, this, x, y, z); 249 } 250 251 252/** 253 * Sets the coordinates to the given values. 254 */ public 255 void setOffsets(double x, double y) { 256 libsbmlJNI.Point_setOffsets__SWIG_1(swigCPtr, this, x, y); 257 } 258 259 260/** */ public 261 boolean getZOffsetExplicitlySet() { 262 return libsbmlJNI.Point_getZOffsetExplicitlySet(swigCPtr, this); 263 } 264 265 266/** 267 * Sets the Z offset to 0.0. 268 */ public 269 void initDefaults() { 270 libsbmlJNI.Point_initDefaults(swigCPtr, this); 271 } 272 273 274/** 275 * Returns the value of the 'id' attribute of this {@link Point}. 276 */ public 277 String getId() { 278 return libsbmlJNI.Point_getId(swigCPtr, this); 279 } 280 281 282/** 283 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 284 * {@link Point}'s 'id' attribute has been set. 285 */ public 286 boolean isSetId() { 287 return libsbmlJNI.Point_isSetId(swigCPtr, this); 288 } 289 290 291/** 292 * Sets the value of the 'id' attribute of this {@link Point}. 293 */ public 294 int setId(String id) { 295 return libsbmlJNI.Point_setId(swigCPtr, this, id); 296 } 297 298 299/** 300 * Unsets the value of the 'id' attribute of this {@link Point}. 301 */ public 302 int unsetId() { 303 return libsbmlJNI.Point_unsetId(swigCPtr, this); 304 } 305 306 307/** 308 * Sets the element name to be returned by getElementName. 309 */ public 310 void setElementName(String name) { 311 libsbmlJNI.Point_setElementName(swigCPtr, this, name); 312 } 313 314 315/** 316 * Returns the XML element name of 317 * this SBML object. 318 */ public 319 String getElementName() { 320 return libsbmlJNI.Point_getElementName(swigCPtr, this); 321 } 322 323 324/** 325 * Creates and returns a deep copy of this {@link Point}. 326 <p> 327 * @return a (deep) copy of this {@link Point}. 328 */ public 329 Point cloneObject() { 330 long cPtr = libsbmlJNI.Point_cloneObject(swigCPtr, this); 331 return (cPtr == 0) ? null : new Point(cPtr, true); 332 } 333 334 335/** 336 * Returns the libSBML type code of this object instance. 337 <p> 338 * <p> 339 * LibSBML attaches an identifying code to every kind of SBML object. These 340 * are integer constants known as <em>SBML type codes</em>. The names of all 341 * the codes begin with the characters “<code>SBML_</code>”. 342 * In the Java language interface for libSBML, the 343 * type codes are defined as static integer constants in the interface class 344 * {@link libsbmlConstants}. Note that different Level 3 345 * package plug-ins may use overlapping type codes; to identify the package 346 * to which a given object belongs, call the <code>getPackageName()</code> 347 * method on the object. 348 <p> 349 * @return the SBML type code for this object: 350 * {@link libsbmlConstants#SBML_LAYOUT_POINT SBML_LAYOUT_POINT} 351 <p> 352 * <p> 353 * @warning <span class='warning'>The specific integer values of the possible 354 * type codes may be reused by different Level 3 package plug-ins. 355 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 356 * both getTypeCode() and getPackageName()</strong>.</span> 357 <p> 358 * @see #getElementName() 359 * @see #getPackageName() 360 */ public 361 int getTypeCode() { 362 return libsbmlJNI.Point_getTypeCode(swigCPtr, this); 363 } 364 365 366/** 367 * Creates an {@link XMLNode} object from this. 368 */ public 369 XMLNode toXML(String name) { 370 return new XMLNode(libsbmlJNI.Point_toXML(swigCPtr, this, name), true); 371 } 372 373}