Package com.inductiveautomation.rm.base
Class RMSize
java.lang.Object
com.inductiveautomation.rm.base.RMListenerList
com.inductiveautomation.rm.base.RMObject
com.inductiveautomation.rm.base.RMSize
- All Implemented Interfaces:
- RMPropertyChanger,- 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(double w, double h) Returns whether size is equal to given width and height.booleanStandard equals implementation.doubleReturns 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.toString()Returns a string representation of size.Methods inherited from class com.inductiveautomation.rm.base.RMObjectaddPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChangeMethods inherited from class com.inductiveautomation.rm.base.RMListenerListaddListener, clone, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
- 
Field Details- 
widthpublic double width
- 
heightpublic double 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
- 
RMSizeCreates a size from a string (assumes comma separated).
 
- 
- 
Method Details- 
absNormalizes the receiver to positive values.
- 
magnitudepublic double 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.
- 
equalsStandard equals implementation.
- 
equalspublic boolean equals(double w, double h) Returns whether size is equal to given width and height.
- 
toStringReturns a string representation of size.
 
-