Components
Aria UI Components
Aria adds many user interface (UI) components to the Aria framework, while some of these components are non-visual components, the extensions offered by Aria can greatly improve the overall visual impact of your application. This section documents some of the Aria specific components. The components fall into a number of categories although some components are related.
Graphical Components
Shape
Class
:
org.formaria.swing.Shape
The shape component is a simple graphical object that renders some simple shapes. The component itself is of limited benefit on its own but it can be used with some of Aria's flowed text components to nest other objects that would otherwise have a rectangular area.
In the example below an image component is embedded in an ellipse shape, and the shape then interacts with a FlowedText component to alter the text layout. The shape may also be defined programmatically.
The XML for the above example is shown below:
Nesting an image within a shape
<Components>
<Panel name="textPanel" x="10" y="10" w="800" h="600" border="1" style="palePanel">
<FlowedText antialias="false" name="flowedTextArea" cols="1"
x="200" y="10" w="680" h="580" style="base/edit"
content="<b>Lorem ipsum..." opaque="false"/>
<Shape name="myShape" x="10" y="10" w="400" h="400" mode="13" style="blue">
<Image name="imageA" x="0" y="0" w="400" h="400" content="glyph.jpg"/>
</Shape>
</Panel>
<Button name="backBtn" content="Back" x="10" y="670" w="100" h="20"/>
<Button name="modeBtn" x="710" y="670" w="100" h="20" content="Mode" />
</Components>
The component is also used to draw some simple adornments like lines using the component foreground and background colors.
Shape drawing modes
|
Mode
|
Description
|
|
RECTANGLE = 0
|
A plain rectangle
|
|
ORTHO_LINE = 1
|
An orthogonal line
|
|
EXTRABOLD_HORIZONTAL = 2
|
Draws an extra bold line horizontally across the top of the component (3 pixels deep)
|
|
BOLD_HORIZONTAL = 3
|
Draws an bold line horizontally across the top of the component
|
|
NORMAL_HORIZONTAL = 4
|
Draws an line horizontally across the top of the component (1 pixel deep)
|
|
THIN_HORIZONTAL = 5
|
Draws an thin line horizontally across the top of the component
|
|
EXTRABOLD_VERTICAL = 6
|
Draws an extra bold line vertically across the top of the component (3 pixels deep)
|
|
BOLD_VERTICAL = 7
|
Draws an bold line vertically across the top of the component (2 pixels deep)
|
|
NORMAL_VERTICAL = 8
|
Draws an line vertically across the top of the component (1 pixel deep)
|
|
THIN_VERTICAL = 9
|
Draws an thin line vertically across the top of the component ( < 1 pixel deep)
|
|
RIGHT_TOP_LINE = 10
|
Draws a line from the top left to the bottom right
|
|
LEFT_TOP_LINE = 11
|
Draws a line from the top right to the bottom left.
|
|
ELLIPSE = 12
|
Draws an ellipse
|
|
SOLID_ELLIPSE = 13
|
Draws and fills an ellipse
|
|
SOLID_DIAMOND = 14
|
Draws a diamond
|
|
DIAMOND = 15
|
Fills a diamond
|
|
USER = 16
|
Draws a user defined shape
|
|
USER_FILL = 17
|
Fills a user defined shape
|
|
USER_FILL_DRAW = 18
|
Fills and draws a user defined shape
|
EasterEgg
Class
:
org.formaria.swing.EasterEgg
The easter egg component is an unusual component in that most of its function is designed to be hidden from the average user. The component is designed to allow restricted access to key features of an application, typically for a project administrator.
Under the hood the EasterEgg component is an extension of the Image component, so normally it will display an image and uses the image controls normal attributes.
The component relies on the
org.formaria.event.ClickListener
class to monitor the user interaction. Using this interface you can define a special key sequence of set of mouse clicks, or a click on a particular area to enable access to a restricted part of the application. By default the component responds to a mouse click anywhere within the component's client area by popping up a password dialog.
Ultimately when the required interaction has occurred a password dialog can be displayed. On successful login the user can then navigate to a restricted page or whatever the author decides via a callback method specified with the
setCallback
api.
ReflectedImage
The reflected image component displays an image and a reflection of that image. For example:
In the above image the top half of the image is the unadorned image and the bottom half is the dynamically generated reflection.
|
Attribute
|
Description
|
|
shear
|
The factor by which to shear the image reflection (0-100)
|
|
content
|
The image name
|
|
tooltip
|
The tooltip text for this component
|
|
opaque
|
true
if the component is to fully paint the client area
|
CaptionedImage
The captioned image component displays an image and a caption below that image. Both the component itself and the image it contains may draw a border.
 |
|
Attribute
|
Description
|
|
border
|
0
for no border,
1
for an outer border and
2
for an inner and outer border
|
|
captionStyle
|
The style name for the caption text
|
|
imageStyle
|
The stylename for the image and its border
|
|
style
|
The style name for the components main area
|
|
fill
|
true
to fill the background
|
|
pad
|
The amount of padding around the image in pixels
|
|
arc
|
The amount of rounding on the borders
|
|
caption
|
The caption text
|
|
minHeight
|
The minimum component height
|
|
minWidth
|
The minimum component width
|
|
opaque
|
true
if the component is to fully paint the client area
|
|
buffered
|
true
if the component is to buffer its painting operations
|
|
tooltip
|
The tooltip text
|
|
align
|
The caption text alignment
|
|
alignment
|
The caption text alignment
|
|
shadow
|
true
to draw a shadow on the image
|
|
imageName
|
The filename of the image
|
|
content
|
The filename of the image
|
|
enabled
|
true
if the component is enabled/selectable
|
|
blend
|
true
if the backgroudn painter is to blend into its parent
|
|
translucent
|
true
if the component is translucent
|
|
laf
|
true
to use the look and feel settings
|
|
painter
|
the class name of the background painter
|
|
titlePos
|
The position of the title text on the main component
|
|
titleStyle
|
The style for the title text
|
|
title
|
The text for the title
|
RollupBar
Class: org.formaria.swing .RollupBar
An outlook style roll-up bar. The methods are modelled on the JTabbedPane.
|
Attribute
|
Description
|
|
alignment
|
Set the component alignment (Left | Right | Center | Leading | Trailing)
|
|
icon
|
The filename of the icon
|
|
iconpressed
|
The filename of the pressed icon
|
|
iconrollover
|
The filename of the rollover icon
|
|
imagename
|
The filename of the image
|
|
pressed
|
The filename of the pressed image
|
|
rollover
|
The filename of the rollover image
|
|
disabled
|
The filename of the disabled image
|
|
style
|
The style for the component and its children
|
|
buttonheight
|
The height of the buttons contained within the component
|
|
painter
|
The class name of a painter for the buttons, for example
org.formaria.swing.painter.GradientButtonPainter
or
org.formaria.swing.painter.GradientToggleButtonPainter
|
|
antialias
|
Turn antialias on or off, true to turn it on or false to turn it off
|
ProgressIndicator
Class:
org.formaria.swing.ProgressIndicator
Provides an animated circular area consisting of bars which gives an indicator of progress.