Changeset 12822


Ignore:
Timestamp:
2006-09-21T17:22:44+12:00 (18 years ago)
Author:
kjdon
Message:

changed from a BoxLayout to a GridLayout for build and import options - looks nicer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/OptionsPane.java

    r12305 r12822  
    7272    static private int IMPORT = 1;
    7373    static private int MINIMUM_ROWS = 11;
    74  
     74    
    7575    /** All process messages are written to this log text area. */
    7676    public JTextArea log_textarea = null;
     
    138138    }
    139139    current_controls.addAll(build_arguments);
     140
    140141    // Now that we know how many arguments there are we can build the pane to view them on. Modes lower than EXPERT can provide a previous pane on which to add the arguments.
    141142    if(pane == null || current_mode >= Configuration.EXPERT_MODE) {
     
    144145        pane.setBackground(Configuration.getColor("coloring.collection_tree_background", false));
    145146        int argument_count = build_arguments.size();
    146         // If in any of the higher detail modes, and assuming we don't want super phat argument controls, we better ensure there is a minimum number or lines in the grid layout
     147        // If in any of the higher detail modes, and assuming we don't want super phat argument controls, we better ensure there is a minimum number of lines in the grid layout
    147148        if(current_mode >= Configuration.EXPERT_MODE) {
    148149        if(argument_count < MINIMUM_ROWS) {
     
    153154        // Otherwise we're just going to throw them on one after another and chuck it in a scroll pane anyway
    154155        else {
    155         pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS));
    156         }
    157     }
     156        // use  GridLayout with 0 rows == as many rows as needed. Unfortunately, rows will
     157        // grow fat if space too large, but we don't know how many rows we'll need yet.
     158        pane.setLayout(new GridLayout(0, 1, 5, 5));
     159        }
     160    }
     161
    158162    for(int j = 0; j < build_arguments.size(); j++) {
    159163        pane.add((JComponent)build_arguments.get(j));
     
    203207        pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    204208        pane.setBackground(Configuration.getColor("coloring.collection_tree_background", false));
    205         int argument_count = import_arguments.size();
    206         // If in any of the higher detail modes, and assuming we don't want super phat argument controls, we better ensure there is a minimum number or lines in the grid layout
     209        int argument_count = import_arguments.size();       
     210        // If in any of the higher detail modes, and assuming we don't want super phat argument controls, we better ensure there is a minimum number of lines in the grid layout
    207211        if(current_mode >= Configuration.EXPERT_MODE) {
    208212        if(argument_count < MINIMUM_ROWS) {
     
    213217        // Otherwise we're just going to throw them on one after another and chuck it in a scroll pane anyway
    214218        else {
    215         pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS));
    216         }
    217     }
     219        // use  GridLayout with 0 rows == as many rows as needed. Unfortunately, rows will
     220        // grow fat if space too large, but we don't know how many rows we'll need yet.
     221        pane.setLayout(new GridLayout(0, 1, 5, 5));
     222        }
     223    }
     224
    218225    for(int j = 0; j < import_arguments.size(); j++) {
    219226        pane.add((JComponent)import_arguments.get(j));
Note: See TracChangeset for help on using the changeset viewer.