001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.7 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 * implementation of the {@link GlobalStyle} concept of the SBML render extension. 013 <p> 014 * Global styles are the style information objects used in {@link GlobalRenderInformation} ( 015 * Since {@link GlobalStyle} is derived from Styles, it inherits all of the methods and attributes from {@link Style}. (@see Style) 016 <p> 017 * @see GlobalRenderInformation). 018 * Global styles can be associated with layout objects by role and type, but not by id, otherwise global 019 * styles and local styles are equivalent. 020 */ 021 022public class GlobalStyle extends Style { 023 private long swigCPtr; 024 025 protected GlobalStyle(long cPtr, boolean cMemoryOwn) 026 { 027 super(libsbmlJNI.GlobalStyle_SWIGUpcast(cPtr), cMemoryOwn); 028 swigCPtr = cPtr; 029 } 030 031 protected static long getCPtr(GlobalStyle obj) 032 { 033 return (obj == null) ? 0 : obj.swigCPtr; 034 } 035 036 protected static long getCPtrAndDisown (GlobalStyle obj) 037 { 038 long ptr = 0; 039 040 if (obj != null) 041 { 042 ptr = obj.swigCPtr; 043 obj.swigCMemOwn = false; 044 } 045 046 return ptr; 047 } 048 049 protected void finalize() { 050 delete(); 051 } 052 053 public synchronized void delete() { 054 if (swigCPtr != 0) { 055 if (swigCMemOwn) { 056 swigCMemOwn = false; 057 libsbmlJNI.delete_GlobalStyle(swigCPtr); 058 } 059 swigCPtr = 0; 060 } 061 super.delete(); 062 } 063 064 065/** 066 * Creates a new {@link GlobalStyle} object with the given SBML level 067 * and SBML version. 068 <p> 069 * @param level SBML level of the new object 070 * @param level SBML version of the new object 071 */ public 072 GlobalStyle(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 073 this(libsbmlJNI.new_GlobalStyle__SWIG_0(level, version, pkgVersion), true); 074 } 075 076 077/** 078 * Creates a new {@link GlobalStyle} object with the given SBML level 079 * and SBML version. 080 <p> 081 * @param level SBML level of the new object 082 * @param level SBML version of the new object 083 */ public 084 GlobalStyle(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 085 this(libsbmlJNI.new_GlobalStyle__SWIG_1(level, version), true); 086 } 087 088 089/** 090 * Creates a new {@link GlobalStyle} object with the given SBML level 091 * and SBML version. 092 <p> 093 * @param level SBML level of the new object 094 * @param level SBML version of the new object 095 */ public 096 GlobalStyle(long level) throws org.sbml.libsbml.SBMLConstructorException { 097 this(libsbmlJNI.new_GlobalStyle__SWIG_2(level), true); 098 } 099 100 101/** 102 * Creates a new {@link GlobalStyle} object with the given SBML level 103 * and SBML version. 104 <p> 105 * @param level SBML level of the new object 106 * @param level SBML version of the new object 107 */ public 108 GlobalStyle() throws org.sbml.libsbml.SBMLConstructorException { 109 this(libsbmlJNI.new_GlobalStyle__SWIG_3(), true); 110 } 111 112 113/** 114 * Creates a new {@link GlobalStyle} object with the given {@link SBMLNamespaces}. 115 <p> 116 * @param sbmlns The SBML namespace for the object. 117 */ public 118 GlobalStyle(RenderPkgNamespaces renderns) throws org.sbml.libsbml.SBMLConstructorException { 119 this(libsbmlJNI.new_GlobalStyle__SWIG_4(RenderPkgNamespaces.getCPtr(renderns), renderns), true); 120 } 121 122 123/** 124 * Creates a new {@link GlobalStyle} object from the given {@link XMLNode} object. 125 * The {@link XMLNode} object has to contain a valid XML representation of a 126 * {@link GlobalStyle} object as defined in the render extension specification. 127 * This method is normally called when render information is read from a file and 128 * should normally not have to be called explicitly. 129 <p> 130 * @param node the {@link XMLNode} object reference that describes the {@link GlobalStyle} 131 * object to be instantiated. 132 */ public 133 GlobalStyle(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 134 this(libsbmlJNI.new_GlobalStyle__SWIG_5(XMLNode.getCPtr(node), node, l2version), true); 135 } 136 137 138/** 139 * Creates a new {@link GlobalStyle} object from the given {@link XMLNode} object. 140 * The {@link XMLNode} object has to contain a valid XML representation of a 141 * {@link GlobalStyle} object as defined in the render extension specification. 142 * This method is normally called when render information is read from a file and 143 * should normally not have to be called explicitly. 144 <p> 145 * @param node the {@link XMLNode} object reference that describes the {@link GlobalStyle} 146 * object to be instantiated. 147 */ public 148 GlobalStyle(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 149 this(libsbmlJNI.new_GlobalStyle__SWIG_6(XMLNode.getCPtr(node), node), true); 150 } 151 152 153/** 154 * Constructor which creates a {@link GlobalStyle} with the given <code>id</code> 155 * and all lists empty. 156 <p> 157 * @param id the new id for the {@link GlobalStyle}. 158 <p> 159 * This constructor is deprecated. The new libsbml API only has 160 * constructors which take the SBML level and version or one that takes 161 * an {@link SBMLNamespaces} object. 162 */ public 163 GlobalStyle(RenderPkgNamespaces renderns, String id) throws org.sbml.libsbml.SBMLConstructorException { 164 this(libsbmlJNI.new_GlobalStyle__SWIG_7(RenderPkgNamespaces.getCPtr(renderns), renderns, id), true); 165 } 166 167 168/** 169 * Returns the libSBML type code for this SBML object. 170 <p> 171 * LibSBML attaches an 172 * identifying code to every kind of SBML object. These are known as 173 * <em>SBML type codes</em>. In other languages, the set of type codes 174 * is stored in an enumeration; in the Java language interface for 175 * libSBML, the type codes are defined as static integer constants in 176 * interface class {@link libsbmlConstants}. The names of the type codes 177 * all begin with the characters <code>SBML_.</code> 178 <p> 179 * @return the SBML type code for this object, or <code>SBML_UNKNOWN</code> (default). 180 <p> 181 * This method is purely abstract and has to be implemented by derived 182 * classes. 183 <p> 184 * @see #getElementName() 185 */ public 186 int getTypeCode() { 187 return libsbmlJNI.GlobalStyle_getTypeCode(swigCPtr, this); 188 } 189 190 191/** 192 * Returns the XML element name of this object, which for 193 * {@link GlobalStyle}, is always <code>'renderInformation'.</code> 194 <p> 195 * @return the name of this element, i.e., <code>'renderInformation'.</code> 196 */ public 197 String getElementName() { 198 return libsbmlJNI.GlobalStyle_getElementName(swigCPtr, this); 199 } 200 201 202/** 203 * Creates and returns a deep copy of this {@link GlobalStyle} object. 204 <p> 205 * @return a (deep) copy of this {@link GlobalStyle}. 206 */ public 207 GlobalStyle cloneObject() { 208 long cPtr = libsbmlJNI.GlobalStyle_cloneObject(swigCPtr, this); 209 return (cPtr == 0) ? null : new GlobalStyle(cPtr, true); 210 } 211 212}