The layout file is XML document that specifies how components are placed on applet.
It defines colours, captions and other properties of applet components. Using layout
file you may add your own components . Besides, layout file may contain resources strings
(for localization of messages, tips and captions).
The root element for layout file is layout. This element defines the default colours and font for applet. The child elements object define components on applet. The component that is descendant of java.awt.Container can contain other components.
You may add the following AWT components to ALOV applet: Panel, Button, Label, TextField, Choice and Image. Besides you may add the following ALOV components Legend, StatusPanel, ToolBar, ImageButton, KeyMap, SystemLog and Map. The type of component is defined by attribute type. The applet has the only component Map. Thus if you define several components type="map" only last defined component will be taken into account.
Example:
Each component have properties that are specific to the visual aspect of controls, such as the position and colours of the component, and behaviour of component. The properties are defined by values of attributes of element object.
The list of attributes:
ATTRIBUTE
APPLIED FOR COMPONENT
DESRIPTION
type
any
type of component. It may be
ALOV components: legend, statuspanel, toolbar, imagebutton, keymap, btn_status and map.
AWT components: panel, button, label, textfield, choice and image.
Specifies the name of the component as reference. For example ALOV ToolBar uses names for reference to its tool buttons and others child controls.
backcolor
any
background colour of the component (by default parent's background colour)
forecolor
any
foreground colour of the component (by default parent's foreground colour)
font
any
defines font for component (by default parent's font).
This is the list of three values "name, style, size".
name - the font name. This can be a logical font name or a font face name. A logical name must be either: Dialog, DialogInput, Monospaced, Serif, SansSerif, or Symbol.
style - the style constant for the Font. 0 - PLAIN, 1 - BOLD , 2 - ITALIC, 3 - BOLD/ITALIC.
size - the point size of the Font
By default this is "SansSerif,0,11"
bounds
any
Defines the location of the component. This is the list of four numbers. xtopleft,ytopleft, width, height.
align
any
Use to align a component to the top, bottom, left, or right of a applet or panel and have it remain there even if the size of the applet or parent component that contains the control changes. When the parent is resized, an aligned control also resizes so that it continues to span the top, bottom, left, or right edge of the parent.
It can have one of the following values:
none
The control remains where it was placed by bounds values. This is the default value.
top
The control moves to the top of its parent and resizes to fill the width of its parent. The height of the control is not affected.
bottom
The control moves to the bottom of its parent and resizes to fill the width of its parent. The height of the control is not affected.
left
The control moves to the left side of its parent and resizes to fill the height of its parent. The width of the control is not affected.
right
The control moves to the right side of its parent and resizes to fill the height of its parent. The width of the control is not affected.
client
The control resizes to fill the client area of its parent. If another control already occupies part of the client area, the control resizes to fit within the remaining client area.
caption
button,label
Text for buttons and labels
image
imagebutton,image
The relative path to image file. This image should appear on the face of the button or image component.
group
imagebutton
determine how the button behaves when clicked. Buttons with the same group property value (other than 0), work together as a group. When the user clicks one of these buttons, it remains selected until the user clicks another button belonging to the same group.
networkactive
image
defines whether the image appears during network activity.
select
choice
Sets the selected item to the specified value.
size
textfield
Sets the number of columns in this text field. A column is an approximate average character width that is platform-dependent.
value
textfield
Text field will be initialized with the specified text.
activetool
map
Active tool on start.
1 - Center
2 - Zoom In
3 - Zoom Out
4 - Pan - default value
5 - Select
6 - Web Link
7 - Search in rectangle
8 - Draw rectangle
tips
map
Defines whether to show tips for map objects under mouse cursor. Possible values "yes" or "no"
separator
legend
defines whether layers in legend will be separated with thin line
select_clr
legend
active layer
disabled_clr
legend
disabled layer
err_color
legend
layer that can't be loaded
net_color
legend
heighlight colour for layer in legend which downloads
select_clr
status panel
color of map message
err_color
status panel
error message colour
net_color
status panel
network message colour
tip_color
status panel
color for tips
progress_color
status panel
color of progress bar
zoom
status panel
Defines whether to show zoom on status panel. Possible values "yes" or "no"
equal
toolbar
Defines how perform search.
helpdoc
toolbar
The help document to be invoked in case user clicks Help button.
The toolbar component contains the set of child components such as tool buttons and choices. It uses name property to reference to them.
Here is the list of controls and their activities
btn_weblink, btn_zoomout, btn_zoomin, btn_pan, btn_select - buttons to set map tool
btn_help - button that invokes help page
btn_getdata - button that show attribute data for selected objects
btn_tips - show/hide tips
tf_search - text field to enter search criterion
btn_search - start the search for data
lst_domains - list of project domains
lst_themes - list of thematic maps
The most recent defined components will be drawn last.
To activate your own layout define parameter for applet.