|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Display
An abstract display that can display Form- and MenuSheets.
Displays are used to hide concrete user interface implementation details from the application
developer. Together with FormSheets
and MenuSheets
they provide a complete abstraction from concrete user interfaces. Whatever the concrete user
interface looks like, Displays, Form- and MenuSheets will always be handled in the same way by the
application.
At any given point of time there may be up to one FormSheet and up to one MenuSheet set on a given Display. The Display interface offers methods to set and close these Form- and MenuSheets. as well as a restricted set of events that can be used to keep up to date with the current state of the display.
Method Summary | |
---|---|
void |
addFormSheetListener(FormSheetListener fsl)
Registers a FormSheetListener to be informed when a FormSheet is set or closed. |
void |
closeFormSheet()
Closes the current FormSheet. |
Rectangle |
getBounds()
Returns currently set size and position of the display |
FormSheet |
getFormSheet()
Returns the FormSheet that is currently attached to the display. |
MenuSheet |
getMenuSheet()
Returns the MenuSheet that is currently attached to the display. |
boolean |
isUseableDisplay()
Returns true to indicate that this is a display that can be used normally. |
void |
load(ObjectInputStream ois)
Restores the display from a stream. |
void |
popUpFormSheet(FormSheet fs)
Shows a FormSheet, but do not close the current FormSheet. |
void |
removeFormSheetListener(FormSheetListener fsl)
Unregisters a FormSheetListener to be informed when a FormSheet is set or closed. |
void |
save(ObjectOutputStream oos)
Writes the display to a stream. |
void |
setBounds(Rectangle r)
Sets size an position of the display. |
void |
setFormSheet(FormSheet fs)
Sets and displays a FormSheet. |
void |
setMenuSheet(MenuSheet ms)
Sets and displays a MenuSheet. |
void |
toFront()
Brings the display to front, i.e. activates it. |
Method Detail |
---|
void setFormSheet(FormSheet fs) throws InterruptedException
This method should attach a FormSheetContainer as the FormSheet's display,
get the FormSheet's caption, component and button bar and render them. The entire
peer creation should be synchronized using FormSheet.getComponentLock()
and FormSheet.getButtonsLock()
, so as not to loose any events.
If fs.waitResponse()
returns true,
setFormSheet()
should block, until the FormSheet is closed by a matching
call to a closeFormSheet()
method.
If a FormSheet is already being displayed, setFormSheet()
should cancel this
FormSheet prior to setting the new FormSheet.
fs
- the FormSheet to be displayed.
InterruptedException
- if an interrupt occured while waiting for the
FormSheet to be closed.FormSheet getFormSheet()
FormSheet
that is currently attached to the display.
void closeFormSheet()
void popUpFormSheet(FormSheet fs) throws InterruptedException
JDisplayDialog
that has the FormSheet set.
This method should attach a FormSheetContainer as the FormSheet's display,
get the FormSheet's caption, component and button bar and render them. The entire
peer creation should be synchronized using FormSheet.getComponentLock()
and FormSheet.getButtonsLock()
, so as not to loose any events.
If fs.waitResponse()
returns true,
popUpFormSheet()
should block, until the FormSheet is closed by a matching
call to a closeFormSheet()
method.
If a FormSheet is already being displayed, popUpFormSheet()
must not close this
FormSheet prior to setting the new FormSheet.
fs
- the FormSheet to be displayed.
InterruptedException
- if an interrupt occured while waiting for the
FormSheet to be closed.void setMenuSheet(MenuSheet ms)
If a MenuSheet is already being displayed, setMenuSheet()
should remove this
MenuSheet prior to setting the new MenuSheet.
ms
- the MenuSheet to be displayed. null
is a valid value and should result in the
current MenuSheet being closed.MenuSheet getMenuSheet()
MenuSheet
that is currently attached to the display.
boolean isUseableDisplay()
NullDisplay
.
void setBounds(Rectangle r)
r
- the Rectangle that contains the size and position information.Rectangle getBounds()
void addFormSheetListener(FormSheetListener fsl)
fsl
- the FormSheetListener to be registered.void removeFormSheetListener(FormSheetListener fsl)
fsl
- the FormSheetListener to be unregistered.void toFront()
void load(ObjectInputStream ois) throws IOException, ClassNotFoundException
As displays should not be serialized when making the Shop persistent, they cannot be normally
deserialized. Instead they should individually read the attributes they previously saved
.
The attributes must be read in the same order they have previously been writtn.
Attention: The current class that has been written by the save()
method
must not be read here!
FormSheet fsCurrent = (FormSheet)ois.readObject(); MenuSheet msCurrent = (MenuSheet)ois.readObject(); ...
ois
- the stream to read attributes from
IOException
ClassNotFoundException
void save(ObjectOutputStream oos) throws IOException
Displays should not be serialized as a whole. Instead use this method to individually write all attributes of the display to the stream.
Attention: The very first attribute to be written must be the display's class!
Example:oos.writeObject(getClass()); oos.writeObject(fsCurrent); //current FormSheet oos.writeObject(msCurrent); //current MenuSheet ...
oos
- the stream to write attributes to
IOException
ClassNotFoundException
|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |