com.sas.awt
Interface VisualInterface

All Known Subinterfaces:
ContainerInterface
All Known Implementing Classes:
AnimationIconView, Applet, AppletVisualComponent, ArrowButton, BaseButton, BasicColorsCanvas, BasicColorsPanel, BorderedContainer, BorderedPanel, BufferedPanel, Button, ButtonDialog, ButtonPanel, ButtonVisualComponent, Canvas, CanvasVisualComponent, CatalogSelectorDialog, CheckBox, CheckBoxCell, CheckBoxVisualComponent, Choice, ChoiceVisualComponent, ClassSelectorPanel, CloseCancelCustomizerDialog, ColorDialog, ColorPanel, ComboBox, Component, ComponentVisualComponent, CompositeContainer, CompositePanel, Container, ContainerContainerComponent, ContainerVisualComponent, CustomColorsPanel, CustomizerDialog, CustomizerPanel, DataSetSelectorDialog, Dialog, DialogContainerComponent, DialogVisualComponent, DirectoryDialog, DualSelector, EISSelectorDialog, Fireworks, FontDialog, FontPanel, Frame, FrameContainerComponent, FrameVisualComponent, GraphicalCheckBox, IconView, ImageAnimation, ImageSequence, ImageView, IndexedPropertyEditorHost, Label, LabelView, LabelVisualComponent, LibrarySelectorDialog, ListBox, ListBoxVisualComponent, Marquee, MessageBox, MetabaseSelectorDialog, NavigationBar, NumericTextField, OkCancelHelpDialog, OrientationSelector, Panel, PanelContainerComponent, PanelVisualComponent, ProgressDialog, PropertyEditorHost, PropertySheet, PushButton, RadioBox, RadioButton, RemoteObjectCustomizerPanel, RemoteObjectSelectorDialog, Scrollbar, Scrollbar, ScrollbarVisualComponent, ScrollPane, ScrollPaneContainerComponent, ScrollPaneVisualComponent, ScrollSlider, SpinBox, SpinButton, StyledLabelView, TabBar, TabbedView, TabButton, TabFolder, TableView, TextArea, TextAreaVisualComponent, TextEditComposite, TextField, TextFieldVisualComponent, ToggleButton, Toolbar, ToolbarButton, TreeView, UnitsBox, UpDownListBox, UpDownTextArea, WordWrapTextArea

public interface VisualInterface

VisualInterface defines added behavior of webAF visual components. It contains functionality such as retrieving and setting component size and position, retrieving and setting foreground and background colors, retrieving and setting the font used by the component, retrieving and setting the border displayed around the component, retrieving and setting whether the component is visible, and retrieving and setting whether the component is enabled.

A default implementation of VisualInterface is supplied by com.sas.visuals.VisualInterfaceSupport. The Bean Extension Wizard can subclass a java.awt.Component derived class and add an implementation of the VisualInterface.


Method Summary
 java.awt.Dimension computePreferredSize()
          The default implementation of this method calls super.getPreferredSize().
 java.awt.Color getBackgroundColor()
          Returns the background color of the component.
 BorderInterface getBorder()
          Returns the border drawn around 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.
 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.
 java.awt.Dimension getPreferredSize()
           
 com.sas.visuals.PainterInterface getPrePainter()
          Returns the painter used to draw over the background of the component.
 int getVerticalPosition()
          This method returns the vertical starting position of the component in pixels.
 VisualInterfaceSupportInfo getVisualInterfaceSupportInfo()
          This method is not intended to be called by users.
 int getWidth()
          This method returns the width of the component in pixels.
 boolean isEnabled()
          Returns whether the component is currently enabled.
 boolean isFocus()
          isFocus returns whether the component currently has focus.
 boolean isTransparent()
          Returns whether the background is not filled with the backgroundColor.
 boolean isVisible()
          Returns whether the component is currently visible.
 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 setDefaultValues()
           
 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 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 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 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()
           
 java.awt.Dimension superGetMinimumSize()
           
 java.awt.Dimension superGetPreferredSize()
           
 boolean superIsEnabled()
           
 boolean superIsVisible()
           
 void superPaint(java.awt.Graphics g)
           
 void superSetBounds(int x, int y, int width, int height)
           
 void superSetEnabled(boolean enabled)
           
 void superSetFont(java.awt.Font font)
           
 void superSetVisible(boolean visible)
           
 void superUpdate(java.awt.Graphics g)
           
 

Method Detail

setDefaultValues

void setDefaultValues()
See Also:
ComponentInterface.setDefaultValues()

getPreferredSize

java.awt.Dimension getPreferredSize()
See Also:
Component.getPreferredSize()

setBounds

void setBounds(int x,
               int y,
               int width,
               int height)
See Also:
Component.setBounds(int, int, int, int)

getForegroundColor

java.awt.Color getForegroundColor()
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.

Returns:
the foreground color of the component.
See Also:
Component.getForeground(), setForegroundColor(java.awt.Color), getBackgroundColor()

setForegroundColor

void setForegroundColor(java.awt.Color color)
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.

Parameters:
color - The foreground color of the component.
See Also:
Component.setForeground(java.awt.Color), setForegroundColor(java.awt.Color), setBackgroundColor(java.awt.Color)

getBackgroundColor

java.awt.Color getBackgroundColor()
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.

Returns:
the background color of the component.
See Also:
Component.getBackground(), getForegroundColor()

setBackgroundColor

void setBackgroundColor(java.awt.Color color)
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.

Parameters:
color - The background color of the component.
See Also:
Component.setBackground(java.awt.Color), setBackgroundColor(java.awt.Color), setForegroundColor(java.awt.Color)

getFont

java.awt.Font getFont()
Returns the font used by the component to display text.

Returns:
the font used by the component to display text.
See Also:
Component.getFont(), setFont(java.awt.Font)

setFont

void setFont(java.awt.Font font)
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.

Parameters:
font - the font to be used by the component for displaying text.
See Also:
Component.setFont(java.awt.Font), getFont()

isVisible

boolean isVisible()
Returns whether the component is currently visible.

Returns:
whether the component is currently visible.
See Also:
Component.isVisible(), setVisible(boolean)

setVisible

void setVisible(boolean visible)
setVisible() is the set accessor method for the Visible attribute. Pass in true to show the component. Pass in false to hide the component.

Parameters:
visible - Whether the component should be visible.
See Also:
isVisible()

isEnabled

boolean isEnabled()
Returns whether the component is currently enabled.

Returns:
whether the component is currently enabled.
See Also:
Component.isEnabled(), setEnabled(boolean)

setEnabled

void setEnabled(boolean enabled)
setEnabled() is the set accessor method for the Enabled attribute. Pass in true to enable the component. Pass in false to disable the component.

Parameters:
enabled - Whether the component should be enabled.
See Also:
isEnabled()

isFocus

boolean isFocus()
isFocus returns whether the component currently has focus.

Returns:
whether the component currently has focus.

setFocus

void setFocus(boolean focus)
setFocus sets focus to the component or away from the component.

Parameters:
focus - true if the component should request focus, false if the component should give up focus.

getMinimumSize

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. For components which do have a peer, the java.awt.Component getMinimumSize method will be called.

Returns:
The minimum size
See Also:
Component.getMinimumSize()

superGetPreferredSize

java.awt.Dimension superGetPreferredSize()
See Also:
Component.getPreferredSize()

superPaint

void superPaint(java.awt.Graphics g)
See Also:
Component.paint(java.awt.Graphics)

superUpdate

void superUpdate(java.awt.Graphics g)
See Also:
Component.update(java.awt.Graphics)

superSetBounds

void superSetBounds(int x,
                    int y,
                    int width,
                    int height)
See Also:
Component.setBounds(int, int, int, int)

superIsVisible

boolean superIsVisible()
See Also:
Component.isVisible()

superSetVisible

void superSetVisible(boolean visible)
See Also:
Component.setVisible(boolean)

superIsEnabled

boolean superIsEnabled()
See Also:
Component.isEnabled()

superSetEnabled

void superSetEnabled(boolean enabled)
See Also:
Component.setEnabled(boolean)

superGetFont

java.awt.Font superGetFont()
See Also:
Component.getFont()

superSetFont

void superSetFont(java.awt.Font font)
See Also:
Component.setFont(java.awt.Font)

superGetMinimumSize

java.awt.Dimension superGetMinimumSize()
See Also:
Component.getMinimumSize()

computePreferredSize

java.awt.Dimension computePreferredSize()
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.

Returns:
The preferred size of the component

setPreferredSize

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

Parameters:
preferredSize - The size to return when getPreferredSize is called on the component.

getWidth

int getWidth()
This method returns the width of the component in pixels.

Returns:
The width
See Also:
setWidth(int), getHeight(), getHorizontalPosition()

setWidth

void setWidth(int width)
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.

Parameters:
width - the new width
See Also:
getWidth(), setHeight(int), setHorizontalPosition(int)

getHeight

int getHeight()
This method returns the vertical size of the component in pixels.

Returns:
The vertical size
See Also:
setHeight(int), getWidth(), getVerticalPosition()

setHeight

void setHeight(int height)
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.

Parameters:
height - The new height
See Also:
getHeight(), setWidth(int), setVerticalPosition(int)

getHorizontalPosition

int getHorizontalPosition()
This method returns the horizontal starting position of the component in pixels.

Returns:
The horizontal starting position
See Also:
setHorizontalPosition(int), getVerticalPosition(), getWidth()

setHorizontalPosition

void setHorizontalPosition(int horizontalPosition)
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.

Parameters:
horizontalPosition - the new horizontal starting position
See Also:
getHorizontalPosition(), setVerticalPosition(int), setWidth(int)

getVerticalPosition

int getVerticalPosition()
This method returns the vertical starting position of the component in pixels.

Returns:
The vertical starting position
See Also:
setVerticalPosition(int), getHorizontalPosition(), getHeight()

setVerticalPosition

void setVerticalPosition(int verticalPosition)
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.

Parameters:
verticalPosition - the new vertical starting position
See Also:
getVerticalPosition(), setHorizontalPosition(int), setWidth(int)

getBorder

BorderInterface getBorder()
Returns the border drawn around the component.

Returns:
The border object.
See Also:
setBorder(com.sas.visuals.BorderInterface)

setBorder

void setBorder(BorderInterface border)
Sets the border drawn around the component.

Parameters:
border - The border object.
See Also:
getBorder()

isTransparent

boolean isTransparent()
Returns whether the background is not filled with the backgroundColor.

Returns:
Whether the background is not filled with the backgroundColor.
See Also:
setTransparent(boolean)

setTransparent

void setTransparent(boolean transparent)
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.

Parameters:
transparent - whether the background of the component is filled with the backgroundColor.
See Also:
isTransparent()

getPrePainter

com.sas.visuals.PainterInterface getPrePainter()
Returns the painter used to draw over the background of the component.

Returns:
the painter used to draw over the background of the component.
See Also:
setPrePainter(com.sas.visuals.PainterInterface)

setPrePainter

void setPrePainter(com.sas.visuals.PainterInterface painter)
Sets the painter used to draw over the background of the component.

Parameters:
painter - The object to use to draw prior to calling paint() on the component.
See Also:
getPrePainter()

getVisualInterfaceSupportInfo

VisualInterfaceSupportInfo getVisualInterfaceSupportInfo()
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.

Returns:
The instance of VisualInterfaceSupportInfo for the component.

setVisualInterfaceSupportInfo

void setVisualInterfaceSupportInfo(VisualInterfaceSupportInfo info)
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.

Parameters:
info - The instance of VisualInterfaceSupportInfo for the component.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.