org.ceryle.ui.prefs
Class PreferencePanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.ceryle.ui.prefs.PreferencePanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
DatabasePrefPanel, FiletypePrefPanel, FontPrefPanel, GeneralPrefPanel, GraphPrefPanel, HTTPPrefPanel, PropertyListPanel, SamplePanel, WikiPrefPanel

public abstract class PreferencePanel
extends JPanel

An abstract class extending JPanel to provide a base class for preferences panels. The panel uses a BorderLayout whose north region is devoted to title information, with the south region used for a button panel, so all preference components should appear in the center region.

Since:
JDK1.3
Version:
$Id: PreferencePanel.java,v 3.9 2007-06-15 12:09:49 altheim Exp $
Author:
Murray Altheim
See Also:
Serialized Form

Nested Class Summary
 class PreferencePanel.RadioListener
          The listener class to handle radio button events.
 
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.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  String m_desc
           
protected  PreferencesDialog m_pd
           
protected  PreferencePanel m_this
           
protected  String m_title
           
protected  MessageHandler mh
           
protected  PropertyManager pm
           
protected  Services srvs
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
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
PreferencePanel(PreferencesDialog prefDialog, String title)
          Constructor for an PreferencePanel, with reference to the parent PreferencesDialog prefDlog and a String title.
PreferencePanel(PreferencesDialog prefDialog, String title, String description)
          Constructor for an PreferencePanel, with reference to the parent PreferencesDialog prefDlog, a String title, and an optional String description.
 
Method Summary
protected  PreferencesDialog getPrefsDialog()
          Return the parent PreferencesDialog.
protected  void initialize()
          Initializes this PreferencePanel.
 boolean isDirty()
          Returns true if an unsaved change has been made to a preference managed by this PreferencePanel.
protected  boolean isInitialized()
          Returns true if initialized.
 void refresh()
          Refresh any components upon displaying this panel.
protected  void savePreference()
          Saves any changes in this PreferencePanel to the properties file.
protected  void setDirty(boolean dirty)
          When true, indicates that an unsaved change has been made to one of the preferences managed by this PreferencePanel.
 
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, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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, setVisible, 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, transferFocusBackward, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_title

protected String m_title

m_desc

protected String m_desc

m_pd

protected PreferencesDialog m_pd

srvs

protected Services srvs

mh

protected MessageHandler mh

pm

protected PropertyManager pm

m_this

protected PreferencePanel m_this
Constructor Detail

PreferencePanel

public PreferencePanel(PreferencesDialog prefDialog,
                       String title)
Constructor for an PreferencePanel, with reference to the parent PreferencesDialog prefDlog and a String title.

Parameters:
prefDialog - the parent PreferencesDialog.
title - the title of the preference or preference group.

PreferencePanel

public PreferencePanel(PreferencesDialog prefDialog,
                       String title,
                       String description)
Constructor for an PreferencePanel, with reference to the parent PreferencesDialog prefDlog, a String title, and an optional String description. This establishes a BorderLayout manager for the panel, with the north region reserved for the preference title. The south region is used for the optional descriptive text.

Generally, content should be added to this Panel's center region, rather than using its east or west regions.

Parameters:
prefDialog - the parent PreferencesDialog.
title - the title of the preference or preference group.
description - the optional description for this panel.
Method Detail

initialize

protected void initialize()
Initializes this PreferencePanel. Ignored if called more than once.


getPrefsDialog

protected PreferencesDialog getPrefsDialog()
Return the parent PreferencesDialog.


isInitialized

protected final boolean isInitialized()
Returns true if initialized. The only way to set this is to extend initialize() and then call super.initialize() when done.


refresh

public void refresh()
Refresh any components upon displaying this panel.


isDirty

public boolean isDirty()
Returns true if an unsaved change has been made to a preference managed by this PreferencePanel.


setDirty

protected final void setDirty(boolean dirty)
When true, indicates that an unsaved change has been made to one of the preferences managed by this PreferencePanel. Individual preference panels will flag the overall preference dirtiness, but never suggest anybody else is clean, only themselves (there's a name for this behaviour...).


savePreference

protected void savePreference()
Saves any changes in this PreferencePanel to the properties file.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.