Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
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)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)Parameters
fForm- the form
paint
public void paint(Graphics g, Rectangle rect)Parameters
gGraphics- the
Graphicsobject rectRectangle- the given rectangle cliping area