ALOV logo

DOCUMENTATION

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:

<layout backcolor="255:255:255"> <object type="map" align="client" activetool="6" tips="yes"/> <object type="statuspanel" usezoom="no" align="bottom" bounds="0,470,400,35"/> </layout>

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:

ATTRIBUTEAPPLIED FOR COMPONENTDESRIPTION
typeanytype 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.
classanyname of java class that defines custom component. See details in "Create custom components"
nameanySpecifies the name of the component as reference. For example ALOV ToolBar uses names for reference to its tool buttons and others child controls.
backcoloranybackground colour of the component (by default parent's background colour)
forecoloranyforeground colour of the component (by default parent's foreground colour)
fontanydefines 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"
boundsanyDefines the location of the component. This is the list of four numbers. xtopleft,ytopleft, width, height.
alignanyUse 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:

noneThe control remains where it was placed by bounds values. This is the default value.
topThe 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.
bottomThe 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.
leftThe 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.
rightThe 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.
clientThe 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.
captionbutton,labelText for buttons and labels
imageimagebutton,imageThe relative path to image file. This image should appear on the face of the button or image component.
groupimagebuttondetermine 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.
networkactiveimagedefines whether the image appears during network activity.
selectchoiceSets the selected item to the specified value.
sizetextfieldSets the number of columns in this text field. A column is an approximate average character width that is platform-dependent.
valuetextfieldText field will be initialized with the specified text.
activetoolmapActive 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
tipsmapDefines whether to show tips for map objects under mouse cursor. Possible values "yes" or "no"
separatorlegenddefines whether layers in legend will be separated with thin line
select_clrlegendactive layer
disabled_clrlegenddisabled layer
err_colorlegendlayer that can't be loaded
net_colorlegendheighlight colour for layer in legend which downloads
select_clrstatus panelcolor of map message
err_colorstatus panelerror message colour
net_colorstatus panelnetwork message colour
tip_colorstatus panelcolor for tips
progress_colorstatus panelcolor of progress bar
zoomstatus panelDefines whether to show zoom on status panel. Possible values "yes" or "no"
equaltoolbarDefines how perform search.
helpdoctoolbarThe 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.

<param name="layout" value="mylayout.xml">

previous  top next


© ALOV 2002-2005 contact6 at alov.org