Slide Elements
The presentation library provides a number of elements that can be used to create slides:
-
Heading <text>, <style>
(orheading <text>
orsubHeading <text>
to use defaults)An element that displays a single line of text, indented for headings. The helpers
heading
andsubHeading
creates headings that use the default style of the presentation. -
Paragraph <text>, <style>
(orpar
)An element that displays a single line of text, similar to
Heading
. This component is, however, intended for paragraph text. -
List <points>, <font>, <space>, <brush>
(orlist <points>
to use default style)Creates a list, each item is a string from the array
<points>
. The default is an unordered list (with bullets), but numbers and letters are also supported.Note: due to overload resolution, Basic Storm is not able to disambiguate the type of an empty list (could be either
FormatStr
orStr
). Specifying at least one string solves the problem.Note: If list elements are line-wrapped, then the reported height during layout is wrong, which has unintended side-effects. Manually wrapping lines (with
\n
) solves this problem.The list has the following attributes:
-
core.Float bulletSize
Size of the bullets.
-
core.Float margin
Space from the left margin of this element to the start of the text.
-
core.Float padding
Space between the text and the bullet or the number.
-
core.Float lineSpace
Space between lines.
-
void ordered()
Create numbers.
-
void letters()
Create alphabetical letters.
-
-
Image <bitmap>
(orimage <bitmap>
)Displays a bitmap. The default behavior is to stretch the image to fill the allocated space. The
minSize
member does, however, return the actual size of the image, which causes the image to be very large in some layout managers. Settingscale
to a proper value solves this issue. TheImage
element has the following attributes:-
void fit()
Fit to the container without clipping (default).
-
void fill()
Fill the container (maybe clips).
-
-
PageNumber <style>
(orpageNumber
to create with default style)A text field that contains the number of the current page. This relies on the page number being located in the background slide to retrieve the proper page number (otherwise, it will show the current animation step).
The attribute
offset
specifies how the numbering should be offset. The default is that the first slide is zero. -
BigArrow <angle>
Create a big arrow, aimed at
angle
. -
HLine <color>
Creates a horizontal line. Useful together with
Grid
to make tables. Allows specifying the with usingwidth
and the minimum length withminLength
. -
VLine <color>
Creates a vertical line. Useful together with
Grid
to make tables. Allows specifying the with usingwidth
and the minimum length withminLength
. -
xBarGraph
andyBarGraph
(in the packagepresentation.graph
)Creates a bar graph with bars on the x or y axis. Allows customizing the look and colors of the graphs, and provides custom animations for the contents of the graph.
Colors
The package presentation.colors
defines many DVIPS colors for use in presentations.
Custom Elements
Elements are simply classes that inherit from the presentation.Element
class. Elements
are simply rectangles on the screen that will be rendered by the presentation system. Implementing a
custom element requires implementing the following members:
-
core.geometry.Size minSize()
Get the minimum size of this element.
-
void draw(ui.Graphics g)
Draw this element at the location indicated by
pos
.
The system also supports interactive elements. These are able to respond to mouse interactions. Such
elements must inherit from the presentation.InteractiveElement
class, which has the
following members: