Package adams.gui.core
Class BasePanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible
- Direct Known Subclasses:
AboutBoxPanel,AbstractAnnotationsDisplayPanel,AbstractChooserPanel,AbstractComparisonPanel,AbstractContainerList,AbstractDatabaseConnectionPanel,AbstractDisplayPanel,AbstractEditorTab,AbstractExperimenterPanel,AbstractHistogramPanel,AbstractLabelSelectorPanel,AbstractLayer,AbstractLogEntryViewerPanel,AbstractManagementPanel,AbstractNamedHistoryPanel,AbstractObjectOverlayFromReport.LocatedObjectsPanel,AbstractPanelWithFile,AbstractPointOverlayFromReport.LocatedPointsPanel,AbstractPreferencesPanel,AbstractQuickSearchPanel,AbstractRemoteControlCenterTab,AbstractResultsPanel,AbstractRunToolPanel,AbstractSelectionPanel,AbstractSequenceViewerPanel,AbstractSetupOptionPanel,AbstractSimpleConversionPanel,AbstractSpreadSheetPreview.AbstractSpreadSheetPreviewPanel,AbstractTextAreaPanelWithAdvancedSyntaxHighlighting,AbstractViewerTab,AbstractWizardPage,AbstractWizardPane,AbstractWorkspaceManagerPanel,AbstractWorkspacePanel,ActorLocationsPanel,ActorTreePanel,AdjustableGridPanel,AnnotateImage.CombinedPanel,AppendDatasetsPanel,AttributeSelectionPanel,AttributeVisualizationPanel,AxisPanel,BaseColorTextField,BaseFlatSplitButton,BaseLogPanel,BasePanelWithButtons,BasePanelWithDatabaseConnection,BasePasswordFieldWithButton,BaseSplitButton,BaseStatusBar,BaseTextPaneWithWordWrap,BatchFilterDatasetsPanel,BoxPlotManager,BreakpointPanel,CanvasPanel,CanvasPanel,ClassHelpPanel,CocoAnnotationsHandler.CombinedPanel,ColorPickerPanel,ColorPickerPanel.ZoomPanel,CombinedLayer.CombinedSubLayer,ComposeEmailPanel,ConfigureOptionHandlerPanel,ConsoleOutputAnalyzerPanel,ConsolePanel,ConsolePanel.OutputPanel,ContentPanel,ControlPanel,DatabaseConnectionsPanel,DatasetCompatibilityPanel,DatePanel,DateTimePanel,DeepLabCutCSVHandler.CombinedPanel,DescriptionPanel,DetachablePanel,DiffPanel,DisplayEmailPanel,DisplayPanelManager.HistorySplitPanel,DOMTreeWithPreview,ErrorMessagePanel,ExpressionWatchPanel,FavoritesManagementPanel,FileCommanderDirectoryPanel,FileCommanderPanel,FileMonitorPanel,FilePanel,FilterPanel,FindInFilesPanel,FlowControlCenterPanel,FlowPanelNotificationArea,FontChooserPanelWithPreview,FourInOne,GenericArrayEditor,GenericObjectEditorClassTreePanel,GUIHelper.AbstractInputPanel,HistogramFactory.Panel,HistoryDisplay.HistorySplitPanel,ImageAnnotator.AnnotatorPanel,ImagePanel.PaintPanel,ImageProcessorPanel,ImageProcessorSubPanel,ImageViewerPanel,InlineEditor,InspectionPanel,InstanceComparePanel,InstanceComparePanel.DatasetPanel,InstanceExplorer,InstancesPanel,InstancesSortDefinitionPanel,InstancesSortPanel,JsonTreeWithPreview,Matrix,MemoryMonitorPanel,MessagePanel,MissionControl.ControlPanel,MultiAttributeSummaryPanel,MultiAttributeVisualizationPanel,MultiExplorer,MultiPagePane,NestedFormatViewerPanel,ObjectAnnotationPanel,ObjectAnnotations.LocatedObjectsPanel,ObjectCentersFromReport.CombinedPanel,ObjectLocationsFromReport.CombinedPanel,ObjectLocationsFromSpreadSheet.CombinedPanel,OneTouchPanel,OptionsConversionPanel,OptionTree,PaintablePanel,ParameterPanel,ParameterPanel.HelpWrapperPanel,PdfFontChooserPanel,PDFPanel,PDFViewerPanel,PixelSelectorPanel,PlaceholderManagementPanel,PointsFromReportHandler.CombinedPanel,PreferencesManagerPanel,PreviewBrowserPanel,PreviewDisplay,PreviewPanel,ProgressBar.ProgressBarPanel,PropertiesParameterPanel,PropertiesViewerPanel,PropertyPanel,PropertySheetPanel,RemoteControlCenterEnginesPanel,RemoteControlCenterLogPanel,ReportFactory.Panel,ScriptingLogPanel,SearchPanel,SegmentationPanel,SelectFieldPanel,SerializedObjectPanel,SideBySideDiffPanel,SimpleLogPanel,SortDefinitionPanel,SortPanel,SplitPanelWithOptionalComponents,SpreadSheetExplorer,SpreadSheetPanel,SpreadSheetPanel,SpreadSheetProcessorPanel,SpreadSheetProcessorPanel.WidgetPanel,SpreadSheetQueryPanel,SqlConnectionPanel,SqlMetaDataPanel,SqlQueryPanel,SQLStatementPanel,SqlWorkbenchPanel,SSHPanel,Stopwatch.StopwatchPanel,StoragePanel,StyledTextEditorPanel,SystemInfoPanel,TagArrayEditor,TextEditorPanel,TextFileChooser.FileEncodingPanel,TextPanel,TimePanel,ToolBarPanel,UndoPanel,VariableManagementPanel,WatermarkedPanel,WekaOptionsConversionPanel,XSLTPanel,XSLTPanel.SubPanel
public class BasePanel extends JPanel
A JPanel extended by a few useful methods.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- 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 static JComponentWriterFileChooserm_FileChooserthe filechooser for saving the panel.-
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 BasePanel()Initializes the panel.BasePanel(LayoutManager manager)Initializes the panel with the given layout.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterHide()Hook method just after the panel was hidden.protected voidafterShow()Hook method just after the panel was made visible.protected voidbeforeHide()Hook method just before the panel is hidden.protected voidbeforeShow()Hook method just before the panel is made visible.voidcloseParent()Closes the parent dialog/frame.protected voidfinishInit()finishes the initialization.ChildgetParentChild()Tries to determine the child window/frame this panel is part of.DialoggetParentDialog()Tries to determine the dialog this panel is part of.FramegetParentFrame()Tries to determine the frame this panel is part of.JInternalFramegetParentInternalFrame()Tries to determine the internal frame this panel is part of.StringgetParentTitle()Returns the current title of the parent.protected voidinitFileChooser()initializes the filechooser, i.e. locates all the available writers in the current packageprotected voidinitGUI()For initializing the GUI.protected voidinitialize()For initializing members.static voidmain(String[] args)Displays the BasePanel descendant, it's classname is the first parameter, in its own frame.voidprintErrorMessage(String msg)Outputs the error message in the console window and the console.voidprintException(String msg, Exception e)Outputs the exception in the console window and the console.voidsaveComponent()displays a save dialog for saving the panel to a file.voidsetEnabledCascade(boolean enabled)Sets the enabled state of itself and all of its children.protected voidsetEnabledCascade(boolean enabled, Component comp)Sets the enabled state of itself and all of its children.voidsetParentTitle(String value)Sets the new title for the parent.voidsetVisible(boolean value)Displays/hides the panel.-
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_FileChooser
protected static JComponentWriterFileChooser m_FileChooser
the filechooser for saving the panel.
-
-
Constructor Detail
-
BasePanel
public BasePanel()
Initializes the panel.
-
BasePanel
public BasePanel(LayoutManager manager)
Initializes the panel with the given layout.- Parameters:
manager- the layout manager to use
-
-
Method Detail
-
initialize
protected void initialize()
For initializing members.
-
initGUI
protected void initGUI()
For initializing the GUI.
-
finishInit
protected void finishInit()
finishes the initialization.
-
initFileChooser
protected void initFileChooser()
initializes the filechooser, i.e. locates all the available writers in the current package
-
getParentFrame
public Frame getParentFrame()
Tries to determine the frame this panel is part of.- Returns:
- the parent frame if one exists or null if not
-
getParentDialog
public Dialog getParentDialog()
Tries to determine the dialog this panel is part of.- Returns:
- the parent dialog if one exists or null if not
-
getParentChild
public Child getParentChild()
Tries to determine the child window/frame this panel is part of.- Returns:
- the parent child window/frame if one exists or null if not
-
getParentInternalFrame
public JInternalFrame getParentInternalFrame()
Tries to determine the internal frame this panel is part of.- Returns:
- the parent internal frame if one exists or null if not
-
closeParent
public void closeParent()
Closes the parent dialog/frame.
-
beforeShow
protected void beforeShow()
Hook method just before the panel is made visible.
-
afterShow
protected void afterShow()
Hook method just after the panel was made visible.
-
beforeHide
protected void beforeHide()
Hook method just before the panel is hidden.
-
afterHide
protected void afterHide()
Hook method just after the panel was hidden.
-
setVisible
public void setVisible(boolean value)
Displays/hides the panel.- Overrides:
setVisiblein classJComponent- Parameters:
value- if true then panel is displayed otherwise hidden
-
setEnabledCascade
protected void setEnabledCascade(boolean enabled, Component comp)Sets the enabled state of itself and all of its children.- Parameters:
enabled- whether the panel is enabled or not
-
setEnabledCascade
public void setEnabledCascade(boolean enabled)
Sets the enabled state of itself and all of its children.- Parameters:
enabled- whether the panel is enabled or not
-
getParentTitle
public String getParentTitle()
Returns the current title of the parent.- Returns:
- the parent's title, null if not available
-
setParentTitle
public void setParentTitle(String value)
Sets the new title for the parent.- Parameters:
value- the title to use
-
printErrorMessage
public void printErrorMessage(String msg)
Outputs the error message in the console window and the console.- Parameters:
msg- the message to output
-
printException
public void printException(String msg, Exception e)
Outputs the exception in the console window and the console.- Parameters:
msg- the message to output with the exceptione- the exception to output
-
saveComponent
public void saveComponent()
displays a save dialog for saving the panel to a file.
-
-