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 LineSegment extends SBase { 012 private long swigCPtr; 013 014 protected LineSegment(long cPtr, boolean cMemoryOwn) 015 { 016 super(libsbmlJNI.LineSegment_SWIGUpcast(cPtr), cMemoryOwn); 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(LineSegment obj) 021 { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected static long getCPtrAndDisown (LineSegment 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_LineSegment(swigCPtr); 047 } 048 swigCPtr = 0; 049 } 050 super.delete(); 051 } 052 053 public LineSegment(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 054 this(libsbmlJNI.new_LineSegment__SWIG_0(level, version, pkgVersion), true); 055 } 056 057 public LineSegment(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 058 this(libsbmlJNI.new_LineSegment__SWIG_1(level, version), true); 059 } 060 061 public LineSegment(long level) throws org.sbml.libsbml.SBMLConstructorException { 062 this(libsbmlJNI.new_LineSegment__SWIG_2(level), true); 063 } 064 065 public LineSegment() throws org.sbml.libsbml.SBMLConstructorException { 066 this(libsbmlJNI.new_LineSegment__SWIG_3(), true); 067 } 068 069 public LineSegment(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 070 this(libsbmlJNI.new_LineSegment__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 071 } 072 073 public LineSegment(LayoutPkgNamespaces layoutns, double x1, double y1, double x2, double y2) throws org.sbml.libsbml.SBMLConstructorException { 074 this(libsbmlJNI.new_LineSegment__SWIG_5(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, x1, y1, x2, y2), true); 075 } 076 077 public LineSegment(LineSegment orig) throws org.sbml.libsbml.SBMLConstructorException { 078 this(libsbmlJNI.new_LineSegment__SWIG_6(LineSegment.getCPtr(orig), orig), true); 079 } 080 081 public LineSegment(LayoutPkgNamespaces layoutns, double x1, double y1, double z1, double x2, double y2, double z2) throws org.sbml.libsbml.SBMLConstructorException { 082 this(libsbmlJNI.new_LineSegment__SWIG_7(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, x1, y1, z1, x2, y2, z2), true); 083 } 084 085 public LineSegment(LayoutPkgNamespaces layoutns, Point start, Point end) throws org.sbml.libsbml.SBMLConstructorException { 086 this(libsbmlJNI.new_LineSegment__SWIG_8(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, Point.getCPtr(start), start, Point.getCPtr(end), end), true); 087 } 088 089 public LineSegment(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 090 this(libsbmlJNI.new_LineSegment__SWIG_9(XMLNode.getCPtr(node), node, l2version), true); 091 } 092 093 public LineSegment(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 094 this(libsbmlJNI.new_LineSegment__SWIG_10(XMLNode.getCPtr(node), node), true); 095 } 096 097 public Point getStart() { 098 long cPtr = libsbmlJNI.LineSegment_getStart(swigCPtr, this); 099 return (cPtr == 0) ? null : new Point(cPtr, false); 100 } 101 102 public void setStart(Point start) { 103 libsbmlJNI.LineSegment_setStart__SWIG_0(swigCPtr, this, Point.getCPtr(start), start); 104 } 105 106 public void setStart(double x, double y, double z) { 107 libsbmlJNI.LineSegment_setStart__SWIG_1(swigCPtr, this, x, y, z); 108 } 109 110 public void setStart(double x, double y) { 111 libsbmlJNI.LineSegment_setStart__SWIG_2(swigCPtr, this, x, y); 112 } 113 114 public Point getEnd() { 115 long cPtr = libsbmlJNI.LineSegment_getEnd(swigCPtr, this); 116 return (cPtr == 0) ? null : new Point(cPtr, false); 117 } 118 119 public void setEnd(Point end) { 120 libsbmlJNI.LineSegment_setEnd__SWIG_0(swigCPtr, this, Point.getCPtr(end), end); 121 } 122 123 public void setEnd(double x, double y, double z) { 124 libsbmlJNI.LineSegment_setEnd__SWIG_1(swigCPtr, this, x, y, z); 125 } 126 127 public void setEnd(double x, double y) { 128 libsbmlJNI.LineSegment_setEnd__SWIG_2(swigCPtr, this, x, y); 129 } 130 131 public void initDefaults() { 132 libsbmlJNI.LineSegment_initDefaults(swigCPtr, this); 133 } 134 135 136/** 137 * Returns the XML element name of this object. 138 * <p> 139 * This is overridden by subclasses to return a string appropriate to the 140 * SBML component. For example, {@link Model} defines it as returning 141 * <code>'model'</code>, {@link CompartmentType} defines it as returning <code>'compartmentType'</code>, 142 * and so on. 143 */ public 144 String getElementName() { 145 return libsbmlJNI.LineSegment_getElementName(swigCPtr, this); 146 } 147 148 149/** 150 * Creates and returns a deep copy of this {@link SBase} object. 151 * <p> 152 * @return a (deep) copy of this {@link SBase} object. 153 */ public 154 LineSegment cloneObject() { 155 return (LineSegment) libsbml.DowncastSBase(libsbmlJNI.LineSegment_cloneObject(swigCPtr, this), true); 156} 157 158 159/** 160 * Returns the libSBML type code for this object. 161 * <p> 162 * This method may return the type code of this SBML object, or it may 163 * return {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN}. This 164 * is because subclasses of {@link SBase} are not required to implement this 165 * method to return a type code. This method is meant primarily for the 166 * LibSBML C interface, in which class and subclass information is not 167 * readily available. 168 * <p> 169 * @return the SBML object type code 170 * of this SBML object or 171 * {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (the default). 172 * <p> 173 * @see #getElementName() 174 * @see #getPackageName() 175 */ public 176 int getTypeCode() { 177 return libsbmlJNI.LineSegment_getTypeCode(swigCPtr, this); 178 } 179 180 public XMLNode toXML() { 181 return new XMLNode(libsbmlJNI.LineSegment_toXML(swigCPtr, this), true); 182 } 183 184 185/** 186 * Sets this SBML object to child SBML objects (if any). 187 * (Creates a child-parent relationship by the parent) 188 * <p> 189 * Subclasses must override this function if they define 190 * one ore more child elements. 191 * Basically, this function needs to be called in 192 * constructor, copy constructor, assignment operator. 193 * <p> 194 * <p> 195 * @internal 196 */ public 197 void connectToChild() { 198 libsbmlJNI.LineSegment_connectToChild(swigCPtr, this); 199 } 200 201 202/** 203 * Enables/Disables the given package with this element and child 204 * elements (if any). 205 * (This is an internal implementation for enablePackage function) 206 * <p> 207 * @note Subclasses in which one or more child elements are defined 208 * must override this function. 209 * <p> 210 * <p> 211 * @see #connectToChild() 212 * @internal 213 */ public 214 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 215 libsbmlJNI.LineSegment_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 216 } 217 218}