1 47 48 package org.jfree.ui; 49 50 import java.io.Serializable ; 51 52 import org.jfree.util.PublicCloneable; 53 54 62 public class Size2D implements Cloneable , PublicCloneable, Serializable { 63 64 65 private static final long serialVersionUID = 2558191683786418168L; 66 67 68 public double width; 69 70 71 public double height; 72 73 76 public Size2D() { 77 this(0.0, 0.0); 78 } 79 80 86 public Size2D(final double width, final double height) { 87 this.width = width; 88 this.height = height; 89 } 90 91 96 public double getWidth() { 97 return this.width; 98 } 99 100 105 public void setWidth(final double width) { 106 this.width = width; 107 } 108 109 114 public double getHeight() { 115 return this.height; 116 } 117 118 123 public void setHeight(final double height) { 124 this.height = height; 125 } 126 127 133 public String toString() { 134 return "Size2D[width=" + this.width + ", height=" + this.height + "]"; 135 } 136 137 144 public boolean equals(final Object obj) { 145 if (this == obj) { 146 return true; 147 } 148 if (!(obj instanceof Size2D)) { 149 return false; 150 } 151 final Size2D that = (Size2D) obj; 152 if (this.width != that.width) { 153 return false; 154 } 155 if (this.height != that.height) { 156 return false; 157 } 158 return true; 159 } 160 161 168 public Object clone() throws CloneNotSupportedException { 169 return super.clone(); 170 } 171 172 } 173 | Popular Tags |