Mp3dings 
20100427

net.sourceforge.mp3dings.utils
Class BeanSetCustomizer

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 net.sourceforge.mp3dings.utils.BeanSetCustomizer
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
FilterSetCustomizer

public class BeanSetCustomizer
extends JPanel

A Preference Module, a container for similar PrefPanels.

Version:
$Revision: 1.23 $ ($Date: 2006/11/23 17:35:21 $)
Author:
Moritz Ringler
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
protected  BeanSet beans
          Description of the Field
protected  String name
          Description of the Field
protected  String prefnode
           
 
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
BeanSetCustomizer(String name)
          Constructs a new BeanSetCustomizer.
BeanSetCustomizer(String name, BeanSet beans)
          Constructs a new BeanSetCustomizer.
 
Method Summary
 boolean addAllBeans(Collection c)
          Adds those beans to this Customizer's BeanSet whose names are not represented in this BeanSet yet.
 boolean addBean(Bean bean)
          Adds a bean to this Customizer's BeanSet if it does not contain a bean with the same name yet.
protected  boolean currentBeanIsValid()
           
 Bean getBeanForName(String name)
          Gets the beanForName attribute of the BeanSetCustomizer object
 BeanSet getBeans()
          Gets the beans attribute of the BeanSetCustomizer object
 Component getControls()
          This method must return a Container to which other Components can be added.
 String getName()
          Gets the name attribute of the BeanSetCustomizer object
static long getNewID(Preferences pref)
          Gets the newID attribute of the BeanSetCustomizer class
 String getSavePath()
           
 boolean isSavable()
           
 void load(Class beanClass)
          Description of the Method
static void main(String[] argv)
          The main program for the BeanSetCustomizer class
protected  MainFrame mainFrame()
          Description of the Method
 void registerType(Class beanClass)
          Description of the Method
 boolean renameBean(Bean bean, String newName)
          Description of the Method
 void save()
          Description of the Method
 void setSavePath(String s)
           
protected  void showFirstInvalidBean()
           
 
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, 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, 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, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

beans

protected BeanSet beans
Description of the Field


name

protected String name
Description of the Field


prefnode

protected String prefnode
Constructor Detail

BeanSetCustomizer

public BeanSetCustomizer(String name)
Constructs a new BeanSetCustomizer.

Parameters:
name - Description of the Parameter

BeanSetCustomizer

public BeanSetCustomizer(String name,
                         BeanSet beans)
Constructs a new BeanSetCustomizer.

Parameters:
name - Description of the Parameter
beans - Description of the Parameter
Method Detail

main

public static void main(String[] argv)
                 throws Exception
The main program for the BeanSetCustomizer class

Parameters:
argv - The command line arguments
Throws:
Exception - Description of the Exception

showFirstInvalidBean

protected void showFirstInvalidBean()

isSavable

public boolean isSavable()

currentBeanIsValid

protected boolean currentBeanIsValid()

renameBean

public boolean renameBean(Bean bean,
                          String newName)
Description of the Method

Parameters:
bean - Description of the Parameter
newName - Description of the Parameter
Returns:
Description of the Return Value

registerType

public void registerType(Class beanClass)
Description of the Method

Parameters:
beanClass - Description of the Parameter

getName

public String getName()
Gets the name attribute of the BeanSetCustomizer object

Overrides:
getName in class Component
Returns:
The name value

addBean

public boolean addBean(Bean bean)
Adds a bean to this Customizer's BeanSet if it does not contain a bean with the same name yet. The client must take care that the bean has a valid id.

Parameters:
bean - The bean to add to the BeanSet
Returns:
true if the bean has indeed been added to the BeanSet
See Also:
Bean.setId(long), getNewID(java.util.prefs.Preferences)

getBeanForName

public Bean getBeanForName(String name)
Gets the beanForName attribute of the BeanSetCustomizer object

Parameters:
name - Description of the Parameter
Returns:
The beanForName value

addAllBeans

public boolean addAllBeans(Collection c)
Adds those beans to this Customizer's BeanSet whose names are not represented in this BeanSet yet. The client must take care that the beans all have valid ids. No type-checking is done by the BeanSet, the client must assure that the Collection contains only Beans.

Parameters:
c - The beans to add to the BeanSet
Returns:
true if the BeanSet has changed as a result of this operation
See Also:
BeanSet.addAll(java.util.Collection), Bean.setId(long), getNewID(java.util.prefs.Preferences)

setSavePath

public void setSavePath(String s)

getSavePath

public String getSavePath()

save

public void save()
          throws BackingStoreException
Description of the Method

Throws:
BackingStoreException - Description of the Exception

load

public void load(Class beanClass)
          throws BackingStoreException
Description of the Method

Parameters:
beanClass - Description of the Parameter
Throws:
BackingStoreException - Description of the Exception

getNewID

public static long getNewID(Preferences pref)
Gets the newID attribute of the BeanSetCustomizer class

Parameters:
pref - Description of the Parameter
Returns:
The newID value

getBeans

public BeanSet getBeans()
Gets the beans attribute of the BeanSetCustomizer object

Returns:
The beans value

getControls

public Component getControls()
This method must return a Container to which other Components can be added.

Returns:
The controls value

mainFrame

protected MainFrame mainFrame()
Description of the Method

Returns:
Description of the Return Value

Mp3dings 
20100427