amber.server.panel
Class BasePanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--amber.server.component.ComponentHandler
              |
              +--amber.server.component.PanelHandler
                    |
                    +--amber.server.panel.BasePanel
All Implemented Interfaces:
ApplicationInterface, ContainerHandler, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
BaseFrame, GenericPanel

public abstract class BasePanel
extends PanelHandler
implements ContainerHandler, java.io.Serializable

This class handles the requirements for the specific manipulation of panels within specific pages. In a lot of ways this class functions very similarly to the ApplicationInterface class. This is the overall intelligence for this particular panel.

See Also:
ApplicationInterface, Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
protected  boolean autoDoLayoutState
          The state of the automatic laying out of components on the remote panel.
protected  int xOffset
          x offset of the top left of the panel.
protected  int yOffset
          y offset of the top left of the panel.
 
Fields inherited from class amber.server.component.PanelHandler
AddOperation, autoRedrawState, drawOperations, InsertOperation, PaintPanel, PanelNextAvailableCommand, postInPacketListeners, preInPacketListeners, RemoveAllOperations, RemoveOperation, ReplaceOperation, SetBorder, SetReDraw
 
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 amber.server.panel.ContainerHandler
AddComponent, AutoDoLayout, ForceDoLayout, GetInsets, GetInsetsResponse, NextAvailableCommand, RemoveAllComponents, RemoveComponent, SetBounds
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
BasePanel()
          Default constructor.
BasePanel(ApplicationInterface pageHandler)
          The initialising constructor.
BasePanel(ApplicationInterface pageHandler, PanelTemplateGroup panelGroup, boolean selectedState)
          The initialising constructor.
BasePanel(ApplicationInterface pageHandler, PanelTemplateGroup panelGroup, boolean selectedState, int x, int y)
          The initialising constructor.
BasePanel(int id, ApplicationInterface pageHandler)
          The initialising constructor.
BasePanel(int id, int baseOffset, ApplicationInterface pageHandler)
          The initialising constructor.
BasePanel(int id, int baseOffset, ApplicationInterface pageHandler, PanelTemplateGroup panelGroup, boolean selectedState)
          The initialising constructor.
BasePanel(int id, int baseOffset, ApplicationInterface pageHandler, PanelTemplateGroup panelGroup, boolean selectedState, int x, int y)
          The initialising constructor.
 
Method Summary
 void add(ComponentHandler newComponent, java.lang.Object constraints)
          This function adds a specified component to this panel.
protected  PanelComponentInfo addComponent(ComponentHandler newComponent, int x, int y, int width, int height, java.lang.String className, java.lang.String parameters, boolean redrawPanel)
          Deprecated. This function is now replaced by add() to make panels more like Java panels.
 void addInPostPacketListener(PacketListener l)
           
 void addInPrePacketListener(PacketListener l)
           
 void buildComponent(PanelComponentInfo component)
          This function adds a specified component to the corresponding Remote Panel.
 void buildComponent(PanelComponentInfo component, boolean redrawPanel)
          This function adds a specified component to the corresponding Remote Panel.
protected abstract  void defineComponents()
          This function is called to define the components which are a part of this template.
 void doPanelLayout()
          This function forces the target remote panel to re-lay itself out.
protected  boolean fireInPostPacketPerformed(Packet p)
           
protected  boolean fireInPrePacketPerformed(Packet p)
           
protected  void forwardPacket(Packet packet)
          Called by the ReceiveThread when a packet has been received.
 boolean getAutoDoLayout()
          This function returns the automatic doLayout which occurs when a component is added.
 java.util.Vector getComponents()
          Returns the component vector.
 java.lang.String getComponentStructure()
          This function dumps component information about this page.
 java.awt.Insets getInsets()
          This function gets the inset values for the container.
 PanelComponentInfo getPanelComponent(int index)
          This function finds the control which is located at the specified location
 PanelComponentInfo getPanelComponentAt(ComponentHandler source, int x, int y)
          This function finds the control which is located at the specified location relative to the coordinate frame of the specified Component.
 PanelComponentInfo getPanelComponentAt(ComponentHandler source, java.awt.Point point)
          This function finds the control which is located at the specified location relative to the coordinate frame of the specified Component.
 PanelComponentInfo getPanelComponentAt(int x, int y)
          This function finds the control which is located at the specified location
 PanelComponentInfo getPanelComponentAt(java.awt.Point point)
          This function finds the control which is located at the specified location
 PanelTemplateGroup getPanelGroup()
          This function returns the main controlling PanelTemplateGroup which links several panel templates together.
 boolean isMyId(int inId)
          Checks that the unique ID passed to this component is handled by this ComponentHandler.
 boolean isSelected()
          This function returns if this panel template is selected.
 PanelComponentInfo matchComponentToControl(ComponentHandler component)
          This function is used to match the component to the corresponding PanelComponentInfo.
 ComponentHandler matchIdToControl(int id)
          This function is used to match the component ID to the corresponding component.
 void processCurrentPacket(Packet packet)
          This function receives the packet given to it by the ApplicationInterface.
 void recreatePanel()
          This function dynamically recreates all the Its specific purpose is to set the controls to a known state once they are created.
 void remove(ComponentHandler component)
          This function removes the specified component from the corresponding remote Panel.
 void removeComponent(ComponentHandler component)
          Deprecated. Now replaced with the function remove () for consistency with Java panels.
 void removeInPostPacketListener(PacketListener l)
          This function removes an input post packet listener.
 void removeInPrePacketListener(PacketListener l)
          This function removes an input pre packet listener.
 void setActive(boolean state)
          This function tells the ComponentHandler that there is a corresponding remote component to communicate with and that the link is active.
 void setAutoDoLayout(boolean state)
          This function turns on/off the automatic doLayout which occurs when a component is added.
 void setBounds(ComponentHandler component, int x, int y, int width, int height)
          This function moves the specified component in the panel.
 void setBounds(ComponentHandler component, java.awt.Rectangle rect)
          This function moves the specified component in the panel.
 void setComponentBaseOffset(int offset)
          This function sets the base offset of the PanelTemplate.
 void setLocation(ComponentHandler component, int x, int y)
          This function moves the specified component in the panel.
 void setLocation(ComponentHandler component, java.awt.Point point)
          This function moves the specified component in the panel.
 void setPanelGroup(PanelTemplateGroup group)
          This function sets the main controlling PanelTemplateGroup which links several panel templates together.
 void setPanelLocation(int x, int y)
          This function moves the panel inside the drawing panel on the remote client.
 void setPanelLocation(java.awt.Point point)
          This function moves the panel inside the drawing panel on the remote client.
 void setSelected(boolean state)
          This function sets this panel template to selected.
protected  void setSelectedInternal(boolean state)
          This function sets this panel template to selected.
 void setSize(ComponentHandler component, java.awt.Dimension dimension)
          This function alters the size of the specified component in the panel.
 void setSize(ComponentHandler component, int width, int height)
          This function alters the size of the specified component in the panel.
protected  PanelComponentInfo setUpComponent(ComponentHandler newComponent, int x, int y, int width, int height, java.lang.String className, java.lang.String parameters)
          This function takes the parameters and creates a PanelComponentInfo containing the information on the component.
 
Methods inherited from class amber.server.component.PanelHandler
addComponent, addComponent, addDraw3DRect, addDrawArc, addDrawImage, addDrawImage, addDrawLine, addDrawOval, addDrawPolygon, addDrawPolyline, addDrawRect, addDrawRoundRect, addDrawString, addDrawString, addFill3DRect, addFillArc, addFillOval, addFillPolygon, addFillRect, addFillRoundRect, addOperation, addSetClip, addSetColour, addSetFont, addSetPaintMode, addSetXORMode, getDrawOperations, getPanelType, handleToIndex, insertDraw3DRect, insertDrawArc, insertDrawImage, insertDrawImage, insertDrawLine, insertDrawPolygon, insertDrawPolyline, insertDrawRect, insertDrawRoundRect, insertDrawString, insertDrawString, insertFill3DRect, insertFill3DRect, insertFillArc, insertFillOval, insertFillPolygon, insertFillRect, insertFillRoundRect, insertOperation, insertSetClip, insertSetColour, insertSetFont, insertSetPaintMode, insertSetXORMode, performSetBounds, performSetLocation, performSetSize, removeAllComponents, removeAllDrawOperations, removeDrawOperation, repaintPanel, replaceDraw3DRect, replaceDrawArc, replaceDrawImage, replaceDrawImage, replaceDrawLine, replaceDrawPolygon, replaceDrawPolyline, replaceDrawRect, replaceDrawRoundRect, replaceDrawString, replaceDrawString, replaceFill3DRect, replaceFill3DRect, replaceFillArc, replaceFillOval, replaceFillPolygon, replaceFillRect, replaceFillRoundRect, replaceOperation, replaceSetClip, replaceSetColour, replaceSetFont, replaceSetPaintMode, replaceSetXORMode, resetState, setAutoRepaint, setBorder, setBounds, setBounds, setLocation, setLocation, setSize, setSize
 
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, 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, isVisible, processActionEvent, processComponentEvent, processEvent, 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, 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, setComponentOrientation, setDropTarget, setLocale, setName, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface amber.server.panel.ContainerHandler
canClose, fillControls, saveData
 

Field Detail

xOffset

protected int xOffset
x offset of the top left of the panel. This is used when rendering the controls.

yOffset

protected int yOffset
y offset of the top left of the panel. This is used when rendering the controls.

autoDoLayoutState

protected boolean autoDoLayoutState
The state of the automatic laying out of components on the remote panel.
Constructor Detail

BasePanel

public BasePanel()
Default constructor.

BasePanel

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

BasePanel

public BasePanel(ApplicationInterface pageHandler,
                 PanelTemplateGroup panelGroup,
                 boolean selectedState)
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.
panelGroup - PanelTemplateGroup class which is used to stitch several panels onto one base panel.
selectedState - boolean true if this is the selected panel template.

BasePanel

public BasePanel(ApplicationInterface pageHandler,
                 PanelTemplateGroup panelGroup,
                 boolean selectedState,
                 int x,
                 int y)
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.
panelGroup - PanelTemplateGroup class which is used to stitch several panels onto one base panel.
selectedState - boolean true if this is the selected panel template.
x - int x coordinate of the top left point of the panel in the drawing panel. This can be used to offset the drawing of the controls in the panel.
y - int y coordinate of the top left point of the panel in the drawing panel.

BasePanel

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

BasePanel

public BasePanel(int id,
                 int baseOffset,
                 ApplicationInterface pageHandler)
The initialising constructor.
Parameters:
id - The int containing the id of the corresponding remote component residing on the browser.
baseOffset - The int containing the base offset for the id's of the internal panel components.
pageHandler - The handle to the main ApplicationInterface which handles the functions of page overall.

BasePanel

public BasePanel(int id,
                 int baseOffset,
                 ApplicationInterface pageHandler,
                 PanelTemplateGroup panelGroup,
                 boolean selectedState)
The initialising constructor.
Parameters:
id - The int containing the id of the corresponding remote component residing on the browser.
baseOffset - The int containing the base offset for the id's of the internal panel components.
pageHandler - The handle to the main ApplicationInterface which handles the functions of page overall.
panelGroup - PanelTemplateGroup class which is used to stitch several panels onto one base panel.
selectedState - boolean true if this is the selected panel template.

BasePanel

public BasePanel(int id,
                 int baseOffset,
                 ApplicationInterface pageHandler,
                 PanelTemplateGroup panelGroup,
                 boolean selectedState,
                 int x,
                 int y)
The initialising constructor.
Parameters:
id - The int containing the id of the corresponding remote component residing on the browser.
baseOffset - The int containing the base offset for the id's of the internal panel components.
pageHandler - The handle to the main ApplicationInterface which handles the functions of page overall.
panelGroup - PanelTemplateGroup class which is used to stitch several panels onto one base panel.
selectedState - boolean true if this is the selected panel template.
x - int x coordinate of the top left point of the panel in the drawing panel. This can be used to offset the drawing of the controls in the panel.
y - int y coordinate of the top left point of the panel in the drawing panel.
Method Detail

processCurrentPacket

public void processCurrentPacket(Packet packet)
                          throws ComponentHandlerException
This function receives the packet given to it by the ApplicationInterface. It then calls the component handling routines to handle the requirements of the packet and generate any events which may be required.
Overrides:
processCurrentPacket in class ComponentHandler
Parameters:
packet - Packet containing the packet to handle.
Throws:
ComponentHandlerException - containing the error information.

forwardPacket

protected void forwardPacket(Packet packet)
                      throws ComponentHandlerException
Called by the ReceiveThread when a packet has been received. This function examines the packet and passes it to the appropriate handler.
Parameters:
packet - Packet to forward to the specified component.

setActive

public void setActive(boolean state)
               throws ComponentHandlerException
This function tells the ComponentHandler that there is a corresponding remote component to communicate with and that the link is active. When active all pending packets are flushed to the remote component. If the panel has been set active more than once setting it active again will force a recreation of the panel at the remote client.
Overrides:
setActive in class ComponentHandler
Parameters:
state - boolean state which when true enables the component. This is the default.
Throws:
ComponentHandlerException - with any errors.

setUpComponent

protected PanelComponentInfo setUpComponent(ComponentHandler newComponent,
                                            int x,
                                            int y,
                                            int width,
                                            int height,
                                            java.lang.String className,
                                            java.lang.String parameters)
                                     throws ComponentHandlerException
This function takes the parameters and creates a PanelComponentInfo containing the information on the component. IT DOES NOT TELL THE REMOTE PANEL TO MAKE THE CONTROL. This function is the one which is called from defineComponents. This is owing to the fact that when the object is constructed the send/receive thread may not be constructed. If the system attempts to build the component at the remote browser the system will attempt to message to create the component and will fail.
Parameters:
newComponent - ComponentHandler for the created component.
x - int x coordinate of top left point of component in panel.
y - int y coordinate of top left point of component in panel.
width - int width of component in panel.
height - int height of component in panel.
className - String name of the class to instantiate on the panel.
parameters - String parameters of the component when created.
Returns:
PanelComponentInfo containing creation characteristics for the control.
Throws:
ComponentHandlerException - with any errors.

add

public void add(ComponentHandler newComponent,
                java.lang.Object constraints)
This function adds a specified component to this panel.
Specified by:
add in interface ContainerHandler
Parameters:
newComponent - ComponentHandler for the created component.
constraints - Object containing the constraints defining where the component will be placed in the panel.

addComponent

protected PanelComponentInfo addComponent(ComponentHandler newComponent,
                                          int x,
                                          int y,
                                          int width,
                                          int height,
                                          java.lang.String className,
                                          java.lang.String parameters,
                                          boolean redrawPanel)
                                   throws ComponentHandlerException
Deprecated. This function is now replaced by add() to make panels more like Java panels.

This function adds a specified component to the corresponding Remote Panel. This function does add the component into the panel event handling loop for this reason it should be used to add components which will message. It may optionally not perform an immediate redraw of the remote panel. This is for speed issues. Forcing a redraw many times takes a substantial amount of time. For this reason if addComponent is to be called for a number of components the redrawPanel should be false for all exception the final component. Thus redraw will occur only once.
Parameters:
newComponent - ComponentHandler for the created component.
x - int x coordinate of top left point of component in panel.
y - int y coordinate of top left point of component in panel.
width - int width of component in panel.
height - int height of component in panel.
className - String name of the class to instantiate on the panel.
parameters - String parameters of the component when created.
redrawPanel - boolean when true will force the remote panel to redraw thereby displaying the control.
Returns:
PanelComponentInfo containing creation characteristics for the control.
Throws:
ComponentHandlerException - containing error information

buildComponent

public void buildComponent(PanelComponentInfo component)
                    throws ComponentHandlerException
This function adds a specified component to the corresponding Remote Panel. This function does not add the component into the panel event handling loop for this reason it should never be used to add components which will message. Adding messaging components should be done using addComponent.
Parameters:
component - PanelComponentInfo for the created component.
Throws:
ComponentHandlerException - containing error information

buildComponent

public void buildComponent(PanelComponentInfo component,
                           boolean redrawPanel)
                    throws ComponentHandlerException
This function adds a specified component to the corresponding Remote Panel. This function does not add the component into the panel event handling loop for this reason it should never be used to add components which will message. Adding messaging components should be done using addComponent.
Parameters:
component - PanelComponentInfo for the created component.
redrawPanel - boolean true if the panel is to redraw after adding the component.
Throws:
ComponentHandlerException - containing error information

remove

public void remove(ComponentHandler component)
            throws ComponentHandlerException
This function removes the specified component from the corresponding remote Panel. This function will attempt to remove the component from the messaging loop code also. As it is possible that components can be created without appearing in the messaging loop it is not considered an error if the component cannot be removed from the messaging system.
Specified by:
remove in interface ContainerHandler
Parameters:
component - ComponentHandler for the created component.
Throws:
ComponentHandlerException - containing error information

removeComponent

public void removeComponent(ComponentHandler component)
                     throws ComponentHandlerException
Deprecated. Now replaced with the function remove () for consistency with Java panels.

This function removes the specified component from the corresponding remote Panel. This function will attempt to remove the component from the messaging loop code also. As it is possible that components can be created without appearing in the messaging loop it is not considered an error if the component cannot be removed from the messaging system.
Overrides:
removeComponent in class PanelHandler
Parameters:
component - ComponentHandler for the created component.
Throws:
ComponentHandlerException - containing error information

getComponents

public java.util.Vector getComponents()
Returns the component vector.
Specified by:
getComponents in interface ContainerHandler
Returns:
Vector which contains the components.

isMyId

public boolean isMyId(int inId)
Checks that the unique ID passed to this component is handled by this ComponentHandler.
Overrides:
isMyId in class ComponentHandler
Parameters:
id - int component handler ID.
Returns:
boolean if this is the correct ComponentHandler.

setComponentBaseOffset

public void setComponentBaseOffset(int offset)
This function sets the base offset of the PanelTemplate. This affects all the IDs of the sub panel components.
Parameters:
offset - int containing the new ID.

getPanelGroup

public PanelTemplateGroup getPanelGroup()
This function returns the main controlling PanelTemplateGroup which links several panel templates together.
Returns:
PanelTemplateGroup this panel template is linked to.

setPanelGroup

public void setPanelGroup(PanelTemplateGroup group)
This function sets the main controlling PanelTemplateGroup which links several panel templates together.
Parameters:
group - PanelTemplateGroup to link to.

setSelected

public void setSelected(boolean state)
                 throws PanelHandlerException
This function sets this panel template to selected. If it is a member of a PanelTemplateGroup the current panel template is altered to match this panel template.
Parameters:
state - boolean state defining whether this panel template is selected.
Throws:
amber.server.panelException - if there is a problem.

getInsets

public java.awt.Insets getInsets()
                          throws ComponentHandlerException
This function gets the inset values for the container. This is the visual elements which are considered a part of drawing the container. For example, in the case of a frame the top inset is the title bar.
Specified by:
getInsets in interface ContainerHandler
Returns:
Inset value for this container.

setSelectedInternal

protected void setSelectedInternal(boolean state)
                            throws PanelHandlerException
This function sets this panel template to selected. It can be called by the PanelTemplateGroup if there is one when the selected item is changed. This is separated from setSelected for recursion reasons.
Parameters:
state - boolean state defining whether this panel template is selected.
Throws:
amber.server.panelException - if there is a problem.

isSelected

public boolean isSelected()
This function returns if this panel template is selected.
Returns:
boolean state defining whether this panel template is selected.

recreatePanel

public void recreatePanel()
                   throws ComponentHandlerException
This function dynamically recreates all the Its specific purpose is to set the controls to a known state once they are created. It builds the panel from the current information stored in the components Vector.
Specified by:
recreatePanel in interface ContainerHandler

getComponentStructure

public java.lang.String getComponentStructure()
This function dumps component information about this page. This is very important in marrying the remote objects to their respective ComponentHandlers. This is written to the internal Log object.
Overrides:
getComponentStructure in class ComponentHandler

matchIdToControl

public ComponentHandler matchIdToControl(int id)
This function is used to match the component ID to the corresponding component. Should the component not exist here the function returns null.
Parameters:
id - int containing the ID of the component to locate.
Returns:
ComponentHandler handle of the matching control.

matchComponentToControl

public PanelComponentInfo matchComponentToControl(ComponentHandler component)
This function is used to match the component to the corresponding PanelComponentInfo. Should the component not exist here the function returns null.
Parameters:
component - ComponentHandler of the component to find.
Returns:
PanelComponentInfo handle of the matching control.

setSize

public void setSize(ComponentHandler component,
                    java.awt.Dimension dimension)
             throws ComponentHandlerException
This function alters the size of the specified component in the panel.
Overrides:
setSize in class PanelHandler
Parameters:
component - ComponentHandler of the component to resize.
dimension - Dimension containing the new size.
Throws:
ComponentHandlerException - containing the error information.

setSize

public void setSize(ComponentHandler component,
                    int width,
                    int height)
             throws ComponentHandlerException
This function alters the size of the specified component in the panel.
Overrides:
setSize in class PanelHandler
Parameters:
component - ComponentHandler of the component to resize.
width - int width of the component.
height - int height of the component.
Throws:
ComponentHandlerException - containing the error information.

setLocation

public void setLocation(ComponentHandler component,
                        java.awt.Point point)
                 throws ComponentHandlerException
This function moves the specified component in the panel.
Overrides:
setLocation in class PanelHandler
Parameters:
component - ComponentHandler of the component to move.
point - Point containing the new location.
Throws:
ComponentHandlerException - containing the error information.

setLocation

public void setLocation(ComponentHandler component,
                        int x,
                        int y)
                 throws ComponentHandlerException
This function moves the specified component in the panel.
Overrides:
setLocation in class PanelHandler
Parameters:
component - ComponentHandler of the component to move.
x - int x location of the component.
y - int y location of the component.
Throws:
ComponentHandlerException - containing the error information.

setBounds

public void setBounds(ComponentHandler component,
                      java.awt.Rectangle rect)
               throws ComponentHandlerException
This function moves the specified component in the panel.
Overrides:
setBounds in class PanelHandler
Parameters:
component - ComponentHandler of the component to move.
rect - Rectangle containing the new location and size.
Throws:
ComponentHandlerException - containing the error information.

setBounds

public void setBounds(ComponentHandler component,
                      int x,
                      int y,
                      int width,
                      int height)
               throws ComponentHandlerException
This function moves the specified component in the panel.
Overrides:
setBounds in class PanelHandler
Parameters:
component - ComponentHandler of the component to move.
x - int x location of the component.
y - int y location of the component.
width - int width of the component.
height - int height of the component.
Throws:
ComponentHandlerException - containing the error information.

setPanelLocation

public void setPanelLocation(java.awt.Point point)
This function moves the panel inside the drawing panel on the remote client. It does not force a redraw of the panel. Use recreatePanel to do this.
Parameters:
point - New top left coordinates stored in the Point.

setPanelLocation

public void setPanelLocation(int x,
                             int y)
This function moves the panel inside the drawing panel on the remote client. It does not force a redraw of the panel. Use recreatePanel to do this.
Parameters:
x - int containing new top left x coordinate of the panel.
y - int containing new top left y coordinate of the panel.

getPanelComponent

public PanelComponentInfo getPanelComponent(int index)
This function finds the control which is located at the specified location
Specified by:
getPanelComponent in interface ContainerHandler
Parameters:
index - int index of the component to retrieve.
Returns:
PanelComponentInfo which matches the specified index.

getPanelComponentAt

public PanelComponentInfo getPanelComponentAt(java.awt.Point point)
This function finds the control which is located at the specified location
Specified by:
getPanelComponentAt in interface ContainerHandler
Parameters:
point - Point containing the location of the control.
Returns:
PanelComponentInfo which matches the specified location or null if there is no match.

getPanelComponentAt

public PanelComponentInfo getPanelComponentAt(int x,
                                              int y)
This function finds the control which is located at the specified location
Specified by:
getPanelComponentAt in interface ContainerHandler
Parameters:
x - int x coordinate of location.
y - int y coordinate of location.
Returns:
PanelComponentInfo which matches the specified location or null if there is no match.

getPanelComponentAt

public PanelComponentInfo getPanelComponentAt(ComponentHandler source,
                                              java.awt.Point point)
This function finds the control which is located at the specified location relative to the coordinate frame of the specified Component.
Parameters:
source - ComponentHandler handle of the object which got the event.
point - Point containing the location of the control.
Returns:
PanelComponentInfo which matches the specified location or null if there is no match.

getPanelComponentAt

public PanelComponentInfo getPanelComponentAt(ComponentHandler source,
                                              int x,
                                              int y)
This function finds the control which is located at the specified location relative to the coordinate frame of the specified Component.
Parameters:
source - ComponentHandler handle of the object which got the event.
x - int x coordinate of location.
y - int y coordinate of location.
Returns:
PanelComponentInfo which matches the specified location or null if there is no match.

setAutoDoLayout

public void setAutoDoLayout(boolean state)
                     throws ComponentHandlerException
This function turns on/off the automatic doLayout which occurs when a component is added.
Specified by:
setAutoDoLayout in interface ContainerHandler
Parameters:
state - boolean state to set the automatic laying out of components.
Throws:
ComponentHandlerException - with any messaging errors.

getAutoDoLayout

public boolean getAutoDoLayout()
This function returns the automatic doLayout which occurs when a component is added.
Specified by:
getAutoDoLayout in interface ContainerHandler
Returns:
boolean state of the automatic laying out of components on a panel.

doPanelLayout

public void doPanelLayout()
                   throws ComponentHandlerException
This function forces the target remote panel to re-lay itself out.
Specified by:
doPanelLayout in interface ContainerHandler
Throws:
ComponentHandlerException - with any messaging errors.

removeInPrePacketListener

public void removeInPrePacketListener(PacketListener l)
This function removes an input pre packet listener.

addInPrePacketListener

public void addInPrePacketListener(PacketListener l)

fireInPrePacketPerformed

protected boolean fireInPrePacketPerformed(Packet p)

removeInPostPacketListener

public void removeInPostPacketListener(PacketListener l)
This function removes an input post packet listener.

addInPostPacketListener

public void addInPostPacketListener(PacketListener l)

fireInPostPacketPerformed

protected boolean fireInPostPacketPerformed(Packet p)

defineComponents

protected abstract void defineComponents()
This function is called to define the components which are a part of this template. This function is called by the derived constructor to set up the normal static components and their location. It cannot be called from the constructor of this class as the components are not likely to be created. It is important to note that components should be added to the panel using the setUpComponent function rather than addComponent. addComponent will attempt to create the component at the remote location which will not be possible when defineComponents is called.


Copyright © 2002 Clearfield Research Ltd. All Rights Reserved.