Class Rectangle.WithMonitor
java.lang.Object
org.eclipse.swt.graphics.Rectangle
org.eclipse.swt.graphics.Rectangle.OfFloat
org.eclipse.swt.graphics.Rectangle.WithMonitor
- All Implemented Interfaces:
Serializable, Cloneable
- Enclosing class:
Rectangle
Instances of this class represent
Rectangle.OfFloat
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.131
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Rectangle
Rectangle.OfFloat, Rectangle.WithMonitor -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateWithMonitor(float x, float y, float width, float height, Monitor monitor) WithMonitor(int x, int y, int width, int height, Monitor monitor) Constructs a new Rectangle.WithMonitor -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a copy of thisRectangle.Returns the monitor with whose context the instance is created.Methods inherited from class Rectangle.OfFloat
from, getBottomRight, getHeight, getTopLeft, getWidth, getX, getY, setHeight, setWidth, setX, setYMethods inherited from class Rectangle
add, contains, contains, equals, hashCode, intersect, intersection, intersects, intersects, isEmpty, of, toString, union
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
monitor
-
-
Constructor Details
-
WithMonitor
Constructs a new Rectangle.WithMonitor- Parameters:
x- the x coordinate of the top left corner of the rectangley- the y coordinate of the top left corner of the rectanglewidth- the width of the rectangleheight- the height of the rectanglemonitor- the monitor with whose context the rectangle is created
-
WithMonitor
-
-
Method Details
-
getMonitor
Returns the monitor with whose context the instance is created.- Returns:
- the monitor with whose context the instance is created
-
clone
Description copied from class:RectangleCreates and returns a copy of thisRectangle.This method performs a shallow copy of the rectangle's fields:
x,y,width, andheight. It does not copy any subclass-specific fields, so subclasses should override this method if additional fields exist.- Overrides:
clonein classRectangle.OfFloat- Returns:
- a new
Rectangleinstance with the same position and size as this one
-