Class Widget

  • Direct Known Subclasses:
    EnrichmentWidget, GraphWidget, HTMLWidget, TableWidget

    public abstract class Widget
    extends java.lang.Object
    A representation of a query using a list tool. It combines the description of the calculation/query to be performed (the config), the list over which to perform it (the bag), the database to query within (the os) and the results of the query. TODO: split into Request and Result classes.
    Author:
    "Xavier Watkins", Daniela Butano
    • Field Detail

      • ids

        protected java.lang.String ids
      • notAnalysed

        protected int notAnalysed
      • poplationCount

        protected int poplationCount
    • Constructor Detail

      • Widget

        public Widget​(WidgetConfig config)
        The constructor
        Parameters:
        config - the WidgetConfig
    • Method Detail

      • process

        public abstract void process()
                              throws java.lang.Exception
        Process the data and create the widget
        Throws:
        java.lang.Exception - if one of the classes in the widget isn't found
      • getNotAnalysed

        public int getNotAnalysed()
        Returns:
        the number of objects not analysed in this widget
      • setNotAnalysed

        public void setNotAnalysed​(int notAnalysed)
        Parameters:
        notAnalysed - the number of objects not analysed in this widget
      • getPopulationCount

        public int getPopulationCount()
        Returns:
        the number of objects in the database annotated with ANY GO term
      • setPopulationCount

        public void setPopulationCount​(int poplationCount)
        Parameters:
        poplationCount - the number of objects in the population
      • getExportResults

        public abstract java.util.List<java.util.List<java.lang.String>> getExportResults​(java.lang.String[] selected)
                                                                                   throws java.lang.Exception
        Parameters:
        selected - the list of checked items from the form
        Returns:
        the checked items in export format
        Throws:
        java.lang.Exception - something has gone wrong. oh no.
      • getHasResults

        public abstract boolean getHasResults()
        Returns:
        the hasResults
      • getConfigId

        public java.lang.String getConfigId()
        Get the ID of the corresponding WidgetConfig
        Returns:
        the WidgetConfig ID
      • getTitle

        public java.lang.String getTitle()
        Get the widget title
        Returns:
        the title
      • getResults

        public abstract java.util.List<java.util.List<java.lang.Object>> getResults()
                                                                             throws java.lang.Exception
        Return the result that represents the data from this widget. Each row is represented as a list of Object
        Returns:
        a list representing the rows containing a list of objects
        Throws:
        java.lang.Exception - if something goes wrong.
      • getPathQuery

        public abstract PathQuery getPathQuery()
        Return the PathQuery generated dynamically by the attribute views in the configuration file
        Returns:
        the pathquery
      • createPathQueryView

        protected PathQuery createPathQueryView​(ObjectStore os,
                                                WidgetConfig config)
        Create a pathquery having a view composed by all items set in the view attribute in the config file
        Parameters:
        os - the object store
        config - the widget configuration
        Returns:
        the path query created