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>
AGeomTransformelement that refers to aGenModelNoteobject 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 ModelNoteTranschangeFont(java.awt.Font font)Return a new note object identical to this one, but with the specified font.ModelNoteTranschangeHeight(Parameter<javax.measure.quantity.Length> height)Return a new note object identical to this one, but with the specified height in model space.ModelNoteTranschangeLocation(GeomPoint location)Return a new note object identical to this one, but with the specified location in model space.ModelNoteTranscopy()Returns a copy of this ModelNoteTrans instanceallocatedby the calling thread (possibly on the stack).ModelNotecopyToReal()Return a copy of the child object transformed by this transformation.booleanequals(java.lang.Object obj)Compares this ModelNoteTrans against the specified object for strict equality (same values and same units).GenModelNotegetChild()Returns the child object transformed by this transform element.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 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.GTransformgetTotalTransform()Returns the total transformation represented by an entire chain of GeomTransform objects below this one.GTransformgetTransform()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.inthashCode()Returns the hash code for this parameter.ModelNoteimmutable()Return an immutable version of this note.booleanisValid()Returntrueif this Note contains valid and finite numerical components.static ModelNoteTransnewInstance(GenModelNote child, GTransform transform)voidsetTransform(GTransform transform)Sets the transformation represented by this transformation element.ModelNoteTransto(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)Returns the equivalent to this note but with the location stated in the specified unit.ModelNoteTranstoDimension(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:
getTransformin 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:
getTotalTransformin 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:
setTransformin 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:
getChildin 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:
getNotein 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:
getLocationin 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:
getXHatin 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:
getYHatin 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:
getHeightin 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:
getFontin classAbstractNote<GenModelNote>- Returns:
- The font used to display this note.
-
immutable
public ModelNote immutable()
Return an immutable version of this note.- Specified by:
immutablein 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:
changeFontin 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:
changeLocationin 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:
changeHeightin 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:
copyToRealin interfaceGeomElement<GenModelNote>- Specified by:
copyToRealin 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:
getPhyDimensionin interfaceGeomElement<GenModelNote>- Returns:
- The number of physical dimensions of this geometry element.
-
isValid
public boolean isValid()
Returntrueif this Note contains valid and finite numerical components. A value offalsewill be returned if any of the coordinate values are NaN or Inf.- Specified by:
isValidin interfaceGeomElement<GenModelNote>- Returns:
- true if this geometry element contains valid and finite data.
-
copy
public ModelNoteTrans copy()
Returns a copy of this ModelNoteTrans instanceallocatedby the calling thread (possibly on the stack).- Specified by:
copyin 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:
getUnitin 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:
toin 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:
toDimensionin 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:
equalsin classAbstractGeomElement<GenModelNote>- 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 parameter.- Overrides:
hashCodein classAbstractGeomElement<GenModelNote>- Returns:
- the hash code value.
-
-