Procedure

This scenario will test out the features and behavior of the Font property editor.

Setup

 

Create a new empty Visual Class (extending Object).  Drop a JLabel on the free form.

Basic Functionality Inspection

Select the JLabel on the free form.
Look at the font property on the sheet
Verify that the font value label provides the following information: font name, style, and size

Click on the font property on the PS.
Verify that the custom editor launcher button is displayed.


Click the editor launcher button
Verify the font property editor is displayed (may have to click on Java Property Editor on taskbar)


Increase the font size to 18.
Verify the font preview size changes.

Click OK to dismiss the editor.
Verify the font change updates the canvas, source and property sheet properly.

With the font property still selected, look to the top of the property sheet
Verify the Restore to Default and Set to Null buttons are enabled


Click the Restore to Default button
Verify the JLabel returns to it's default font (Dialog bold 12) and the setFont line is removed from the source.

Click the Set to Null button
Verify the canvas changes default to the default font (Dialog plain 12), the source is updated properly, and the PS shows an empty font value.

Click the Restore to Default button again then click the property editor button again.
Change the font to a different value.
Click the Cancel button.
Verify the font value does not change in the source, canvas and property sheet.

Property Editor Functionality Inspection

Click the property editor button to launch the editor again.
Verify the Name, Style, and Size boxes reflect the value of the selected font.
Verify the selection on the Name, Style and Size lists reflect the value of the selected font.
Verify the font preview reflects the value of the selected font
Verify the font preview is populated with an adequate default preview string.

Verify the font names list contains the following values: Default, Dialog, DialogInput, Monospaced, SansSerif, Serif
Verify the font names list contains the other fonts installed on the system.
Verify the font names are sorted alphabetically.

Verify the font styles list contains the following values: plain, bold, italic, bold italic
Verify the font size list contains common font sizes, in increasing order.

Verify that choosing a font name from the list, the font name populates the Name box, and the preview updates to reflect the new font.

Choose each font style on the style list
Verify that choosing a font style from the list, the font style populates the Style box, and the preview updates to reflect the new style.
Verify that choosing a font size from the list, the font size populates the Size box, and the preview updates to reflect the new size.

Clear the text in the font Name box.
Verify the first name in the list becomes selected.
Type dialogi into the Name box.
Verify the selection changes in the list as the name is typed, refining the search as the typing occurs (type-ahead search results)
Verify that clicking a name in the list populates the Name box with the name, clearing the previously typed text.

Verify the font style box is not editable.

Clear the text in the font size text.
Verify the list selection clears and the font preview changes to a small font size.

Type in a font size in the box.
Verify the font preview updates as the size is typed.
Verify that if a font size on the list is typed, the size is selected on the list.
Verify that nonnumeric characters cannot be entered into the box.
Verify that large sizes are permitted (e.g. 500)

Verify font preview text is editable, change the text including pressing enter for new line
Verify the font preview area scrolls correctly when a large font size is chosen.

Maximize the Property Editor window.
Verify the GUI components are resized nicely on expansion.
Verify the font preview area can be expanded/contracted by dragging the split pane handle.
Verify the one touch expandable controls are present on the split pane handle, and work properly.


Restore the Property Editor window to its regular size.
Resize the window smaller than usual.
Verify each list creates a scroll bar as needed.
Resize the window larger and smaller.
Verify the display is laid out well whenever possible.

Source Code

Choose a font name, and set the size to 36.
For each style on the list


From the source, change the style parameter in the source call to 0
[eg jLabel.setFont(new java.awt.Font("Georgia", java.awt.Font.BOLD, 36)); -> jLabel.setFont(new java.awt.Font("Georgia", 0, 36)); ]
Verify the font style changes to plain on the canvas and the PS.
Repeat with values 1 = bold, 2 = italic, 3 = bold italic

Change the font name in the source to "sAnSseRIF"
Verify the font changes to SansSerif on the canvas.