|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--amber.server.component.ComponentHandler
|
+--amber.server.component.PanelHandler
|
+--amber.server.panel.BasePanel
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.
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 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 |
protected int xOffset
protected int yOffset
protected boolean autoDoLayoutState
| Constructor Detail |
public BasePanel()
public BasePanel(ApplicationInterface pageHandler)
pageHandler - The handle to the main ApplicationInterface which handles the functions of page overall.
residing on the browser.
public BasePanel(ApplicationInterface pageHandler,
PanelTemplateGroup panelGroup,
boolean selectedState)
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.
public BasePanel(ApplicationInterface pageHandler,
PanelTemplateGroup panelGroup,
boolean selectedState,
int x,
int y)
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.
public BasePanel(int id,
ApplicationInterface pageHandler)
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.
public BasePanel(int id,
int baseOffset,
ApplicationInterface pageHandler)
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.
public BasePanel(int id,
int baseOffset,
ApplicationInterface pageHandler,
PanelTemplateGroup panelGroup,
boolean selectedState)
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.
public BasePanel(int id,
int baseOffset,
ApplicationInterface pageHandler,
PanelTemplateGroup panelGroup,
boolean selectedState,
int x,
int y)
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 |
public void processCurrentPacket(Packet packet)
throws ComponentHandlerException
processCurrentPacket in class ComponentHandlerpacket - Packet containing the packet to handle.ComponentHandlerException - containing the error information.
protected void forwardPacket(Packet packet)
throws ComponentHandlerException
packet - Packet to forward to the specified component.
public void setActive(boolean state)
throws ComponentHandlerException
setActive in class ComponentHandlerstate - boolean state which when true enables the component.
This is the default.ComponentHandlerException - with any errors.
protected PanelComponentInfo setUpComponent(ComponentHandler newComponent,
int x,
int y,
int width,
int height,
java.lang.String className,
java.lang.String parameters)
throws ComponentHandlerException
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.ComponentHandlerException - with any errors.
public void add(ComponentHandler newComponent,
java.lang.Object constraints)
add in interface ContainerHandlernewComponent - ComponentHandler for the created component.constraints - Object containing the constraints defining where the
component will be placed in the panel.
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
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.ComponentHandlerException - containing error information
public void buildComponent(PanelComponentInfo component)
throws ComponentHandlerException
component - PanelComponentInfo for the created component.ComponentHandlerException - containing error information
public void buildComponent(PanelComponentInfo component,
boolean redrawPanel)
throws ComponentHandlerException
component - PanelComponentInfo for the created component.redrawPanel - boolean true if the panel is to redraw after adding the component.ComponentHandlerException - containing error information
public void remove(ComponentHandler component)
throws ComponentHandlerException
remove in interface ContainerHandlercomponent - ComponentHandler for the created component.ComponentHandlerException - containing error information
public void removeComponent(ComponentHandler component)
throws ComponentHandlerException
removeComponent in class PanelHandlercomponent - ComponentHandler for the created component.ComponentHandlerException - containing error informationpublic java.util.Vector getComponents()
getComponents in interface ContainerHandlerpublic boolean isMyId(int inId)
isMyId in class ComponentHandlerid - int component handler ID.public void setComponentBaseOffset(int offset)
offset - int containing the new ID.public PanelTemplateGroup getPanelGroup()
public void setPanelGroup(PanelTemplateGroup group)
group - PanelTemplateGroup to link to.
public void setSelected(boolean state)
throws PanelHandlerException
state - boolean state defining whether this panel template is selected.amber.server.panelException - if there is a problem.
public java.awt.Insets getInsets()
throws ComponentHandlerException
getInsets in interface ContainerHandler
protected void setSelectedInternal(boolean state)
throws PanelHandlerException
state - boolean state defining whether this panel template is selected.amber.server.panelException - if there is a problem.public boolean isSelected()
public void recreatePanel()
throws ComponentHandlerException
recreatePanel in interface ContainerHandlerpublic java.lang.String getComponentStructure()
getComponentStructure in class ComponentHandlerpublic ComponentHandler matchIdToControl(int id)
id - int containing the ID of the component to locate.public PanelComponentInfo matchComponentToControl(ComponentHandler component)
component - ComponentHandler of the component to find.
public void setSize(ComponentHandler component,
java.awt.Dimension dimension)
throws ComponentHandlerException
setSize in class PanelHandlercomponent - ComponentHandler of the component to resize.dimension - Dimension containing the new size.ComponentHandlerException - containing the error information.
public void setSize(ComponentHandler component,
int width,
int height)
throws ComponentHandlerException
setSize in class PanelHandlercomponent - ComponentHandler of the component to resize.width - int width of the component.height - int height of the component.ComponentHandlerException - containing the error information.
public void setLocation(ComponentHandler component,
java.awt.Point point)
throws ComponentHandlerException
setLocation in class PanelHandlercomponent - ComponentHandler of the component to move.point - Point containing the new location.ComponentHandlerException - containing the error information.
public void setLocation(ComponentHandler component,
int x,
int y)
throws ComponentHandlerException
setLocation in class PanelHandlercomponent - ComponentHandler of the component to move.x - int x location of the component.y - int y location of the component.ComponentHandlerException - containing the error information.
public void setBounds(ComponentHandler component,
java.awt.Rectangle rect)
throws ComponentHandlerException
setBounds in class PanelHandlercomponent - ComponentHandler of the component to move.rect - Rectangle containing the new location and size.ComponentHandlerException - containing the error information.
public void setBounds(ComponentHandler component,
int x,
int y,
int width,
int height)
throws ComponentHandlerException
setBounds in class PanelHandlercomponent - 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.ComponentHandlerException - containing the error information.public void setPanelLocation(java.awt.Point point)
point - New top left coordinates stored in the Point.
public void setPanelLocation(int x,
int y)
x - int containing new top left x coordinate of the panel.y - int containing new top left y coordinate of the panel.public PanelComponentInfo getPanelComponent(int index)
getPanelComponent in interface ContainerHandlerindex - int index of the component to retrieve.public PanelComponentInfo getPanelComponentAt(java.awt.Point point)
getPanelComponentAt in interface ContainerHandlerpoint - Point containing the location of the control.
public PanelComponentInfo getPanelComponentAt(int x,
int y)
getPanelComponentAt in interface ContainerHandlerx - int x coordinate of location.y - int y coordinate of location.
public PanelComponentInfo getPanelComponentAt(ComponentHandler source,
java.awt.Point point)
source - ComponentHandler handle of the object which got the event.point - Point containing the location of the control.
public PanelComponentInfo getPanelComponentAt(ComponentHandler source,
int x,
int y)
source - ComponentHandler handle of the object which got the event.x - int x coordinate of location.y - int y coordinate of location.
public void setAutoDoLayout(boolean state)
throws ComponentHandlerException
setAutoDoLayout in interface ContainerHandlerstate - boolean state to set the automatic laying out of components.ComponentHandlerException - with any messaging errors.public boolean getAutoDoLayout()
getAutoDoLayout in interface ContainerHandler
public void doPanelLayout()
throws ComponentHandlerException
doPanelLayout in interface ContainerHandlerComponentHandlerException - with any messaging errors.public void removeInPrePacketListener(PacketListener l)
public void addInPrePacketListener(PacketListener l)
protected boolean fireInPrePacketPerformed(Packet p)
public void removeInPostPacketListener(PacketListener l)
public void addInPostPacketListener(PacketListener l)
protected boolean fireInPostPacketPerformed(Packet p)
protected abstract void defineComponents()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||