Class HeatmapPanel

  • All Implemented Interfaces:
    adams.gui.core.KnownParentSupporter, adams.gui.event.ImagePanelSelectionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

    public class HeatmapPanel
    extends adams.gui.core.BasePanel
    implements adams.gui.event.ImagePanelSelectionListener, adams.gui.core.KnownParentSupporter
    Panel for displaying a single heatmap.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Properties

        protected static adams.core.Properties m_Properties
        the setup for the panel.
      • m_Heatmap

        protected Heatmap m_Heatmap
        the heatmap on display.
      • m_HeatmapImage

        protected adams.gui.visualization.image.ImagePanel m_HeatmapImage
        the panel for displaying the heatmap as image.
      • m_HeatmapTable

        protected adams.gui.core.SpreadSheetTable m_HeatmapTable
        the table with the heatmap as spreadsheet.
      • m_ReportTable

        protected adams.gui.visualization.report.ReportFactory.Table m_ReportTable
        the report of the heatmap.
      • m_SearchPanel

        protected adams.gui.core.SearchPanel m_SearchPanel
        the search panel for the heatmap report.
      • m_LogTabbedPane

        protected adams.gui.core.BaseTabbedPaneWithTabHiding m_LogTabbedPane
        the tabbed pane for image/report and log.
      • m_SplitPane

        protected adams.gui.core.BaseSplitPane m_SplitPane
        the split pane for image/spreadsheet and report.
      • m_TabbedPane

        protected adams.gui.core.BaseTabbedPane m_TabbedPane
        the tabbed pane for the image and spreadsheet view.
      • m_Reader

        protected AbstractHeatmapReader m_Reader
        the reader that was used for reading in the heatmap.
      • m_ColorGenerator

        protected adams.gui.visualization.core.ColorGradientGenerator m_ColorGenerator
        the color generator to use.
      • m_MissingValueColor

        protected Color m_MissingValueColor
        the color to use for missing values.
      • m_PanelLog

        protected adams.gui.core.BaseLogPanel m_PanelLog
        the log panel.
    • Constructor Detail

      • HeatmapPanel

        public HeatmapPanel​(HeatmapViewerPanel owner)
        Initializes the panel.
        Parameters:
        owner - the owner of this panel
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class adams.gui.core.BasePanel
      • initGUI

        protected void initGUI()
        Initializes the widgets.
        Overrides:
        initGUI in class adams.gui.core.BasePanel
      • getOwner

        public HeatmapViewerPanel getOwner()
        Returns the owner of this panel.
        Returns:
        the owner, null if none set
      • getKnownParent

        public Container getKnownParent()
        Returns the component that acts as this component's parent.
        Specified by:
        getKnownParent in interface adams.gui.core.KnownParentSupporter
        Returns:
        the parent, null if not available
      • refresh

        protected String refresh()
        Regenerates the image of the current heatmap and redisplays it.
        Returns:
        null if everything OK, otherwiser error message
      • setHeatmap

        public void setHeatmap​(Heatmap value)
        Sets the heatmap to display.
        Parameters:
        value - the heatmap to display
      • getHeatmap

        public Heatmap getHeatmap()
        The current heatmap on display.
        Returns:
        the heatmap on display
      • setReader

        public void setReader​(AbstractHeatmapReader value)
        Sets the heatmap reader that was used for loading this heatmap. Used for reloading.
        Parameters:
        value - the reader
      • getReader

        public AbstractHeatmapReader getReader()
        Returns the heatmap reader that was used for loading this heatmap.
        Returns:
        the reader, null if loaded from database
      • setColorGenerator

        public void setColorGenerator​(adams.gui.visualization.core.ColorGradientGenerator value)
        Sets the generator for the color gradient.
        Parameters:
        value - the generator
      • getColorGenerator

        public adams.gui.visualization.core.ColorGradientGenerator getColorGenerator()
        Returns the generator for the color gradient.
        Returns:
        the generator
      • addOverlay

        public void addOverlay​(AbstractHeatmapOverlay overlay)
        Adds the heatmap overlay.
        Parameters:
        overlay - the overlay to add
      • removeOverlays

        public void removeOverlays()
        Removes all overlays.
      • setMissingValueColor

        public void setMissingValueColor​(Color value)
        Sets the color to use for missing values.
        Parameters:
        value - the color
      • getMissingValueColor

        public Color getMissingValueColor()
        Returns the color to use for missing values.
        Returns:
        the color
      • getTitle

        public String getTitle()
        Returns the database ID or filename as title.
        Returns:
        the title
      • getImagePanel

        public adams.gui.visualization.image.ImagePanel getImagePanel()
        Returns the underlying image panel
        Returns:
        the panel
      • canReload

        public boolean canReload()
        Checks whether this panel can be reloaded.
        Returns:
        true if reload is possible
      • reload

        public boolean reload()
        Reloads the data, if possible.
        Returns:
        true if successfully reloaded
      • search

        public void search​(String text,
                           boolean isRegExp)
        Performs a search.
        Parameters:
        text - the search text
        isRegExp - whether the search text is a regular expression
      • setSearchPanelVisible

        public void setSearchPanelVisible​(boolean value)
        Sets whether to display the search panel or not.
        Parameters:
        value - if true then the search panel is displayed
      • isSearchPanelVisible

        public boolean isSearchPanelVisible()
        Returns whether the search panel is visible.
        Returns:
        true if the search panel is visible
      • getProperties

        public static adams.core.Properties getProperties()
        Returns the properties for this panel.
        Returns:
        the properties file for this panel
      • setZoom

        public void setZoom​(double zoom)
        Sets the zoom factor (0-16). Use -1 to fit inside panel.
        Parameters:
        zoom - the zoom factor
      • getZoom

        public double getZoom()
        Returns the zoom factor (0-16).
        Returns:
        the zoom factor
      • log

        public void log​(String msg)
        Logs the message in the log panel.
        Parameters:
        msg - the log message
      • isReportVisible

        public boolean isReportVisible()
        Returns whether the report table is visible.
        Returns:
        true if visible
      • setReportVisible

        public void setReportVisible​(boolean value)
        Sets the visibility state of the report table.
        Parameters:
        value - true if visible
      • isLogVisible

        public boolean isLogVisible()
        Returns whether the report table is visible.
        Returns:
        true if visible
      • setLogVisible

        public void setLogVisible​(boolean value)
        Sets the visibility state of the report table.
        Parameters:
        value - true if visible
      • addSelectionListener

        public void addSelectionListener​(HeatmapPanelSelectionListener l)
        Adds the given listener to the internal list of selection listeners.
        Parameters:
        l - the listener to add
      • removeSelectionListener

        public void removeSelectionListener​(HeatmapPanelSelectionListener l)
        Removes the given listener from the internal list of selection listeners.
        Parameters:
        l - the listener to remove
      • removeSelectionListeners

        public void removeSelectionListeners()
        Removes all listeners from the internal list of selection listeners.
      • imageChanged

        public void imageChanged​(adams.gui.visualization.image.ImagePanel.PaintPanel panel)
        Notifies the overlay that the image has changed.
        Specified by:
        imageChanged in interface adams.gui.event.ImagePanelSelectionListener
        Parameters:
        panel - the panel this overlay belongs to
      • selected

        public void selected​(adams.gui.event.ImagePanelSelectionEvent e)
        Invoked when a selection happened in a ImagePanel.
        Specified by:
        selected in interface adams.gui.event.ImagePanelSelectionListener
        Parameters:
        e - the event