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 * base class for all graphical primitives which implements all 2D attributes 013 <p> 014 * The {@link GraphicalPrimitive2D} class implements attributes and methods necessary for 2D objects 015 * like rectangles, polygons or ellipses. The attributes that are implemented are a fill color 016 * and a fill rule that specifies how the fill color is applied. 017 <p> 018 * The {@link GraphicalPrimitive2D} class is derived from {@link GraphicalPrimitive1D} and inherits all its methods 019 * and attributes. 020 */ 021 022public class GraphicalPrimitive2D extends GraphicalPrimitive1D { 023 private long swigCPtr; 024 025 protected GraphicalPrimitive2D(long cPtr, boolean cMemoryOwn) 026 { 027 super(libsbmlJNI.GraphicalPrimitive2D_SWIGUpcast(cPtr), cMemoryOwn); 028 swigCPtr = cPtr; 029 } 030 031 protected static long getCPtr(GraphicalPrimitive2D obj) 032 { 033 return (obj == null) ? 0 : obj.swigCPtr; 034 } 035 036 protected static long getCPtrAndDisown (GraphicalPrimitive2D 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_GraphicalPrimitive2D(swigCPtr); 058 } 059 swigCPtr = 0; 060 } 061 super.delete(); 062 } 063 064 065/** 066 * Set fill color to the id of a color definition, the id of a gradient 067 * definition or a color value string. 068 <p> 069 * @param color the id of a color deifnition or a gradient or a color value string. 070 */ public 071 void setFillColor(String color) { 072 libsbmlJNI.GraphicalPrimitive2D_setFillColor(swigCPtr, this, color); 073 } 074 075 076/** 077 * Sets the fill rule. Possible values are GraphicalPrimitive2D.NONZERO, 078 * GraphicalPrimitive2D.EVENODD, GraphicalPrimitive.INHERIT or 079 * GraphicalPrimitive2D.UNSET. 080 <p> 081 * If the fill rule for an object is unset, it default to INHERIT, 082 * which means that it inherits the attribute from it's parent group. 083 * The topmost group in an object hierarchy has a default value for this 084 * attribute which is GraphicalPrimitive2D.NONZERO. 085 <p> 086 * For more details please consult the render extension specification. 087 <p> 088 * @param rule the fill rule to be set. 089 */ public 090 void setFillRule(int rule) { 091 libsbmlJNI.GraphicalPrimitive2D_setFillRule(swigCPtr, this, rule); 092 } 093 094 095/** 096 * Returns the fill color. 097 <p> 098 * @return this id of the fill color or the fill gradient or the fill color value string. 099 */ public 100 String getFillColor() { 101 return libsbmlJNI.GraphicalPrimitive2D_getFillColor(swigCPtr, this); 102 } 103 104 105/** 106 * Returns the fill rule. 107 <p> 108 * @return this fill rule enum 109 */ public 110 int getFillRule() { 111 return libsbmlJNI.GraphicalPrimitive2D_getFillRule(swigCPtr, this); 112 } 113 114 115/** 116 * Returns true if the fill attribute is set or false otherwise. 117 * The fill attribute is considered set if the string is not empty. 118 <p> 119 * This function is deprecated, please use isSetFillColor instead. 120 <p> 121 * @return true is the fill color is set. 122 */ public 123 boolean isSetFill() { 124 return libsbmlJNI.GraphicalPrimitive2D_isSetFill(swigCPtr, this); 125 } 126 127 128/** 129 * Returns true if the fill attribute is set or false otherwise. 130 * The fill attribute is considered set if the string is not empty. 131 <p> 132 * @return true is the fill color is set. 133 */ public 134 boolean isSetFillColor() { 135 return libsbmlJNI.GraphicalPrimitive2D_isSetFillColor(swigCPtr, this); 136 } 137 138 139/** 140 * Returns true if the fill rule attribute is set or false otherwise. 141 * The fill rule is considered as set if it is not GraphicalPrimitive2D.UNSET. 142 <p> 143 * @return true is the fill color is set. 144 */ public 145 boolean isSetFillRule() { 146 return libsbmlJNI.GraphicalPrimitive2D_isSetFillRule(swigCPtr, this); 147 } 148 149 // FILL_RULE 150 public final static int UNSET = 0; 151 public final static int NONZERO = UNSET + 1; 152 public final static int EVENODD = NONZERO + 1; 153 public final static int INHERIT = EVENODD + 1; 154 155}