Changeset 6843


Ignore:
Timestamp:
2004-02-18T17:14:24+13:00 (20 years ago)
Author:
kjdon
Message:

changed the layout and unfixed the label sizes so other langs text can fit in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java

    r6672 r6843  
    212212        JPanel all_details_panel = new JPanel();
    213213        JPanel details_panel = new JPanel();
    214         JPanel creator_panel = new JPanel();
     214        JPanel fields_panel = new JPanel();
     215
    215216        creator_label = new JLabel();
    216         creator_label.setPreferredSize(LABEL_SIZE);
    217217        Dictionary.registerText(creator_label, "CDM.General.Email.Creator");
    218218
     
    220220        Dictionary.registerTooltip(creator_emailfield, "CDM.General.Email.Creator_Tooltip");
    221221
    222         JPanel maintainer_panel = new JPanel();
    223222        maintainer_label = new JLabel();
    224         maintainer_label.setPreferredSize(LABEL_SIZE);
    225223        Dictionary.registerText(maintainer_label, "CDM.General.Email.Maintainer");
    226224
    227225        maintainer_emailfield = new EmailField(Gatherer.config.getColor("coloring.error_background", false));
    228226        Dictionary.registerTooltip(maintainer_emailfield, "CDM.General.Email.Maintainer_Tooltip");
    229         public_checkbox = new JCheckBox("", public_collectionmeta.getValue(CollectionMeta.TEXT).equals(CollectionConfiguration.TRUE_STR));
    230         Dictionary.registerText(public_checkbox, "CDM.General.Access");
    231         beta_checkbox = new JCheckBox("", beta_collectionmeta.getValue(CollectionMeta.TEXT).equals(CollectionConfiguration.TRUE_STR));
    232         Dictionary.registerText(beta_checkbox, "CDM.General.Beta");
    233         JPanel name_panel = new JPanel();
     227
    234228        name_label = new JLabel();
    235         name_label.setPreferredSize(LABEL_SIZE);
    236229        Dictionary.registerText(name_label, "CDM.General.Collection_Name");
    237230        name_textfield = new JTextField("CDM.General.Collection_Name");
    238231        Dictionary.registerTooltip(name_textfield, "CDM.General.Collection_Name_Tooltip");
    239         JPanel short_name_panel = new JPanel();
    240232        JLabel short_name_label = new JLabel();
    241         short_name_label.setPreferredSize(LABEL_SIZE);
    242233        Dictionary.registerText(short_name_label, "NewCollectionPrompt.Collection_Name");
    243234        JTextField short_name_textfield = new JTextField(Gatherer.c_man.getCollection().getName());
     
    246237        JPanel icon_panel = new JPanel();
    247238        icon_label = new JLabel();
    248         icon_label.setPreferredSize(LABEL_SIZE);
    249239        Dictionary.registerText(icon_label, "CDM.General.Icon_Collection");
    250240        icon_textfield = new JTextField("CDM.General.Icon_Collection");
     
    255245        JPanel small_icon_panel = new JPanel();
    256246        small_icon_label = new JLabel("CDM.General.Icon_Collection_Small");
    257         small_icon_label.setPreferredSize(LABEL_SIZE);
    258247        Dictionary.registerText(small_icon_label, "CDM.General.Icon_Collection_Small");
    259248        small_icon_textfield = new JTextField("CDM.General.Icon_Collection_Small");
     
    262251        browse_home_icon_button.setMnemonic(KeyEvent.VK_A);
    263252        Dictionary.registerText(browse_home_icon_button, "General.Browse");
     253
     254        // public and beta
     255        JPanel box_panel = new JPanel();
     256        public_checkbox = new JCheckBox("", public_collectionmeta.getValue(CollectionMeta.TEXT).equals(CollectionConfiguration.TRUE_STR));
     257        Dictionary.registerText(public_checkbox, "CDM.General.Access");
     258        beta_checkbox = new JCheckBox("", beta_collectionmeta.getValue(CollectionMeta.TEXT).equals(CollectionConfiguration.TRUE_STR));
     259        Dictionary.registerText(beta_checkbox, "CDM.General.Beta");
     260
    264261        JPanel description_panel = new JPanel();
    265262        description_label = new JLabel();
    266         description_label.setPreferredSize(LABEL_SIZE);
     263        //description_label.setPreferredSize(LABEL_SIZE);
    267264        Dictionary.registerText(description_label, "CDM.General.Collection_Extra");
    268265        description_textarea = new JTextArea();
     
    290287        instruction_panel.add(new JScrollPane(instructions_textarea), BorderLayout.CENTER);
    291288
    292         creator_panel.setLayout(new BorderLayout());
    293         creator_panel.add(creator_label, BorderLayout.WEST);
    294         creator_panel.add(creator_emailfield, BorderLayout.CENTER);
    295 
    296         maintainer_panel.setLayout(new BorderLayout());
    297         maintainer_panel.add(maintainer_label, BorderLayout.WEST);
    298         maintainer_panel.add(maintainer_emailfield, BorderLayout.CENTER);
    299 
    300         name_panel.setLayout(new BorderLayout());
    301         name_panel.add(name_label, BorderLayout.WEST);
    302         name_panel.add(name_textfield, BorderLayout.CENTER);
    303 
    304         short_name_panel.setLayout(new BorderLayout());
    305         short_name_panel.add(short_name_label, BorderLayout.WEST);
    306         short_name_panel.add(short_name_textfield, BorderLayout.CENTER);
     289        fields_panel.setBorder(BorderFactory.createEmptyBorder(5,0,0,0));
     290        fields_panel.setLayout(new BorderLayout(5,2));
     291       
     292        JPanel fields_label_panel = new JPanel();
     293        fields_label_panel.setLayout(new GridLayout(6,1));
     294
     295        JPanel fields_box_panel = new JPanel();
     296        fields_box_panel.setLayout(new GridLayout(6,1));
     297   
     298        // creator
     299        fields_label_panel.add(creator_label);
     300        fields_box_panel.add(creator_emailfield);
     301
     302        // maintainer
     303        fields_label_panel.add(maintainer_label);
     304        fields_box_panel.add(maintainer_emailfield);
     305
     306        // title
     307        fields_label_panel.add(name_label);
     308        fields_box_panel.add(name_textfield);
     309
     310        // collection short name
     311        fields_label_panel.add(short_name_label);
     312        fields_box_panel.add(short_name_textfield);
     313
     314        // icon
     315        fields_label_panel.add(icon_label);
     316        fields_box_panel.add(icon_panel);
     317
     318        // small icon
     319        fields_label_panel.add(small_icon_label);
     320        fields_box_panel.add(small_icon_panel);
     321
     322        fields_panel.add(fields_label_panel, BorderLayout.WEST);
     323        fields_panel.add(fields_box_panel, BorderLayout.CENTER);
    307324
    308325        icon_panel.setLayout(new BorderLayout());
    309         icon_panel.add(icon_label, BorderLayout.WEST);
    310326        icon_panel.add(icon_textfield, BorderLayout.CENTER);
    311327        icon_panel.add(browse_about_icon_button, BorderLayout.EAST);
    312328
    313329        small_icon_panel.setLayout(new BorderLayout());
    314         small_icon_panel.add(small_icon_label, BorderLayout.WEST);
    315330        small_icon_panel.add(small_icon_textfield, BorderLayout.CENTER);
    316331        small_icon_panel.add(browse_home_icon_button, BorderLayout.EAST);
    317332
    318         details_panel.setLayout(new GridLayout(8,1,5,2));
    319         details_panel.add(creator_panel);
    320         details_panel.add(maintainer_panel);
    321         details_panel.add(public_checkbox);
    322         details_panel.add(beta_checkbox);
    323         details_panel.add(name_panel);
    324         details_panel.add(short_name_panel);
    325         details_panel.add(icon_panel);
    326         details_panel.add(small_icon_panel);
     333        box_panel.setLayout(new GridLayout(2,1,5,2));
     334        box_panel.add(public_checkbox);
     335        box_panel.add(beta_checkbox);
    327336
    328337        description_panel.setLayout(new BorderLayout());
    329338        description_panel.add(description_label, BorderLayout.NORTH);
    330339        description_panel.add(new JScrollPane(description_textarea), BorderLayout.CENTER);
     340       
     341        details_panel.setLayout(new BorderLayout());
     342        details_panel.add(fields_panel, BorderLayout.NORTH);
     343        details_panel.add(box_panel, BorderLayout.CENTER);
    331344
    332345        all_details_panel.setLayout(new BorderLayout());
Note: See TracChangeset for help on using the changeset viewer.