Package adams.gui.visualization.report
Class ReportFactory.Panel<C extends ReportContainer,M extends ReportContainerManager>
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.visualization.report.ReportFactory.Panel<C,M>
-
- Type Parameters:
C
- the type of container to useM
- the manager in use
- All Implemented Interfaces:
DataChangeListener
,ImageObserver
,MenuContainer
,Serializable
,Accessible
- Direct Known Subclasses:
InstanceReportFactory.Panel
,SpreadSheetRowReportFactory.Panel
- Enclosing class:
- ReportFactory
public static class ReportFactory.Panel<C extends ReportContainer,M extends ReportContainerManager> extends BasePanel implements DataChangeListener
A specialized panel that displays reports.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
Report
, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected M
m_ContainerManager
the manager the tabbed pane listens to.protected DataContainerPanel
m_DataContainerPanel
the associated panel with the data.protected BasePanel
m_PanelTable
the panel for the table.protected boolean
m_RegExp
whether the last search was using regular expressions.protected ReportContainerList
m_ReportContainerList
the panel with the containers.protected String
m_SearchString
the string that was searched for.protected BaseSplitPane
m_SplitPane
the split pane for table and list.protected boolean
m_VisibilityManager
whether the manager is one handling visibility.-
Fields inherited from class adams.gui.core.BasePanel
m_FileChooser
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Constructor Description Panel()
Initializes the tabbed pane with not reports.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dataChanged(DataChangeEvent e)
Gets called if the data of the spectrum panel has changed.protected String
getBorderTitle(int index)
Returns the title used in the border around the table with the report.M
getContainerManager()
Returns the current manager listening to.ReportFactory.Table
getCurrentTable()
Returns the currently selected table.List<C>
getData()
Returns the underlying data.DataContainerPanel
getDataContainerPanel()
Returns the data container panel in use.int
getDividerLocation()
Returns the current location of the divider.ReportContainerList
getReportContainerList()
Returns the container list.String
getSeachString()
Returns the current search string.int
getSelectedRow()
Returns the currently selected row.protected ReportFactory.Table
getTable(int index)
Returns the table associated with the specified report.protected void
initGUI()
Initializes the widgets.protected void
initialize()
Performs further initializations.protected M
newContainerManager()
Creates a new container manager.protected ReportFactory.Model
newModel(Report report)
Creates a new table model from the report.protected ReportFactory.Table
newTable(ReportFactory.Model model)
Creates a new table.void
search(String searchString, boolean regexp)
Performs a search for the given string.protected void
selectTable(int index)
Selects and displays the selected report.void
setContainerManager(M value)
Sets the manager to listen to.void
setCurrentTable(int index)
Makes the specified report the current table.void
setData(List<C> data)
Sets the data and reports.void
setDataContainerPanel(DataContainerPanel value)
Sets the data container panel to use.void
setDividerLocation(double value)
Sets the proportional location of the divider.void
setDividerLocation(int value)
Sets the location of the divider.void
setReportContainerListWidth(int width)
Sets the preferred width of the ReportContainerList panel.void
setReports(List<Report> data)
Sets the reports.protected void
showTable(int index)
Displays the selected report.-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, finishInit, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, initFileChooser, main, printErrorMessage, printException, saveComponent, setEnabledCascade, setEnabledCascade, setParentTitle, setVisible
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
m_ContainerManager
protected M extends ReportContainerManager m_ContainerManager
the manager the tabbed pane listens to.
-
m_VisibilityManager
protected boolean m_VisibilityManager
whether the manager is one handling visibility.
-
m_SearchString
protected String m_SearchString
the string that was searched for.
-
m_RegExp
protected boolean m_RegExp
whether the last search was using regular expressions.
-
m_SplitPane
protected BaseSplitPane m_SplitPane
the split pane for table and list.
-
m_PanelTable
protected BasePanel m_PanelTable
the panel for the table.
-
m_ReportContainerList
protected ReportContainerList m_ReportContainerList
the panel with the containers.
-
m_DataContainerPanel
protected DataContainerPanel m_DataContainerPanel
the associated panel with the data.
-
-
Method Detail
-
initialize
protected void initialize()
Performs further initializations.- Overrides:
initialize
in classBasePanel
-
setDataContainerPanel
public void setDataContainerPanel(DataContainerPanel value)
Sets the data container panel to use.- Parameters:
value
- the panel to use
-
getDataContainerPanel
public DataContainerPanel getDataContainerPanel()
Returns the data container panel in use.- Returns:
- the panel, can be null if none set
-
setDividerLocation
public void setDividerLocation(int value)
Sets the location of the divider.- Parameters:
value
- the position in pixel
-
setDividerLocation
public void setDividerLocation(double value)
Sets the proportional location of the divider.- Parameters:
value
- the proportional position (0-1)
-
getDividerLocation
public int getDividerLocation()
Returns the current location of the divider.- Returns:
- the position in pixel
-
newContainerManager
protected M newContainerManager()
Creates a new container manager.- Returns:
- the container manager
-
getContainerManager
public M getContainerManager()
Returns the current manager listening to.- Returns:
- the manager, null if not yet set
-
setContainerManager
public void setContainerManager(M value)
Sets the manager to listen to.- Parameters:
value
- the manager
-
getReportContainerList
public ReportContainerList getReportContainerList()
Returns the container list.- Returns:
- the panel with the list
-
setReportContainerListWidth
public void setReportContainerListWidth(int width)
Sets the preferred width of the ReportContainerList panel.- Parameters:
width
- the preferred width
-
setData
public void setData(List<C> data)
Sets the data and reports.- Parameters:
data
- the spectrum containers containing the reports
-
setReports
public void setReports(List<Report> data)
Sets the reports. Note: there is not underlying data or container panel available.- Parameters:
data
- the reports
-
search
public void search(String searchString, boolean regexp)
Performs a search for the given string. Limits the display of rows to ones containing the search string.- Parameters:
searchString
- the string to search forregexp
- whether to perform regular expression matching or just plain string comparison
-
getSeachString
public String getSeachString()
Returns the current search string.- Returns:
- the search string, null if not filtered
-
dataChanged
public void dataChanged(DataChangeEvent e)
Gets called if the data of the spectrum panel has changed.- Specified by:
dataChanged
in interfaceDataChangeListener
- Parameters:
e
- the event that the spectrum panel sent
-
newTable
protected ReportFactory.Table newTable(ReportFactory.Model model)
Creates a new table.- Parameters:
model
- the model to use- Returns:
- the new table
-
newModel
protected ReportFactory.Model newModel(Report report)
Creates a new table model from the report.- Parameters:
report
- the report to base the model on- Returns:
- the new table model
-
getTable
protected ReportFactory.Table getTable(int index)
Returns the table associated with the specified report.- Parameters:
index
- the index of the report- Returns:
- the table
-
getBorderTitle
protected String getBorderTitle(int index)
Returns the title used in the border around the table with the report.- Parameters:
index
- the container/report to generate the title for- Returns:
- the title
-
selectTable
protected void selectTable(int index)
Selects and displays the selected report.- Parameters:
index
- the index of the report table to display, use <0 to remove report from display
-
showTable
protected void showTable(int index)
Displays the selected report.- Parameters:
index
- the index of the report table to display, use <0 to remove report from display
-
getCurrentTable
public ReportFactory.Table getCurrentTable()
Returns the currently selected table.- Returns:
- the table, null if none selected
-
getSelectedRow
public int getSelectedRow()
Returns the currently selected row.- Returns:
- the selected row, can be -1
-
setCurrentTable
public void setCurrentTable(int index)
Makes the specified report the current table. Also selects this entry in the panel list.- Parameters:
index
- the index of the report to display
-
-