com.sas.visuals
Class GraphicalCheckBox

com.sas.visuals.GraphicalCheckBox
All Implemented Interfaces:
ActionSource, CompositeInterface, ContainerInterface, com.sas.awt.print.PrintableInterface, VisualInterface, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.ComponentInterface, com.sas.DesignTimeDropTargetInterface, com.sas.lang.StringDataInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, com.sas.PublicClonable, ValidatorInterface, com.sas.ViewInterface, Alignment, MultipleValueEventSourceInterface, ResizeToFitInterface, SelectableInterface, java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
CheckBoxCell

public class GraphicalCheckBox

A GraphicalCheckBox is a ToggleButton with a predefined set of images.
Creating a GraphicalCheckBox:


 GraphicalCheckBox graphicalCheckBox1 = new GraphicalCheckBox(); 
 graphicalCheckBox1.setImageSet (GraphicalCheckBox.LIGHT_SWITCH);
 myPanel.add (graphicalCheckBox1);
 

Usage:

The GraphicalCheckBox class supports a number of predefined image sets for common things like a light switch, a light bulb, a traffic light, and a lock. It provides a property for choosing which of the predefined sets of images to use (imageSet).

See Also:
Serialized Form

Field Summary
static int CHECK
          CHECK image value id
static int CHECK_INVALID
          CHECK_X image value id
static int COLOR_CHECK
          COLOR_CHECK image value id
protected  int imageSet
           
static int LAMP
          LAMP image value id
static int LIGHT_BULB
          LIGHT_BULB image value id
static int LOCK
          LOCK image value id
static int MAILBOX
          MAILBOX image value id
static int MOON_SUN
          MOON_SUN image value id
protected  ImageView offImageView
           
protected  ImageView onImageView
           
static int STOP_GO
          STOP_GO image value id
static int TRAFFIC_LIGHT
          TRAFFIC_LIGHT image value id
static int TRASH
          TRASH image value id
static int XBOX
          XBOX image value id
 
Fields inherited from class com.sas.visuals.ToggleButton
contentShift, label, textBounds
 
Fields inherited from class com.sas.visuals.BaseButton
actionCommand, actionListenerList, borderPainted, BOTTOM, buttonListener, buttonModel, currentInsets, defaultIcon, disabledIcon, displayTransform, focusGap, focusPainted, gap, hasFocus, horizontalAlignment, horizontalTextAlignment, item, itemListenerList, LEFT, pressedIcon, resizeToFit, RIGHT, rolloverIcon, selectedIcon, text, textPosition, TOP, updateItem, updateText, verticalAlignment, verticalTextAlignment
 
Fields inherited from interface com.sas.visuals.Alignment
BEGIN, CENTER, END
 
Constructor Summary
GraphicalCheckBox()
          Constructor creates a GraphicalCheckBox with default image and text, "CheckBox".
GraphicalCheckBox(int imageSetIn)
          Constructor that sets the images to use in the GraphicalCheckBox.
 
Method Summary
static int getDefaultHeight()
          Gets the default height of the GraphicalCheckBox in pixels
static int getDefaultWidth()
          Gets the default width of the GraphicalCheckBox in pixels
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
          Returns property information about the GraphicalCheckBox.
 int getImageSet()
          Gets the image value ids for the images displayed in the GraphicalCheckBox.
protected  void paintFocus(java.awt.Graphics g)
          Overridden to paint the focus rectangle around the text and not around the entire RadioButton.
static void setDefaultHeight(int newDefaultHeight)
          Sets the default height of the GraphicalCheckBox
static void setDefaultWidth(int newDefaultWidth)
          Sets the default width of the GraphicalCheckBox
 void setImageSet(int imageSetIn)
          Sets the images displayed in the GraphicalCheckBox.
 
Methods inherited from class com.sas.visuals.ToggleButton
buttonModelArmed, buttonModelPressed, buttonModelSelected, clone, contentShift, getContentShift, getMinimumSize, getSelectionGroup, getSource, getTextBounds, paint, paintBackground, setContentShift, setFont, setHorizontalTextAlignment, setSelected, setSelectionGroup, setSource, setText, setVerticalTextAlignment
 
Methods inherited from class com.sas.visuals.BaseButton
actionPerformed, addActionListener, addItemListener, addNotify, buttonModelDisabled, buttonModelRollover, computePreferredSize, detachModel, focusGained, focusLost, getActionCommand, getButtonListener, getButtonModel, getContentSize, getDefaultIcon, getDisabledIcon, getDisplayTransform, getFocusGap, getHorizontalAlignment, getHorizontalTextAlignment, getIconTextGap, getInsets, getItem, getKeyAccelerator, getPressedIcon, getRequiredInterfaces, getRolloverIcon, getSelectedIcon, getSelectedObjects, getText, getTextPosition, getVerticalAlignment, getVerticalTextAlignment, isBorderPainted, isFocusPainted, isFocusTraversable, isResizeToFit, isSelected, itemStateChanged, processActionEvent, processEvent, processItemEvent, propertyChange, refresh, refreshItem, removeActionListener, removeItemListener, resizeToFit, setActionCommand, setBorderPainted, setBounds, setButtonListener, setButtonModel, setDefaultIcon, setDefaultValues, setDisabledIcon, setDisplayTransform, setEnabled, setFocusGap, setFocusPainted, setHorizontalAlignment, setIconTextGap, setInsets, setItem, setKeyAccelerator, setPressedIcon, setResizeToFit, setRolloverIcon, setSelectedIcon, setTextPosition, setVerticalAlignment
 
Methods inherited from class com.sas.awt.ContainerContainerComponent
dragEnter, dragLeave, dragOver, drop, getContainerInterfaceSupportInfo, getErrorHandler, getValidator, isIDEDnDDropBarrier, isIDEDnDDropTarget, isValid, removeNotify, setContainerInterfaceSupportInfo, setErrorHandler, setIDEDnDDropBarrier, setIDEDnDDropTarget, setInsets, setValidator, superAddNotify, superGetInsets, superRemoveNotify, superSetDefaultValues
 
Methods inherited from class com.sas.awt.ContainerVisualComponent
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getBackgroundColor, getBorder, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getFont, getForegroundColor, getHeight, getHorizontalPosition, getLinkInfo, getModelInterface, getPageBounds, getPreferredSize, getPrePainter, getPrintOptionsPanel, getVerticalPosition, getViewInterfaceSupportInfo, getVisualInterfaceSupportInfo, getWidth, initialize, initializeComponent, isDesignTime, isEnabled, isFocus, isLinked, isTransparent, isVisible, pageExists, print, printFinalize, printInitialize, queryLinks, queryLinks, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setBackgroundColor, setBorder, setComponentDescription, setComponentSupportInfo, setFocus, setForegroundColor, setHeight, setHorizontalPosition, setLinkInfo, setModelInterface, setPreferredSize, setPrePainter, setRequiredInterfaces, setTransparent, setVerticalPosition, setViewInterfaceSupportInfo, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, update, validateObject
 
Methods inherited from interface com.sas.visuals.SelectableInterface
getButtonModel, getDisplayTransform, getItem, setDisplayTransform, setItem
 
Methods inherited from interface com.sas.awt.ContainerInterface
getComponents, getLayout, invalidate, setLayout, validate
 
Methods inherited from interface com.sas.awt.VisualInterface
getBackgroundColor, getBorder, getFont, getForegroundColor, getHeight, getHorizontalPosition, getPreferredSize, getPrePainter, getVerticalPosition, getVisualInterfaceSupportInfo, getWidth, isEnabled, isFocus, isTransparent, isVisible, setBackgroundColor, setBorder, setFocus, setForegroundColor, setHeight, setHorizontalPosition, setPreferredSize, setPrePainter, setTransparent, setVerticalPosition, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate
 

Field Detail

CHECK

public static final int CHECK
CHECK image value id

See Also:
Constant Field Values

LAMP

public static final int LAMP
LAMP image value id

See Also:
Constant Field Values

LIGHT_BULB

public static final int LIGHT_BULB
LIGHT_BULB image value id

See Also:
Constant Field Values

CHECK_INVALID

public static final int CHECK_INVALID
CHECK_X image value id

See Also:
Constant Field Values

STOP_GO

public static final int STOP_GO
STOP_GO image value id

See Also:
Constant Field Values

TRAFFIC_LIGHT

public static final int TRAFFIC_LIGHT
TRAFFIC_LIGHT image value id

See Also:
Constant Field Values

MAILBOX

public static final int MAILBOX
MAILBOX image value id

See Also:
Constant Field Values

TRASH

public static final int TRASH
TRASH image value id

See Also:
Constant Field Values

LOCK

public static final int LOCK
LOCK image value id

See Also:
Constant Field Values

MOON_SUN

public static final int MOON_SUN
MOON_SUN image value id

See Also:
Constant Field Values

COLOR_CHECK

public static final int COLOR_CHECK
COLOR_CHECK image value id

See Also:
Constant Field Values

XBOX

public static final int XBOX
XBOX image value id

See Also:
Constant Field Values

offImageView

protected ImageView offImageView

onImageView

protected ImageView onImageView

imageSet

protected int imageSet
Constructor Detail

GraphicalCheckBox

public GraphicalCheckBox()
Constructor creates a GraphicalCheckBox with default image and text, "CheckBox".


GraphicalCheckBox

public GraphicalCheckBox(int imageSetIn)
Constructor that sets the images to use in the GraphicalCheckBox.

Parameters:
imageSetIn - one of the image value ids.
Method Detail

getDefaultWidth

public static int getDefaultWidth()
Gets the default width of the GraphicalCheckBox in pixels

See Also:
setDefaultWidth(int)

setDefaultWidth

public static void setDefaultWidth(int newDefaultWidth)
Sets the default width of the GraphicalCheckBox

Parameters:
newDefaultWidth - desired default width in pixels
See Also:
getDefaultWidth()

getDefaultHeight

public static int getDefaultHeight()
Gets the default height of the GraphicalCheckBox in pixels

See Also:
setDefaultHeight(int)

setDefaultHeight

public static void setDefaultHeight(int newDefaultHeight)
Sets the default height of the GraphicalCheckBox

Parameters:
newDefaultHeight - desired default height in pixels
See Also:
getDefaultHeight()

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
Returns property information about the GraphicalCheckBox.

Returns:
ExtendedBeanInfo object containing property information about the GraphicalCheckBox

paintFocus

protected void paintFocus(java.awt.Graphics g)
Overridden to paint the focus rectangle around the text and not around the entire RadioButton.

Overrides:
paintFocus in class ToggleButton
Parameters:
g - the Graphics context

setImageSet

public void setImageSet(int imageSetIn)
Sets the images displayed in the GraphicalCheckBox.

Parameters:
imageSetIn - one of the image value ids descibing which images to display.
See Also:
getImageSet()

getImageSet

public int getImageSet()
Gets the image value ids for the images displayed in the GraphicalCheckBox.

Returns:
one of the image value ids descibing which images to display.
See Also:
setImageSet(int)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.