Class NoteData

  • All Implemented Interfaces:
    Data

    public class NoteData
    extends java.lang.Object
    implements Data
    Class to hold and perform operations on a set of notes
    • Constructor Detail

      • NoteData

        public NoteData()
        Construct a new note container without notes
        Since:
        14101
      • NoteData

        public NoteData​(java.util.Collection<Note> notes)
        Construct a new note container with a given list of notes
        Parameters:
        notes - The list of notes to populate the container with
    • Method Detail

      • getNotes

        public java.util.Collection<NotegetNotes()
        Returns the notes stored in this layer
        Returns:
        collection of notes
      • getSortedNotes

        public java.util.Collection<NotegetSortedNotes()
        Returns the notes stored in this layer sorted according to comparator
        Returns:
        sorted collection of notes
      • getSelectedNote

        public Note getSelectedNote()
        Returns the currently selected note
        Returns:
        currently selected note
      • setSelectedNote

        public void setSelectedNote​(Note note)
        Set a selected note. Causes the dialog to select the note and the note layer to draw the selected note's comments.
        Parameters:
        note - Selected note. Null indicates no selection
      • isModified

        public boolean isModified()
        Return whether or not there are any changes in the note data set. These changes may need to be either uploaded or saved.
        Returns:
        true if local modifications have been made to the note data set. False otherwise.
      • mergeFrom

        public void mergeFrom​(NoteData from)
        Merge notes from an existing note data.
        Parameters:
        from - existing note data
        Since:
        13437
      • addNotes

        public void addNotes​(java.util.Collection<Note> newNotes)
        Add notes to the data set. It only adds a note if the ID is not already present
        Parameters:
        newNotes - A list of notes to add
      • createNote

        public void createNote​(LatLon location,
                               java.lang.String text)
        Create a new note
        Parameters:
        location - Location of note
        text - Required comment with which to open the note
      • addCommentToNote

        public void addCommentToNote​(Note note,
                                     java.lang.String text)
        Add a new comment to an existing note
        Parameters:
        note - Note to add comment to. Must already exist in the layer
        text - Comment to add
      • closeNote

        public void closeNote​(Note note,
                              java.lang.String text)
        Close note with comment
        Parameters:
        note - Note to close. Must already exist in the layer
        text - Comment to attach to close action, if desired
      • reOpenNote

        public void reOpenNote​(Note note,
                               java.lang.String text)
        Reopen a closed note.
        Parameters:
        note - Note to reopen. Must already exist in the layer
        text - Comment to attach to the reopen action, if desired
      • updateNotes

        public void updateNotes​(java.util.Map<Note,​Note> updatedNotes)
        Updates notes with new state. Primarily to be used when updating the note layer after uploading note changes to the server.
        Parameters:
        updatedNotes - Map containing the original note as the key and the updated note as the value
      • getCurrentSortMethod

        public java.util.Comparator<NotegetCurrentSortMethod()
        Returns the current comparator being used to sort the note list.
        Returns:
        The current comparator being used to sort the note list
      • setSortMethod

        public void setSortMethod​(java.util.Comparator<Note> comparator)
        Set the comparator to be used to sort the note list. Several are available as public static members of this class.
        Parameters:
        comparator - - The Note comparator to sort by
      • getDataSources

        public java.util.Collection<DataSourcegetDataSources()
        Description copied from interface: Data
        Returns the collection of data sources.
        Specified by:
        getDataSources in interface Data
        Returns:
        the collection of data sources.
      • addDataSource

        public boolean addDataSource​(DataSource source)
        Adds a new data source.
        Parameters:
        source - data source to add
        Returns:
        true if the collection changed as a result of the call
        Since:
        18868