| 1 | /* |
|---|
| 2 | * Copyright 2007-2008, Plutext Pty Ltd. |
|---|
| 3 | * |
|---|
| 4 | * This file is part of docx4j. |
|---|
| 5 | |
|---|
| 6 | docx4j is licensed under the Apache License, Version 2.0 (the "License"); |
|---|
| 7 | you may not use this file except in compliance with the License. |
|---|
| 8 | |
|---|
| 9 | You may obtain a copy of the License at |
|---|
| 10 | |
|---|
| 11 | http://www.apache.org/licenses/LICENSE-2.0 |
|---|
| 12 | |
|---|
| 13 | Unless required by applicable law or agreed to in writing, software |
|---|
| 14 | distributed under the License is distributed on an "AS IS" BASIS, |
|---|
| 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|---|
| 16 | See the License for the specific language governing permissions and |
|---|
| 17 | limitations under the License. |
|---|
| 18 | |
|---|
| 19 | */ |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | package org.docx4j.dml; |
|---|
| 23 | |
|---|
| 24 | import org.jvnet.jaxb2_commons.ppp.Child; |
|---|
| 25 | |
|---|
| 26 | import java.util.ArrayList; |
|---|
| 27 | import java.util.List; |
|---|
| 28 | import javax.xml.bind.Unmarshaller; |
|---|
| 29 | import javax.xml.bind.annotation.*; |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | /** |
|---|
| 33 | * <p>Java class for CT_Blip complex type. |
|---|
| 34 | * |
|---|
| 35 | * <p>The following schema fragment specifies the expected content contained within this class. |
|---|
| 36 | * |
|---|
| 37 | * <pre> |
|---|
| 38 | * <complexType name="CT_Blip"> |
|---|
| 39 | * <complexContent> |
|---|
| 40 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
|---|
| 41 | * <sequence> |
|---|
| 42 | * <choice maxOccurs="unbounded" minOccurs="0"> |
|---|
| 43 | * <element name="alphaBiLevel" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AlphaBiLevelEffect"/> |
|---|
| 44 | * <element name="alphaCeiling" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AlphaCeilingEffect"/> |
|---|
| 45 | * <element name="alphaFloor" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AlphaFloorEffect"/> |
|---|
| 46 | * <element name="alphaInv" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AlphaInverseEffect"/> |
|---|
| 47 | * <element name="alphaMod" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AlphaModulateEffect"/> |
|---|
| 48 | * <element name="alphaModFix" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AlphaModulateFixedEffect"/> |
|---|
| 49 | * <element name="alphaRepl" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AlphaReplaceEffect"/> |
|---|
| 50 | * <element name="biLevel" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_BiLevelEffect"/> |
|---|
| 51 | * <element name="blur" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_BlurEffect"/> |
|---|
| 52 | * <element name="clrChange" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_ColorChangeEffect"/> |
|---|
| 53 | * <element name="clrRepl" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_ColorReplaceEffect"/> |
|---|
| 54 | * <element name="duotone" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_DuotoneEffect"/> |
|---|
| 55 | * <element name="fillOverlay" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_FillOverlayEffect"/> |
|---|
| 56 | * <element name="grayscl" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_GrayscaleEffect"/> |
|---|
| 57 | * <element name="hsl" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_HSLEffect"/> |
|---|
| 58 | * <element name="lum" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_LuminanceEffect"/> |
|---|
| 59 | * <element name="tint" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_TintEffect"/> |
|---|
| 60 | * </choice> |
|---|
| 61 | * <element name="extLst" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_OfficeArtExtensionList" minOccurs="0"/> |
|---|
| 62 | * </sequence> |
|---|
| 63 | * <attGroup ref="{http://schemas.openxmlformats.org/drawingml/2006/main}AG_Blob"/> |
|---|
| 64 | * <attribute name="cstate" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_BlipCompression" default="none" /> |
|---|
| 65 | * </restriction> |
|---|
| 66 | * </complexContent> |
|---|
| 67 | * </complexType> |
|---|
| 68 | * </pre> |
|---|
| 69 | * |
|---|
| 70 | * |
|---|
| 71 | */ |
|---|
| 72 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 73 | @XmlType(name = "CT_Blip", propOrder = { |
|---|
| 74 | "alphaBiLevelOrAlphaCeilingOrAlphaFloor", |
|---|
| 75 | "extLst" |
|---|
| 76 | }) |
|---|
| 77 | public class CTBlip implements Child { |
|---|
| 78 | |
|---|
| 79 | @XmlElements({ |
|---|
| 80 | @XmlElement(name = "fillOverlay", type = CTFillOverlayEffect.class), |
|---|
| 81 | @XmlElement(name = "blur", type = CTBlurEffect.class), |
|---|
| 82 | @XmlElement(name = "alphaModFix", type = CTAlphaModulateFixedEffect.class), |
|---|
| 83 | @XmlElement(name = "tint", type = CTTintEffect.class), |
|---|
| 84 | @XmlElement(name = "alphaInv", type = CTAlphaInverseEffect.class), |
|---|
| 85 | @XmlElement(name = "hsl", type = CTHSLEffect.class), |
|---|
| 86 | @XmlElement(name = "biLevel", type = CTBiLevelEffect.class), |
|---|
| 87 | @XmlElement(name = "alphaCeiling", type = CTAlphaCeilingEffect.class), |
|---|
| 88 | @XmlElement(name = "alphaBiLevel", type = CTAlphaBiLevelEffect.class), |
|---|
| 89 | @XmlElement(name = "alphaFloor", type = CTAlphaFloorEffect.class), |
|---|
| 90 | @XmlElement(name = "alphaRepl", type = CTAlphaReplaceEffect.class), |
|---|
| 91 | @XmlElement(name = "duotone", type = CTDuotoneEffect.class), |
|---|
| 92 | @XmlElement(name = "clrRepl", type = CTColorReplaceEffect.class), |
|---|
| 93 | @XmlElement(name = "lum", type = CTLuminanceEffect.class), |
|---|
| 94 | @XmlElement(name = "clrChange", type = CTColorChangeEffect.class), |
|---|
| 95 | @XmlElement(name = "grayscl", type = CTGrayscaleEffect.class), |
|---|
| 96 | @XmlElement(name = "alphaMod", type = CTAlphaModulateEffect.class) |
|---|
| 97 | }) |
|---|
| 98 | protected List<Object> alphaBiLevelOrAlphaCeilingOrAlphaFloor; |
|---|
| 99 | protected CTOfficeArtExtensionList extLst; |
|---|
| 100 | @XmlAttribute |
|---|
| 101 | protected STBlipCompression cstate; |
|---|
| 102 | @XmlAttribute(namespace = "http://schemas.openxmlformats.org/officeDocument/2006/relationships") |
|---|
| 103 | protected String embed; |
|---|
| 104 | @XmlAttribute(namespace = "http://schemas.openxmlformats.org/officeDocument/2006/relationships") |
|---|
| 105 | protected String link; |
|---|
| 106 | @XmlTransient |
|---|
| 107 | private Object parent; |
|---|
| 108 | |
|---|
| 109 | /** |
|---|
| 110 | * Gets the value of the alphaBiLevelOrAlphaCeilingOrAlphaFloor property. |
|---|
| 111 | * |
|---|
| 112 | * <p> |
|---|
| 113 | * This accessor method returns a reference to the live list, |
|---|
| 114 | * not a snapshot. Therefore any modification you make to the |
|---|
| 115 | * returned list will be present inside the JAXB object. |
|---|
| 116 | * This is why there is not a <CODE>set</CODE> method for the alphaBiLevelOrAlphaCeilingOrAlphaFloor property. |
|---|
| 117 | * |
|---|
| 118 | * <p> |
|---|
| 119 | * For example, to add a new item, do as follows: |
|---|
| 120 | * <pre> |
|---|
| 121 | * getAlphaBiLevelOrAlphaCeilingOrAlphaFloor().add(newItem); |
|---|
| 122 | * </pre> |
|---|
| 123 | * |
|---|
| 124 | * |
|---|
| 125 | * <p> |
|---|
| 126 | * Objects of the following type(s) are allowed in the list |
|---|
| 127 | * {@link CTFillOverlayEffect } |
|---|
| 128 | * {@link CTBlurEffect } |
|---|
| 129 | * {@link CTAlphaModulateFixedEffect } |
|---|
| 130 | * {@link CTTintEffect } |
|---|
| 131 | * {@link CTAlphaInverseEffect } |
|---|
| 132 | * {@link CTHSLEffect } |
|---|
| 133 | * {@link CTBiLevelEffect } |
|---|
| 134 | * {@link CTAlphaCeilingEffect } |
|---|
| 135 | * {@link CTAlphaBiLevelEffect } |
|---|
| 136 | * {@link CTAlphaFloorEffect } |
|---|
| 137 | * {@link CTAlphaReplaceEffect } |
|---|
| 138 | * {@link CTDuotoneEffect } |
|---|
| 139 | * {@link CTColorReplaceEffect } |
|---|
| 140 | * {@link CTLuminanceEffect } |
|---|
| 141 | * {@link CTColorChangeEffect } |
|---|
| 142 | * {@link CTGrayscaleEffect } |
|---|
| 143 | * {@link CTAlphaModulateEffect } |
|---|
| 144 | * |
|---|
| 145 | * |
|---|
| 146 | */ |
|---|
| 147 | public List<Object> getAlphaBiLevelOrAlphaCeilingOrAlphaFloor() { |
|---|
| 148 | if (alphaBiLevelOrAlphaCeilingOrAlphaFloor == null) { |
|---|
| 149 | alphaBiLevelOrAlphaCeilingOrAlphaFloor = new ArrayList<Object>(); |
|---|
| 150 | } |
|---|
| 151 | return this.alphaBiLevelOrAlphaCeilingOrAlphaFloor; |
|---|
| 152 | } |
|---|
| 153 | |
|---|
| 154 | /** |
|---|
| 155 | * Gets the value of the extLst property. |
|---|
| 156 | * |
|---|
| 157 | * @return |
|---|
| 158 | * possible object is |
|---|
| 159 | * {@link CTOfficeArtExtensionList } |
|---|
| 160 | * |
|---|
| 161 | */ |
|---|
| 162 | public CTOfficeArtExtensionList getExtLst() { |
|---|
| 163 | return extLst; |
|---|
| 164 | } |
|---|
| 165 | |
|---|
| 166 | /** |
|---|
| 167 | * Sets the value of the extLst property. |
|---|
| 168 | * |
|---|
| 169 | * @param value |
|---|
| 170 | * allowed object is |
|---|
| 171 | * {@link CTOfficeArtExtensionList } |
|---|
| 172 | * |
|---|
| 173 | */ |
|---|
| 174 | public void setExtLst(CTOfficeArtExtensionList value) { |
|---|
| 175 | this.extLst = value; |
|---|
| 176 | } |
|---|
| 177 | |
|---|
| 178 | /** |
|---|
| 179 | * Gets the value of the cstate property. |
|---|
| 180 | * |
|---|
| 181 | * @return |
|---|
| 182 | * possible object is |
|---|
| 183 | * {@link STBlipCompression } |
|---|
| 184 | * |
|---|
| 185 | */ |
|---|
| 186 | public STBlipCompression getCstate() { |
|---|
| 187 | if (cstate == null) { |
|---|
| 188 | return STBlipCompression.NONE; |
|---|
| 189 | } else { |
|---|
| 190 | return cstate; |
|---|
| 191 | } |
|---|
| 192 | } |
|---|
| 193 | |
|---|
| 194 | /** |
|---|
| 195 | * Sets the value of the cstate property. |
|---|
| 196 | * |
|---|
| 197 | * @param value |
|---|
| 198 | * allowed object is |
|---|
| 199 | * {@link STBlipCompression } |
|---|
| 200 | * |
|---|
| 201 | */ |
|---|
| 202 | public void setCstate(STBlipCompression value) { |
|---|
| 203 | this.cstate = value; |
|---|
| 204 | } |
|---|
| 205 | |
|---|
| 206 | /** |
|---|
| 207 | * Embedded Picture Reference |
|---|
| 208 | * |
|---|
| 209 | * @return |
|---|
| 210 | * possible object is |
|---|
| 211 | * {@link String } |
|---|
| 212 | * |
|---|
| 213 | */ |
|---|
| 214 | public String getEmbed() { |
|---|
| 215 | if (embed == null) { |
|---|
| 216 | return ""; |
|---|
| 217 | } else { |
|---|
| 218 | return embed; |
|---|
| 219 | } |
|---|
| 220 | } |
|---|
| 221 | |
|---|
| 222 | /** |
|---|
| 223 | * Sets the value of the embed property. |
|---|
| 224 | * |
|---|
| 225 | * @param value |
|---|
| 226 | * allowed object is |
|---|
| 227 | * {@link String } |
|---|
| 228 | * |
|---|
| 229 | */ |
|---|
| 230 | public void setEmbed(String value) { |
|---|
| 231 | this.embed = value; |
|---|
| 232 | } |
|---|
| 233 | |
|---|
| 234 | /** |
|---|
| 235 | * Linked Picture Reference |
|---|
| 236 | * |
|---|
| 237 | * @return |
|---|
| 238 | * possible object is |
|---|
| 239 | * {@link String } |
|---|
| 240 | * |
|---|
| 241 | */ |
|---|
| 242 | public String getLink() { |
|---|
| 243 | if (link == null) { |
|---|
| 244 | return ""; |
|---|
| 245 | } else { |
|---|
| 246 | return link; |
|---|
| 247 | } |
|---|
| 248 | } |
|---|
| 249 | |
|---|
| 250 | /** |
|---|
| 251 | * Sets the value of the link property. |
|---|
| 252 | * |
|---|
| 253 | * @param value |
|---|
| 254 | * allowed object is |
|---|
| 255 | * {@link String } |
|---|
| 256 | * |
|---|
| 257 | */ |
|---|
| 258 | public void setLink(String value) { |
|---|
| 259 | this.link = value; |
|---|
| 260 | } |
|---|
| 261 | /** |
|---|
| 262 | * Gets the parent object in the object tree representing the unmarshalled xml document. |
|---|
| 263 | * |
|---|
| 264 | * @return |
|---|
| 265 | * The parent object. |
|---|
| 266 | */ |
|---|
| 267 | public Object getParent() { |
|---|
| 268 | return this.parent; |
|---|
| 269 | } |
|---|
| 270 | |
|---|
| 271 | public void setParent(Object parent) { |
|---|
| 272 | this.parent = parent; |
|---|
| 273 | } |
|---|
| 274 | |
|---|
| 275 | /** |
|---|
| 276 | * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. |
|---|
| 277 | * |
|---|
| 278 | * @param parent |
|---|
| 279 | * The parent object in the object tree. |
|---|
| 280 | * @param unmarshaller |
|---|
| 281 | * The unmarshaller that generated the instance. |
|---|
| 282 | */ |
|---|
| 283 | public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { |
|---|
| 284 | setParent(parent); |
|---|
| 285 | } |
|---|
| 286 | } |
|---|