Drawing

Display sketch code: Drawing.pde

Demo of Many Clickable Objects

You can click the panel to create various objects as specified by the ListBoxes and ComboBoxes on the left and right. Objects have from 1 to 4 vertices. When you change color options, they are implemented on the current shape and future shapes. However, if you change shape after giving the current figure any points, you will need to complete it before the new shape is implemented.

Note: when drawing multiple points objects, the sketch starts the drawing by using the points it currently has available. I.e. a line is drawn after the second point is clicked, and a triangle is drawn after the third point even if the final figure is a quadrilateral.

The sketch remembers the last 10 figures drawn.

Clickable Objects Used

ClassExample
(Traditional) ListBoxShapes ListBox.
(Traditional) ComboBoxPoint Color ComboBox.
(Non-traditional) ListBox Line Color ListBox (each item is a CircleButton and is arranged 2 items per line).
(Non-traditional) ComboBox Background Color ComboBox (opens to the right and each box has its own color).
ClickablePanel The panel in the center.
Button The Clear button. Also explicitly created for Background color, Option Menu, and LineColor Menu and implicitly created for the traditional ComboBox, ListBox, and the other menus.
Checkbox The Fill Shape Checkbox.
RadioButtonListBox The Fill Color radio buttons.
Menu "Point Color", "Fill Color", and "Background Color" menu items were created by the first constructor, "Shape" by the second constructor, while "Options" and "Line Color" were created by the third constructor.
ButtonGroup Explicitly created for Background Color ComboBox, Line Color List Box, Options Menu, and LineColor Menu. Implicitly created by the traditional ComboBox, traditional ListBox, RadioButtonListBox, and the other menu items.
ScrollSketch The scroll bars on the right and bottom of the sketch.
ClickableGroup All the Clickable items are in a ClickableGroup.
MenuBar The menu bar.
CircleButton Explicitly created for Line Color ListBox.
RadioButton Implicitly created for Fill Color RadioButtonListBox.

Return to the top of the page

Revised: 04/11/2014