amber.server.component
Class CheckboxPanelHandler

java.lang.Object
  |
  +--java.awt.Component
        |
        +--amber.server.component.ComponentHandler
              |
              +--amber.server.component.CheckboxPanelHandler
All Implemented Interfaces:
ApplicationInterface, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable

public class CheckboxPanelHandler
extends ComponentHandler
implements java.io.Serializable

This class handles the requirements for the manipulation of the packets moving to and from a checkbox panel component. It is designed to look like a standard panel with a series of checkbox items grouped together (i.e. a radio button panel). This component interacts with the ApplicationInterface as if the items were running on the server rather than the Browser.

The remote client class also responds to information stored in the parameters field of the XYConstraints object when this handler is added to a panel. The allowed parameters are separated in the string by '|' characters. Any unused trailing parameters are optional and will assume default values, however the parameter order is fixed.

For example, if the component takes 4 parameters which are ints, a valid parameter string would be:

"1|2|3"

In this case the fourth parameter would assume the default value.

The parameter elements for this component are:

Component Parameters
NameTypeDescriptionRepeatsDefault
OrientationintVertical/Horizontal orientation of the radio controls: 0 = Vertical, 1 = HorizontalNo 
Selected indexintThe radio control to select first.No 
LabelStringLabel for a radio controlsYes 

Version:
1.0.0
Author:
Dr. David J. Knowles
See Also:
ApplicationInterface, ComponentHandler, XYConstraints, Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static byte AddLabel
           
static byte ClearList
           
static byte GetLabel
           
static byte GetLabelCount
           
static byte GetLabelCountResponse
           
static byte GetLabelResponse
           
static byte GetSelectedIndex
           
static byte GetSelectedIndexResponse
           
static byte GetSelectedLabel
           
static byte GetSelectedLabelResponse
           
static byte SetLabel
           
static byte SetOrientation
           
static byte SetSelectedIndex
           
static byte SetSelectedLabel
           
 
Fields inherited from class amber.server.component.ComponentHandler
actionCommand, active, ApplicationId, CancelReturn, dataEncoder, DefaultTimeout, enabledState, encoderBytes, id, InvalidId, MaximumId, NoReturn, OkCancelType, OkReturn, OkType, OkYesReturn, parentPage, responsePackets, timeoutValue, UnchangeableInvalidId, visibleState, YesNoCancelType, YesNoType, YesReturn
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CheckboxPanelHandler()
          Default constructor.
CheckboxPanelHandler(ApplicationInterface pageHandler)
          The initialising constructor.
CheckboxPanelHandler(int id, ApplicationInterface pageHandler)
          The initialising constructor.
 
Method Summary
 void addLabel(java.lang.String label)
          Adds a label to the checkbox panel.
 java.lang.String getLabel(int index)
          Returns the label of the checkbox specified by the index value.
 int getLabelCount()
          Returns the number of labels in the checkbox panel.
 java.lang.String getPanelType()
          This function returns the panel component to use with this class.
 int getSelectedIndex()
          Returns the index of the checkbox which is currently selected (ie.
 java.lang.String getSelectedLabel()
          Returns the label of the checkbox which is currently selected (ie.
 boolean isVerticalOrientation()
          Returns the state of orientation for the checkboxes in the panel.
 void removeAll()
          Removes all the items in the checkbox panel.
 void setLabel(int index, java.lang.String label)
          Sets the label of a checkbox in the checkbox panel.
 void setSelectedIndex(int index)
          Sets the checkbox selected by the index value to be the active checkbox (ie.
 void setSelectedLabel(java.lang.String label)
          Sets the checkbox selected by the label specified to be the active checkbox (ie.
 void setVerticalOrientation(boolean state)
          Sets the state of orientation for the checkboxes in the panel.
 
Methods inherited from class amber.server.component.ComponentHandler
addActionListener, addComponentListener, addEventMask, addFocusListener, addItemListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addReceivedPacket, addTextListener, addWindowListener, booleanToInt, createDataInput, directPacket, displayMessageBox, fireWindowActivated, fireWindowClosed, fireWindowClosing, fireWindowDeactivated, fireWindowDeiconified, fireWindowEvent, fireWindowIconified, fireWindowOpened, forceComponentGetUrl, forceComponentGetUrl, forwardEventPacket, generateActionEvent, generateFocusEvent, generateItemEvent, generateKeyEvent, generateMouseEvent, getActionCommand, getBounds, getComponentStructure, getDefaultParameters, getEventMask, getFontCharacteristics, getFontCharacteristics, getFontCharacteristics, getFontCharacteristics, getFontStyle, getId, getLocation, getLog, getModalObject, getParentApplication, getParentContainer, getParentServer, getResponsePacket, getSelectedObjects, getSize, getTimeout, getValidId, getX, getY, handleMessages, handlePacket, internalForwardPacket, internalGetBounds, intToBoolean, isActive, isApplicationActive, isComponentModal, isConnected, isEnabled, isMyId, isVisible, processActionEvent, processComponentEvent, processCurrentPacket, processEvent, processFocusEvent, processItemEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processNormalResponse, processTextEvent, queryMessageBox, removeActionListener, removeComponentListener, removeEventMask, removeFocusListener, removeItemListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removeTextListener, removeWindowListener, requestFocus, resetState, restart, sendPacket, sendPacketAndBlock, sendPendingPackets, setActionCommand, setActive, setBackground, setComponentModal, setConnectedState, setCursor, setEnabled, setEventMask, setFont, setFont, setFontStyle, setForeground, setForegroundBackground, setId, setLog, setModalObject, setParentApplication, setParentContainer, setParentServer, setTimeout, setVisible, setX, setY, shutDown, shutDownClient, shutDownClient, start
 
Methods inherited from class java.awt.Component
action, add, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getToolkit, getTreeLock, getWidth, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, remove, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AddLabel

public static final byte AddLabel

GetLabel

public static final byte GetLabel

GetLabelResponse

public static final byte GetLabelResponse

SetLabel

public static final byte SetLabel

SetSelectedLabel

public static final byte SetSelectedLabel

GetSelectedLabel

public static final byte GetSelectedLabel

GetSelectedLabelResponse

public static final byte GetSelectedLabelResponse

SetSelectedIndex

public static final byte SetSelectedIndex

GetSelectedIndex

public static final byte GetSelectedIndex

GetSelectedIndexResponse

public static final byte GetSelectedIndexResponse

SetOrientation

public static final byte SetOrientation

ClearList

public static final byte ClearList

GetLabelCount

public static final byte GetLabelCount

GetLabelCountResponse

public static final byte GetLabelCountResponse
Constructor Detail

CheckboxPanelHandler

public CheckboxPanelHandler()
Default constructor.

CheckboxPanelHandler

public CheckboxPanelHandler(ApplicationInterface pageHandler)
The initialising constructor. This constructor dynamically requests a valid ID value from the ApplicationInterface.
Parameters:
pageHandler - The handle to the main ApplicationInterface which handles the functions of page overall. residing on the browser.

CheckboxPanelHandler

public CheckboxPanelHandler(int id,
                            ApplicationInterface pageHandler)
The initialising constructor.
Parameters:
id - The int containing the id of the corresponding remote component residing on the browser.
pageHandler - The handle to the main ApplicationInterface which handles the functions of page overall.
Method Detail

addLabel

public void addLabel(java.lang.String label)
              throws ComponentHandlerException
Adds a label to the checkbox panel. This creates a new checkbox to hold the state and places it at the end of the list.
Parameters:
label - String containing the label for the new checkbox in the panel.
Throws:
ComponentHandlerException - with any messaging errors.

setVerticalOrientation

public void setVerticalOrientation(boolean state)
                            throws ComponentHandlerException
Sets the state of orientation for the checkboxes in the panel.
Parameters:
state - boolean which is true if the checkboxes are to be stacked vertically otherwise the checkboxes are horizontally aligned (alongside each other).
Throws:
ComponentHandlerException - with any messaging errors.

isVerticalOrientation

public boolean isVerticalOrientation()
Returns the state of orientation for the checkboxes in the panel.
Returns:
boolean which is true if the checkboxes are stacked vertically otherwise a false is returned.

removeAll

public void removeAll()
               throws ComponentHandlerException
Removes all the items in the checkbox panel.
Throws:
ComponentHandlerException - with any messaging errors.

getLabelCount

public int getLabelCount()
                  throws ComponentHandlerException
Returns the number of labels in the checkbox panel.
Returns:
int number of labels in the panel.
Throws:
ComponentHandlerException - with any messaging errors.

getLabel

public java.lang.String getLabel(int index)
                          throws ComponentHandlerException
Returns the label of the checkbox specified by the index value.
Parameters:
index - int index of the checkbox to determine the label for.
Returns:
String containing the specified label.
Throws:
ComponentHandlerException - with any messaging errors.

setLabel

public void setLabel(int index,
                     java.lang.String label)
              throws ComponentHandlerException
Sets the label of a checkbox in the checkbox panel. This alters the current label of the checkbox specified by the index to a new value.
Parameters:
index - int index of the checkbox to alter.
label - String containing the label to alter the checkbox to.
Throws:
ComponentHandlerException - with any messaging errors.

setSelectedLabel

public void setSelectedLabel(java.lang.String label)
                      throws ComponentHandlerException
Sets the checkbox selected by the label specified to be the active checkbox (ie. the checkbox which is on).
Parameters:
label - String specifying which checkbox to select.
Throws:
ComponentHandlerException - with any messaging errors.

getSelectedLabel

public java.lang.String getSelectedLabel()
                                  throws ComponentHandlerException
Returns the label of the checkbox which is currently selected (ie. the checkbox which is on).
Returns:
String specifying which checkbox was selected.
Throws:
ComponentHandlerException - with any messaging errors.

setSelectedIndex

public void setSelectedIndex(int index)
                      throws ComponentHandlerException
Sets the checkbox selected by the index value to be the active checkbox (ie. the checkbox which is on).
Parameters:
index - int index of the checkbox to select.
Throws:
ComponentHandlerException - with any messaging errors.

getSelectedIndex

public int getSelectedIndex()
                     throws ComponentHandlerException
Returns the index of the checkbox which is currently selected (ie. the checkbox which is on).
Returns:
int specifying which checkbox was selected.
Throws:
ComponentHandlerException - with any messaging errors.

getPanelType

public java.lang.String getPanelType()
This function returns the panel component to use with this class.
Overrides:
getPanelType in class ComponentHandler
Returns:
String containing the panel type to use.


Copyright © 2002 Clearfield Research Ltd. All Rights Reserved.