Package geomss.geom
Class ModelNoteTrans
- java.lang.Object
-
- geomss.geom.AbstractGeomElement<T>
-
- geomss.geom.AbstractNote<GenModelNote>
-
- geomss.geom.GenModelNote
-
- geomss.geom.ModelNoteTrans
-
- All Implemented Interfaces:
GeomElement<GenModelNote>
,GeomTransform<GenModelNote>
,Transformable<GenModelNote>
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,javolution.lang.Reusable
,javolution.xml.XMLSerializable
public final class ModelNoteTrans extends GenModelNote implements GeomTransform<GenModelNote>
AGeomTransform
element that refers to aGenModelNote
object and masquerades as a GenModelNote object itself.Modified by: Joseph A. Huwaldt
- Version:
- April 10, 2018
- Author:
- Joseph A. Huwaldt, Date: February 10, 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 ModelNoteTrans
changeFont(java.awt.Font font)
Return a new note object identical to this one, but with the specified font.ModelNoteTrans
changeHeight(Parameter<javax.measure.quantity.Length> height)
Return a new note object identical to this one, but with the specified height in model space.ModelNoteTrans
changeLocation(GeomPoint location)
Return a new note object identical to this one, but with the specified location in model space.ModelNoteTrans
copy()
Returns a copy of this ModelNoteTrans instanceallocated
by the calling thread (possibly on the stack).ModelNote
copyToReal()
Return a copy of the child object transformed by this transformation.boolean
equals(java.lang.Object obj)
Compares this ModelNoteTrans against the specified object for strict equality (same values and same units).GenModelNote
getChild()
Returns the child object transformed by this transform element.java.awt.Font
getFont()
Return the font used to display this note.Parameter<javax.measure.quantity.Length>
getHeight()
Return the height of the text box in model units.Point
getLocation()
Return the location of this note in model space.java.lang.String
getNote()
Return the text string associated with this note object.int
getPhyDimension()
Returns the number of physical dimensions of the geometry element.GTransform
getTotalTransform()
Returns the total transformation represented by an entire chain of GeomTransform objects below this one.GTransform
getTransform()
Returns the transformation represented by this transformation element.javax.measure.unit.Unit<javax.measure.quantity.Length>
getUnit()
Returns the unit in which the note location Point is stored.GeomVector<javax.measure.quantity.Dimensionless>
getXHat()
Return the vector indicating the horizontal axis direction for the text.GeomVector<javax.measure.quantity.Dimensionless>
getYHat()
Return the vector indicating the vertical axis direction (or ascent direction) for the text.int
hashCode()
Returns the hash code for this parameter.ModelNote
immutable()
Return an immutable version of this note.boolean
isValid()
Returntrue
if this Note contains valid and finite numerical components.static ModelNoteTrans
newInstance(GenModelNote child, GTransform transform)
void
setTransform(GTransform transform)
Sets the transformation represented by this transformation element.ModelNoteTrans
to(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
Returns the equivalent to this note but with the location stated in the specified unit.ModelNoteTrans
toDimension(int newDim)
Return the equivalent of this note converted to the specified number of physical dimensions.-
Methods inherited from class geomss.geom.GenModelNote
getBoundsMax, getBoundsMin, getLimitPoint, getNormal, getOrientation, getTransformed, getWidth, 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, getBoundsMax, getBoundsMin, getID, getLimitPoint, getName, getParDimension, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, size, toText
-
Methods inherited from interface geomss.geom.Transformable
getTransformed
-
-
-
-
Method Detail
-
newInstance
public static ModelNoteTrans newInstance(GenModelNote child, GTransform transform)
- Parameters:
child
- The note that is the child of this transform element (may not benull
).transform
- The transform held by this transform element (may not benull
).- Returns:
- the transform element having the specified values.
- Throws:
DimensionException
- if the input element is not 3D.
-
getTransform
public GTransform getTransform()
Returns the transformation represented by this transformation element.- Specified by:
getTransform
in interfaceGeomTransform<GenModelNote>
- Returns:
- The transformation represented by this transformation element.
-
getTotalTransform
public GTransform getTotalTransform()
Returns the total transformation represented by an entire chain of GeomTransform objects below this one.- Specified by:
getTotalTransform
in interfaceGeomTransform<GenModelNote>
- Returns:
- The total transformation represented by an entire chain of GeomTransform objects below this one.
-
setTransform
public void setTransform(GTransform transform)
Sets the transformation represented by this transformation element.- Specified by:
setTransform
in interfaceGeomTransform<GenModelNote>
- Parameters:
transform
- The transform to set this transform element to (may not benull
).
-
getChild
public GenModelNote getChild()
Returns the child object transformed by this transform element.- Specified by:
getChild
in interfaceGeomTransform<GenModelNote>
- Returns:
- The child object transformed by this transform element.
-
getNote
public java.lang.String getNote()
Return the text string associated with this note object.- Specified by:
getNote
in classAbstractNote<GenModelNote>
- Returns:
- The text string associated with this note object.
-
getLocation
public Point getLocation()
Return the location of this note in model space.- Specified by:
getLocation
in classAbstractNote<GenModelNote>
- Returns:
- The location of this note in model space.
-
getXHat
public GeomVector<javax.measure.quantity.Dimensionless> getXHat()
Return the vector indicating the horizontal axis direction for the text.- Specified by:
getXHat
in classGenModelNote
- Returns:
- The vector indicating the horizontal axis direction for the text.
-
getYHat
public GeomVector<javax.measure.quantity.Dimensionless> getYHat()
Return the vector indicating the vertical axis direction (or ascent direction) for the text.- Specified by:
getYHat
in classGenModelNote
- Returns:
- The vector indicating the vertical axis direction (or ascent direction) for the text.
-
getHeight
public Parameter<javax.measure.quantity.Length> getHeight()
Return the height of the text box in model units.- Specified by:
getHeight
in classGenModelNote
- Returns:
- The height of the text box in model units.
-
getFont
public java.awt.Font getFont()
Return the font used to display this note.- Specified by:
getFont
in classAbstractNote<GenModelNote>
- Returns:
- The font used to display this note.
-
immutable
public ModelNote immutable()
Return an immutable version of this note.- Specified by:
immutable
in classGenModelNote
- Returns:
- An immutable version of this note.
-
changeFont
public ModelNoteTrans changeFont(java.awt.Font font)
Return a new note object identical to this one, but with the specified font.- Specified by:
changeFont
in classAbstractNote<GenModelNote>
- Parameters:
font
- The font for the copy of this note to use. May not be null.- Returns:
- A new note object identical to this one, but with the specified font.
-
changeLocation
public ModelNoteTrans changeLocation(GeomPoint location)
Return a new note object identical to this one, but with the specified location in model space.- Specified by:
changeLocation
in classAbstractNote<GenModelNote>
- Parameters:
location
- The location for the copy of this note. May not be null.- Returns:
- A new note object identical to this one, but with the specified location in model space.
-
changeHeight
public ModelNoteTrans 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:
changeHeight
in classGenModelNote
- Parameters:
height
- The height for the copy of this note. May not be null.- Returns:
- A new note object identical to this one, but with the specified height in model space.
-
copyToReal
public ModelNote copyToReal()
Return a copy of the child object transformed by this transformation.- Specified by:
copyToReal
in interfaceGeomElement<GenModelNote>
- Specified by:
copyToReal
in interfaceGeomTransform<GenModelNote>
- Returns:
- A copy of the child object transformed by this transformation.
-
getPhyDimension
public int getPhyDimension()
Returns the number of physical dimensions of the geometry element. This implementation always returns 3.- Specified by:
getPhyDimension
in interfaceGeomElement<GenModelNote>
- Returns:
- The number of physical dimensions of this geometry element.
-
isValid
public boolean isValid()
Returntrue
if this Note contains valid and finite numerical components. A value offalse
will be returned if any of the coordinate values are NaN or Inf.- Specified by:
isValid
in interfaceGeomElement<GenModelNote>
- Returns:
- true if this geometry element contains valid and finite data.
-
copy
public ModelNoteTrans copy()
Returns a copy of this ModelNoteTrans instanceallocated
by the calling thread (possibly on the stack).- Specified by:
copy
in interfaceGeomElement<GenModelNote>
- Returns:
- an identical and independent copy of this note.
-
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:
getUnit
in interfaceGeomElement<GenModelNote>
- Returns:
- The unit in which the geometry in this element are stated.
-
to
public ModelNoteTrans 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:
to
in interfaceGeomElement<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.
-
toDimension
public ModelNoteTrans toDimension(int newDim)
Return the equivalent of this note converted to the specified number of physical dimensions. This implementation will throw an exception if the specified dimension is anything other than 3.- Specified by:
toDimension
in interfaceGeomElement<GenModelNote>
- Parameters:
newDim
- The dimension of the point to return. MUST equal 3.- Returns:
- The equivalent of this note converted to the new dimensions.
- Throws:
java.lang.IllegalArgumentException
- if the new dimension is anything other than 3.
-
equals
public boolean equals(java.lang.Object obj)
Compares this ModelNoteTrans against the specified object for strict equality (same values and same units).- Overrides:
equals
in classAbstractGeomElement<GenModelNote>
- Parameters:
obj
- the object to compare with.- Returns:
true
if this note is identical to that note;false
otherwise.
-
hashCode
public int hashCode()
Returns the hash code for this parameter.- Overrides:
hashCode
in classAbstractGeomElement<GenModelNote>
- Returns:
- the hash code value.
-
-