Package com.reportmill.base
Class RMSize
java.lang.Object
com.reportmill.base.RMObject
com.reportmill.base.RMSize
- All Implemented Interfaces:
- RMArchiver.Archiving,- Cloneable
This class represents a simple geometric size (width, height).
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabs()Normalizes the receiver to positive values.booleanequals(float w, float h) Returns whether size is equal to given width and height.booleanStandard equals implementation.floatReturns the square root of the sum of the squares of the width and height.voidnegate()Simply sets the width and height to their negatives.Normalizes the receiver by scaling its width and height such that its magnitude will be 1.transform(RMTransform aTransform) Transforms size by given transform (return this for convenience).Methods inherited from class com.reportmill.base.RMObjectclone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
- 
Field Details- 
widthpublic float width
- 
heightpublic float height
 
- 
- 
Constructor Details- 
RMSizepublic RMSize()Creates a size initialized to 0,0.
- 
RMSizepublic RMSize(double w, double h) Creates a size initialized to the given width and height.
- 
RMSizeCreates a size initialized to the given size.
- 
RMSizeCreates a size from a java2D dimension
 
- 
- 
Method Details- 
absNormalizes the receiver to positive values.
- 
magnitudepublic float magnitude()Returns the square root of the sum of the squares of the width and height.
- 
normalizeNormalizes the receiver by scaling its width and height such that its magnitude will be 1.
- 
negatepublic void negate()Simply sets the width and height to their negatives.
- 
transformTransforms size by given transform (return this for convenience).
- 
equalsStandard equals implementation.
- 
equalspublic boolean equals(float w, float h) Returns whether size is equal to given width and height.
 
-