Swing library

Index:

Functions:

paint

paint

Synopsis
Paint graphic primitives on screen.
Usage
(paint primitive ... primitive)
Returns
scene
Where
  • primitive is list[0..N]: A list representing a graphic primitive to paint on screen. The first element is a string that indicates the type of the primitive. The rest of the elements in the list are the primitive parameters. The supported primitives are: ("group" "offset-x" => offset-x "offset-y" => offset-y "rotation" => rotation), ("line" x1 y1 x2 y2), ("text" text x y), ("image" url x y [width height]), ("rectangle" x y width height) and ("circle" x y radius). "group" primitives can contain other graphic primitives. The next styling properties can be set for most primitives: "color", "font-family", "font-size", "line-width". These properties are inherited by children primitives.
  • scene is list: The primitive tree that is painted on screen.
Description
This function paints the graphic primitives passed as arguments. If primitives are omitted, the screen is cleared.
Examples
(paint
  (list
    "text"
    (format-date (date))
    100
    100
    "font-family" => "Monospaced"
  )
)
(
  "text"
  "02/11/2017 13:21:36"
  100
  100
  "font-family" => "Monospaced"
)
(paint
  (
    "group"
    "color" => "#ff0000"
    ("line" 0 0 100 100)
    ("rectangle" 0 0 100 100)
  )
)
(
  "group"
  "color" => "#ff0000"
  ("line" 0 0 100 100)
  ("rectangle" 0 0 100 100)
)
Top