Interface ViewDataConsumer

    • Method Detail

      • selectionChanged

        boolean selectionChanged​(DFResultSet.VertexState vs,
                                 SelectionDescription from,
                                 SelectionDescription to)
        Notifies about change in selection from from selection to to selection in a given VertexState. Consumer should consider whether this selection change implies a need for a new data and report so within return value. If new data are needed consumer will be soon asked with prepareRequest(RelationalDataRequest)

        The method might be called from any thread.

        Parameters:
        vs - VertexState in which the selection has changed
        from - old selection
        to - new selection
        Returns:
        true if new data are needed; false otherwise.
      • startingViewDataRequest

        void startingViewDataRequest()
        Notifies consumer that new data distribution round starts.
      • prepareRequest

        boolean prepareRequest​(com.chemaxon.ijc.commons.datarequest.api.RelationalDataRequest request)
        Consumer is supposed to fill in a given request if it's missing some data. If it does not need any data it is supposed to say so by returning false and ignoring the request. Note that consumer which did not manifest interest in the request will not be bothered with any response, i.e. updateData(com.chemaxon.ijc.commons.datarequest.api.EntityDataResponse) method will not be called within this round.
        Parameters:
        request - request to be filed
        Returns:
        whether consumer has the interest in request or not
      • updateData

        void updateData​(com.chemaxon.ijc.commons.datarequest.api.EntityDataResponse response)
        New entity response arrived. It's up to consumer what it does with it.
        Parameters:
        response - entity response
      • viewDataRequestFinished

        void viewDataRequestFinished()
        This method is called always at the end of the data distribution round (see ViewDataConsumer's Javadoc). It is ensured that startingViewDataRequest() was called before this method, i.e. this method cannot be called without the startingViewDataRequest. It is ensured to be called also in cases when some of the previous methods in the round threw exception.
      • getVertices

        java.util.Collection<DFDataTree.Vertex> getVertices()
        Returns:
        Vertexs used by this consumer
      • idsChanged

        void idsChanged​(DFResultSet.VertexState vs,
                        java.util.List<? extends java.lang.Comparable<?>> oldIDs,
                        java.util.List<? extends java.lang.Comparable<?>> newIDs)
        Notification about change in the VertexState IDs.
        Parameters:
        vs - VertexState whose IDs were changed
        oldIDs - old IDs
        newIDs - new IDs
      • setQueryIsRunning

        void setQueryIsRunning​(boolean queryIsRunning)
        Notifies that query in the underlaying DFResultSet has just been run or that its application has just finished.
        Parameters:
        queryIsRunning - whether a query is running
        See Also:
        DFResultSet.PROP_QUERY_IS_RUNNING
      • sortDirectiveChanged

        void sortDirectiveChanged​(DFResultSet.VertexState vs,
                                  SortDirective oldSort,
                                  SortDirective newSort)
        Notification that sort directive of a VertexState has changed.
        Parameters:
        vs - VertexState whose sort directive was changed
        oldSort - old sort directive
        newSort - new sort directive