Package geomss.geom
Class ModelNote
- java.lang.Object
- 
- geomss.geom.AbstractGeomElement<T>
- 
- geomss.geom.AbstractNote<GenModelNote>
- 
- geomss.geom.GenModelNote
- 
- geomss.geom.ModelNote
 
 
 
 
- 
- All Implemented Interfaces:
- GeomElement<GenModelNote>,- Transformable<GenModelNote>,- java.io.Serializable,- java.lang.Cloneable,- java.lang.Comparable,- javolution.lang.Immutable,- javolution.lang.Reusable,- javolution.lang.ValueType,- javolution.xml.XMLSerializable
 
 public final class ModelNote extends GenModelNote implements javolution.lang.ValueType Represents a textual note located at a point in model space with a specified size and orientation in model space.Modified by: Joseph A. Huwaldt - Version:
- February 17, 2015
- Author:
- Joseph A. Huwaldt, Date: February 10, 2014
- See Also:
- Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from class geomss.geom.AbstractNoteDEFAULT_FONT
 - 
Fields inherited from class geomss.geom.AbstractGeomElementRESOURCES
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ModelNotechangeFont(java.awt.Font font)Return a new note object identical to this one, but with the specified font.ModelNotechangeHeight(Parameter<javax.measure.quantity.Length> height)Return a new note object identical to this one, but with the specified height in model space.ModelNotechangeLocation(GeomPoint location)Return a new note object identical to this one, but with the specified location in model space.ModelNotecopy()Returns a copy of this ModelNote instanceallocatedby the calling thread (possibly on the stack).ModelNotecopyToReal()Return a copy of this object with any transformations or subranges removed (applied).booleanequals(java.lang.Object obj)Compares this ModelNote against the specified object for strict equality (same values and same units).java.awt.FontgetFont()Return the font used to display this note.Parameter<javax.measure.quantity.Length>getHeight()Return the height of the text box in model units.PointgetLocation()Return the location of this note in space.java.lang.StringgetNote()Return the text string associated with this note object.intgetPhyDimension()Returns the number of physical dimensions of the geometry element.javax.measure.unit.Unit<javax.measure.quantity.Length>getUnit()Returns the unit in which the note height and location are stored.Vector<javax.measure.quantity.Dimensionless>getXHat()Return the vector indicating the horizontal axis direction for the text.Vector<javax.measure.quantity.Dimensionless>getYHat()Return the vector indicating the vertical axis direction (or ascent direction) for the text.inthashCode()Returns the hash code for this ModelNote object.ModelNoteimmutable()Return an immutable version of this note.booleanisValid()Returntrueif this ModelNote contains valid and finite numerical components.ModelNoteto(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)Returns the equivalent to this note but with the location stated in the specified unit.ModelNotetoDimension(int newDim)Return the equivalent of this note converted to the specified number of physical dimensions.static ModelNotevalueOf(ModelNote note)Returns a new ModelNote instance that is identical to the specified ModelNote.static ModelNotevalueOf(java.lang.CharSequence text, GeomPoint location, Parameter<javax.measure.quantity.Length> height)Construct and return a new instance of a ModelNote that uses the specified text string, the default display font at the specified size, and is located parallel to the the XY plane with the xhat in the X-axis direction, yhat in the Y-axis direction.static ModelNotevalueOf(java.lang.CharSequence text, GeomVector<javax.measure.quantity.Dimensionless> xhat, GeomVector<javax.measure.quantity.Dimensionless> yhat, GeomPoint location, Parameter<javax.measure.quantity.Length> height)Construct and return a new instance of a ModelNote that uses the specified text string, the default display font at the specified size, and is located at the location and orientation in space specified by the input plane.static ModelNotevalueOf(java.lang.CharSequence text, GeomVector<javax.measure.quantity.Dimensionless> xhat, GeomVector<javax.measure.quantity.Dimensionless> yhat, GeomPoint location, java.awt.Font font, Parameter<javax.measure.quantity.Length> height)Construct and return a new instance of a ModelNote that uses the specified text string, the specified display font, is located at the location and orientation in space specified by the input vectors, and has the specified height in model units.static ModelNotevalueOf(java.lang.CharSequence text, Rotation orientation, GeomPoint location, Parameter<javax.measure.quantity.Length> height)Construct and return a new instance of a ModelNote that uses the specified text string, the default display font at the specified size, and is located at the specified location with the text plane oriented using the specified orientation rotation.- 
Methods inherited from class geomss.geom.GenModelNotegetBoundsMax, getBoundsMin, getLimitPoint, getNormal, getOrientation, getTransformed, getWidth, size, toText
 - 
Methods inherited from class geomss.geom.AbstractNotegetParDimension, length
 - 
Methods inherited from class geomss.geom.AbstractGeomElementaddChangeListener, clone, compareTo, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString
 - 
Methods inherited from interface geomss.geom.GeomElementaddChangeListener, getAllUserData, getID, getName, getParDimension, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName
 
- 
 
- 
- 
- 
Method Detail- 
valueOfpublic static ModelNote valueOf(java.lang.CharSequence text, GeomVector<javax.measure.quantity.Dimensionless> xhat, GeomVector<javax.measure.quantity.Dimensionless> yhat, GeomPoint location, java.awt.Font font, Parameter<javax.measure.quantity.Length> height) Construct and return a new instance of a ModelNote that uses the specified text string, the specified display font, is located at the location and orientation in space specified by the input vectors, and has the specified height in model units.- Parameters:
- text- The text to be displayed in this geometry object. May not be null.
- xhat- The vector indicating the direction that left-to-right text flows in space. May not be null.
- yhat- The vector, orthogonal to xhat, indicating the vertical direction (or ascent) of the text. May not be null.
- location- The location of this geometry object in model space. May not be null.
- font- The font used to display this note. May not be null.
- height- The height of the text box in model units. May not be null.
- Returns:
- A new ModelNote using the specified inputs.
 
 - 
valueOfpublic static ModelNote valueOf(java.lang.CharSequence text, GeomVector<javax.measure.quantity.Dimensionless> xhat, GeomVector<javax.measure.quantity.Dimensionless> yhat, GeomPoint location, Parameter<javax.measure.quantity.Length> height) Construct and return a new instance of a ModelNote that uses the specified text string, the default display font at the specified size, and is located at the location and orientation in space specified by the input plane.- Parameters:
- text- The text to be displayed in this geometry object. May not be null.
- xhat- The vector indicating the direction that left-to-right text flows in space. May not be null.
- yhat- The vector, orthogonal to xhat, indicating the vertical direction (or ascent) of the text. May not be null.
- location- The location of this geometry object in model space. May not be null.
- height- The height of the text box in model units. May not be null.
- Returns:
- A new ModelNote using the specified inputs.
 
 - 
valueOfpublic static ModelNote valueOf(java.lang.CharSequence text, GeomPoint location, Parameter<javax.measure.quantity.Length> height) Construct and return a new instance of a ModelNote that uses the specified text string, the default display font at the specified size, and is located parallel to the the XY plane with the xhat in the X-axis direction, yhat in the Y-axis direction.- Parameters:
- text- The text to be displayed in this geometry object. May not be null.
- location- The location of this geometry object in model space. May not be null.
- height- The height of the text box in model units. May not be null.
- Returns:
- A new ModelNote using the specified inputs.
 
 - 
valueOfpublic static ModelNote valueOf(java.lang.CharSequence text, Rotation orientation, GeomPoint location, Parameter<javax.measure.quantity.Length> height) Construct and return a new instance of a ModelNote that uses the specified text string, the default display font at the specified size, and is located at the specified location with the text plane oriented using the specified orientation rotation.- Parameters:
- text- The text to be displayed in this geometry object. May not be null.
- orientation- The orientation of the text relative to X,Y & Z 3D space axes. May not be null.
- location- The location of this geometry object in model space. The physical dimension must be ≤ 3. If it is less than 3, it will be increased to 3. If > 3, an exception is thrown. May not be null.
- height- The height of the text box in model units. May not be null.
- Returns:
- A new ModelNote using the specified inputs.
- Throws:
- java.lang.IllegalArgumentException- if the physical dimension of the input location point is greater than 3.
 
 - 
valueOfpublic static ModelNote valueOf(ModelNote note) Returns a new ModelNote instance that is identical to the specified ModelNote.- Parameters:
- note- the ModelNote to be copied into a new ModelNote. May not be null.
- Returns:
- A new ModelNote identical to the input note (a copy or clone).
 
 - 
getNotepublic java.lang.String getNote() Return the text string associated with this note object.- Specified by:
- getNotein class- AbstractNote<GenModelNote>
- Returns:
- The text string associated with this note object.
 
 - 
getXHatpublic Vector<javax.measure.quantity.Dimensionless> getXHat() Return the vector indicating the horizontal axis direction for the text.- Specified by:
- getXHatin class- GenModelNote
- Returns:
- The vector indicating the horizontal axis direction for the text.
 
 - 
getYHatpublic Vector<javax.measure.quantity.Dimensionless> getYHat() Return the vector indicating the vertical axis direction (or ascent direction) for the text.- Specified by:
- getYHatin class- GenModelNote
- Returns:
- The vector indicating the vertical axis direction (or ascent direction) for the text.
 
 - 
getLocationpublic Point getLocation() Return the location of this note in space.- Specified by:
- getLocationin class- AbstractNote<GenModelNote>
- Returns:
- The location of this note in space.
 
 - 
getHeightpublic Parameter<javax.measure.quantity.Length> getHeight() Return the height of the text box in model units.- Specified by:
- getHeightin class- GenModelNote
- Returns:
- The height of the text box in model units.
 
 - 
getFontpublic java.awt.Font getFont() Return the font used to display this note.- Specified by:
- getFontin class- AbstractNote<GenModelNote>
- Returns:
- The font used to display this note.
 
 - 
immutablepublic ModelNote immutable() Return an immutable version of this note.- Specified by:
- immutablein class- GenModelNote
- Returns:
- An immutable version of this note.
 
 - 
changeFontpublic ModelNote changeFont(java.awt.Font font) Return a new note object identical to this one, but with the specified font.- Specified by:
- changeFontin class- AbstractNote<GenModelNote>
- Parameters:
- font- The font for the new copy of this note. May not be null.
- Returns:
- A new note object identical to this one, but with the specified font.
 
 - 
changeLocationpublic ModelNote changeLocation(GeomPoint location) Return a new note object identical to this one, but with the specified location in model space. The returned note will have a different physical dimension from this one if the input location has a different physical dimension from the original location.- Specified by:
- changeLocationin class- AbstractNote<GenModelNote>
- Parameters:
- location- The location for the new copy of this note. May note be null.
- Returns:
- A new note object identical to this one, but with the specified location in model space.
 
 - 
changeHeightpublic ModelNote changeHeight(Parameter<javax.measure.quantity.Length> height) Return a new note object identical to this one, but with the specified height in model space.- Specified by:
- changeHeightin class- GenModelNote
- Parameters:
- height- The height of the new copy of this note. May note be null.
- Returns:
- A new note object identical to this one, but with the specified height in model space.
 
 - 
getPhyDimensionpublic int getPhyDimension() Returns the number of physical dimensions of the geometry element. This implementation will return the physical dimensions of the plane indicating the location and orientation of the note in space.- Specified by:
- getPhyDimensionin interface- GeomElement<GenModelNote>
- Returns:
- The number of physical dimensions of the geometry element.
 
 - 
isValidpublic boolean isValid() Returntrueif this ModelNote contains valid and finite numerical components. A value offalsewill be returned if any of the location coordinate values are NaN or Inf.- Specified by:
- isValidin interface- GeomElement<GenModelNote>
- Returns:
- true if this ModelNote contains valid and finite numerical components.
 
 - 
copypublic ModelNote copy() Returns a copy of this ModelNote instanceallocatedby the calling thread (possibly on the stack).- Specified by:
- copyin interface- GeomElement<GenModelNote>
- Specified by:
- copyin interface- javolution.lang.ValueType
- Returns:
- an identical and independent copy of this note.
 
 - 
copyToRealpublic ModelNote copyToReal() Return a copy of this object with any transformations or subranges removed (applied).- Specified by:
- copyToRealin interface- GeomElement<GenModelNote>
- Returns:
- A copy of this object with any transformations or subranges removed.
 
 - 
getUnitpublic final javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit() Returns the unit in which the note height and location are stored.- Specified by:
- getUnitin interface- GeomElement<GenModelNote>
- Returns:
- The unit in which the note height and location are stored.
 
 - 
topublic ModelNote to(javax.measure.unit.Unit<javax.measure.quantity.Length> unit) throws javax.measure.converter.ConversionException Returns the equivalent to this note but with the location stated in the specified unit.- Specified by:
- toin interface- GeomElement<GenModelNote>
- Parameters:
- unit- the length unit of the note to be returned. May not be null.
- Returns:
- an equivalent of this note but with location stated in the specified unit.
- Throws:
- javax.measure.converter.ConversionException- if the the input unit is not a length unit.
 
 - 
toDimensionpublic ModelNote toDimension(int newDim) Return the equivalent of this note converted to the specified number of physical dimensions. If the number of dimensions is greater than this element, then zeros are added to the additional dimensions. If the number of dimensions is less than this element, then the extra dimensions are simply dropped (truncated). If the new dimensions are the same as the dimension of this element, then this element is simply returned.- Specified by:
- toDimensionin interface- GeomElement<GenModelNote>
- Parameters:
- newDim- The dimension of the note to return.
- Returns:
- The equivalent to this note converted to the new dimensions.
 
 - 
equalspublic boolean equals(java.lang.Object obj) Compares this ModelNote against the specified object for strict equality (same values and same units).- Overrides:
- equalsin class- AbstractGeomElement<GenModelNote>
- Parameters:
- obj- the object to compare with.
- Returns:
- trueif this note is identical to that note;- falseotherwise.
 
 - 
hashCodepublic int hashCode() Returns the hash code for this ModelNote object.- Overrides:
- hashCodein class- AbstractGeomElement<GenModelNote>
- Returns:
- the hash code value.
 
 
- 
 
-