Class MonitorAwareRectangle

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

@Deprecated(forRemoval=true, since="2025-09") public final class MonitorAwareRectangle extends Rectangle
Deprecated, for removal: This API element is subject to removal in a future version.
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
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.swt.graphics.Rectangle

    Rectangle.OfFloat, Rectangle.WithMonitor
  • Field Summary

    Fields inherited from class org.eclipse.swt.graphics.Rectangle

    height, width, x, y
  • Constructor Summary

    Constructors
    Constructor
    Description
    MonitorAwareRectangle(int x, int y, int width, int height, Monitor monitor)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a new MonitorAwareRectangle
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates and returns a copy of this Rectangle.
    boolean
    equals(Object object)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the monitor with whose context the instance is created.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns an integer hash code for the receiver.

    Methods inherited from class org.eclipse.swt.graphics.Rectangle

    add, contains, contains, intersect, intersection, intersects, intersects, isEmpty, of, toString, union

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MonitorAwareRectangle

      public MonitorAwareRectangle(int x, int y, int width, int height, Monitor monitor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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:
    • clone

      public MonitorAwareRectangle clone()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Rectangle
      Creates and returns a copy of this Rectangle.

      This method performs a shallow copy of the rectangle's fields: x, y, width, and height. It does not copy any subclass-specific fields, so subclasses should override this method if additional fields exist.

      Overrides:
      clone in class Rectangle
      Returns:
      a new Rectangle instance with the same position and size as this one