com.sas.swing.visuals
Class JComponentCustomizerPanel

com.sas.swing.visuals.JComponentCustomizerPanel
All Implemented Interfaces:
com.sas.beans.CustomizerClosingInterface, LayoutConstants, java.awt.event.ActionListener, java.awt.event.ComponentListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.Customizer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class JComponentCustomizerPanel
implements java.beans.PropertyChangeListener, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.ComponentListener, java.awt.event.FocusListener

JComponentCustomizerPanel provides the user interface for customizing components which implement the javax.swing.JComponent. It allows editting of the foreground color, background color, font, border, visibility, and enable state of the component.

See Also:
Serialized Form

Field Summary
protected  com.sas.swing.property.PropertyEditorHost bgColorHost
           
protected  javax.swing.JPanel borderContainer
           
protected  boolean borderContainerCreated
           
protected  com.sas.swing.property.PropertyEditorHost borderHost
           
protected  SpinBox borderMargin
           
protected  javax.swing.JPanel borderMarginContainer
           
protected  javax.swing.JTextField borderText
           
protected  javax.swing.JPanel borderTextContainer
           
protected  boolean boundsContainerCreated
           
protected  boolean colorContainerCreated
           
protected  javax.swing.JCheckBox enabled
           
protected  com.sas.swing.property.PropertyEditorHost fgColorHost
           
protected  javax.swing.JPanel fontContainer
           
protected  boolean fontContainerCreated
           
protected  com.sas.swing.property.PropertyEditorHost fontHost
           
protected  javax.swing.JTextField heightField
           
protected  JTextFieldValidator heightValidator
           
protected  javax.swing.JLabel labelBorderMargin
           
protected  com.sas.PropertyLinkAdaptor propertyLinkAdaptor0in
           
protected  com.sas.PropertyLinkAdaptor propertyLinkAdaptor0out
           
protected static java.lang.String RB_KEY
           
protected  javax.swing.JTextField sampleText
           
protected  javax.swing.JPanel spacer
           
protected  javax.swing.JTextField toolTip
           
protected  boolean tooltipContainerCreated
           
protected  javax.swing.JCheckBox transparent
           
protected  javax.swing.JCheckBox visible
           
protected  boolean visibleEnabledContainerCreated
           
protected  javax.swing.JTextField widthField
           
protected  JTextFieldValidator widthValidator
           
protected  javax.swing.JTextField xField
           
protected  JTextFieldValidator xValidator
           
protected  javax.swing.JTextField yField
           
protected  JTextFieldValidator yValidator
           
 
Fields inherited from class com.sas.swing.visuals.SwingCustomizerPanel
bean, tabTitle
 
Fields inherited from interface com.sas.swing.visuals.util.LayoutConstants
DOTS_BUTTON_INSETS, EMPTY_INSETS, HGAP, HMARGIN, INDENTED_BORDER, TAB_BORDER, TEXTFIELD_INSETS, VGAP, VMARGIN
 
Constructor Summary
JComponentCustomizerPanel(java.lang.String tabName)
          Constructor used pass the name of the tab up to the superclass.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
           
protected  javax.swing.JTextField addLabelAndField(java.awt.Container container, java.lang.String label)
           
 void componentHidden(java.awt.event.ComponentEvent e)
           
 void componentMoved(java.awt.event.ComponentEvent e)
           
 void componentResized(java.awt.event.ComponentEvent e)
           
 void componentShown(java.awt.event.ComponentEvent e)
           
protected  java.awt.Container createBorderContainer()
           
protected  java.awt.Container createBoundsContainer()
           
protected  java.awt.Container createColorContainer()
           
protected  java.awt.Container createFontContainer()
           
protected  java.awt.Container createToolTipContainer()
           
protected  java.awt.Container createVisibleEnabledContainer()
           
 void customizerClosing()
          customizerClosing() is called when the customizer for a component is closed.
 void focusGained(java.awt.event.FocusEvent ev)
           
 void focusLost(java.awt.event.FocusEvent ev)
           
 com.sas.swing.property.PropertyEditorHost getBackgroundHost()
          Returns the PropertyEditorHost that the background color uses to set the value.
 com.sas.swing.property.PropertyEditorHost getBorderHost()
          Returns the PropertyEditorHost that the border uses to set the value.
 com.sas.swing.property.PropertyEditorHost getFontHost()
          Returns the PropertyEditorHost that the font uses to set the value.
 com.sas.swing.property.PropertyEditorHost getForegroundHost()
          Returns the PropertyEditorHost that the foreground color uses to set the value.
 void itemStateChanged(java.awt.event.ItemEvent evt)
           
 void propertyChange(java.beans.PropertyChangeEvent evt)
          Handle PropertyChangeEvents from the PropertyEditorHosts.
 void setDefaultValues()
          Create the UI controls for customizing instances of VisualInterface.
 void setObject(java.lang.Object bean)
          Sets the Object being customized.
 void updateBorderText()
           
 void updateToolTipText()
           
 
Methods inherited from class com.sas.swing.visuals.SwingCustomizerPanel
getObject, getTabTitle, setTabTitle
 

Field Detail

RB_KEY

protected static final java.lang.String RB_KEY
See Also:
Constant Field Values

fgColorHost

protected com.sas.swing.property.PropertyEditorHost fgColorHost

bgColorHost

protected com.sas.swing.property.PropertyEditorHost bgColorHost

fontHost

protected com.sas.swing.property.PropertyEditorHost fontHost

borderHost

protected com.sas.swing.property.PropertyEditorHost borderHost

visible

protected javax.swing.JCheckBox visible

enabled

protected javax.swing.JCheckBox enabled

transparent

protected javax.swing.JCheckBox transparent

xField

protected javax.swing.JTextField xField

yField

protected javax.swing.JTextField yField

widthField

protected javax.swing.JTextField widthField

heightField

protected javax.swing.JTextField heightField

sampleText

protected javax.swing.JTextField sampleText

borderText

protected javax.swing.JTextField borderText

toolTip

protected javax.swing.JTextField toolTip

borderMargin

protected SpinBox borderMargin

labelBorderMargin

protected javax.swing.JLabel labelBorderMargin

fontContainer

protected javax.swing.JPanel fontContainer

borderContainer

protected javax.swing.JPanel borderContainer

borderTextContainer

protected javax.swing.JPanel borderTextContainer

borderMarginContainer

protected javax.swing.JPanel borderMarginContainer

spacer

protected javax.swing.JPanel spacer

propertyLinkAdaptor0in

protected com.sas.PropertyLinkAdaptor propertyLinkAdaptor0in

propertyLinkAdaptor0out

protected com.sas.PropertyLinkAdaptor propertyLinkAdaptor0out

xValidator

protected JTextFieldValidator xValidator

yValidator

protected JTextFieldValidator yValidator

widthValidator

protected JTextFieldValidator widthValidator

heightValidator

protected JTextFieldValidator heightValidator

colorContainerCreated

protected boolean colorContainerCreated

fontContainerCreated

protected boolean fontContainerCreated

boundsContainerCreated

protected boolean boundsContainerCreated

borderContainerCreated

protected boolean borderContainerCreated

visibleEnabledContainerCreated

protected boolean visibleEnabledContainerCreated

tooltipContainerCreated

protected boolean tooltipContainerCreated
Constructor Detail

JComponentCustomizerPanel

public JComponentCustomizerPanel(java.lang.String tabName)
Constructor used pass the name of the tab up to the superclass.

Method Detail

addLabelAndField

protected javax.swing.JTextField addLabelAndField(java.awt.Container container,
                                                  java.lang.String label)

setDefaultValues

public void setDefaultValues()
Create the UI controls for customizing instances of VisualInterface.


createColorContainer

protected java.awt.Container createColorContainer()

createFontContainer

protected java.awt.Container createFontContainer()

createBoundsContainer

protected java.awt.Container createBoundsContainer()

createBorderContainer

protected java.awt.Container createBorderContainer()

createVisibleEnabledContainer

protected java.awt.Container createVisibleEnabledContainer()

createToolTipContainer

protected java.awt.Container createToolTipContainer()

getFontHost

public com.sas.swing.property.PropertyEditorHost getFontHost()
Returns the PropertyEditorHost that the font uses to set the value.

Returns:
A PropertyEditorHost that allows the user to change the property editor or other attributes of the PropertyEditorHost

getForegroundHost

public com.sas.swing.property.PropertyEditorHost getForegroundHost()
Returns the PropertyEditorHost that the foreground color uses to set the value.

Returns:
A PropertyEditorHost that allows the user to change the property editor or other attributes of the PropertyEditorHost

getBackgroundHost

public com.sas.swing.property.PropertyEditorHost getBackgroundHost()
Returns the PropertyEditorHost that the background color uses to set the value.

Returns:
A PropertyEditorHost that allows the user to change the property editor or other attributes of the PropertyEditorHost

getBorderHost

public com.sas.swing.property.PropertyEditorHost getBorderHost()
Returns the PropertyEditorHost that the border uses to set the value.

Returns:
A PropertyEditorHost that allows the user to change the property editor or other attributes of the PropertyEditorHost

setObject

public void setObject(java.lang.Object bean)
Description copied from class: SwingCustomizerPanel
Sets the Object being customized.

Specified by:
setObject in interface java.beans.Customizer
Overrides:
setObject in class SwingCustomizerPanel
Parameters:
bean - the Object being customized.
See Also:
Customizer.setObject(java.lang.Object)

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Specified by:
componentShown in interface java.awt.event.ComponentListener

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Specified by:
componentResized in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

focusGained

public void focusGained(java.awt.event.FocusEvent ev)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent ev)
Specified by:
focusLost in interface java.awt.event.FocusListener

updateBorderText

public void updateBorderText()

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Handle PropertyChangeEvents from the PropertyEditorHosts. Get the value of the property from the host and set it on the bean.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent evt)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

updateToolTipText

public void updateToolTipText()

customizerClosing

public void customizerClosing()
Description copied from class: SwingCustomizerPanel
customizerClosing() is called when the customizer for a component is closed. customizerClosing() of the customizerView calls customizerClosing() on each of the panels in the CustomizerView which extend CustomizerPanel.

customizerClosing() should "unhook" the bean from the customizer by removing any event listeners the panel added to the bean.

Subclasses should call super in case we add some functionality to this method in the future.

Specified by:
customizerClosing in interface com.sas.beans.CustomizerClosingInterface
Overrides:
customizerClosing in class SwingCustomizerPanel



Copyright © 2009 SAS Institute Inc. All Rights Reserved.