| Method from org.jfree.ui.Spacer Detail: |
public double calculateExtendedHeight(double height) {
double result = height;
if (this.type == ABSOLUTE) {
result = result + this.top + this.bottom;
}
else if (this.type == RELATIVE) {
result = result + (this.top * height) + (this.bottom * height);
}
return result;
}
Calculates the extended height after adding the top and bottom spacing
amounts. |
public double calculateExtendedWidth(double width) {
double result = width;
if (this.type == ABSOLUTE) {
result = result + this.left + this.right;
}
else if (this.type == RELATIVE) {
result = result + (this.left * width) + (this.right * width);
}
return result;
}
Returns the width after adding the left and right spacing amounts. |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof Spacer)) {
return false;
}
final Spacer that = (Spacer) obj;
if (this.type != that.type) {
return false;
}
if (this.left != that.left) {
return false;
}
if (this.right != that.right) {
return false;
}
if (this.top != that.top) {
return false;
}
if (this.bottom != that.bottom) {
return false;
}
return true;
}
Tests this object for equality with another object. |
public double getBottomSpace(double height) {
double result = 0.0;
if (this.type == ABSOLUTE) {
result = this.bottom;
}
else if (this.type == RELATIVE) {
result = this.bottom * height;
}
return result;
}
Returns the amount of space for the bottom of a rectangular area. The
height argument is only used for calculating 'relative' spacing. |
public double getLeftSpace(double width) {
double result = 0.0;
if (this.type == ABSOLUTE) {
result = this.left;
}
else if (this.type == RELATIVE) {
result = this.left * width;
}
return result;
}
Returns the amount of space for the left hand side of a rectangular
area. The width argument is only used for calculating 'relative'
spacing. |
public double getRightSpace(double width) {
double result = 0.0;
if (this.type == ABSOLUTE) {
result = this.right;
}
else if (this.type == RELATIVE) {
result = this.right * width;
}
return result;
}
Returns the amount of space for the right hand side of a rectangular
area. The width argument is only used for calculating 'relative'
spacing. |
public double getTopSpace(double height) {
double result = 0.0;
if (this.type == ABSOLUTE) {
result = this.top;
}
else if (this.type == RELATIVE) {
result = this.top * height;
}
return result;
}
Returns the amount of space for the top of a rectangular area. The
height argument is only used for calculating 'relative' spacing. |
public int hashCode() {
int result;
long temp;
result = this.type;
temp = this.left != +0.0d ? Double.doubleToLongBits(this.left) : 0l;
result = 29 * result + (int) (temp ^ (temp > > > 32));
temp = this.right != +0.0d ? Double.doubleToLongBits(this.right) : 0l;
result = 29 * result + (int) (temp ^ (temp > > > 32));
temp = this.top != +0.0d ? Double.doubleToLongBits(this.top) : 0l;
result = 29 * result + (int) (temp ^ (temp > > > 32));
temp = this.bottom != +0.0d ? Double.doubleToLongBits(this.bottom) : 0l;
result = 29 * result + (int) (temp ^ (temp > > > 32));
return result;
}
Returns a hashcode for this instance. |
public void trim(Rectangle2D area) {
if (area == null) {
throw new IllegalArgumentException("Null 'area' argument.");
}
final double x = area.getX();
final double y = area.getY();
final double h = area.getHeight();
final double w = area.getWidth();
final double l = getLeftSpace(w);
final double r = getRightSpace(w);
final double t = getTopSpace(h);
final double b = getBottomSpace(h);
area.setRect(x + l, y + t, w - l - r, h - t - b);
}
Calculates the margins and trims them from the supplied area. |
public double trimWidth(double w) {
return w - getLeftSpace(w) - getRightSpace(w);
}
Reduces the specified width according to the left and right space
settings. |