Class MonitorAwareRectangle

java.lang.Object
org.eclipse.swt.graphics.Rectangle
org.eclipse.swt.graphics.MonitorAwareRectangle
All Implemented Interfaces:
Serializable

public final class MonitorAwareRectangle extends Rectangle
Instances of this class represent Rectangle objects along with the context of the monitor in relation to which they are placed on the display. The monitor awareness makes it easy to scale and translate the rectangles between pixels and points.
Since:
3.129
See Also:
Restriction:
This class is not intended to be referenced by clients
  • Constructor Details

    • MonitorAwareRectangle

      public MonitorAwareRectangle(int x, int y, int width, int height, Monitor monitor)
      Constructs a new MonitorAwareRectangle
      Parameters:
      x - the x coordinate of the top left corner of the rectangle
      y - the y coordinate of the top left corner of the rectangle
      width - the width of the rectangle
      height - the height of the rectangle
      monitor - the monitor with whose context the rectangle is created
  • Method Details

    • getMonitor

      public Monitor getMonitor()
      Returns the monitor with whose context the instance is created.
      Returns:
      the monitor with whose context the instance is created
    • equals

      public boolean equals(Object object)
      Description copied from class: Rectangle
      Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
      Overrides:
      equals in class Rectangle
      Parameters:
      object - the object to compare with this object
      Returns:
      true if the object is the same as this object and false otherwise
      See Also:
    • hashCode

      public int hashCode()
      Description copied from class: Rectangle
      Returns an integer hash code for the receiver. Any two objects that return true when passed to equals must return the same value for this method.
      Overrides:
      hashCode in class Rectangle
      Returns:
      the receiver's hash
      See Also: