|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.aspects.gui.CustomizedGUI
This interface allows the programmer to create simple customized GUIs.
The idea is to define sub-panels that can contain views on the
objects of the application. The geometric placement of the
sub-panel is defined by the setSubPanesGeometry
method
that has to be called at contruction-time.
Once the geometry is chosen, you can tell a pane to contain a
view on a given object by using the addReferenceToPane
method.
This class must be subclassed by the porgrammer of a JAC application to provide a customized GUI.
GuiAC
,
setSubPanesGeometry(int,int,boolean[])
,
addReferenceToPane(MemberItem,String,String[],String)
Field Summary | |
static String |
BOTTOM
|
static int |
HORIZONTAL
The subpanes are separated by an horizontal splitter |
static int |
HORIZONTAL_DOWN
The down subpanes are separated by a vertical splitter |
static int |
HORIZONTAL_UP
The upper subpanes are separated by a vertical splitter |
static String |
TOP
|
static int |
VERTICAL
The subpanes are separated by a vertical splitter |
static int |
VERTICAL_LEFT
The left subpanes are separated by an horizontal splitter |
static int |
VERTICAL_RIGHT
The right subpanes are separated by an horizontal splitter |
Constructor Summary | |
CustomizedGUI(String id)
Creates a new customized GUI. |
Method Summary | |
void |
addMenuItem(String menuName,
String[] menuPath,
Callback callback)
Add an item in a menu |
void |
addMenuSeparator(String menuName,
String[] menuPath)
Add a separator in a menu |
void |
addReferenceToPane(MemberItem reference,
String viewType,
String[] viewParams,
String paneId)
Tells a referenced object to open in a given panel when a view is asked by the user (instead of opening in a popup). |
void |
addStatusBar(MethodItem method,
String position)
Adds a status bar to the GUI. |
void |
addStyleSheetURL(String url)
|
void |
addToolbarAction(AbstractMethodItem method)
Add a button in the toolbar |
void |
addToolbarAction(String objectName,
AbstractMethodItem method)
Add a button in the toolbar |
void |
addToolbarAction(String objectName,
AbstractMethodItem method,
Object[] params)
|
void |
addToolbarSeparator()
Add a separator in the toolbar |
String |
getApplication()
Get the value of application. |
List |
getFieldTargets(MemberItem reference)
|
int |
getGeometry()
|
int |
getHeight()
|
String |
getIcon()
|
String |
getId()
|
String |
getInvalidPane(String changedPane)
|
int |
getLeft()
|
protected Menu |
getMenu(String menuName,
String[] menuPath)
Find a menu defined by its path |
Hashtable |
getMenus()
|
Menu |
getMenus(String name)
|
AbstractMethodItem |
getOnCloseHandler()
|
String |
getPaneContainer(String paneId)
|
Map |
getPaneContainers()
|
String[] |
getPaneContentArgs(String paneID)
|
Map |
getPaneContents()
|
String |
getPaneContentType(String paneID)
Returns the type of the object to be displayed in a pane |
boolean[] |
getScrollings()
|
Map |
getSplitters()
|
MethodItem |
getStatusBarMethod()
|
String |
getStatusPosition()
|
Vector |
getStyleSheetURLs()
|
Map |
getSubPaneContents()
|
int |
getSubPanesCount()
|
Map |
getTargetContainers()
|
String |
getTitle()
|
Collection |
getToolbar()
Returns the toolbar of the customized GUI. |
int |
getUp()
|
int |
getWidth()
|
boolean |
hasMenuBar()
|
boolean |
hasStatusBar()
|
boolean |
hasToolBar()
|
boolean |
isGeometrySet()
Returns true if the geometry of this GUI was set with setPosition . |
void |
setApplication(String v)
Set the value of application. |
void |
setIcon(String icon)
|
void |
setInvalidPane(String changedPane,
String invalidPane)
|
void |
setMenuIcon(String menuName,
String[] menuPath,
String icon)
|
void |
setMenuPosition(String menuName,
String position)
|
void |
setOnCloseHandler(AbstractMethodItem handler)
|
void |
setPaneContainer(String paneId,
String containerType)
|
void |
setPaneContent(String paneId,
String viewType,
String[] args)
Sets the object that should be opened in the given panel id. |
void |
setPosition(int left,
int up,
int width,
int height)
Sets the dimensions and position of the window regarding to the main screen. |
void |
setSplitterLocation(int splitterId,
float location)
Sets a splitter location. |
void |
setSubPanesGeometry(int subPanesCount,
int geometry,
boolean[] scrollings)
Sets the geometric arrangement of the panes. |
void |
setTitle(String title)
|
void |
setWelcomeMessage(String title,
String message,
String icon)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int HORIZONTAL
public static final int HORIZONTAL_UP
public static final int HORIZONTAL_DOWN
public static final int VERTICAL
public static final int VERTICAL_LEFT
public static final int VERTICAL_RIGHT
public static final String BOTTOM
public static final String TOP
Constructor Detail |
public CustomizedGUI(String id)
When subclassing, a typical implementation of the constructor is:
super() // initialization calls such as setSubPanesGeometry // addReferenceToPane, setPosition ... show();
setSubPanesGeometry(int,int,boolean[])
,
addReferenceToPane(MemberItem,String,String[],String)
,
setPosition(int,int,int,int)
,
setSplitterLocation(int,float)
Method Detail |
public void setInvalidPane(String changedPane, String invalidPane)
public String getInvalidPane(String changedPane)
public int getSubPanesCount()
public int getGeometry()
public boolean[] getScrollings()
public String getApplication()
public void setApplication(String v)
v
- Value to assign to application.public void setSubPanesGeometry(int subPanesCount, int geometry, boolean[] scrollings)
subPanesCount == 4 && geometry == VERTICAL
:
+-------+ | 0 | 2 | +---|---+ | 1 | 3 | +-------+
subPanesCount == 4 && geometry == HORIZONTAL
:
+-------+ | 0 | 1 | +-------+ | 2 | 3 | +-------+
subPanesCount == 3 && geometry == HORIZONTAL_UP
:
+-------+ | 0 | 1 | +-------+ | 2 | +-------+
subPanesCount == 3 && geometry == HORIZONTAL_DOWN
:
+-------+ | 2 | +-------+ | 0 | 1 | +-------+
subPanesCount == 3 && geometry == VERTICAL_LEFT
:
+---+---+ | 0 | | +---| 2 | | 1 | | +---+---+
subPanesCount == 3 && geometry == VERTICAL_RIGHT
:
+---+---+ | | 0 | | 2 |---+ | | 1 | +---+---+
subPanesCount == 2 && geometry == VERTICAL
:
+---+---+ | | | | 0 | 1 | | | | +---+---+
subPanesCount == 2 && geometry == HORIZONTAL
:
+-------+ | 0 | +-------+ | 1 | +-------+
subPanesCount
- the number of subpanes in the windowgeometry
- the geometry = VERTICAL || HORIZONTAL ||
VERTICAL_LEFT || VERTICAL_RIGHT || HORIZONTAL_UP ||
HORIZONTAL_DOWN
(see above)scrollings
- a set of string that tells if the sub-panes
must be srollable or notpublic void setPaneContent(String paneId, String viewType, String[] args)
paneId
- the panel id (see the geometry to know its
placement)viewType
- of the type of the viewargs
- parameters to pass to the view type constructorsetSubPanesGeometry(int,int,boolean[])
public String getPaneContentType(String paneID)
public String[] getPaneContentArgs(String paneID)
public Map getPaneContents()
public void setPaneContainer(String paneId, String containerType)
public String getPaneContainer(String paneId)
public Map getPaneContainers()
public Map getSubPaneContents()
public void addReferenceToPane(MemberItem reference, String viewType, String[] viewParams, String paneId)
reference
- the reference (can be a method's result)viewType
- the type of the view that must be openedpaneId
- the panel id where the view must be openedpublic Map getTargetContainers()
public List getFieldTargets(MemberItem reference)
public int getLeft()
public int getUp()
public int getWidth()
public int getHeight()
public boolean isGeometrySet()
setPosition
.
setPosition(int,int,int,int)
public void setPosition(int left, int up, int width, int height)
left
- left-border pixelup
- upper-border pixelwidth
- in percentage regarding the screenheight
- in percentage regarding the screenisGeometrySet()
public void setSplitterLocation(int splitterId, float location)
The splitter is referenced by its index going from the front-end splitter to the back-end splitters. For instance, in the case of a 3 sub-panel window, the 0 index references the splitter that splits the main window in two, the 1 index, the one that splits the half-window in two other smaller parts.
splitterId
- the splitter's indexlocation
- the position in pixel, regarding to the top/left
component, a negative value means that the splitter should be
set at the preferred sized of the inner componentspublic Map getSplitters()
public boolean hasStatusBar()
public String getStatusPosition()
public MethodItem getStatusBarMethod()
public void addStatusBar(MethodItem method, String position)
public String getId()
public Hashtable getMenus()
public Menu getMenus(String name)
public boolean hasMenuBar()
public void addMenuItem(String menuName, String[] menuPath, Callback callback)
menuPath
- the path of the menu where to add an itemcallback
- the method to call when this item is selectedaddMenuSeparator(String,String[])
public void addMenuSeparator(String menuName, String[] menuPath)
menuName
- the name of the menumenuPath
- the path of the menu where to add a separatoraddMenuItem(String,String[],Callback)
public void addToolbarAction(AbstractMethodItem method)
method
- the static method to call when the button is pressedaddToolbarSeparator()
,
addToolbarAction(String,AbstractMethodItem)
public void addToolbarAction(String objectName, AbstractMethodItem method)
objectName
- name of the object on which to invoke the methodmethod
- the method to call when the button is pressedaddToolbarSeparator()
,
addToolbarAction(AbstractMethodItem)
public void addToolbarAction(String objectName, AbstractMethodItem method, Object[] params)
public void addToolbarSeparator()
addToolbarAction(AbstractMethodItem)
public Collection getToolbar()
public boolean hasToolBar()
protected Menu getMenu(String menuName, String[] menuPath)
public void setMenuIcon(String menuName, String[] menuPath, String icon)
public void setMenuPosition(String menuName, String position)
public void setWelcomeMessage(String title, String message, String icon)
public void setTitle(String title)
public String getTitle()
public void addStyleSheetURL(String url)
public Vector getStyleSheetURLs()
public void setOnCloseHandler(AbstractMethodItem handler)
public AbstractMethodItem getOnCloseHandler()
public String getIcon()
public void setIcon(String icon)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |