Class DefaultLabelModel

  • All Implemented Interfaces:
    com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, LabelModel, Model
    Direct Known Subclasses:
    DefaultInfoModel, Notification

    public class DefaultLabelModel
    extends AbstractModel
    implements LabelModel
    A default implementation of a model for an identifier such as text and/or an icon.
    Author:
    Garret Wilson
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultLabelModel()
      Default constructor.
      DefaultLabelModel​(java.lang.String label)
      Label constructor.
      DefaultLabelModel​(java.lang.String label, java.net.URI glyphURI)
      Label and glyph URI constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.URI getGlyphURI()  
      java.lang.String getLabel()  
      com.globalmentor.net.ContentType getLabelContentType()  
      void setGlyphURI​(java.net.URI newGlyphURI)
      Sets the URI of the icon.
      void setLabel​(java.lang.String newLabelText)
      Sets the text of the label.
      void setLabelContentType​(com.globalmentor.net.ContentType newLabelTextContentType)
      Sets the content type of the label text.
      java.lang.String toString()  
      • Methods inherited from class com.globalmentor.beans.BoundPropertyObject

        addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.globalmentor.beans.PropertyBindable

        addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
      • Methods inherited from interface com.globalmentor.beans.PropertyConstrainable

        addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, hasVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
    • Constructor Detail

      • DefaultLabelModel

        public DefaultLabelModel()
        Default constructor.
      • DefaultLabelModel

        public DefaultLabelModel​(java.lang.String label)
        Label constructor.
        Parameters:
        label - The text of the label, or null if there should be no label.
      • DefaultLabelModel

        public DefaultLabelModel​(java.lang.String label,
                                 java.net.URI glyphURI)
        Label and glyph URI constructor.
        Parameters:
        label - The text of the label, or null if there should be no label.
        glyphURI - The glyph URI, which may be a resource URI, or null if there is no glyph URI.
    • Method Detail

      • getGlyphURI

        public java.net.URI getGlyphURI()
        Specified by:
        getGlyphURI in interface LabelModel
        Returns:
        The glyph URI, which may be a resource URI, or null if there is no glyph URI.
      • setGlyphURI

        public void setGlyphURI​(java.net.URI newGlyphURI)
        Description copied from interface: LabelModel
        Sets the URI of the icon. This is a bound property.
        Specified by:
        setGlyphURI in interface LabelModel
        Parameters:
        newGlyphURI - The new URI of the icon, which may be a resource URI.
        See Also:
        LabelModel.GLYPH_URI_PROPERTY
      • getLabel

        public java.lang.String getLabel()
        Specified by:
        getLabel in interface LabelModel
        Returns:
        The label text, which may include a resource reference, or null if there is no label text.
      • setLabel

        public void setLabel​(java.lang.String newLabelText)
        Description copied from interface: LabelModel
        Sets the text of the label. This is a bound property.
        Specified by:
        setLabel in interface LabelModel
        Parameters:
        newLabelText - The new text of the label, which may include a resource reference.
        See Also:
        LabelModel.LABEL_PROPERTY
      • getLabelContentType

        public com.globalmentor.net.ContentType getLabelContentType()
        Specified by:
        getLabelContentType in interface LabelModel
        Returns:
        The content type of the label text.
      • setLabelContentType

        public void setLabelContentType​(com.globalmentor.net.ContentType newLabelTextContentType)
        Description copied from interface: LabelModel
        Sets the content type of the label text. This is a bound property.
        Specified by:
        setLabelContentType in interface LabelModel
        Parameters:
        newLabelTextContentType - The new label text content type.
        See Also:
        LabelModel.LABEL_CONTENT_TYPE_PROPERTY
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object