View Javadoc

1   /**********************************************
2    * Copyright (C) 2010 Lukas Laag
3    * This file is part of lib-gwt-svg.
4    * 
5    * libgwtsvg is free software: you can redistribute it and/or modify
6    * it under the terms of the GNU Lesser General Public License as published by
7    * the Free Software Foundation, either version 3 of the License, or
8    * (at your option) any later version.
9    * 
10   * libgwtsvg is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU Lesser General Public License for more details.
14   * 
15   * You should have received a copy of the GNU Lesser General Public License
16   * along with libgwtsvg.  If not, see http://www.gnu.org/licenses/
17   **********************************************/
18  /*
19   * Copyright (c) 2004 World Wide Web Consortium,
20   *
21   * (Massachusetts Institute of Technology, European Research Consortium for
22   * Informatics and Mathematics, Keio University). All Rights Reserved. This
23   * work is distributed under the W3C(r) Software License [1] in the hope that
24   * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
25   * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
26   *
27   * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
28   */
29  
30  package org.vectomatic.dom.svg;
31  
32  import com.google.gwt.core.client.JavaScriptException;
33  import com.google.gwt.core.client.JavaScriptObject;
34  
35  /**
36   * The {@link org.vectomatic.dom.svg.OMSVGPreserveAspectRatio} interface corresponds
37   * to the <code>preserveAspectRatio</code> attribute, which is available for
38   * some of SVG's elements. <p id="ReadOnlyPreserveAspectRatio">An {@link org.vectomatic.dom.svg.OMSVGPreserveAspectRatio}
39   * object can be designated as <em>read only</em>, which means that attempts
40   * to modify the object will result in an exception being thrown, as described
41   * below.</p>
42   */
43  public class OMSVGPreserveAspectRatio extends JavaScriptObject {
44  /**
45   * The enumeration was set to a value that is not one of predefined types.
46   * It is invalid to attempt to define a new value of this type or to attempt
47   * to switch an existing value to this type.
48   */
49    public static final short SVG_PRESERVEASPECTRATIO_UNKNOWN = 0;
50  /**
51   * Corresponds to value <span class='attr-value'>'none'</span> for attribute
52   * <code>preserveAspectRatio</code>.
53   */
54    public static final short SVG_PRESERVEASPECTRATIO_NONE = 1;
55  /**
56   * Corresponds to value <span class='attr-value'>'xMinYMin'</span> for attribute
57   * <code>preserveAspectRatio</code>.
58   */
59    public static final short SVG_PRESERVEASPECTRATIO_XMINYMIN = 2;
60  /**
61   * Corresponds to value <span class='attr-value'>'xMidYMin'</span> for attribute
62   * <code>preserveAspectRatio</code>.
63   */
64    public static final short SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3;
65  /**
66   * Corresponds to value <span class='attr-value'>'xMaxYMin'</span> for attribute
67   * <code>preserveAspectRatio</code>.
68   */
69    public static final short SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4;
70  /**
71   * Corresponds to value <span class='attr-value'>'XMinYMid'</span> for attribute
72   * <code>preserveAspectRatio</code>.
73   */
74    public static final short SVG_PRESERVEASPECTRATIO_XMINYMID = 5;
75  /**
76   * Corresponds to value <span class='attr-value'>'xMidYMid'</span> for attribute
77   * <code>preserveAspectRatio</code>.
78   */
79    public static final short SVG_PRESERVEASPECTRATIO_XMIDYMID = 6;
80  /**
81   * Corresponds to value <span class='attr-value'>'xMaxYMid'</span> for attribute
82   * <code>preserveAspectRatio</code>.
83   */
84    public static final short SVG_PRESERVEASPECTRATIO_XMAXYMID = 7;
85  /**
86   * Corresponds to value <span class='attr-value'>'xMinYMax'</span> for attribute
87   * <code>preserveAspectRatio</code>.
88   */
89    public static final short SVG_PRESERVEASPECTRATIO_XMINYMAX = 8;
90  /**
91   * Corresponds to value <span class='attr-value'>'xMidYMax'</span> for attribute
92   * <code>preserveAspectRatio</code>.
93   */
94    public static final short SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9;
95  /**
96   * Corresponds to value <span class='attr-value'>'xMaxYMax'</span> for attribute
97   * <code>preserveAspectRatio</code>.
98   */
99    public static final short SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10;
100 /**
101  * The enumeration was set to a value that is not one of predefined types.
102  * It is invalid to attempt to define a new value of this type or to attempt
103  * to switch an existing value to this type.
104  */
105   public static final short SVG_MEETORSLICE_UNKNOWN = 0;
106 /**
107  * Corresponds to value <span class='attr-value'>'meet'</span> for attribute
108  * <code>preserveAspectRatio</code>.
109  */
110   public static final short SVG_MEETORSLICE_MEET = 1;
111 /**
112  * Corresponds to value <span class='attr-value'>'slice'</span> for attribute
113  * <code>preserveAspectRatio</code>.
114  */
115   public static final short SVG_MEETORSLICE_SLICE = 2;
116   protected OMSVGPreserveAspectRatio() {
117   }
118 
119   // Implementation of the svg::SVGPreserveAspectRatio W3C IDL interface
120   /**
121    * The type of the alignment value as specified by one of the SVG_PRESERVEASPECTRATIO_
122    * constants defined on this interface.
123    */
124   public final native short getAlign() /*-{
125     return this.align;
126   }-*/;
127   /**
128    * The type of the alignment value as specified by one of the SVG_PRESERVEASPECTRATIO_
129    * constants defined on this interface.
130    * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) Raised when the object
131    * corresponds to a <a href="svgdom.html#ReadOnlyNodes">read only attribute</a>
132    * or when the object itself is   <a href="#ReadOnlyPreserveAspectRatio">read
133    * only</a>.
134    */
135   public final native void setAlign(short value) throws JavaScriptException /*-{
136     this.align = value;
137   }-*/;
138   /**
139    * The type of the meet-or-slice value as specified by one of the SVG_MEETORSLICE_
140    * constants defined on this interface.
141    */
142   public final native short getMeetOrSlice() /*-{
143     return this.meetOrSlice;
144   }-*/;
145   /**
146    * The type of the meet-or-slice value as specified by one of the SVG_MEETORSLICE_
147    * constants defined on this interface.
148    * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) Raised when the object
149    * corresponds to a <a href="svgdom.html#ReadOnlyNodes">read only attribute</a>
150    * or when the object itself is   <a href="#ReadOnlyPreserveAspectRatio">read
151    * only</a>.
152    */
153   public final native void setMeetOrSlice(short value) throws JavaScriptException /*-{
154     this.meetOrSlice = value;
155   }-*/;
156 
157 }