TS 61 gridbagcustomizer

Form Editor - Grid Bag Customizer Test Specification

Author: Adam Senk
Version: 7.0
Last update: 16/03/2011
Introduction: In NetBeans 7.0 is included a new GridBagLayout editor. This test spacification cover the basic operation, which is editor able to realize.
Comments:

Contents


Test suite: Customizer - basic function test

Purpose:
Setup: Start IDE with clear userdir. Create new project, Java Application (e.g. MyApplication).In myapplication packege create a new JFrame Form (e.g. MyForm).

  1. Opening Grid Bag Layout Customizer 1
    1. Invoke pop-up menu on JFrame in MyForm Design
    2. Try select "Customize Layout" from this menu
    • EXPECTED RESULT: "Customize Layout" item is disabled!


  1. Opening Grid Bag Layout Customizer2
    1. Invoke pop-up menu on JFrame in MyForm Design
    2. Set Layout -> Grid Bag
    3. Invoke this pop-up menu again
    4. Try select "Customize Layout" from this menu
    • EXPECTED RESULT: "Customize Layout" window is open.No Exception is thrown. Close it.


  1. Inserting Swing controls
    1. insert some Swing controls from pallete a change their text. The result should look like this http://netbeans.org/images_www/articles/70/java/gbcustomizer-basic/sampleform.png File:gb1.png
    • EXPECTED RESULT: Inserted Swing controls are placed only in one line


  1. Opening Grid Bag Layout Customizer3
    1. Invoke pop-up menu on JFrame in MyForm Design
    2. Try select "Customize Layout" from this menu
    • EXPECTED RESULT: Customize Layout window is open a looks like http://netbeans.org/images_www/articles/70/java/gbcustomizer-basic/customizerdialog.png File:gb2.png
      Window contains:
      Grid Area
      The Grid area is on the right side of the Customize Layout dialog box. It shows the grid layout of the components.The components in the sample form are already added but not laid out correctly.
      Toolbar
      A toolbar with four buttons is located above the Grid area. It provides convenient access to common commands, such as undoing, redoing, padding, and previewing layout.
      Property Customizer
      The Property Customizer is positioned in the top left corner of the Customize Layout dialog box. It allows for easy modification of the most common layout constraints - Anchor and Fill.
      Property Sheet
      The Property Sheet is located below the Property Customizer. It displays the layout constraints of the selected components.

Test suite: Laying Out Components

Purpose:
Setup: Continue with the project from previous test case.

  1. Moving components
    1. Select some component
    2. Move it, using drag and drop
    • EXPECTED RESULT: While dragging a component, its Grid X and Grid Y properties change to reflect its new position. New columns and rows are created automatically when needed.

    1. Move all components
  1. Resizing components
    1. Control-click the two JTextField(First Name, Surname) components to select them.
    2. The JTextFields are selected, you can see the small resize handlers.
    3. Position the cursor over the cells right edge, click and drag until the orange highlighted guideline embraces the adjacent cells in column 3 on the right.
    4. Release the cursor to resize the components.

The occupied cells are highlighted.

  1. Specifying Fill Layout Constraint
    1. Control-click the two JTextField(First Name, Surname) components to select them.
    2. Text fields occupy two cells, they have the preferred size and are placed in the middle of the display area
    3. select Horizontal,in the Fill combobox in the Property Sheet area.

Test suite: Adding new components

Purpose:
Setup: Continue with the project from previous test case.

  1. Adding new rows and columns
    1. Make the third (Toggle) Button on Toolbar ON File:Ico.png
    2. Left click on some Number on the left side of the JFrame.
    3. Insert Row Before
    4. Left click on some Number on the top of the JFrame.
    5. Insert Column After
    • EXPECTED RESULT: New Row and Column are aded correctly on the right place.
  1. Adding new components
    1. Right click on some empty cell.
    2. Add Component -> Swing Controllers -> Button
    3. Add some other components
    • EXPECTED RESULT: Components are added correctly.Check the source code too.

Test suite: Toolbar testing

Purpose:
Setup: Continue with the project from previous test case.


  1. Undo, Redo
    1. Do some changes in JFrame (Add some component, replace some component, change size of some component)
    2. Use the Undo button to take the changes back
    3. Use the Redo button to invoke the changes again
    4. Use the Undo button again, to take the changes back
    • EXPECTED RESULT:The JFrame should look exactly as it looks on the begin of this test spec. Undo and Redo buttons should work correctly.

  1. Third Button on Toolbar
    1. Click on the third button on Toolbar with toolTipText: "Determines wheter empty columns and rows should be padded." and make this Button ON.
    2. Move some component and create some new empty rows and columns. You can see new rows and columns.
    3. Move component back
    4. You can still see new rows and columns even they are empty.
    5. Click on the third button on Toolbar again and make it OFF.
    6. The empty columns and rows disappear.
    • EXPECTED RESULT:The third button on Toolbar should work correctly. When it is ON, it is possible to see empty columns and rows. When it is OFF the empty rows and columns are hidden.


  1. Design Preview
    1. Click on the Design Preview button
    • EXPECTED RESULT:The Design Preview Window is opened. Ale components are placed correctly and has the right size.

Test suite: Anchoring testing

Purpose:
Setup: Continue with the project from previous test case.

  1. Anchor icons
    1. Select some text component (e.g. First name JLabel)
    2. Click gradually on all Anchor icons
    • EXPECTED RESULT:When you click on the icon the Anchor property changes. It should be same as Anchor icon toolTipText. The text is moving correctly inside the cell as you click on icons.

  1. Anchor property
    1. Change the anchor property using the combo box
    2. Select some property, that is impossible to set with Anchor Button
    • EXPECTED RESULT:The text is moving correctly inside the cell as change Anchor property.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo