public class

ScreenBounds

extends Object
java.lang.Object
   ↳ com.carto.core.ScreenBounds

Class Overview

A container class that defines a bounding box on the screen using minimum and maximum screen positions.

Summary

Public Constructors
ScreenBounds()
Constructs an empty ScreenBounds object.
ScreenBounds(ScreenPos min, ScreenPos max)
Constructs a ScreenBounds object from a minimum and maximum position.
Public Methods
boolean contains(ScreenPos pos)
Tests whether this screen bounds object contains a screen position.
boolean contains(ScreenBounds bounds)
Tests whether this screen bounds object contains a another screen bounds object.
synchronized void delete()
boolean equals(Object obj)
Checks if this object is equal to the specified object.
ScreenPos getCenter()
Calculates the center screen position of this screen envelope object.
float getHeight()
Returns the height of the bounds object.
ScreenPos getMax()
Returns the maximum screen position of this screen envelope object.
ScreenPos getMin()
Returns the minimum screen position.
float getWidth()
Returns the width of the bounds object.
int hashCode()
Returns the hash value of this object.
boolean intersects(ScreenBounds bounds)
Tests whether this screen bounds object intersects with a another screen bounds object.
String toString()
Creates a string representation of this screen bounds object, useful for logging.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ScreenBounds ()

Constructs an empty ScreenBounds object. The coordinates of the minimum position will be
set to positive infinity and the coordinates of the maximum position will be
set to negative infinity.

public ScreenBounds (ScreenPos min, ScreenPos max)

Constructs a ScreenBounds object from a minimum and maximum position. If a coordinate of the
minimum positon is larger than the same coordinate of the maximum position then those
coordinates will be swapped.

Parameters
min The minimum position.
max The maximum position.

Public Methods

public boolean contains (ScreenPos pos)

Tests whether this screen bounds object contains a screen position.

Parameters
pos The screen position.
Returns
  • True if this screen bounds object contains the screen position.

public boolean contains (ScreenBounds bounds)

Tests whether this screen bounds object contains a another screen bounds object.

Parameters
bounds The other screen bounds object.
Returns
  • True if this screen bounds object contains the other screen bounds object.

public synchronized void delete ()

public boolean equals (Object obj)

Checks if this object is equal to the specified object.

Parameters
obj The reference object.
Returns
  • True when objects are equal, false otherwise.

public ScreenPos getCenter ()

Calculates the center screen position of this screen envelope object.

Returns
  • The center postion if this screen envelope object.

public float getHeight ()

Returns the height of the bounds object.

Returns
  • The height on the bounds object.

public ScreenPos getMax ()

Returns the maximum screen position of this screen envelope object.

Returns
  • The maximum screen position of this screen envelope object.

public ScreenPos getMin ()

Returns the minimum screen position.

Returns
  • The minimum screen position.

public float getWidth ()

Returns the width of the bounds object.

Returns
  • The width on the bounds object.

public int hashCode ()

Returns the hash value of this object.

Returns
  • The hash value of this object.

public boolean intersects (ScreenBounds bounds)

Tests whether this screen bounds object intersects with a another screen bounds object.

Parameters
bounds The other screen bounds object.
Returns
  • True if this screen bounds object intersects with the other screen bounds object.

public String toString ()

Creates a string representation of this screen bounds object, useful for logging.

Returns
  • The string representation of this screen bounds object.