com.sas.awt
Class LabelVisualComponent

com.sas.awt.LabelVisualComponent
All Implemented Interfaces:
VisualInterface, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.ComponentInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, com.sas.ViewInterface, MultipleValueEventSourceInterface, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible
Direct Known Subclasses:
Label

public abstract class LabelVisualComponent
implements com.sas.ComponentInterface, VisualInterface, MultipleValueEventSourceInterface

See Also:
Serialized Form

Constructor Summary
LabelVisualComponent()
           
LabelVisualComponent(java.lang.String text)
           
LabelVisualComponent(java.lang.String text, int alignment)
           
 
Method Summary
 void addLink(java.lang.String property, com.sas.ComponentInterface linked_component, java.lang.String linked_property)
          addLink() adds a link between property on this component and source_property on source_component.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener to the component.
 void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Adds a VetoableChangeListener to the component.
 boolean anyPropertyChangeListeners()
          Return true if there are any PropertyChangeEvent listeners.
 void attachModel(com.sas.ModelInterface model)
          Attaches the specified model to this view.
 boolean attachView()
          attachView is called on the model during an attachModel call on the view.
 java.lang.Object clone()
          Return a clone of the object.
 java.awt.Dimension computePreferredSize()
          The default implementation of this method calls super.getPreferredSize().
 void detachModel(com.sas.ModelInterface model)
          Detaches the specified model from this view.
 void detachView()
          detachView is called on the model during an detachModel call on the view.
 void dumpComponent()
          This method prints debugging information about the component.
 void firePropertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
          Report a bound property update to any registered listeners.
 void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Report a bound property update to any registered listeners.
 void fireVetoableChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Report a constrained property update to any registered listeners.
 java.awt.Color getBackgroundColor()
          Returns the background color of the component.
 BorderInterface getBorder()
          Returns the border drawn around the component.
 java.lang.String getComponentDescription()
          This method returns the description of the component.
 com.sas.ComponentInterfaceSupportInfo getComponentSupportInfo(boolean createIfNecessary)
          Internal framework method.
 java.lang.reflect.Method getEventMethod(java.lang.reflect.Method listenerMethod)
          Get the method used to check the value of the event.
 java.lang.String[] getEventValues(java.lang.reflect.Method listenerMethod)
          Get the possible values for the listenerInterface method the event is sent to.
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
          Returns information used by the com.sas.beans.Introspector to augment the automatically introspected information about the component.
 java.awt.Font getFont()
          Returns the font used by the component to display text.
 java.awt.Color getForegroundColor()
          Returns the foreground color of the component.
 int getHeight()
          This method returns the vertical size of the component in pixels.
 int getHorizontalPosition()
          This method returns the horizontal starting position of the component in pixels.
 com.sas.LinkPropertiesInfo getLinkInfo()
          Internal framework method.
 java.awt.Dimension getMinimumSize()
          Overrides the java.awt.Component getMinimumSize method to return a minimum size of 5,5 for components which do not have a peer.
 com.sas.ModelInterface getModelInterface()
           
 java.awt.Dimension getPreferredSize()
           
 com.sas.visuals.PainterInterface getPrePainter()
          Returns the painter used to draw over the background of the component.
 java.util.Vector getRequiredInterfaces()
          The get method for the requiredInterfaces attribute.
 int getVerticalPosition()
          This method returns the vertical starting position of the component in pixels.
 com.sas.ViewInterfaceSupportInfo getViewInterfaceSupportInfo()
          Internal framework method.
 VisualInterfaceSupportInfo getVisualInterfaceSupportInfo()
          This method is not intended to be called by users.
 int getWidth()
          This method returns the width of the component in pixels.
 void initialize()
          The initialize() method was designed to be a synchronization point after the constructor for the object has completed and a number of methods have been called on the component.
 void initializeComponent()
          Called by the default constructor.
 boolean isDesignTime()
          This method returns whether the component is in design mode or in run mode.
 boolean isEnabled()
          Returns whether the component is currently enabled.
 boolean isFocus()
          isFocus returns whether the component currently has focus.
 boolean isLinked(java.lang.String property, com.sas.ComponentInterface linked_component, java.lang.String linked_property)
          isLinked() determines if property on this component is linked to source_property on source_component.
 boolean isTransparent()
          Returns whether the background is not filled with the backgroundColor.
 boolean isVisible()
          Returns whether the component is currently visible.
 void paint(java.awt.Graphics g)
           
 void propertyChange(java.beans.PropertyChangeEvent e)
          Handles any property links on this component from the source component.
 com.sas.PropertyLinkInfo[] queryLinks()
          queryLinks() returns an array of PropertyLinkInfo objects containing information about properties on this component which are linked to properties on this or other components.
 com.sas.PropertyLinkInfo[] queryLinks(java.lang.String property)
          queryLinks() returns an array of PropertyLinkInfo objects containing information about the links to the specified property.
 void refresh(com.sas.ModelInterface model)
          Updates the view based on updates in the model.
 void removeAllLinks()
          removeAllLinks() removes all the links on this component.
 void removeInterfaceTraps(com.sas.ModelInterface model)
           
 void removeLink(java.lang.String property, com.sas.ComponentInterface linked_component, java.lang.String linked_property)
          removeLink() removes a link between property on this component and source_property on source_component.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener from the component.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Removes a VetoableChangeListener from the component.
 void setBackgroundColor(java.awt.Color color)
          Sets the background color of the component.
 void setBorder(BorderInterface border)
          Sets the border drawn around the component.
 void setBounds(int x, int y, int width, int height)
           
 void setComponentDescription(java.lang.String description)
          This method sets the description of the component.
 void setComponentSupportInfo(com.sas.ComponentInterfaceSupportInfo info)
          Internal framework method.
 void setDefaultValues()
          This method sets the initial property values to their default values.
 void setEnabled(boolean enabled)
          setEnabled() is the set accessor method for the Enabled attribute.
 void setFocus(boolean focus)
          setFocus sets focus to the component or away from the component.
 void setFont(java.awt.Font font)
          Sets the font to be used by the component for displaying text.
 void setForegroundColor(java.awt.Color color)
          Sets the foreground color of the component.
 void setHeight(int height)
          This method sets the height of the component in pixels.
 void setHorizontalPosition(int horizontalPosition)
          This method sets the horizontal starting position of the component in pixels.
 void setLinkInfo(com.sas.LinkPropertiesInfo info)
          Internal framework method.
 void setModelInterface(com.sas.ModelInterface model)
          Calling setModelInterface will detach the previous model (if any) and will call attachModel to attach the model to this view.
 void setPreferredSize(java.awt.Dimension preferredSize)
          This method allows the user to set the Dimension returned by getPreferredSize.
 void setPrePainter(com.sas.visuals.PainterInterface painter)
          Sets the painter used to draw over the background of the component.
 void setRequiredInterfaces(java.util.Vector interfaces)
          The set method for the requiredInterfaces attribute.
 void setTransparent(boolean transparent)
          Sets whether the background of the component is filled with the backgroundColor.
 void setVerticalPosition(int verticalPosition)
          This method sets the vertical starting position of the component in pixels.
 void setViewInterfaceSupportInfo(com.sas.ViewInterfaceSupportInfo info)
          Internal framework method.
 void setVisible(boolean visible)
          setVisible() is the set accessor method for the Visible attribute.
 void setVisualInterfaceSupportInfo(VisualInterfaceSupportInfo info)
          This method is not intended to be called by users.
 void setWidth(int width)
          This method sets the width of the component in pixels.
 java.awt.Font superGetFont()
          This method is not intended to be used by users.
 java.awt.Dimension superGetMinimumSize()
          This method is not intended to be used by users.
 java.awt.Dimension superGetPreferredSize()
          This method is not intended to be used by users.
 boolean superIsEnabled()
          This method is not intended to be used by users.
 boolean superIsVisible()
          This method is not intended to be used by users.
 void superPaint(java.awt.Graphics g)
          This method is not intended to be used by users.
 void superSetBounds(int x, int y, int width, int height)
          This method is not intended to be used by users.
 void superSetEnabled(boolean enabled)
          This method is not intended to be used by users.
 void superSetFont(java.awt.Font font)
          This method is not intended to be used by users.
 void superSetVisible(boolean visible)
          This method is not intended to be used by users.
 void superUpdate(java.awt.Graphics g)
          This method is not intended to be used by users.
 boolean supportsListenerInterface(java.lang.Class listenerInterface)
          Determines if a listenerInterface class is supported by the implementing class.
 boolean supportsRequiredInterfaces(com.sas.ModelInterface model)
          Checks a potential model to this view to see if it supports the required interfaces of this view.
 void trapInterfaceEvents(com.sas.ModelInterface model)
           
 void update(java.awt.Graphics g)
           
 void validateObject()
           
 

Constructor Detail

LabelVisualComponent

public LabelVisualComponent()

LabelVisualComponent

public LabelVisualComponent(java.lang.String text)

LabelVisualComponent

public LabelVisualComponent(java.lang.String text,
                            int alignment)
Method Detail

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
Returns information used by the com.sas.beans.Introspector to augment the automatically introspected information about the component.


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Return a clone of the object.

Overrides:
clone in class java.lang.Object
Returns:
a clone of the object.
Throws:
java.lang.CloneNotSupportedException - if the model attached to the component being cloned will not allow the clone to attach.

trapInterfaceEvents

public void trapInterfaceEvents(com.sas.ModelInterface model)
Specified by:
trapInterfaceEvents in interface com.sas.ViewInterface
See Also:
ViewInterface.trapInterfaceEvents(com.sas.ModelInterface)

removeInterfaceTraps

public void removeInterfaceTraps(com.sas.ModelInterface model)
Specified by:
removeInterfaceTraps in interface com.sas.ViewInterface
See Also:
ViewInterface.removeInterfaceTraps(com.sas.ModelInterface)

getRequiredInterfaces

public java.util.Vector getRequiredInterfaces()
Description copied from interface: ViewInterface
The get method for the requiredInterfaces attribute. Retrieves the current value of the RequiredInterfaces atttribute. This information contains an array for each required interface.

Specified by:
getRequiredInterfaces in interface com.sas.ViewInterface
Returns:
interfaces - Array of interface information for each required interface
See Also:
ViewInterface.getRequiredInterfaces()

setRequiredInterfaces

public void setRequiredInterfaces(java.util.Vector interfaces)
Description copied from interface: ViewInterface
The set method for the requiredInterfaces attribute. Sets the current value of the RequiredInterfaces attribute.

Specified by:
setRequiredInterfaces in interface com.sas.ViewInterface
Parameters:
interfaces - Vector of interface information for each required interface Each element in the vector contains the required interface name followed by attribute name to method pairings for each attribute in the model which the view will set up event handlers for. For example, this view requires the StringListInterface and handles two attribute changed event notifications from the model.
        Vector requiredInterfaces =     new Vector();
        String[] requiredInterfacesString = { "com.sas.util.StaticStringListInterface", "items", "refresh", "listName", "setTitle" };
        requiredInterfaces.addElement(requiredInterfacesString);

        this.setRequiredInterfaces( requiredInterfaces );
 
See Also:
ViewInterface.setRequiredInterfaces(java.util.Vector)

attachModel

public void attachModel(com.sas.ModelInterface model)
Description copied from interface: ViewInterface
Attaches the specified model to this view. Calls attachView on the model to notify it of the attach request. Throws a run time ComponentException if the model denies the attach request. Calls trapInterfaceEvents on the view to set up the appropriate event handlers in the view for attribute changed events from the model. attachModel will be called once for the model specified in the setModel method. It is the responsibility of the views to maintain interface handles to multiple models; one interface handle will be set in the attachModel call and cleared in detachModel. Therefore, the interface handle will always point to the last model attached to. Throws a run time ComponentException if the specified model does not support the required interface on the view. Calls refresh, passing the model interface, on the view after successful completion to allow the view to update itself.

Specified by:
attachModel in interface com.sas.ViewInterface
Parameters:
model - Model to attach to
See Also:
ViewInterface.attachModel(com.sas.ModelInterface)

detachModel

public void detachModel(com.sas.ModelInterface model)
Description copied from interface: ViewInterface
Detaches the specified model from this view. Calls detachView on the model to notify it of the attach request. Calls removeInterfaceTraps on the view to remove the appropriate event handlers in the view for attribute changed events from the model. Calls refresh, passing null for the model interface, on the view after successful completion to allow the view to clear itself.

Specified by:
detachModel in interface com.sas.ViewInterface
Parameters:
model - Model to detach
See Also:
ViewInterface.detachModel(com.sas.ModelInterface)

refresh

public void refresh(com.sas.ModelInterface model)
Description copied from interface: ViewInterface
Updates the view based on updates in the model. Called by attachModel upon a successful attach to give the view a chance to update itself. Views should override this method to perform whatever updates are necessary after a model update.

Specified by:
refresh in interface com.sas.ViewInterface
Parameters:
model - Model that has just been updated
See Also:
ViewInterface.refresh(com.sas.ModelInterface)

supportsRequiredInterfaces

public boolean supportsRequiredInterfaces(com.sas.ModelInterface model)
Description copied from interface: ViewInterface
Checks a potential model to this view to see if it supports the required interfaces of this view.

Specified by:
supportsRequiredInterfaces in interface com.sas.ViewInterface
Parameters:
model - Model to check for the required interfaces
Returns:
true for this model supports the required interfaces of the view; false for the model does not support the required interfaces of the view
See Also:
ViewInterface.supportsRequiredInterfaces(com.sas.ModelInterface)

getModelInterface

public com.sas.ModelInterface getModelInterface()
Specified by:
getModelInterface in interface com.sas.ViewInterface
Returns:
A reference to the connected model. If no model is connected, null is returned.
See Also:
ViewInterface.getModelInterface()

setModelInterface

public void setModelInterface(com.sas.ModelInterface model)
Description copied from interface: ViewInterface
Calling setModelInterface will detach the previous model (if any) and will call attachModel to attach the model to this view. Sends a propertyChange event for the model property

Specified by:
setModelInterface in interface com.sas.ViewInterface
Parameters:
model - The new model for this view
See Also:
ViewInterface.setModelInterface(com.sas.ModelInterface)

getViewInterfaceSupportInfo

public com.sas.ViewInterfaceSupportInfo getViewInterfaceSupportInfo()
Internal framework method. Not intended to be called by component users.

Specified by:
getViewInterfaceSupportInfo in interface com.sas.ViewInterface
Returns:
A reference to an instance of ViewInterfaceSupportInfo which holds information needed by ViewInterfaceSupport to implement the ViewInterface.
See Also:
ViewInterface.getViewInterfaceSupportInfo()

setViewInterfaceSupportInfo

public void setViewInterfaceSupportInfo(com.sas.ViewInterfaceSupportInfo info)
Internal framework method. Not intended to be called by component users.

Specified by:
setViewInterfaceSupportInfo in interface com.sas.ViewInterface
Parameters:
info - A reference to an instance of ViewInterfaceSupportInfo which holds information needed by ViewInterfaceSupport to implement the ViewInterface.
See Also:
ViewInterface.setViewInterfaceSupportInfo(com.sas.ViewInterfaceSupportInfo)

attachView

public boolean attachView()
Description copied from interface: ModelInterface
attachView is called on the model during an attachModel call on the view. The attachView method serves as a hook for the model to receive notification that a view is attaching to it. The model can deny the attach request by returning false, in which case the attachModel request on the view will fail.

Specified by:
attachView in interface com.sas.ModelInterface
Returns:
boolean whether the model will allow the attach
See Also:
ModelInterface.attachView()

detachView

public void detachView()
Description copied from interface: ModelInterface
detachView is called on the model during an detachModel call on the view. The detachView method serves as a hook for the model to receive notification that a view is detaching from it.

Specified by:
detachView in interface com.sas.ModelInterface
See Also:
ModelInterface.detachView()

addLink

public void addLink(java.lang.String property,
                    com.sas.ComponentInterface linked_component,
                    java.lang.String linked_property)
Description copied from interface: LinkPropertiesInterface
addLink() adds a link between property on this component and source_property on source_component. The value of source_component.source_property will be read and set on property when addLink() is called. Whenever the value of source_component.source_property changes in the future, the value of this.property will be updated.

Adding a link that already exists does nothing.

Specified by:
addLink in interface com.sas.LinkPropertiesInterface
Parameters:
property - The property to be linked to source_property on source_component.
linked_component - The component with source_property.
linked_property - The property on source_component.
See Also:
LinkPropertiesInterface.addLink(java.lang.String, com.sas.ComponentInterface, java.lang.String)

removeLink

public void removeLink(java.lang.String property,
                       com.sas.ComponentInterface linked_component,
                       java.lang.String linked_property)
Description copied from interface: LinkPropertiesInterface
removeLink() removes a link between property on this component and source_property on source_component.

Specified by:
removeLink in interface com.sas.LinkPropertiesInterface
Parameters:
property - The property currently linked to source_property on source_component.
linked_component - The component with source_property.
linked_property - The property on source_component.
See Also:
LinkPropertiesInterface.removeLink(java.lang.String, com.sas.ComponentInterface, java.lang.String)

removeAllLinks

public void removeAllLinks()
Description copied from interface: LinkPropertiesInterface
removeAllLinks() removes all the links on this component.

Specified by:
removeAllLinks in interface com.sas.LinkPropertiesInterface
See Also:
LinkPropertiesInterface.removeAllLinks()

queryLinks

public com.sas.PropertyLinkInfo[] queryLinks(java.lang.String property)
Description copied from interface: LinkPropertiesInterface
queryLinks() returns an array of PropertyLinkInfo objects containing information about the links to the specified property.

Specified by:
queryLinks in interface com.sas.LinkPropertiesInterface
Parameters:
property - The property to return the list of links for.
Returns:
An array of PropertyLinkInfo objects.
See Also:
LinkPropertiesInterface.queryLinks(java.lang.String)

queryLinks

public com.sas.PropertyLinkInfo[] queryLinks()
Description copied from interface: LinkPropertiesInterface
queryLinks() returns an array of PropertyLinkInfo objects containing information about properties on this component which are linked to properties on this or other components.

Specified by:
queryLinks in interface com.sas.LinkPropertiesInterface
Returns:
A list of linked property names.
See Also:
LinkPropertiesInterface.queryLinks(java.lang.String)

isLinked

public boolean isLinked(java.lang.String property,
                        com.sas.ComponentInterface linked_component,
                        java.lang.String linked_property)
Description copied from interface: LinkPropertiesInterface
isLinked() determines if property on this component is linked to source_property on source_component.

Specified by:
isLinked in interface com.sas.LinkPropertiesInterface
Parameters:
property - The property potentially linked to source_property on source_component.
linked_component - The component with source_property.
linked_property - The property on source_component.
Returns:
true if the properties are linked, false if not.
See Also:
LinkPropertiesInterface.queryLinks(java.lang.String)

getLinkInfo

public com.sas.LinkPropertiesInfo getLinkInfo()
Internal framework method. Not intended to be called by component users.

Specified by:
getLinkInfo in interface com.sas.LinkPropertiesInterface
See Also:
LinkPropertiesInterfaceSupport

setLinkInfo

public void setLinkInfo(com.sas.LinkPropertiesInfo info)
Internal framework method. Not intended to be called by component users.

Specified by:
setLinkInfo in interface com.sas.LinkPropertiesInterface
See Also:
LinkPropertiesInterfaceSupport

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface: ComponentInterface
Adds a PropertyChangeListener to the component.

Specified by:
addPropertyChangeListener in interface com.sas.beans.PropertyChangeSource
Specified by:
addPropertyChangeListener in interface com.sas.ComponentInterface
Overrides:
addPropertyChangeListener in class java.awt.Component
Parameters:
listener - The PropertyChangeListener to receive PropertyChangeEvents.
See Also:
ComponentInterface.addPropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface: ComponentInterface
Removes a PropertyChangeListener from the component.

Specified by:
removePropertyChangeListener in interface com.sas.beans.PropertyChangeSource
Specified by:
removePropertyChangeListener in interface com.sas.ComponentInterface
Overrides:
removePropertyChangeListener in class java.awt.Component
Parameters:
listener - The PropertyChangeListener to stop receiving PropertyChangeEvents.
See Also:
ComponentInterface.removePropertyChangeListener(java.beans.PropertyChangeListener)

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)
Description copied from interface: ComponentInterface
Report a bound property update to any registered listeners. This method returns immediately without any action if there are no registered PropertyChangeEvent listeners. No event is fired if old and new are equal and non-null. This method corresponds to the java.beans.PropertyChangeSupport firePropertyChange method, which we cannot call directly since we have our own com.sas.beans.PropertyChangeEvent.

Specified by:
firePropertyChange in interface com.sas.ComponentInterface
Overrides:
firePropertyChange in class java.awt.Component
Parameters:
propertyName - The name of the property that was changed. null may be passed in to indicate that a generic change to the component (and not a specific property) was made.
oldValue - The old value of the property. null may be passed in to indicate that the old value is unknown.
newValue - The new value of the property. null may be passed in to indicate that the new value is unknown.
See Also:
ComponentInterface.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)

firePropertyChange

public void firePropertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
Description copied from interface: ComponentInterface
Report a bound property update to any registered listeners. This method is provided to allow the user to pass in their existing property change event; usually the other firePropertyChange method will be used which constructs a property change event. Before constructing a PropertyChangeEvent, you should test if there are any PropertyChangeEvent listeners and skip allocating and firing the event if there are no listeners.

Specified by:
firePropertyChange in interface com.sas.ComponentInterface
Parameters:
propertyChangeEvent - A previously constructed property change event
See Also:
ComponentInterface.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Handles any property links on this component from the source component.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

getComponentDescription

public java.lang.String getComponentDescription()
Description copied from interface: ComponentInterface
This method returns the description of the component.

Specified by:
getComponentDescription in interface com.sas.ComponentInterface
Returns:
The description of the component.
See Also:
ComponentInterface.getComponentDescription()

setComponentDescription

public void setComponentDescription(java.lang.String description)
Description copied from interface: ComponentInterface
This method sets the description of the component.

Application writers may want to set unique componentDescriptions on components so that they can be distinquished properly in a testing environment.

Specified by:
setComponentDescription in interface com.sas.ComponentInterface
Parameters:
description - The new description for the component.
See Also:
ComponentInterface.setComponentDescription(java.lang.String)

isDesignTime

public boolean isDesignTime()
Description copied from interface: ComponentInterface
This method returns whether the component is in design mode or in run mode. Typically, a development environment for JavaBeans will set the designTime property to true while the component is being manipulated inside the development environment.

ComponentInterface.isDesignTime should be used instead of java.beans.Beans.isDesignTime since java.beans.Beans.isDesignTime is not thread safe and changes the status of all JavaBeans at the same time.

Specified by:
isDesignTime in interface com.sas.ComponentInterface
Returns:
true for the component is in design mode, false for the component is in run mode.
See Also:
ComponentInterface.isDesignTime()

dumpComponent

public void dumpComponent()
Description copied from interface: ComponentInterface
This method prints debugging information about the component. The value of all of the component's properties is printed. dumpComponent may be overridden by subclasses to provide additional information about component.

Specified by:
dumpComponent in interface com.sas.ComponentInterface
See Also:
ComponentInterface.dumpComponent()

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Description copied from interface: ComponentInterface
Adds a VetoableChangeListener to the component.

Specified by:
addVetoableChangeListener in interface com.sas.beans.VetoableChangeSource
Specified by:
addVetoableChangeListener in interface com.sas.ComponentInterface
Parameters:
listener - The VetoableChangeListener to receive PropertyChangeEvents.
See Also:
ComponentInterface.addVetoableChangeListener(java.beans.VetoableChangeListener)

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Description copied from interface: ComponentInterface
Removes a VetoableChangeListener from the component.

Specified by:
removeVetoableChangeListener in interface com.sas.beans.VetoableChangeSource
Specified by:
removeVetoableChangeListener in interface com.sas.ComponentInterface
Parameters:
listener - The VetoableChangeListener to stop receiving PropertyChangeEvents.
See Also:
ComponentInterface.removeVetoableChangeListener(java.beans.VetoableChangeListener)

fireVetoableChange

public void fireVetoableChange(java.lang.String propertyName,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)
                        throws java.beans.PropertyVetoException
Description copied from interface: ComponentInterface
Report a constrained property update to any registered listeners. No event is fired if old and new are equal and non-null. This method calls the java.beans.VetoableChangeSupport fireVetoableChange method. Throws a java.beans.PropertyVetoException.

Specified by:
fireVetoableChange in interface com.sas.ComponentInterface
Parameters:
propertyName - The name of the property that was changed.
oldValue - The old value of the property. null may be passed in to indicate that the new value is unknown.
newValue - The new value of the property. null may be passed in to indicate that the new value is unknown.
Throws:
java.beans.PropertyVetoException - The listener vetoed the set of this constrained property
See Also:
ComponentInterface.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object)

anyPropertyChangeListeners

public boolean anyPropertyChangeListeners()
Return true if there are any PropertyChangeEvent listeners. If false, you property set methods can skip any additional logic for sending PropertyChangeEvents. Note, there is no equivalent test for vetoable PropertyChangeListeners.

Specified by:
anyPropertyChangeListeners in interface com.sas.ComponentInterface
Returns:
true if there are any property change listeners.

initialize

public void initialize()
Description copied from interface: ComponentInterface
The initialize() method was designed to be a synchronization point after the constructor for the object has completed and a number of methods have been called on the component. This allows components with "expensive" set method calls to delay processing until all the sets have occurred.

initialize() should be called on a component after is it constructed :

     ListBox listBox = new ListBox();
     listBox.initialize();
     container.add( listBox );
 

Overriding initialize is now discouraged since it is generally better to override setDefaultValues and readObject to perform initialization.

By default (in the ComponentInterface implementation), initialize() does nothing. However, various components override initialize() to perform operations, and it should be called.

Although use of initialize() is now discouraged, initialize() is also called by the validateObject method after a component is deserialized. This allows components which need processing during creation and deserialization to have a common place to perform operations. Adding event handlers to subcomponents is a typical use of the initialize method.

Specified by:
initialize in interface com.sas.ComponentInterface
See Also:
ComponentInterface.initialize()

initializeComponent

public void initializeComponent()
Description copied from interface: ComponentInterface
Called by the default constructor. initializeComponent calls setDefaultValues and then sets the designTime property on the component based on com.sas.Component.beansIsDesignTime().

Specified by:
initializeComponent in interface com.sas.ComponentInterface
See Also:
ComponentInterface.initializeComponent()

setDefaultValues

public void setDefaultValues()
Description copied from interface: ComponentInterface
This method sets the initial property values to their default values. It is called by initializeComponent. Subclasses of the Component class or classes that implement the ComponentInterface should override setDefaultValues to perform their initialization.

Note that the designTime property is not initialized when setDefaultValues is called, so initialization which depends on the value of designTime should take place in initializeComponent.

Specified by:
setDefaultValues in interface VisualInterface
Specified by:
setDefaultValues in interface com.sas.ComponentInterface
See Also:
ComponentInterface.setDefaultValues()

validateObject

public void validateObject()
Specified by:
validateObject in interface java.io.ObjectInputValidation
See Also:
ComponentInterfaceSupport.validateObject(com.sas.ComponentInterface)

getComponentSupportInfo

public com.sas.ComponentInterfaceSupportInfo getComponentSupportInfo(boolean createIfNecessary)
Internal framework method. Not intended to be called by component users.

Specified by:
getComponentSupportInfo in interface com.sas.ComponentInterface
Parameters:
createIfNecessary - Whether to create the ComponentInterfaceSupportInfo object if it does not already exist.
Returns:
An instance of ComponentInterfaceSupportInfo holding the information used by the ComponentSupport class to implement the ComponentInterface.

setComponentSupportInfo

public void setComponentSupportInfo(com.sas.ComponentInterfaceSupportInfo info)
Internal framework method. Not intended to be called by component users.

Specified by:
setComponentSupportInfo in interface com.sas.ComponentInterface
Parameters:
info - An instance of ComponentInterfaceSupportInfo holding the information used by the ComponentSupport class to implement the ComponentInterface.

supportsListenerInterface

public boolean supportsListenerInterface(java.lang.Class listenerInterface)
Description copied from interface: MultipleValueEventSourceInterface
Determines if a listenerInterface class is supported by the implementing class.

Specified by:
supportsListenerInterface in interface MultipleValueEventSourceInterface
Parameters:
listenerInterface - the class of the listenerInterface of the event sent out
Returns:
true if the implementing class supports the specified listenerInterface; false otherwise
See Also:
MultipleValueEventSourceInterfaceSupport.supportsListenerInterface(java.lang.Object, java.lang.Class)

getEventMethod

public java.lang.reflect.Method getEventMethod(java.lang.reflect.Method listenerMethod)
Description copied from interface: MultipleValueEventSourceInterface
Get the method used to check the value of the event.

Specified by:
getEventMethod in interface MultipleValueEventSourceInterface
Parameters:
listenerMethod - the listenerInterface method the event is sent to.
Returns:
the method used to find the value of a specific event.
See Also:
MultipleValueEventSourceInterfaceSupport.getEventMethod(java.lang.Object, java.lang.reflect.Method)

getEventValues

public java.lang.String[] getEventValues(java.lang.reflect.Method listenerMethod)
Description copied from interface: MultipleValueEventSourceInterface
Get the possible values for the listenerInterface method the event is sent to.

Specified by:
getEventValues in interface MultipleValueEventSourceInterface
Parameters:
listenerMethod - the listenerInterface method the event is sent to.
Returns:
a string array of all the possible values the method returned by getEventMethod() can return.
See Also:
MultipleValueEventSourceInterfaceSupport.getEventValues(java.lang.Object, java.lang.reflect.Method)

computePreferredSize

public java.awt.Dimension computePreferredSize()
Description copied from interface: VisualInterface
The default implementation of this method calls super.getPreferredSize(). This method should be overridden (instead of getPreferredSize) in components which wish to change their preferred size, so that setPreferredSize can work.

This method should not be called directly since it is called from getPreferredSize when setPreferredSize has not been called with a non-null value.

Specified by:
computePreferredSize in interface VisualInterface
Returns:
The preferred size of the component
See Also:
VisualInterface.computePreferredSize()

getPreferredSize

public java.awt.Dimension getPreferredSize()
Specified by:
getPreferredSize in interface VisualInterface
Overrides:
getPreferredSize in class java.awt.Component
See Also:
VisualInterface.getPreferredSize()

setPreferredSize

public void setPreferredSize(java.awt.Dimension preferredSize)
Description copied from interface: VisualInterface
This method allows the user to set the Dimension returned by getPreferredSize. Passing in null indicates that the superclass getPreferredSize should be called.

Specified by:
setPreferredSize in interface VisualInterface
Overrides:
setPreferredSize in class java.awt.Component
Parameters:
preferredSize - The size to return when getPreferredSize is called on the component.
See Also:
VisualInterface.setPreferredSize(java.awt.Dimension)

getPrePainter

public com.sas.visuals.PainterInterface getPrePainter()
Description copied from interface: VisualInterface
Returns the painter used to draw over the background of the component.

Specified by:
getPrePainter in interface VisualInterface
Returns:
the painter used to draw over the background of the component.
See Also:
VisualInterface.getPrePainter()

setPrePainter

public void setPrePainter(com.sas.visuals.PainterInterface painter)
Description copied from interface: VisualInterface
Sets the painter used to draw over the background of the component.

Specified by:
setPrePainter in interface VisualInterface
Parameters:
painter - The object to use to draw prior to calling paint() on the component.
See Also:
VisualInterface.setPrePainter(com.sas.visuals.PainterInterface)

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Specified by:
setBounds in interface VisualInterface
Overrides:
setBounds in class java.awt.Component
See Also:
VisualInterface.setBounds(int, int, int, int)

getForegroundColor

public java.awt.Color getForegroundColor()
Description copied from interface: VisualInterface
Returns the foreground color of the component.

If you override getForegroundColor, users which treat the component as a java.awt.Component by calling getForeground will not get your behavior changes. So, it would be advisable to override getForeground instead.

Specified by:
getForegroundColor in interface VisualInterface
Returns:
the foreground color of the component.
See Also:
VisualInterface.getForegroundColor()

setForegroundColor

public void setForegroundColor(java.awt.Color color)
Description copied from interface: VisualInterface
Sets the foreground color of the component.

If you override setForegroundColor, users which treat the component as a java.awt.Component by calling setForeground will not get your behavior changes. So, it would be advisable to override setForeground instead.

Specified by:
setForegroundColor in interface VisualInterface
Parameters:
color - The foreground color of the component.
See Also:
VisualInterface.setForegroundColor(java.awt.Color)

getBackgroundColor

public java.awt.Color getBackgroundColor()
Description copied from interface: VisualInterface
Returns the background color of the component.

If you override getBackgroundColor, users which treat the component as a java.awt.Component by calling getBackground will not get your behavior changes. So, it would be advisable to override getBackground instead.

Specified by:
getBackgroundColor in interface VisualInterface
Returns:
the background color of the component.
See Also:
VisualInterface.getBackgroundColor()

setBackgroundColor

public void setBackgroundColor(java.awt.Color color)
Description copied from interface: VisualInterface
Sets the background color of the component.

If you override setBackgroundColor, users which treat the component as a java.awt.Component by calling setBackground will not get your behavior changes. So, it would be advisable to override setBackground instead.

Specified by:
setBackgroundColor in interface VisualInterface
Parameters:
color - The background color of the component.
See Also:
VisualInterface.setBackgroundColor(java.awt.Color)

getFont

public java.awt.Font getFont()
Description copied from interface: VisualInterface
Returns the font used by the component to display text.

Specified by:
getFont in interface VisualInterface
Specified by:
getFont in interface java.awt.MenuContainer
Overrides:
getFont in class java.awt.Component
Returns:
the font used by the component to display text.
See Also:
VisualInterface.getFont()

setFont

public void setFont(java.awt.Font font)
Description copied from interface: VisualInterface
Sets the font to be used by the component for displaying text. Note that some very complex components may use additional or alternate fonts to display text.

Specified by:
setFont in interface VisualInterface
Overrides:
setFont in class java.awt.Component
Parameters:
font - the font to be used by the component for displaying text.
See Also:
VisualInterface.setFont(java.awt.Font)

getWidth

public int getWidth()
Description copied from interface: VisualInterface
This method returns the width of the component in pixels.

Specified by:
getWidth in interface VisualInterface
Overrides:
getWidth in class java.awt.Component
Returns:
The width
See Also:
VisualInterface.getWidth()

setWidth

public void setWidth(int width)
Description copied from interface: VisualInterface
This method sets the width of the component in pixels. The component is responsible for resizing itself to the new size after the change is made.

Specified by:
setWidth in interface VisualInterface
Parameters:
width - the new width
See Also:
VisualInterface.setWidth(int)

getHeight

public int getHeight()
Description copied from interface: VisualInterface
This method returns the vertical size of the component in pixels.

Specified by:
getHeight in interface VisualInterface
Overrides:
getHeight in class java.awt.Component
Returns:
The vertical size
See Also:
VisualInterface.getHeight()

setHeight

public void setHeight(int height)
Description copied from interface: VisualInterface
This method sets the height of the component in pixels. The component is responsible for resizing itself to the new size after the change is made.

Specified by:
setHeight in interface VisualInterface
Parameters:
height - The new height
See Also:
VisualInterface.setHeight(int)

getHorizontalPosition

public int getHorizontalPosition()
Description copied from interface: VisualInterface
This method returns the horizontal starting position of the component in pixels.

Specified by:
getHorizontalPosition in interface VisualInterface
Returns:
The horizontal starting position
See Also:
VisualInterface.getHorizontalPosition()

setHorizontalPosition

public void setHorizontalPosition(int horizontalPosition)
Description copied from interface: VisualInterface
This method sets the horizontal starting position of the component in pixels. The component is responsible for moving itself to the new location after the change is made.

Specified by:
setHorizontalPosition in interface VisualInterface
Parameters:
horizontalPosition - the new horizontal starting position
See Also:
VisualInterface.setHorizontalPosition(int)

getVerticalPosition

public int getVerticalPosition()
Description copied from interface: VisualInterface
This method returns the vertical starting position of the component in pixels.

Specified by:
getVerticalPosition in interface VisualInterface
Returns:
The vertical starting position
See Also:
VisualInterface.getVerticalPosition()

setVerticalPosition

public void setVerticalPosition(int verticalPosition)
Description copied from interface: VisualInterface
This method sets the vertical starting position of the component in pixels. The component is responsible for moving itself to the new location after the change is made.

Specified by:
setVerticalPosition in interface VisualInterface
Parameters:
verticalPosition - the new vertical starting position
See Also:
VisualInterface.setVerticalPosition(int)

getBorder

public BorderInterface getBorder()
Description copied from interface: VisualInterface
Returns the border drawn around the component.

Specified by:
getBorder in interface VisualInterface
Returns:
The border object.
See Also:
VisualInterface.getBorder()

setBorder

public void setBorder(BorderInterface border)
Description copied from interface: VisualInterface
Sets the border drawn around the component.

Specified by:
setBorder in interface VisualInterface
Parameters:
border - The border object.
See Also:
VisualInterface.setBorder(com.sas.visuals.BorderInterface)

isEnabled

public boolean isEnabled()
Description copied from interface: VisualInterface
Returns whether the component is currently enabled.

Specified by:
isEnabled in interface VisualInterface
Overrides:
isEnabled in class java.awt.Component
Returns:
whether the component is currently enabled.
See Also:
VisualInterface.isEnabled()

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: VisualInterface
setEnabled() is the set accessor method for the Enabled attribute. Pass in true to enable the component. Pass in false to disable the component.

Specified by:
setEnabled in interface VisualInterface
Overrides:
setEnabled in class java.awt.Component
Parameters:
enabled - Whether the component should be enabled.
See Also:
VisualInterface.setEnabled(boolean)

isTransparent

public boolean isTransparent()
Description copied from interface: VisualInterface
Returns whether the background is not filled with the backgroundColor.

Specified by:
isTransparent in interface VisualInterface
Returns:
Whether the background is not filled with the backgroundColor.
See Also:
VisualInterface.isTransparent()

setTransparent

public void setTransparent(boolean transparent)
Description copied from interface: VisualInterface
Sets whether the background of the component is filled with the backgroundColor.

The default implementation of the VisualInterface in VisualInterfaceSupport throws a java.lang.IllegalStateException if setTransparent(true) is called on a heavyweight component.

Specified by:
setTransparent in interface VisualInterface
Parameters:
transparent - whether the background of the component is filled with the backgroundColor.
See Also:
VisualInterface.setTransparent(boolean)

isFocus

public boolean isFocus()
Description copied from interface: VisualInterface
isFocus returns whether the component currently has focus.

Specified by:
isFocus in interface VisualInterface
Returns:
whether the component currently has focus.
See Also:
VisualInterface.isFocus()

setFocus

public void setFocus(boolean focus)
Description copied from interface: VisualInterface
setFocus sets focus to the component or away from the component.

Specified by:
setFocus in interface VisualInterface
Parameters:
focus - true if the component should request focus, false if the component should give up focus.
See Also:
VisualInterface.setFocus(boolean)

isVisible

public boolean isVisible()
Description copied from interface: VisualInterface
Returns whether the component is currently visible.

Specified by:
isVisible in interface VisualInterface
Overrides:
isVisible in class java.awt.Component
Returns:
whether the component is currently visible.
See Also:
VisualInterface.isVisible()

setVisible

public void setVisible(boolean visible)
Description copied from interface: VisualInterface
setVisible() is the set accessor method for the Visible attribute. Pass in true to show the component. Pass in false to hide the component.

Specified by:
setVisible in interface VisualInterface
Overrides:
setVisible in class java.awt.Component
Parameters:
visible - Whether the component should be visible.
See Also:
VisualInterface.setVisible(boolean)

getMinimumSize

public java.awt.Dimension getMinimumSize()
Description copied from interface: VisualInterface
Overrides the java.awt.Component getMinimumSize method to return a minimum size of 5,5 for components which do not have a peer. For components which do have a peer, the java.awt.Component getMinimumSize method will be called.

Specified by:
getMinimumSize in interface VisualInterface
Overrides:
getMinimumSize in class java.awt.Component
Returns:
The minimum size
See Also:
VisualInterface.getMinimumSize()

getVisualInterfaceSupportInfo

public VisualInterfaceSupportInfo getVisualInterfaceSupportInfo()
Description copied from interface: VisualInterface
This method is not intended to be called by users. The VisualInterfaceSupport class uses this method.

Returns the info object which holds instance data for objects implementing the VisualInterface interface.

Specified by:
getVisualInterfaceSupportInfo in interface VisualInterface
Returns:
The instance of VisualInterfaceSupportInfo for the component.
See Also:
VisualInterface.getVisualInterfaceSupportInfo()

setVisualInterfaceSupportInfo

public void setVisualInterfaceSupportInfo(VisualInterfaceSupportInfo info)
Description copied from interface: VisualInterface
This method is not intended to be called by users. The VisualInterfaceSupport class uses this method.

Sets the info object which holds instance data for objects implementing the VisualInterface interface.

Specified by:
setVisualInterfaceSupportInfo in interface VisualInterface
Parameters:
info - The instance of VisualInterfaceSupportInfo for the component.
See Also:
VisualInterface.setVisualInterfaceSupportInfo(com.sas.awt.VisualInterfaceSupportInfo)

update

public void update(java.awt.Graphics g)
Overrides:
update in class java.awt.Component
See Also:
VisualInterfaceSupport.update(com.sas.ComponentInterface, com.sas.awt.VisualInterface, java.awt.Component, java.awt.Graphics)

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Component
See Also:
VisualInterfaceSupport.paint(com.sas.ComponentInterface, com.sas.awt.VisualInterface, java.awt.Component, java.awt.Graphics)

superGetPreferredSize

public final java.awt.Dimension superGetPreferredSize()
This method is not intended to be used by users. It is only used by VisualInterfaceSupport.

Calls the superclasses getPreferredSize() method. This is used to avoid an infinite recursive loop in VisualInterfaceSupport.

Specified by:
superGetPreferredSize in interface VisualInterface
See Also:
getPreferredSize()

superPaint

public final void superPaint(java.awt.Graphics g)
This method is not intended to be used by users. It is only used by VisualInterfaceSupport.

Calls the superclasses paint() method. This is used to avoid an infinite recursive loop in VisualInterfaceSupport.

Specified by:
superPaint in interface VisualInterface
See Also:
paint(java.awt.Graphics)

superUpdate

public final void superUpdate(java.awt.Graphics g)
This method is not intended to be used by users. It is only used by VisualInterfaceSupport.

Calls the superclasses update() method. This is used to avoid an infinite recursive loop in VisualInterfaceSupport.

Specified by:
superUpdate in interface VisualInterface
See Also:
update(java.awt.Graphics)

superSetBounds

public final void superSetBounds(int x,
                                 int y,
                                 int width,
                                 int height)
This method is not intended to be used by users. It is only used by VisualInterfaceSupport.

Calls the superclasses setBounds() method. This is used to avoid an infinite recursive loop in VisualInterfaceSupport.

Specified by:
superSetBounds in interface VisualInterface
See Also:
setBounds(int, int, int, int)

superGetMinimumSize

public final java.awt.Dimension superGetMinimumSize()
This method is not intended to be used by users. It is only used by VisualInterfaceSupport.

Calls the superclasses getMinimumSize() method and returns the result. This is used to avoid an infinite recursive loop in VisualInterfaceSupport.

Specified by:
superGetMinimumSize in interface VisualInterface
Returns:
The minimum size of the component.
See Also:
getMinimumSize()

superIsVisible

public final boolean superIsVisible()
This method is not intended to be used by users. It is only used by VisualInterfaceSupport.

Calls the superclasses isVisible() method and returns the result. This is used to avoid an infinite recursive loop in VisualInterfaceSupport.

Specified by:
superIsVisible in interface VisualInterface
Returns:
Whether the component is visible.
See Also:
VisualInterface.superIsVisible()

superSetVisible

public final void superSetVisible(boolean visible)
This method is not intended to be used by users. It is only used by VisualInterfaceSupport.

Calls the superclasses setVisible() method. This is used to avoid an infinite recursive loop in VisualInterfaceSupport.

Specified by:
superSetVisible in interface VisualInterface
Parameters:
visible - Whether the component is visible.
See Also:
VisualInterface.superSetVisible(boolean)

superIsEnabled

public final boolean superIsEnabled()
This method is not intended to be used by users. It is only used by VisualInterfaceSupport.

Calls the superclasses isEnabled() method and returns the result. This is used to avoid an infinite recursive loop in VisualInterfaceSupport.

Specified by:
superIsEnabled in interface VisualInterface
Returns:
Whether the component is enabled.
See Also:
VisualInterface.superIsEnabled()

superSetEnabled

public void superSetEnabled(boolean enabled)
This method is not intended to be used by users. It is only used by VisualInterfaceSupport.

Calls the superclasses setEnabled() method. This is used to avoid an infinite recursive loop in VisualInterfaceSupport.

Specified by:
superSetEnabled in interface VisualInterface
See Also:
VisualInterface.superSetEnabled(boolean)

superGetFont

public final java.awt.Font superGetFont()
This method is not intended to be used by users. It is only used by VisualInterfaceSupport.

Calls the superclasses getFont() method and returns the result. This is used to avoid an infinite recursive loop in VisualInterfaceSupport.

Specified by:
superGetFont in interface VisualInterface
Returns:
The components Font.
See Also:
VisualInterface.superGetFont()

superSetFont

public void superSetFont(java.awt.Font font)
This method is not intended to be used by users. It is only used by VisualInterfaceSupport.

Calls the superclasses setFont() method. This is used to avoid an infinite recursive loop in VisualInterfaceSupport.

Specified by:
superSetFont in interface VisualInterface
See Also:
VisualInterface.superSetEnabled(boolean)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.