Repository navigation
Reference
getDistinctColor() is a convenience utility to generate a set of colours that are different from each other - for example if you were drawing a graph that needed some different colours, you could obtain them from this function.

bd.setDrawColor(bd.getDistinctColor(1, 1));
bd.drawFilledRect(50, 50, 50, 100);
bd.setDrawColor(bd.getDistinctColor(16, 0.2));
bd.drawFilledRect(100, 50, 50, 100);
Retrieve the size of the app window.

Point displaySize = bd.getDisplaySize();
bd.drawText("width=" + displaySize.x, 20, 40);
bd.drawText("height=" + displaySize.y, 20, 70);
The width can be retrieved on it's own:
int width = bd.getWidth();
bd.drawText("width=" + width, 20, 40);
And the height:
int height = bd.getHeight();
bd.drawText("height=" + height, 20, 40);

Close the application.
bd.close();

Repaint causes anything drawn this frame to be updated and made visible. The FPS parameter controls how long to wait until the next repaint. NOTE: this should not be required if you are using the MinvioApp.
bd.drawText("repaint", 20, 40);
bd.repaint(30);
drawPoint() - draw a pixel to the screen using the current colour.

Point point = new Point(80, 80);
bd.drawPoint(point);
bd.drawPoint(120, 120);
drawPoint() - draw a 1 pixel wide line in the current draw colour.

bd.drawLine(20, 20, 160, 160);
bd.drawLine(20.0, 100.0, 160, 160);
Two point objects can be used as the start and end of the line:

Point p1 = new Point(10, 10);
Point p2 = new Point(100, 100);
bd.drawLine(p1, p2);
The thickness of the line can be specified:

Point p1 = new Point(10, 10);
Point p2 = new Point(100, 100);
bd.drawLine(p1, p2, 3);
bd.drawLine(130, 60, 20, 100, 5);
Draw the border of a rectangle in the current draw colour.

bd.drawRect(50, 50, 100, 100);
Draw a solid rectangle in the current draw colour.

bd.drawFilledRect(50, 50, 100, 100);

Draw the supplied text using the current font at the specified location.
bd.drawText("Hello, world", 30, 70);

Draw the supplied text using the current font at the specified location. This example shows how to create and apply a new font.
Font font1 = new Font("Times New Roman", Font.PLAIN, 20);
Font font2 = new Font("Menlo", Font.PLAIN, 20);
bd.setFont(font1);
bd.drawText("Hello, world", 30, 70);
bd.setFont(font2);
bd.drawText("Hello, world", 30, 100);

Use getAvailableFontNames() to obtain a list of the names of all the current available fonts on your system.
String fonts[] = BasicDisplay.getAvailableFontNames();
Font font = new Font(fonts[fonts.length / 2], Font.PLAIN, 30);
bd.setFont(font);
bd.drawText("Hello, world", 30, 70);
You could write something like this to output all the font names to the java terminal:
String fonts[] = BasicDisplay.getAvailableFontNames();
for (String font : fonts) {
System.out.println(font);
}