View Javadoc
1   /*
2    * Copyright (c) 2002-2025 Gargoyle Software Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * https://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package org.htmlunit.javascript.host.svg;
16  
17  import org.htmlunit.javascript.HtmlUnitScriptable;
18  import org.htmlunit.javascript.configuration.JsxClass;
19  import org.htmlunit.javascript.configuration.JsxConstructor;
20  import org.htmlunit.javascript.configuration.JsxGetter;
21  import org.htmlunit.javascript.configuration.JsxSetter;
22  
23  /**
24   * A JavaScript object for {@code SVGRect}.
25   *
26   * @author Ahmed Ashour
27   * @author Ronald Brill
28   */
29  @JsxClass
30  public class SVGRect extends HtmlUnitScriptable {
31  
32      private double xValue_;
33      private double yValue_;
34      private double width_;
35      private double height_;
36  
37      /**
38       * JavaScript constructor.
39       */
40      @JsxConstructor
41      public void jsConstructor() {
42          // nothing to do
43      }
44  
45      /**
46       * Gets x.
47       * @return x
48       */
49      @JsxGetter
50      public double getX() {
51          return xValue_;
52      }
53  
54      /**
55       * Sets x.
56       * @param x the x
57       */
58      @JsxSetter
59      public void setX(final double x) {
60          xValue_ = x;
61      }
62  
63      /**
64       * Gets y.
65       * @return y
66       */
67      @JsxGetter
68      public double getY() {
69          return yValue_;
70      }
71  
72      /**
73       * Sets y.
74       * @param y the y
75       */
76      @JsxSetter
77      public void setY(final double y) {
78          yValue_ = y;
79      }
80  
81      /**
82       * Gets width.
83       * @return width
84       */
85      @JsxGetter
86      public double getWidth() {
87          return width_;
88      }
89  
90      /**
91       * Sets width.
92       * @param width the width
93       */
94      @JsxSetter
95      public void setWidth(final double width) {
96          width_ = width;
97      }
98  
99      /**
100      * Gets height.
101      * @return height
102      */
103     @JsxGetter
104     public double getHeight() {
105         return height_;
106     }
107 
108     /**
109      * Sets height.
110      * @param height the height
111      */
112     @JsxSetter
113     public void setHeight(final double height) {
114         height_ = height;
115     }
116 
117 }