TS 71 gridbagcustomizer

Form Editor - Grid Bag Customizer Test Specification

Author: Adam Senk
Version: 7.1
Last update: 09/08/2011
Introduction: In NetBeans 7.1 is included a new GridBagLayout editor. This test spacification covers 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!
  2. 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.
  3. 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
  4. Opening Grid Bag Layout Customizer3
    1. Invoke pop-up menu on JFrame in MyForm Design
    2. Try select "Customize Layout" from this menu

      File:gb2version71.png
    • EXPECTED RESULT: 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 five buttons and two spinners is located above the Grid area. It provides convenient access to common commands, such as undoing, redoing, padding, and previewing layout.There is also button for enabling "uniform gaps" and two spinners for gap column width and gap row height settings. This spinners are enabled if and only if the "uniform gap" button is pressed.
      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, Insets,Internal Padding,Fill,Size in Grid, Position in Grid and Weights.
      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.
    3. Move all components (Using Drag and Drop and/or setting Grid X and Grid Y property and/or clicking on Position in Grid buttons.)
    • EXPECTED RESULT: Components should be placed like this :
      File:Gb3version71.png
      You can see all components and empty cells. Empty whole lines or columns are hidden.
  2. Uniform gaps
    1. Press "Enable uniform gaps" button
      • EXPECTED RESULT: Odd lines and columns are empty. You cannot add component from palette into this cells. You cannot even move any component here.
    2. Press "Disable uniform gaps" button
    • EXPECTED RESULT:Odd lines and columns disappear.
  3. 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 2 on the right.
    4. Release the cursor to resize the components.
    • EXPECTED RESULT:Text fields are extended to span between the two cells as shown in the following illustration:
      File:Gb4version71.png
      The occupied cells are highlighted.
  4. 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. Press Fill buttons and check that text in Fill property is ok.
    • EXPECTED RESULT: ↔ button pressed - Horizontal
      Both pressed - Both
      ↕ pressed - Vertical
      Select Horizontal from Fill combobox. The JTextFields fills the both cells completely:
      File:Gb5version71.png

Test suite: Laying Out Components - changing of other properties

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

  1. Insets
    1. Select the second Browse button
    2. Try change Insets settings, using Insets buttons
    • EXPECTED RESULT: Insets setting is changing (Insets button works as is written in their Tool Tip Text. ) Set insets to [19,29,19,29]: Frame should looks like this:File:GridBagInsetsversion71.png


  1. Internal padding
    1. Select the second Browse button
    2. Try change Internal Padding X and Internal Padding Y settings, using Insets buttons (try also CTRL-click).
    • EXPECTED RESULT: Internal Padding setting is changing (Internal Padding button works as is written in their Tool Tip Text. ) Set Internal Padding X and Internal Padding Y to 15.: Frame should looks like this:File:GridBagPaddingversion71.png


  1. Size in Grid, Weights
    1. Try Size in Grid and Weights buttons
    • EXPECTED RESULT: Properties are changing as is written in buttons Tool Tip Texts.

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.
  2. 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.
  2. 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.
  3. Design Preview
    1. Click on the Design Preview button
    • EXPECTED RESULT:The Design Preview Window is opened. All 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.
  2. 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