Implement a SalesPoint
Description:
The SalesPoint
is a part of the Shop
. A Shop
usually consists of one
SalesPoint
at least. SaleProcesses
take place at a Point of Sale in most cases. They could be startet
easily with the public void runProcess(SaleProcess p)
method.
The SalesPoint
appeares in a seperate Frame, a JDisplayFrame
. In the JTabbedPane
of
the Shop
appeares the SalesPoints
StatusDisplay. It could be used for different purposes.
The FormSheets
could be both added with MenuSheets
, which could be used to start Processes or to
open other SalesPoints
or to close them.
Used classes:
Related topics:
- Define a FormSheet for a SalesPoint
- Define a StatusFormSheet for a SalesPoint
- Define a MenuSheet for a SalesPoint
- Define a StatusMenuSheet for a SalesPoint
ToDo:
- Create a class that extends
SalesPoint
-
Add the class constructor.
You can also set theSalesPoints
frame size here for example. -
Implement
protected FormSheet getDefaultFormSheet()
to define theSalesPoints
FormSheet
.
Change theFormSheet
content by adding aFormSheetContentCreator
. This can be done by creating a subclass ofFormSheetContentCreator
. -
Implement
protected MenuSheet getDefaultMenuSheet()
to define theSalesPoints
MenuSheet
.
Example Source Code:
SalesPoint class:
// necessary imports import java.awt.Rectangle; import sale.FormSheet; import sale.MenuSheet; import sale.SalesPoint; 1 public class ArchitectureSalesPoint extends SalesPoint { 2 public ArchitectureSalesPoint(String sPointName) { super(sPointName); setSalesPointFrameBounds(new Rectangle(0, 0, 640, 480)); } 3 protected FormSheet getDefaultFormSheet() { FormSheet fs = new FormSheet("TutorialFormSheet", new ArchitectureSPointFormSheetCC(), false); return fs; } 4 protected MenuSheet getDefaultMenuSheet() { return null; } }
FormSheetContentCreator class:
public class ArchitectureSPointFormSheetCC extends FormSheetContentCreator
{
protected void createFormSheetContent(FormSheet fs)
{
fs.removeAllButtons();
// add ui code here
}
}
Back to:
Change quit behaviour
Description:
A SalesPoint
quit´s with a MsgForm
, asking "Are you sure, you want to close this SalesPoint? YES/NO".
If you want to change this behavior, overwrite the protected boolean onCanQuit()
method.
Used classes:
Related topics:
ToDo:
-
Open the designated
SalesPoint
class. -
Implement the
protected boolean onCanQuit()
method to change the quit behaviour.
The return oftrue
will close theSalesPoint
against the return offalse
will keep theSalesPoint
opened.
Example Source Code:
1 public class ArchitectureSalesPoint extends SalesPoint { 2 protected boolean onCanQuit() { return true; } }
Back to:
Application Architecture: Shop | Application Architecture: Processes |