Class AbstractChartGenerator

    • Field Detail

      • STORAGE_NAME

        public static final String STORAGE_NAME
        the name for the spreadsheet in the flow's storage.
        See Also:
        Constant Field Values
      • m_Width

        protected int m_Width
        the width of the dialog.
      • m_Height

        protected int m_Height
        the height of the dialog.
    • Constructor Detail

      • AbstractChartGenerator

        public AbstractChartGenerator()
    • Method Detail

      • getDefaultWidth

        protected int getDefaultWidth()
        Returns the default width for the dialog.
        Returns:
        the default width
      • setWidth

        public void setWidth​(int value)
        Sets the width of the dialog.
        Parameters:
        value - the width
      • getWidth

        public int getWidth()
        Returns the currently set width of the dialog.
        Returns:
        the width
      • widthTipText

        public String widthTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getDefaultHeight

        protected int getDefaultHeight()
        Returns the default height for the dialog.
        Returns:
        the default height
      • setHeight

        public void setHeight​(int value)
        Sets the height of the dialog.
        Parameters:
        value - the height
      • getHeight

        public int getHeight()
        Returns the currently set height of the dialog.
        Returns:
        the height
      • heightTipText

        public String heightTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the object, which can be displayed in the GUI.

        The default implementation returns null.
        Specified by:
        getQuickInfo in interface QuickInfoSupporter
        Returns:
        null if no info available, otherwise short string
      • columnTypeToAxisType

        protected Type columnTypeToAxisType​(SpreadSheet sheet,
                                            int colIndex)
        Returns the most appropriate axis type for a given column.
        Parameters:
        sheet - the spreadsheet to use
        colIndex - the column index to inspect
        Returns:
        the suggested axis type
      • columnTypesToAxisType

        protected Type columnTypesToAxisType​(SpreadSheet sheet,
                                             int[] colIndices)
        Returns the most appropriate axis type for the given columns.
        Parameters:
        sheet - the spreadsheet to use
        colIndices - the column indices to inspect
        Returns:
        the suggested axis type
      • columnTypeToTickGenerator

        protected TickGenerator columnTypeToTickGenerator​(SpreadSheet sheet,
                                                          int colIndex)
        Returns the most appropriate tick generator for a given column.
        Parameters:
        sheet - the spreadsheet to use
        colIndex - the column index to inspect
        Returns:
        the suggested tick generator
      • columnTypesToTickGenerator

        protected TickGenerator columnTypesToTickGenerator​(SpreadSheet sheet,
                                                           int[] colIndices)
        Returns the most appropriate tick generator for the given columns.
        Parameters:
        sheet - the spreadsheet to use
        colIndices - the column indices to inspect
        Returns:
        the suggested tick generator
      • check

        protected void check​(String name,
                             SpreadSheet sheet)
        Checks whether the spreadsheet can be processed.

        Default implementation only ensures that data is present.
        Parameters:
        name - the name of the tab/sheet
        sheet - the spreadsheet to check
      • addChartGeneration

        protected abstract void addChartGeneration​(Flow flow,
                                                   String name,
                                                   SpreadSheet sheet)
        Adds the chart generation to the flow. The flow already contains forwarding of spreadsheet and selecting subset of rows.
        Parameters:
        flow - the flow to extend
        name - the name of the tab/sheet
        sheet - the spreadsheet to generate the flow for
      • doGenerate

        protected Flow doGenerate​(String name,
                                  SpreadSheet sheet)
        Generates the actual flow. The spreadsheet is available from storage via the STORAGE_NAME identifier.
        Parameters:
        name - the name of the tab/sheet
        sheet - the sheet to generate the chart for
        Returns:
        the generated flow
      • generate

        public Flow generate​(String name,
                             SpreadSheet sheet)
        Generates a flow for displaying a chart for the spreadsheet.
        Parameters:
        sheet - the spreadsheet to generate the chart for
        Returns:
        the flow for creating the chart