|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.gridsystems.config.tools.swing.BasePanel
public class BasePanel
Panel Extension for Swing Configuration Views. It adds some common functionalities, like:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
---|
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 | |
---|---|
BasePanel(Configurator config)
Creates a new instance. |
|
BasePanel(java.awt.LayoutManager layout,
Configurator config)
Creates a new instance with the specified layout. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
If the event source is a button that is "guarding" a component set, it synchronizes the "enabled" state of the component set with the "selected" state of the source button. |
void |
addChangeListener(javax.swing.event.ChangeListener listener)
Adds a change listener to the listener list of this panel. |
void |
focusGained(java.awt.event.FocusEvent e)
|
void |
focusLost(java.awt.event.FocusEvent e)
|
java.util.ResourceBundle |
getBundle()
Sets the bundle used by this instance. |
javax.swing.JComponent |
getComponent()
Gets a Swing component for visual edition. |
Configurator |
getConfigurator()
Gets the configurator this view is associated to. |
javax.swing.Icon |
getIcon()
Gets an icon instance for displaying on the view panel topright side. |
javax.swing.Icon |
getSmallIcon()
Gets an icon instance for displaying on the menu tree node. |
java.lang.String |
getString(java.lang.String key)
Gets a localized string. |
java.lang.String |
getString(java.lang.String key,
java.lang.Object[] params)
Gets a localized string, using the found string as a pattern to be used by a MessageFormat instance. |
java.lang.String |
getSubtitle()
Gets the subtitle of this view. |
java.lang.String |
getTitle()
Gets the title of this view. |
void |
getValues(ConfiguratorModel model)
Copies the model values into this view fields. |
boolean |
hasErrors()
Gets if the view contains any error. |
boolean |
isModified()
Gets if a change has been detected on the view. |
void |
propertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
Manages a PropertyChangeEvent. |
void |
setBundle(java.util.ResourceBundle bundle)
Sets the bundle to be used by this instance. |
void |
setBundle(java.lang.String name)
Sets the name of the bundle to be used by this instance. |
protected void |
setGuarded(javax.swing.AbstractButton btn,
javax.swing.JComponent[] guarded)
Registers btn as a "enabled" guard for the components in "guarded". |
void |
setIcon(javax.swing.Icon icon)
Sets the icon. |
protected void |
setModified(java.lang.Object src,
boolean flag)
Sets the "isModified" flag, and notifies all registered change listeners. |
void |
setSmallIcon(javax.swing.Icon icon)
Sets the small icon. |
void |
setValues(ConfiguratorModel model)
Copies this view field values into the destination model. |
protected void |
watch(javax.swing.JComboBox field)
Registers itself as interested in changes in the specified combo box. |
protected void |
watch(javax.swing.JTextField field)
Registers itself as interested in changes in the specified text field. |
protected void |
watch(PopupTextField field)
Registers itself as interested in changes in the specified text field. |
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, 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 |
Constructor Detail |
---|
public BasePanel(Configurator config)
config
- The configurator this view is associated topublic BasePanel(java.awt.LayoutManager layout, Configurator config)
layout
- The layout for this instanceconfig
- The configurator this view is associated toMethod Detail |
---|
public void setBundle(java.lang.String name)
name
- The name of the resource bundlepublic void setBundle(java.util.ResourceBundle bundle)
bundle
- The resource bundlepublic java.util.ResourceBundle getBundle()
public Configurator getConfigurator()
getConfigurator
in interface ConfiguratorView
public javax.swing.Icon getIcon()
getIcon
in interface SwingConfiguratorView
public void setIcon(javax.swing.Icon icon)
icon
- The iconpublic javax.swing.Icon getSmallIcon()
getSmallIcon
in interface SwingConfiguratorView
public void setSmallIcon(javax.swing.Icon icon)
icon
- The small iconpublic javax.swing.JComponent getComponent()
getComponent
in interface SwingConfiguratorView
public java.lang.String getTitle()
getTitle
in interface ConfiguratorView
public java.lang.String getSubtitle()
getSubtitle
in interface ConfiguratorView
public void getValues(ConfiguratorModel model)
getValues
in interface ConfiguratorView
model
- The source modelpublic void setValues(ConfiguratorModel model)
This copy should not involve validation or persistence storage, as these actions will be performed later.
setValues
in interface ConfiguratorView
model
- The destination modelpublic java.lang.String getString(java.lang.String key)
key
- The i18n key
java.lang.NullPointerException
- if the bundle is not setpublic java.lang.String getString(java.lang.String key, java.lang.Object[] params)
key
- The key for the localized patternparams
- The parameters for pattern substitution
java.lang.NullPointerException
- if the bundle is not setpublic boolean isModified()
isModified
in interface SwingConfiguratorView
public void addChangeListener(javax.swing.event.ChangeListener listener)
addChangeListener
in interface SwingConfiguratorView
listener
- The listener to addprotected void setModified(java.lang.Object src, boolean flag)
src
- The event source, for listeners notificationflag
- The new value of the flagprotected void watch(javax.swing.JTextField field)
field
- The text field to listenprotected void watch(PopupTextField field)
field
- The text field to listenprotected void watch(javax.swing.JComboBox field)
field
- the combo box field to listenprotected void setGuarded(javax.swing.AbstractButton btn, javax.swing.JComponent[] guarded)
btn
- The guarding buttonguarded
- The list of componentspublic void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
event
- The event containing the event sourcepublic void focusGained(java.awt.event.FocusEvent e)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent e)
focusLost
in interface java.awt.event.FocusListener
public void propertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
propertyChange
in interface java.beans.PropertyChangeListener
propertyChangeEvent
- a propertyChangeEvent with the information of
the event.public boolean hasErrors()
hasErrors
in interface ConfiguratorView
true
if there is any error in the view
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |