amber.server.component
Class ComplexListHandler

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

public class ComplexListHandler
extends ComponentHandler
implements java.io.Serializable

This class handles the requirements for the manipulation of the packets moving to and from a complex list component. It is designed to look like a multicolumnar list and interacts with the ApplicationInterface as if the list 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

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

Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static byte AddLine
           
static byte ChangeSelection
           
static byte ClearList
           
static byte ColumnEvent
           
static byte DeleteLine
           
static byte Display
           
static byte GetIndexAtPoint
           
static byte GetIndexAtPointResponse
           
static byte GetSelectedColumn
           
static byte GetSelectedColumnResponse
           
static byte GetSelectedIndex
           
static byte GetSelectedIndexes
           
static byte GetSelectedIndexesResponse
           
static byte GetSelectedIndexResponse
           
static byte HeaderHeight
           
static byte InsertLine
           
static byte NextAvailableCommand
           
static byte ReplaceItem
           
static byte ReplaceLine
           
static byte SetAlignment
           
static byte SetAlignments
           
static byte SetColumnSizes
           
static byte SetHeaders
           
static byte SetLineHeight
           
static byte SetMultipleMode
           
static byte SetSelectedColumn
           
static byte ShowHeader
           
 
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
ComplexListHandler()
          Default constructor.
ComplexListHandler(ApplicationInterface pageHandler)
          The initialising constructor.
ComplexListHandler(int id, ApplicationInterface pageHandler)
          The initialising constructor.
 
Method Summary
 void add(ComplexLine item)
          This adds a line at the end of the list.
 void add(java.util.Vector item)
          Deprecated. The correct interface now uses the ComplexLine class.
 void add(java.util.Vector item, int type)
          Deprecated. The correct interface now uses the ComplexLine class.
 void addColumn(ComplexColumn column)
          This function adds a column to the end of the columns in the list.
 void addComplexColumnListener(ComplexColumnListener l)
          Add a complex column listener to this component.
 void addItem(ComplexLine item)
          This adds a line at the end of the list.
 void addItem(java.util.Vector item)
          Deprecated. The correct interface now uses the ComplexLine class.
 void addItem(java.util.Vector item, int type)
          Deprecated. The correct interface now uses the ComplexLine class.
protected  byte[] convertDataVector(java.util.Vector items)
          Converts a Vector of ComplexItems into the corresponding coded information which is to be sent to the remote component.
protected  byte[] convertIntegerVector(java.util.Vector items)
          Converts a Vector of Integers into the corresponding coded information which is to be sent to the remote component.
 void deselect(int index)
          Deselects a specific line in the list.
protected  ComplexColumnEvent generateColumnEvent(PacketData packet)
          Generates a complex column event from the specified packet.
 ComplexColumn[] getColumns()
          This returns the headers for a complex list.
 boolean getDrawHeader()
          This returns the list title header drawing state.
 ComplexLine getItem(int index)
          This returns the specified item in the complex list.
 int getItemCount()
          This returns the number of lines in the complex list.
 java.util.Vector getItems()
          This returns the lines in the complex list.
 int getLineHeight()
          Normally the line item height is specified by the size of the font.
 java.lang.String getPanelType()
          This function returns the panel component to use with this class.
 ColumnState getSelectedColumn()
          Return the index of the column selected in the list.
 int getSelectedIndex()
          Return the index of the item selected in the list.
 int[] getSelectedIndexes()
          Gets the multiple selected indexes of the list.
 ComplexLine getSelectedItem()
          Return the item selected in the list.
 ComplexLine[] getSelectedItems()
          Gets the multiple selected items of the list.
protected  void handlePacket(PacketData packet)
          This function handles the incoming packets from the component residing on the browser.
 void insert(ComplexLine item, int index)
          Inserts the line at the location specified by the index in the list.
 void insert(java.util.Vector item, int index)
          Deprecated. The correct interface now uses the ComplexLine class.
 void insert(java.util.Vector item, int index, int type)
          Deprecated. The correct interface now uses the ComplexLine class.
 void insertItem(ComplexLine item, int index)
          Inserts the line at the location specified by the index in the list.
 void insertItem(java.util.Vector item, int index)
          Deprecated. The correct interface now uses the ComplexLine class.
 void insertItem(java.util.Vector item, int index, int type)
          Deprecated. The correct interface now uses the ComplexLine class.
 boolean isMultipleMode()
          This returns what the handler thinks is the mode of the list.
 int locationToIndex(java.awt.Point pointInList)
          This function converts a physical point location in the list into a line index.
protected  void processComplexColumnEvent(ComplexColumnEvent e)
          Processes complex column events occurring on this component by dispatching them to any registered listeners.
protected  void processEvent(java.awt.AWTEvent e)
          Processes events on this button.
 void remove(int position)
          Removes an item in the list.
 void removeAll()
          Removes all items in the list.
 void removeComplexColumnListener(ComplexColumnListener l)
          Remove a specified complex column listener.
 void replaceItem(ComplexLine newValue, int index)
          Replaces the line specified by the index in the list.
 void replaceItem(java.util.Vector newValue, int index)
          Deprecated. The correct interface now uses the ComplexLine class.
 void replaceItem(java.util.Vector newValue, int index, int type)
          Deprecated. The correct interface now uses the ComplexLine class.
 void replaceSubItem(ComplexItem newValue, int row, int column)
          Replaces the a column item in the line specified by the row in the list.
 void resetState()
          This function resets the component to a default state.
 void select(int index)
          Selects a specific line in the list.
 void setColumnAlignment(int index, int alignment)
          This sets the text alignment for an individual column in a complex list.
protected  void setColumnAlignments(java.util.Vector alignments)
          This sets the alignments for the columns in a complex list.
 void setColumnHeaders(java.util.Vector headers)
          Deprecated. The correct interface is now the setColumns function.
 void setColumns(ComplexColumn[] headers)
          This sets the headers for a complex list.
 void setColumnSizes(java.util.Vector sizes)
          Deprecated. The correct interface is now the setColumns function.
 void setDrawHeader(boolean state)
          This turns the list title header on and off.
 void setHeaderHeight(int height)
          Normally the header height is specified by the size of the font.
 void setLineHeight(int height)
          Normally the line item height is specified by the size of the font.
 void setMultipleMode(boolean mode)
          Sets the list to or from multiple select mode.
 void setSelectedColumn(int index, int state)
          Specifies which column is selected in the list.
protected  void setSelection(int index, boolean state)
          Sets the selection state of a line in the list.
protected  void show(int index, boolean type)
          Shows the specified line or column.
 void showColumn(int index)
          Displays the specified column number.
 void showLine(int index)
          Displays the specified line number.
 void updateNode(ComplexLine line)
          Updates the contents of the node in the list.
 
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, internalForwardPacket, internalGetBounds, intToBoolean, isActive, isApplicationActive, isComponentModal, isConnected, isEnabled, isMyId, isVisible, processActionEvent, processComponentEvent, processCurrentPacket, processFocusEvent, processItemEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processNormalResponse, processTextEvent, queryMessageBox, removeActionListener, removeComponentListener, removeEventMask, removeFocusListener, removeItemListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removeTextListener, removeWindowListener, requestFocus, 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

ClearList

public static final byte ClearList

SetHeaders

public static final byte SetHeaders

SetColumnSizes

public static final byte SetColumnSizes

GetSelectedIndex

public static final byte GetSelectedIndex

GetSelectedIndexResponse

public static final byte GetSelectedIndexResponse

AddLine

public static final byte AddLine

InsertLine

public static final byte InsertLine

DeleteLine

public static final byte DeleteLine

ChangeSelection

public static final byte ChangeSelection

SetMultipleMode

public static final byte SetMultipleMode

GetSelectedIndexes

public static final byte GetSelectedIndexes

GetSelectedIndexesResponse

public static final byte GetSelectedIndexesResponse

ReplaceLine

public static final byte ReplaceLine

ReplaceItem

public static final byte ReplaceItem

GetIndexAtPoint

public static final byte GetIndexAtPoint

GetIndexAtPointResponse

public static final byte GetIndexAtPointResponse

GetSelectedColumn

public static final byte GetSelectedColumn

GetSelectedColumnResponse

public static final byte GetSelectedColumnResponse

SetAlignment

public static final byte SetAlignment

SetAlignments

public static final byte SetAlignments

SetSelectedColumn

public static final byte SetSelectedColumn

SetLineHeight

public static final byte SetLineHeight

ShowHeader

public static final byte ShowHeader

HeaderHeight

public static final byte HeaderHeight

Display

public static final byte Display

ColumnEvent

public static final byte ColumnEvent

NextAvailableCommand

public static final byte NextAvailableCommand
Constructor Detail

ComplexListHandler

public ComplexListHandler()
Default constructor.

ComplexListHandler

public ComplexListHandler(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.

ComplexListHandler

public ComplexListHandler(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

handlePacket

protected void handlePacket(PacketData packet)
                     throws ComponentHandlerException
This function handles the incoming packets from the component residing on the browser. This code may generate events if there is a requirement for the ApplicationInterface to handle the packet.
Overrides:
handlePacket in class ComponentHandler
Parameters:
packet - PacketData containing the packet to handle.
Throws:
ComponentHandlerException - containing the error information.

resetState

public void resetState()
This function resets the component to a default state. It is used to resynchronize the visual and internal versions of the component. IT SHOULD NEVER BE CALLED BY THE APPLICATION CODE.
Overrides:
resetState in class ComponentHandler

add

public void add(java.util.Vector item)
         throws ComponentHandlerException
Deprecated. The correct interface now uses the ComplexLine class.

This adds a set of items to the end of the list. The line items are contained in the Vector which contains a set of ComplexItems.
Parameters:
item - Vector containing the ComplexItems defining the type of items.
Throws:
ComponentHandlerException - containing messaging error information.

add

public void add(ComplexLine item)
         throws ComponentHandlerException
This adds a line at the end of the list. The line items are contained in the ComplexLine which contains a Vector which in turn contains a set of ComplexItems.
Parameters:
item - ComplexLine containing the information for the line.
Throws:
ComponentHandlerException - containing messaging error information.

addColumn

public void addColumn(ComplexColumn column)
               throws ComponentHandlerException
This function adds a column to the end of the columns in the list.
Parameters:
title - ComplexColumn containing the information about the column.
size - int containing the size of the column in pixels.
Throws:
ComponentHandlerException - with any messaging errors.

setColumns

public void setColumns(ComplexColumn[] headers)
                throws ComponentHandlerException
This sets the headers for a complex list. The header items are contained in the array which contains a set of ComplexColumns.
Parameters:
headers - array containing the ComplexColumns defining the type of column.
Throws:
ComponentHandlerException - containing messaging error information.

getColumns

public ComplexColumn[] getColumns()
This returns the headers for a complex list. The header items are contained in the array which contains a set of ComplexColumns.
Returns:
array containing the ComplexColumns defining the type of column.

setColumnAlignments

protected void setColumnAlignments(java.util.Vector alignments)
                            throws ComponentHandlerException
This sets the alignments for the columns in a complex list. The alignment items are contained in the Vector which contains a set of Integers.
Parameters:
alignments - Vector containing the Integers defining the column alignments.
Throws:
ComponentHandlerException - containing messaging error information.

setColumnHeaders

public void setColumnHeaders(java.util.Vector headers)
                      throws ComponentHandlerException
Deprecated. The correct interface is now the setColumns function.

This sets the headers for a complex list. The header items are contained in the Vector which contains a set of ComplexItems.
Parameters:
headers - Vector containing the ComplexItems defining the type of items.
Throws:
ComponentHandlerException - containing messaging error information.

setColumnSizes

public void setColumnSizes(java.util.Vector sizes)
                    throws ComponentHandlerException
Deprecated. The correct interface is now the setColumns function.

This sets the header sizes for a complex list. The header items are contained in the Vector which contains a set of Integers.
Parameters:
sizes - Vector containing the Integers defining the Integer sizes.
Throws:
ComponentHandlerException - containing messaging error information.

add

public void add(java.util.Vector item,
                int type)
         throws ComponentHandlerException
Deprecated. The correct interface now uses the ComplexLine class.

This adds a line to the end of the list. The line items are contained in the Vector which contains a set of ComplexItems.
Parameters:
item - Vector containing the ComplexItems defining the type of items.
type - int containing the type of line. Major lines are 0, increasing values for type decrease the size of the string.
Throws:
ComponentHandlerException - containing messaging error information.

addItem

public void addItem(ComplexLine item)
             throws ComponentHandlerException
This adds a line at the end of the list. The line items are contained in the ComplexLine which contains a Vector which in turn contains a set of ComplexItems.
Parameters:
item - ComplexLine containing the information for the line.
Throws:
ComponentHandlerException - containing messaging error information.

addItem

public void addItem(java.util.Vector item)
             throws ComponentHandlerException
Deprecated. The correct interface now uses the ComplexLine class.

Adds a line at the end of the list.
Parameters:
item - Vector of ColumnItems containing the columns of items.
Throws:
ComponentHandlerException - containing messaging error information.

addItem

public void addItem(java.util.Vector item,
                    int type)
             throws ComponentHandlerException
Deprecated. The correct interface now uses the ComplexLine class.

Adds a line at the end of the list.
Parameters:
item - Vector of ColumnItems containing the columns of items.
type - int containing the indentation of the line in the list. Higher numbers are greater indentations. In effect higher numbers are child lines of lower numbers.
Throws:
ComponentHandlerException - containing messaging error information.

insert

public void insert(java.util.Vector item,
                   int index)
            throws ComponentHandlerException
Deprecated. The correct interface now uses the ComplexLine class.

Inserts the line at the location specified by the index in the list.
Parameters:
item - Vector of ColumnItems containing the columns of items.
index - int line number of the line to insert.
Throws:
ComponentHandlerException - containing messaging error information.

insert

public void insert(java.util.Vector item,
                   int index,
                   int type)
            throws ComponentHandlerException
Deprecated. The correct interface now uses the ComplexLine class.

Inserts the line at the location specified by the index in the list.
Parameters:
item - Vector of ColumnItems containing the columns of items.
index - int line number of the line to insert.
type - int containing the indentation of the line in the list. Higher numbers are greater indentations. In effect higher numbers are child lines of lower numbers.
Throws:
ComponentHandlerException - containing messaging error information.

insert

public void insert(ComplexLine item,
                   int index)
            throws ComponentHandlerException
Inserts the line at the location specified by the index in the list.
Parameters:
item - ComplexLine to insert into the list.
index - int line number of the line to insert.
Throws:
ComponentHandlerException - containing messaging error information.

insertItem

public void insertItem(ComplexLine item,
                       int index)
                throws ComponentHandlerException
Inserts the line at the location specified by the index in the list.
Parameters:
item - ComplexLine to insert into the list.
index - int line number of the line to insert.
Throws:
ComponentHandlerException - containing messaging error information.

insertItem

public void insertItem(java.util.Vector item,
                       int index)
                throws ComponentHandlerException
Deprecated. The correct interface now uses the ComplexLine class.

Inserts the line at the location specified by the index in the list.
Parameters:
item - Vector of ColumnItems containing the columns of items.
index - int line number of the line to insert.
Throws:
ComponentHandlerException - containing messaging error information.

insertItem

public void insertItem(java.util.Vector item,
                       int index,
                       int type)
                throws ComponentHandlerException
Deprecated. The correct interface now uses the ComplexLine class.

Inserts the line at the location specified by the index in the list.
Parameters:
item - Vector of ColumnItems containing the columns of items.
index - int line number of the line to insert.
type - int containing the indentation of the line in the list. Higher numbers are greater indentations. In effect higher numbers are child lines of lower numbers.
Throws:
ComponentHandlerException - containing messaging error information.

replaceItem

public void replaceItem(java.util.Vector newValue,
                        int index)
                 throws ComponentHandlerException
Deprecated. The correct interface now uses the ComplexLine class.

Replaces the line specified by the index in the list.
Parameters:
newValue - Vector containing the columns of items.
index - int line number of the line to replace.
Throws:
ComponentHandlerException - containing messaging error information.

replaceItem

public void replaceItem(java.util.Vector newValue,
                        int index,
                        int type)
                 throws ComponentHandlerException
Deprecated. The correct interface now uses the ComplexLine class.

Replaces the line specified by the index in the list.
Parameters:
newValue - Vector of ColumnItems containing the columns of items.
index - int line number of the line to replace.
type - int containing the indentation of the line in the list. Higher numbers are greater indentations. In effect higher numbers are child lines of lower numbers.
Throws:
ComponentHandlerException - containing messaging error information.

replaceItem

public void replaceItem(ComplexLine newValue,
                        int index)
                 throws ComponentHandlerException
Replaces the line specified by the index in the list.
Parameters:
newValue - ComplexLine containing the new line.
index - int line number of the line to replace.
Throws:
ComponentHandlerException - containing messaging error information.

replaceSubItem

public void replaceSubItem(ComplexItem newValue,
                           int row,
                           int column)
                    throws ComponentHandlerException
Replaces the a column item in the line specified by the row in the list.
Parameters:
newValue - ComplexItem containing the new column item.
row - int line number of the line to replace.
column - int number of the column within the line to replace.
Throws:
ComponentHandlerException - containing messaging error information.

removeAll

public void removeAll()
               throws ComponentHandlerException
Removes all items in the list.
Throws:
ComponentHandlerException - containing messaging error information.

remove

public void remove(int position)
            throws ComponentHandlerException
Removes an item in the list.
Parameters:
position - int position of the line to remove.
Throws:
ComponentHandlerException - containing messaging error information.

getSelectedColumn

public ColumnState getSelectedColumn()
                              throws ComponentHandlerException
Return the index of the column selected in the list. The column is selected by pressing on one of the column headers at the top of the list.
Returns:
ColumnState containing the index of the selected column or null if there is no selected column.
Throws:
ComponentHandlerException - containing messaging error information.

getSelectedIndex

public int getSelectedIndex()
                     throws ComponentHandlerException
Return the index of the item selected in the list.
Returns:
int containing the index of the selected list item or -1 if there is no selected item.
Throws:
ComponentHandlerException - containing messaging error information.

getSelectedItem

public ComplexLine getSelectedItem()
                            throws ComponentHandlerException
Return the item selected in the list.
Returns:
ComplexLine containing the line selected in the list or null if no such item.
Throws:
ComponentHandlerException - containing messaging error information.

locationToIndex

public int locationToIndex(java.awt.Point pointInList)
                    throws ComponentHandlerException
This function converts a physical point location in the list into a line index. This is typically used in drag and drop situations.
Parameters:
pointInList - Point containing the location to convert.
Returns:
int line number which matches this point.
Throws:
ComponentHandlerException - containing messaging error information.

setSelectedColumn

public void setSelectedColumn(int index,
                              int state)
                       throws ComponentHandlerException
Specifies which column is selected in the list. This has no effect on the list apart from one of the header columns gaining an arrow if the correct value is used. This is purely a visual effect.
Parameters:
index - int index of the column to select.
state - int state of the selected column.
Throws:
ComponentHandlerException - containing messaging error information.

setHeaderHeight

public void setHeaderHeight(int height)
                     throws ComponentHandlerException
Normally the header height is specified by the size of the font. This function allows the height of the header to be specified in pixels.
Parameters:
height - int size of each header vertically. The function accepts the following type of variables:
  • Positive numbers. The header height is set to this number of pixels.
  • 0. The current font height is used.
  • Negative numbers. The header height uses the current item height.
Throws:
ComponentHandlerException - containing messaging error information.

setLineHeight

public void setLineHeight(int height)
                   throws ComponentHandlerException
Normally the line item height is specified by the size of the font. This function allows the height of the lines to be specified in pixels.
Parameters:
height - int size of each line vertically. Setting the height to a negative value reverts to the font height.
Throws:
ComponentHandlerException - containing messaging error information.

getLineHeight

public int getLineHeight()
Normally the line item height is specified by the size of the font. This function returns the height of the lines when specified in pixels. This function will not return a valid item height if the height is specified by the font size.
Returns:
int size of each line vertically. A negative value indicates that the line height is specified by the font height.

setDrawHeader

public void setDrawHeader(boolean state)
                   throws ComponentHandlerException
This turns the list title header on and off. If the header is off there is no way of selecting a column.
Parameters:
height - int size of each line vertically. Setting the height to a negative value reverts to the font height.
Throws:
ComponentHandlerException - containing messaging error information.

getDrawHeader

public boolean getDrawHeader()
This returns the list title header drawing state. If the header is off there is no way of selecting a column.
Returns:
boolean true if the header of the list is displayed.

setColumnAlignment

public void setColumnAlignment(int index,
                               int alignment)
                        throws ComponentHandlerException
This sets the text alignment for an individual column in a complex list.
Parameters:
index - int index of the column to set the alignment of.
alignment - int alignment for the column. This matches values in amber.awt.ComplexList.
Throws:
ComponentHandlerException - containing messaging error information.
See Also:
ComplexList.LEFT, ComplexList.CENTER, ComplexList.RIGHT

select

public void select(int index)
            throws ComponentHandlerException
Selects a specific line in the list.
Parameters:
index - int line number to select.
Throws:
ComponentHandlerException - containing messaging error information.

deselect

public void deselect(int index)
              throws ComponentHandlerException
Deselects a specific line in the list.
Parameters:
index - int line number to deselect.
Throws:
ComponentHandlerException - containing messaging error information.

showLine

public void showLine(int index)
              throws ComponentHandlerException
Displays the specified line number.
Parameters:
index - int the line number to display.
Throws:
ComponentHandlerException - with messaging errors.

showColumn

public void showColumn(int index)
                throws ComponentHandlerException
Displays the specified column number.
Parameters:
index - int the column number to display.
Throws:
ComponentHandlerException - with messaging errors.

updateNode

public void updateNode(ComplexLine line)
                throws ComponentHandlerException
Updates the contents of the node in the list.
Parameters:
node - ComplexLine containing the new information.
Throws:
ComponentHandlerException - with messaging errors.
ComponentHandlerException - containing messaging error information.

setSelection

protected void setSelection(int index,
                            boolean state)
                     throws ComponentHandlerException
Sets the selection state of a line in the list.
Parameters:
index - int line number to select/deselect.
state - boolean state to set the line to.
Throws:
ComponentHandlerException - containing messaging error information.

show

protected void show(int index,
                    boolean type)
             throws ComponentHandlerException
Shows the specified line or column.
Parameters:
index - int item number to show.
type - boolean type of item to display.
Throws:
ComponentHandlerException - containing messaging error information.

setMultipleMode

public void setMultipleMode(boolean mode)
                     throws ComponentHandlerException
Sets the list to or from multiple select mode.
Parameters:
mode - boolean true if multiselection required.
Throws:
ComponentHandlerException - containing messaging error information.

isMultipleMode

public boolean isMultipleMode()
This returns what the handler thinks is the mode of the list. NOTE it is possible that this could be wrong.
Returns:
boolean containing the mode, true if multiple selections allowed.

getItemCount

public int getItemCount()
This returns the number of lines in the complex list.
Returns:
int containing the number of lines in the list.

getItems

public java.util.Vector getItems()
This returns the lines in the complex list.
Returns:
Vector containing the lines as a series of ComplexLine's.

getItem

public ComplexLine getItem(int index)
This returns the specified item in the complex list.
Parameters:
index - int specifying which line in the list to get.
Returns:
ComplexLine containing the line specified.

getSelectedIndexes

public int[] getSelectedIndexes()
                         throws ComponentHandlerException
Gets the multiple selected indexes of the list.
Returns:
int [] containing the indexes.
Throws:
ComponentHandlerException - containing messaging error information.

getSelectedItems

public ComplexLine[] getSelectedItems()
                               throws ComponentHandlerException
Gets the multiple selected items of the list.
Returns:
ComplexLine [] containing the items.
Throws:
ComponentHandlerException - containing messaging error information.

removeComplexColumnListener

public void removeComplexColumnListener(ComplexColumnListener l)
Remove a specified complex column listener.
Parameters:
l - ComplexColumnListener to remove.

addComplexColumnListener

public void addComplexColumnListener(ComplexColumnListener l)
Add a complex column listener to this component.
Parameters:
l - ComplexColumnListener to respond to events on the column headers.

processEvent

protected void processEvent(java.awt.AWTEvent e)
Processes events on this button. If an event is an instance of ActionEvent, TextEvent, ItemEvent, this method invokes the corresponding process function. Otherwise, it invokes the super processEvent in component to handle any other events.
Overrides:
processEvent in class ComponentHandler
Parameters:
e - AWTEvent to process.

processComplexColumnEvent

protected void processComplexColumnEvent(ComplexColumnEvent e)
Processes complex column events occurring on this component by dispatching them to any registered listeners.
Parameters:
e - ComplexColumnEvent to process.

generateColumnEvent

protected ComplexColumnEvent generateColumnEvent(PacketData packet)
                                          throws ComponentHandlerException
Generates a complex column event from the specified packet.
Parameters:
packet - PacketData which sparked the event.
Returns:
ComplexColumnEvent which matches the packet.
Throws:
ComponentHandlerException - with and conversion errors.

convertDataVector

protected byte[] convertDataVector(java.util.Vector items)
                            throws java.io.IOException
Converts a Vector of ComplexItems into the corresponding coded information which is to be sent to the remote component.
Parameters:
items - Vector of ComplexItems which are to be coded.
Returns:
byte array of encoded information.
Throws:
java.io.IOException - with encoding errors.

convertIntegerVector

protected byte[] convertIntegerVector(java.util.Vector items)
                               throws java.io.IOException
Converts a Vector of Integers into the corresponding coded information which is to be sent to the remote component.
Parameters:
items - Vector of Integers which are to be coded.
Returns:
byte array of encoded information.
Throws:
java.io.IOException - with encoding 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.