Package geomss.geom

Class 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
    • 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:
        getNote in class AbstractNote<GenScreenNote>
        Returns:
        The text string associated with this note object.
      • changeFont

        public Note changeFont​(java.awt.Font font)
        Return a new note object identical to this one, but with the specified font.
        Specified by:
        changeFont in class AbstractNote<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:
        changeLocation in class AbstractNote<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:
        getPhyDimension in interface GeomElement<GenScreenNote>
        Returns:
        The number of physical dimensions of the geometry element.
      • isValid

        public boolean isValid()
        Return true if this Note contains valid and finite numerical components. A value of false will be returned if any of the location coordinate values are NaN or Inf.
        Specified by:
        isValid in interface GeomElement<GenScreenNote>
        Returns:
        true if this Note contains valid and finite numerical components.
      • copy

        public Note copy()
        Returns a copy of this Note instance allocated by the calling thread (possibly on the stack).
        Specified by:
        copy in interface GeomElement<GenScreenNote>
        Specified by:
        copy in interface javolution.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:
        copyToReal in interface GeomElement<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:
        getUnit in interface GeomElement<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:
        to in interface GeomElement<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:
        toDimension in interface GeomElement<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:
        equals in class AbstractGeomElement<GenScreenNote>
        Parameters:
        obj - the object to compare with.
        Returns:
        true if this note is identical to that note; false otherwise.