public double getWidth() { return m_bounds.getWidth(); }
public double getWidth() { return m_bounds.getWidth(); }
private double getAspectRatio() { return getHeight() == 0 ? 0 : (double)getWidth()/(double)getHeight(); }
private double getAspectRatio() { return getHeight() == 0 ? 0 : (double)getWidth()/(double)getHeight(); }
private double getAspectRatio() { return getHeight() == 0 ? 0 : (double)getWidth()/(double)getHeight(); }
public Point2D getCenter() { return new Point2D.Double(getX() + (getWidth()/2), getY() + (getHeight()/2)); }
public Point2D getCenter() { return new Point2D.Double(getX() + (getWidth()/2), getY() + (getHeight()/2)); }
@Override public String toString() { return "x: " + getX() + " y: " + getY() + " width: " + getWidth() + " height: " + getHeight(); }
public Point2D getCenter() { return new Point2D.Double(getX() + (getWidth()/2), getY() + (getHeight()/2)); }
public void setCenter(Point center) { m_left = center.getX() - getWidth()/2; m_top = center.getY() - getHeight()/2; }
public void setCenter(Point center) { m_left = center.getX() - getWidth()/2; m_top = center.getY() - getHeight()/2; }
@Override public String toString() { return "x: " + getX() + " y: " + getY() + " width: " + getWidth() + " height: " + getHeight(); }
public String fragment() { return "(" + getX() + "," + getY() + "," + getWidth() + "," + getHeight() + ")"; }
public void setCenter(Point center) { m_left = center.getX() - getWidth()/2; m_top = center.getY() - getHeight()/2; }
@Override public String toString() { return "x: " + getX() + " y: " + getY() + " width: " + getWidth() + " height: " + getHeight(); }
private DblBoundingBox getChildBounds(int quadrant) { double x = m_bounds.getX(); double y = m_bounds.getY(); double halfW = m_bounds.getWidth()/2; double halfH = m_bounds.getHeight()/2; switch(quadrant) { case NW: return new DblBoundingBox(x, y, halfW, halfH); case SW: return new DblBoundingBox(x, y + halfH, halfW, halfH); case NE: return new DblBoundingBox(x + halfW, y, halfW, halfH); default: return new DblBoundingBox(x + halfW, y+halfH, halfW, halfH); } }
private DblBoundingBox getChildBounds(int quadrant) { double x = m_bounds.getX(); double y = m_bounds.getY(); double halfW = m_bounds.getWidth()/2; double halfH = m_bounds.getHeight()/2; switch(quadrant) { case NW: return new DblBoundingBox(x, y, halfW, halfH); case SW: return new DblBoundingBox(x, y + halfH, halfW, halfH); case NE: return new DblBoundingBox(x + halfW, y, halfW, halfH); default: return new DblBoundingBox(x + halfW, y+halfH, halfW, halfH); } }