public class GlassTutorial
- Object
- GlassTutorial
ImplementsPainter
A Glass Tutorial appears on top of the UI especially on a touch device but could be on any device and points to/circles components within the UI coupled with explanation of what they do and a tint of the screen. It is implemented as a GlassPane on top of a Form which is automatically removed when a user touches the screen or presses a button.
To position elements within the glass tutorial the elements must be associated with a component instance of the underlying UI and positioned relatively to said component.
The GlassTutorial uses the “GlassTutorial” UIID to paint itself it then paints the hint components in their proper places.
Constructors
public GlassTutorial() |
Methods
public void addHint(Component hintComponent, Component destinationComponent, String position) | Places a hint within the glass in a position relative to the destinationComponent, the position is indicated with border layout attributes. |
public void showOn(Form f) | Install the glass tutorial on a form and seamlessly dismiss it when no longer necessary |
public void paint(Graphics g, Rectangle rect) | Draws inside the given rectangle clipping area. |
Inherited methods
Constructor details
GlassTutorial
public GlassTutorial()Method details
addHint
public void addHint(Component hintComponent, Component destinationComponent, String position)Places a hint within the glass in a position relative to the destinationComponent, the position
is indicated with border layout attributes. Notice you can place multiple components on a single
element and they will be rendered in order e.g. a component with a border can be used to “circle”
the destination by placing it in the CENTER position and another arrow with text can be places in
the south position below.
Parameters
hintComponentComponent- The component that would be renderered in the given position
destinationComponentComponent- the “hinted” component over which the hint will show
positionString- the position relative to the destinationComponent in BorderLayout values e.g. to place the hint above the component just place it in BorderLayout.NORTH. The center will stretch the component but the other sides will give the component its exact preferred size.
showOn
public void showOn(Form f)Install the glass tutorial on a form and seamlessly dismiss it when no longer necessary
Parameters
fForm- the form
paint
public void paint(Graphics g, Rectangle rect)Draws inside the given rectangle clipping area.
Parameters
gGraphics- the
Graphicsobject rectRectangle- the given rectangle cliping area