Package geomss.geom
Class Note
- java.lang.Object
-
- geomss.geom.AbstractGeomElement<T>
-
- geomss.geom.AbstractNote<GenScreenNote>
-
- geomss.geom.GenScreenNote
-
- geomss.geom.Note
-
- All Implemented Interfaces:
GeomElement<GenScreenNote>,Transformable<GenScreenNote>,java.io.Serializable,java.lang.Cloneable,java.lang.Comparable,javolution.lang.Immutable,javolution.lang.Reusable,javolution.lang.ValueType,javolution.xml.XMLSerializable
public final class Note extends GenScreenNote implements javolution.lang.ValueType
Represents a textual note located at a point in model space with a fixed size and orientation on the screen.Modified by: Joseph A. Huwaldt
- Version:
- November 26, 2015
- Author:
- Joseph A. Huwaldt, Date: February 5, 2014
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class geomss.geom.AbstractNote
DEFAULT_FONT
-
Fields inherited from class geomss.geom.AbstractGeomElement
RESOURCES
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NotechangeFont(java.awt.Font font)Return a new note object identical to this one, but with the specified font.NotechangeLocation(GeomPoint location)Return a new note object identical to this one, but with the specified location in model space.Notecopy()Returns a copy of this Note instanceallocatedby the calling thread (possibly on the stack).NotecopyToReal()Return a copy of this object with any transformations or subranges removed (applied).booleanequals(java.lang.Object obj)Compares this Note against the specified object for strict equality (same values and same units).java.awt.FontgetFont()Return the font used to display this note.PointgetLocation()Return the location of this note in model 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 location Point is stored.inthashCode()Returns the hash code for this Note object.Noteimmutable()Return an immutable version of this note.booleanisValid()Returntrueif this Note contains valid and finite numerical components.Noteto(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)Returns the equivalent to this note but with the location stated in the specified unit.NotetoDimension(int newDim)Return the equivalent of this note converted to the specified number of physical dimensions.static NotevalueOf(Note note)Returns a new Note instance that is identical to the specified Note.static NotevalueOf(java.lang.CharSequence text, GeomPoint location)Construct and return a new instance of a Note that uses the specified text string, the default display font, and is located at the specified location in space.static NotevalueOf(java.lang.CharSequence text, GeomPoint location, int fontPoints)Construct and return a new instance of a Note that uses the specified text string, the default display font at the specified size, and is located at the specified location in space.static NotevalueOf(java.lang.CharSequence text, GeomPoint location, java.awt.Font font)Construct and return a new instance of a Note that uses the specified text string, the specified display font, and is located at the specified location in space.-
Methods inherited from class geomss.geom.GenScreenNote
getBoundsMax, getBoundsMin, getLimitPoint, getTransformed, size, toText
-
Methods inherited from class geomss.geom.AbstractNote
getParDimension, length
-
Methods inherited from class geomss.geom.AbstractGeomElement
addChangeListener, clone, compareTo, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString
-
Methods inherited from interface geomss.geom.GeomElement
addChangeListener, getAllUserData, getID, getName, getParDimension, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName
-
-
-
-
Method Detail
-
valueOf
public static Note valueOf(java.lang.CharSequence text, GeomPoint location, java.awt.Font font)
Construct and return a new instance of a Note that uses the specified text string, the specified display font, and is located at the specified location in space.- 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.font- The font used to display this note. May not be null.- Returns:
- A new Note using the specified inputs.
-
valueOf
public static Note valueOf(java.lang.CharSequence text, GeomPoint location, int fontPoints)
Construct and return a new instance of a Note that uses the specified text string, the default display font at the specified size, and is located at the specified location in space.- 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.fontPoints- The size of the default font in pixels.- Returns:
- A new Note using the specified inputs.
-
valueOf
public static Note valueOf(java.lang.CharSequence text, GeomPoint location)
Construct and return a new instance of a Note that uses the specified text string, the default display font, and is located at the specified location in space.- 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.- Returns:
- A new Note using the specified inputs.
-
valueOf
public static Note valueOf(Note note)
Returns a new Note instance that is identical to the specified Note.- Parameters:
note- the Note to be copied into a new Note. May not be null.- Returns:
- A new not identical to the input note.
-
getNote
public java.lang.String getNote()
Return the text string associated with this note object.- Specified by:
getNotein classAbstractNote<GenScreenNote>- Returns:
- The text string associated with this note object.
-
getLocation
public Point getLocation()
Return the location of this note in model space.- Specified by:
getLocationin classAbstractNote<GenScreenNote>- Returns:
- The location of this note in model space.
-
getFont
public java.awt.Font getFont()
Return the font used to display this note.- Specified by:
getFontin classAbstractNote<GenScreenNote>- Returns:
- The font used to display this note.
-
immutable
public Note immutable()
Return an immutable version of this note.- Specified by:
immutablein classGenScreenNote- Returns:
- An immutable version of this note.
-
changeFont
public Note changeFont(java.awt.Font font)
Return a new note object identical to this one, but with the specified font.- Specified by:
changeFontin classAbstractNote<GenScreenNote>- Parameters:
font- The font to use in the copy of this note returned. May not be null.- Returns:
- A new note object identical to this one, but with the specified font.
-
changeLocation
public Note changeLocation(GeomPoint location)
Return a new note object identical to this one, but with the specified location in model space.- Specified by:
changeLocationin classAbstractNote<GenScreenNote>- Parameters:
location- The location for the copy of this note returned. May not be null.- Returns:
- A new note object identical to this one, but with the specified location in model space.
-
getPhyDimension
public int getPhyDimension()
Returns the number of physical dimensions of the geometry element. This implementation will return the physical dimensions of the point indicating the location of the note in space.- Specified by:
getPhyDimensionin interfaceGeomElement<GenScreenNote>- Returns:
- The number of physical dimensions of the geometry element.
-
isValid
public boolean isValid()
Returntrueif this Note 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 interfaceGeomElement<GenScreenNote>- Returns:
- true if this Note contains valid and finite numerical components.
-
copy
public Note copy()
Returns a copy of this Note instanceallocatedby the calling thread (possibly on the stack).- Specified by:
copyin interfaceGeomElement<GenScreenNote>- Specified by:
copyin interfacejavolution.lang.ValueType- Returns:
- an identical and independent copy of this note.
-
copyToReal
public Note copyToReal()
Return a copy of this object with any transformations or subranges removed (applied).- Specified by:
copyToRealin interfaceGeomElement<GenScreenNote>- Returns:
- A copy of this object with any transformations or subranges removed.
-
getUnit
public final javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
Returns the unit in which the note location Point is stored.- Specified by:
getUnitin interfaceGeomElement<GenScreenNote>- Returns:
- The unit in which the note location Point is stored.
-
to
public Note 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 interfaceGeomElement<GenScreenNote>- 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.
-
toDimension
public Note 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 interfaceGeomElement<GenScreenNote>- Parameters:
newDim- The dimension of the note to return.- Returns:
- The equivalent to this note converted to the new dimensions.
-
equals
public boolean equals(java.lang.Object obj)
Compares this Note against the specified object for strict equality (same values and same units).- Overrides:
equalsin classAbstractGeomElement<GenScreenNote>- Parameters:
obj- the object to compare with.- Returns:
trueif this note is identical to that note;falseotherwise.
-
hashCode
public int hashCode()
Returns the hash code for this Note object.- Overrides:
hashCodein classAbstractGeomElement<GenScreenNote>- Returns:
- the hash code value.
-
-