- Timestamp:
- 2009-01-12T13:04:29+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/gui/Preferences.java
r17612 r18370 111 111 // Creation 112 112 JPanel content_pane = (JPanel) getContentPane(); 113 content_pane.setComponentOrientation(Dictionary.getOrientation()); 113 114 tab_pane = new JTabbedPane(); 115 tab_pane.setComponentOrientation(Dictionary.getOrientation()); 114 116 JPanel general_preferences = createGeneralPreferences(); 117 general_preferences.setComponentOrientation(Dictionary.getOrientation()); 115 118 tab_pane.addTab(Dictionary.get("Preferences.General"), null, general_preferences, Dictionary.get("Preferences.General_Tooltip")); 116 119 tab_pane.addTab(Dictionary.get("Preferences.Mode"), null, createModePreferences(), Dictionary.get("Preferences.Mode_Tooltip")); 117 120 // tab_pane.addTab(Dictionary.get("Preferences.Workflow"), null, createWorkflowPreferences(), Dictionary.get("Preferences.Workflow_Tooltip")); 118 121 JPanel connection_preferences = createConnectionPreferences(); 122 connection_preferences.setComponentOrientation(Dictionary.getOrientation()); 119 123 tab_pane.addTab(Dictionary.get("Preferences.Connection"), null, connection_preferences, Dictionary.get("Preferences.Connection_Tooltip")); 120 124 tab_pane.addTab(Dictionary.get("Preferences.Warnings"), null, createWarningPreferences(), Dictionary.get("Preferences.Warnings_Tooltip")); 121 125 122 126 JPanel button_pane = new JPanel(); 127 button_pane.setComponentOrientation(Dictionary.getOrientation()); 123 128 ok_button = new GLIButton(Dictionary.get("General.OK"), Dictionary.get("General.OK_Tooltip")); 124 129 … … 138 143 button_pane.add(apply_button); 139 144 button_pane.add(cancel_button); 140 145 button_pane.setComponentOrientation(Dictionary.getOrientation()); 146 141 147 content_pane.setLayout(new BorderLayout()); 142 148 content_pane.add(tab_pane, BorderLayout.CENTER); 143 149 content_pane.add(button_pane, BorderLayout.SOUTH); 144 150 content_pane.setComponentOrientation(Dictionary.getOrientation()); 151 145 152 Dimension frame_size = Gatherer.g_man.getSize(); 146 153 Point frame_location = Gatherer.g_man.getLocation(); … … 171 178 private JPanel createConnectionPreferences() { 172 179 JPanel program_pane = new JPanel(); 180 program_pane.setComponentOrientation(Dictionary.getOrientation()); 173 181 program_pane.setPreferredSize(ROW_SIZE); 174 182 JLabel program_label = new JLabel(Dictionary.get("Preferences.Connection.ProgramCommand")); 175 183 program_label.setPreferredSize(LABEL_SIZE); 176 184 program_label.setComponentOrientation(Dictionary.getOrientation()); 185 177 186 program_field = new JTextField(Configuration.getPreviewCommand()); 178 187 program_field.setCaretPosition(0); 179 188 program_field.setToolTipText(Dictionary.get("Preferences.Connection.ProgramCommand_Tooltip")); 180 189 program_field.setComponentOrientation(Dictionary.getOrientation()); 190 181 191 JPanel library_path_pane = new JPanel(); 182 192 library_path_pane.setPreferredSize(ROW_SIZE); 193 library_path_pane.setComponentOrientation(Dictionary.getOrientation()); 183 194 JLabel library_path_label = new JLabel(); 184 195 library_path_label.setPreferredSize(LABEL_SIZE); 196 library_path_label.setComponentOrientation(Dictionary.getOrientation()); 185 197 String library_url_string = ""; 186 198 if (Configuration.library_url != null) { … … 189 201 library_path_field = new JTextField(library_url_string); 190 202 library_path_field.setCaretPosition(0); 203 library_path_field.setComponentOrientation(Dictionary.getOrientation()); 191 204 if (Gatherer.GS3) { 192 205 library_path_label.setText(Dictionary.get("Preferences.Connection.Library_Path_GS3")); … … 208 221 gliserver_url_label = new JLabel(Dictionary.get("Preferences.Connection.GLIServer_URL")); 209 222 gliserver_url_label.setPreferredSize(LABEL_SIZE); 223 gliserver_url_label.setComponentOrientation(Dictionary.getOrientation()); 210 224 String gliserver_url_string = ""; 211 225 if (Configuration.gliserver_url != null) { … … 213 227 } 214 228 gliserver_url_field = new JTextField(gliserver_url_string); 229 gliserver_url_field.setComponentOrientation(Dictionary.getOrientation()); 215 230 gliserver_url_field.setCaretPosition(0); 216 231 gliserver_url_field.setToolTipText(Dictionary.get("Preferences.Connection.GLIServer_URL_Tooltip")); 217 232 218 233 // Disable this field when using the applet, as it is automatically determined 219 234 gliserver_url_label.setEnabled(!Gatherer.isApplet); … … 228 243 site_pane = new JPanel(); 229 244 site_pane.setPreferredSize(ROW_SIZE); 245 site_pane.setComponentOrientation(Dictionary.getOrientation()); 230 246 site_label = new JLabel(Dictionary.get("Preferences.Connection.Site")); 231 247 site_label.setPreferredSize(LABEL_SIZE); 248 site_label.setComponentOrientation(Dictionary.getOrientation()); 232 249 // what should we do if Gatherer.servlet_config.getSites() is null? 233 250 site_combobox = new JComboBox(Gatherer.servlet_config.getSites().toArray()); 234 251 site_combobox.setOpaque(false); 235 252 site_combobox.setToolTipText(Dictionary.get("Preferences.Connection.Site_Tooltip")); 236 253 site_combobox.setComponentOrientation(Dictionary.getOrientation()); 254 237 255 servlet_pane = new JPanel(); 238 256 servlet_pane.setPreferredSize(ROW_SIZE); 257 servlet_pane.setComponentOrientation(Dictionary.getOrientation()); 258 239 259 servlet_label = new JLabel(Dictionary.get("Preferences.Connection.Servlet")); 240 260 servlet_label.setPreferredSize(LABEL_SIZE); 261 servlet_label.setComponentOrientation(Dictionary.getOrientation()); 241 262 servlet_combobox = new JComboBox(); 242 263 servlet_combobox.setOpaque(false); 264 servlet_combobox.setComponentOrientation(Dictionary.getOrientation()); 243 265 // try to locate and select the current site 244 266 String this_site = Configuration.site_name; … … 281 303 // Creation 282 304 JPanel connection_pane = new JPanel(); 305 connection_pane.setComponentOrientation(Dictionary.getOrientation()); 283 306 use_proxy_checkbox = new JCheckBox(Dictionary.get("Preferences.Connection.Use_Proxy")); 284 307 use_proxy_checkbox.setSelected(currently_enabled); 285 308 use_proxy_checkbox.setComponentOrientation(Dictionary.getOrientation()); 286 309 use_proxy_checkbox.setPreferredSize(ROW_SIZE); 287 JPanel proxy_host_pane = new JPanel(); 310 311 JPanel proxy_host_pane = new JPanel(); 312 proxy_host_pane.setComponentOrientation(Dictionary.getOrientation()); 288 313 proxy_host_pane.setPreferredSize(ROW_SIZE); 314 289 315 JLabel proxy_host_label = new JLabel(Dictionary.get("Preferences.Connection.Proxy_Host")); 316 proxy_host_label.setComponentOrientation(Dictionary.getOrientation()); 290 317 proxy_host_label.setPreferredSize(LABEL_SIZE); 291 318 … … 293 320 proxy_host_field.setEnabled(currently_enabled); 294 321 proxy_host_field.setToolTipText(Dictionary.get("Preferences.Connection.Proxy_Host_Tooltip")); 295 322 proxy_host_field.setComponentOrientation(Dictionary.getOrientation()); 323 296 324 JPanel proxy_port_pane = new JPanel(); 325 proxy_port_pane.setComponentOrientation(Dictionary.getOrientation()); 297 326 proxy_port_pane.setPreferredSize(ROW_SIZE); 327 298 328 JLabel proxy_port_label = new JLabel(Dictionary.get("Preferences.Connection.Proxy_Port")); 299 329 proxy_port_label.setPreferredSize(LABEL_SIZE); 330 proxy_port_label.setComponentOrientation(Dictionary.getOrientation()); 300 331 301 332 String port_value = Configuration.getString("general.proxy_port", true); … … 317 348 // Layout 318 349 program_pane.setLayout(new BorderLayout()); 319 program_pane.add(program_label, BorderLayout. WEST);350 program_pane.add(program_label, BorderLayout.LINE_END); 320 351 program_pane.add(program_field, BorderLayout.CENTER); 321 352 322 353 library_path_pane.setLayout(new BorderLayout()); 323 library_path_pane.add(library_path_label, BorderLayout. WEST);354 library_path_pane.add(library_path_label, BorderLayout.LINE_START); 324 355 library_path_pane.add(library_path_field, BorderLayout.CENTER); 325 356 326 357 if (Gatherer.isGsdlRemote && !Gatherer.GS3) { 327 358 gliserver_url_pane.setLayout(new BorderLayout()); 328 gliserver_url_pane.add(gliserver_url_label, BorderLayout. WEST);359 gliserver_url_pane.add(gliserver_url_label, BorderLayout.LINE_START); 329 360 gliserver_url_pane.add(gliserver_url_field, BorderLayout.CENTER); 330 361 } … … 332 363 if (Gatherer.GS3) { 333 364 site_pane.setLayout(new BorderLayout()); 334 site_pane.add(site_label, BorderLayout. WEST);365 site_pane.add(site_label, BorderLayout.LINE_START); 335 366 site_pane.add(site_combobox, BorderLayout.CENTER); 336 367 337 368 servlet_pane.setLayout(new BorderLayout()); 338 servlet_pane.add(servlet_label, BorderLayout. WEST);369 servlet_pane.add(servlet_label, BorderLayout.LINE_START); 339 370 servlet_pane.add(servlet_combobox, BorderLayout.CENTER); 340 371 } 341 372 342 373 proxy_host_pane.setLayout(new BorderLayout()); 343 proxy_host_pane.add(proxy_host_label, BorderLayout. WEST);374 proxy_host_pane.add(proxy_host_label, BorderLayout.LINE_START); 344 375 proxy_host_pane.add(proxy_host_field, BorderLayout.CENTER); 345 376 346 377 proxy_port_pane.setLayout(new BorderLayout()); 347 proxy_port_pane.add(proxy_port_label, BorderLayout. WEST);378 proxy_port_pane.add(proxy_port_label, BorderLayout.LINE_START); 348 379 proxy_port_pane.add(proxy_port_field, BorderLayout.CENTER); 349 380 … … 368 399 private JPanel createGeneralPreferences() { 369 400 JPanel general_pane = new JPanel(); 370 401 general_pane.setComponentOrientation(Dictionary.getOrientation()); 371 402 // Build the model of available languages 372 403 ArrayList dictionary_model = new ArrayList(); … … 393 424 // Users email 394 425 JPanel email_pane = new JPanel(); 395 JLabel email_label = new JLabel(Dictionary.get("Preferences.General.Email")); 426 email_pane.setComponentOrientation(Dictionary.getOrientation()); 427 428 JLabel email_label = new JLabel(Dictionary.get("Preferences.General.Email")); 429 email_label.setComponentOrientation(Dictionary.getOrientation()); 396 430 email_label.setPreferredSize(LABEL_SIZE); 397 email_field = new EmailField(Configuration.getColor("coloring.error_background", false)); 431 432 email_field = new EmailField(Configuration.getColor("coloring.error_background", false)); 398 433 email_field.setText(Configuration.getEmail()); 399 434 email_field.setToolTipText(Dictionary.get("Preferences.General.Email_Tooltip")); 400 435 email_field.setComponentOrientation(Dictionary.getOrientation()); 401 436 // Font selection 402 437 JPanel font_pane = new JPanel(); 403 JLabel font_label = new JLabel(Dictionary.get("Preferences.General.Font")); 438 font_pane.setComponentOrientation(Dictionary.getOrientation()); 439 440 JLabel font_label = new JLabel(Dictionary.get("Preferences.General.Font")); 441 font_label.setComponentOrientation(Dictionary.getOrientation()); 404 442 font_label.setPreferredSize(LABEL_SIZE); 405 font_field = new JTextField(Configuration.getString("general.font", true)); 443 444 font_field = new JTextField(Configuration.getString("general.font", true)); 406 445 font_field.setToolTipText(Dictionary.get("Preferences.General.Font_Tooltip")); 407 446 font_field.setComponentOrientation(Dictionary.getOrientation()); 447 408 448 // Extracted metadata 409 449 view_extracted_metadata_checkbox = new JCheckBox(Dictionary.get("Preferences.General.View_Extracted_Metadata")); 410 450 view_extracted_metadata_checkbox.setSelected(false); 411 if (Configuration.get("general.view_extracted_metadata", Configuration.COLLECTION_SPECIFIC)) { 451 view_extracted_metadata_checkbox.setComponentOrientation(Dictionary.getOrientation()); 452 453 if (Configuration.get("general.view_extracted_metadata", Configuration.COLLECTION_SPECIFIC)) { 412 454 view_extracted_metadata_checkbox.setSelected(true); 413 455 } 414 456 view_extracted_metadata_checkbox.setToolTipText(Dictionary.get("Preferences.General.View_Extracted_Metadata_Tooltip")); 415 457 view_extracted_metadata_checkbox.setComponentOrientation(Dictionary.getOrientation()); 458 416 459 // Show file sizes 417 460 show_file_size_checkbox = new JCheckBox(Dictionary.get("Preferences.General.Show_File_Size")); 418 461 show_file_size_checkbox.setSelected(false); 462 show_file_size_checkbox.setComponentOrientation(Dictionary.getOrientation()); 463 419 464 if (Configuration.get("general.show_file_size", Configuration.COLLECTION_SPECIFIC)) { 420 465 show_file_size_checkbox.setSelected(true); … … 424 469 // Language 425 470 JPanel language_pane = new JPanel(); 426 JLabel language_label = new JLabel(Dictionary.get("Preferences.General.Interface_Language")); 471 language_pane.setComponentOrientation(Dictionary.getOrientation()); 472 473 JLabel language_label = new JLabel(Dictionary.get("Preferences.General.Interface_Language")); 474 language_label.setComponentOrientation(Dictionary.getOrientation()); 427 475 language_label.setPreferredSize(LABEL_SIZE); 428 476 … … 430 478 language_combobox.setOpaque(false); 431 479 language_combobox.setToolTipText(Dictionary.get("Preferences.General.Interface_Language_Tooltip")); 432 480 language_combobox.setComponentOrientation(Dictionary.getOrientation()); 481 433 482 // Try to locate and select the current language 434 483 String language_code = Configuration.getLanguage(); … … 443 492 // Layout 444 493 email_pane.setLayout(new BorderLayout()); 445 email_pane.add(email_label, BorderLayout. WEST);494 email_pane.add(email_label, BorderLayout.LINE_START); 446 495 email_pane.add(email_field, BorderLayout.CENTER); 447 496 448 497 language_pane.setLayout(new BorderLayout()); 449 language_pane.add(language_label, BorderLayout. WEST);498 language_pane.add(language_label, BorderLayout.LINE_START); 450 499 language_pane.add(language_combobox, BorderLayout.CENTER); 451 500 452 501 font_pane.setLayout(new BorderLayout()); 453 font_pane.add(font_label, BorderLayout. WEST);502 font_pane.add(font_label, BorderLayout.LINE_START); 454 503 font_pane.add(font_field, BorderLayout.CENTER); 455 504 … … 471 520 // Create Controls 472 521 JPanel mode_panel = new JPanel(); 473 JPanel button_panel = new JPanel(); 474 ButtonGroup mode_button_group = new ButtonGroup(); 475 assistant_mode_radio_button = new JRadioButton(Dictionary.get("Preferences.Mode.Assistant")); 522 mode_panel.setComponentOrientation(Dictionary.getOrientation()); 523 524 JPanel button_panel = new JPanel(); 525 button_panel.setComponentOrientation(Dictionary.getOrientation()); 526 527 ButtonGroup mode_button_group = new ButtonGroup(); 528 529 assistant_mode_radio_button = new JRadioButton(Dictionary.get("Preferences.Mode.Assistant")); 476 530 assistant_mode_radio_button.setOpaque(false); 531 assistant_mode_radio_button.setComponentOrientation(Dictionary.getOrientation()); 477 532 mode_button_group.add(assistant_mode_radio_button); 478 expert_mode_radio_button = new JRadioButton(Dictionary.get("Preferences.Mode.Expert")); 533 534 expert_mode_radio_button = new JRadioButton(Dictionary.get("Preferences.Mode.Expert")); 479 535 expert_mode_radio_button.setOpaque(false); 536 expert_mode_radio_button.setComponentOrientation(Dictionary.getOrientation()); 480 537 mode_button_group.add(expert_mode_radio_button); 481 librarian_mode_radio_button = new JRadioButton(Dictionary.get("Preferences.Mode.Librarian")); 538 539 librarian_mode_radio_button = new JRadioButton(Dictionary.get("Preferences.Mode.Librarian")); 482 540 librarian_mode_radio_button.setOpaque(false); 541 librarian_mode_radio_button.setComponentOrientation(Dictionary.getOrientation()); 483 542 mode_button_group.add(librarian_mode_radio_button); 484 systems_mode_radio_button = new JRadioButton(Dictionary.get("Preferences.Mode.Systems")); 543 544 systems_mode_radio_button = new JRadioButton(Dictionary.get("Preferences.Mode.Systems")); 485 545 systems_mode_radio_button.setOpaque(false); 546 systems_mode_radio_button.setComponentOrientation(Dictionary.getOrientation()); 486 547 mode_button_group.add(systems_mode_radio_button); 487 mode_description_textarea = new JTextArea(); 548 549 mode_description_textarea = new JTextArea(); 550 mode_description_textarea.setComponentOrientation(Dictionary.getOrientation()); 488 551 mode_description_textarea.setEditable(false); 489 552 mode_description_textarea.setLineWrap(true); … … 535 598 { 536 599 warning_preferences_check_list = new CheckList(false); 600 warning_preferences_check_list.setComponentOrientation(Dictionary.getOrientation()); 537 601 538 602 // Read all the warnings from the general xml/config.xml file, and their values from the user config.xml file … … 552 616 553 617 JPanel warning_preferences_pane = new JPanel(); 618 warning_preferences_pane.setComponentOrientation(Dictionary.getOrientation()); 554 619 warning_preferences_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); 555 620 warning_preferences_pane.setLayout(new BorderLayout()); 556 warning_preferences_pane.add(new JScrollPane(warning_preferences_check_list), BorderLayout.CENTER); 621 JScrollPane scrol_tmp = new JScrollPane(warning_preferences_check_list); 622 scrol_tmp.setComponentOrientation(Dictionary.getOrientation()); 623 warning_preferences_pane.add(scrol_tmp, BorderLayout.CENTER); 557 624 return warning_preferences_pane; 558 625 } … … 571 638 // Creation 572 639 JPanel workflow_preferences_pane = new JPanel(); 573 JPanel checklist_pane = new JPanel(); 574 JLabel title_label = new JLabel(Dictionary.get("Preferences.Workflow.Title")); 640 workflow_preferences_pane.setComponentOrientation(Dictionary.getOrientation()); 641 642 JPanel checklist_pane = new JPanel(); 643 checklist_pane.setComponentOrientation(Dictionary.getOrientation()); 644 645 JLabel title_label = new JLabel(Dictionary.get("Preferences.Workflow.Title")); 646 title_label.setComponentOrientation(Dictionary.getOrientation()); 575 647 title_label.setPreferredSize(ROW_SIZE); 576 648 577 649 workflow_download = new JCheckBox(Dictionary.get("GUI.Download")+" - "+Dictionary.get("GUI.Download_Tooltip")); 650 workflow_download.setComponentOrientation(Dictionary.getOrientation()); 578 651 workflow_download.setSelected(Configuration.get("workflow.download", false)); 579 652 workflow_download.setPreferredSize(ROW_SIZE); … … 582 655 workflow_gather.setSelected(Configuration.get("workflow.gather", false)); 583 656 workflow_gather.setPreferredSize(ROW_SIZE); 584 657 workflow_gather.setComponentOrientation(Dictionary.getOrientation()); 658 585 659 workflow_enrich = new JCheckBox(Dictionary.get("GUI.Enrich")+" - "+Dictionary.get("GUI.Enrich_Tooltip")); 586 660 workflow_enrich.setSelected(Configuration.get("workflow.enrich", false)); 587 661 workflow_enrich.setPreferredSize(ROW_SIZE); 588 662 workflow_enrich.setComponentOrientation(Dictionary.getOrientation()); 663 589 664 workflow_design = new JCheckBox(Dictionary.get("GUI.Design")+" - "+Dictionary.get("GUI.Design_Tooltip")); 590 665 workflow_design.setSelected(Configuration.get("workflow.design", false)); 591 666 workflow_design.setPreferredSize(ROW_SIZE); 592 667 workflow_design.setComponentOrientation(Dictionary.getOrientation()); 668 593 669 workflow_create = new JCheckBox(Dictionary.get("GUI.Create")+" - "+Dictionary.get("GUI.Create_Tooltip")); 594 670 workflow_create.setSelected(Configuration.get("workflow.create", false)); 595 671 workflow_create.setPreferredSize(ROW_SIZE); 596 597 672 workflow_create.setComponentOrientation(Dictionary.getOrientation()); 673 598 674 workflow_format = new JCheckBox(Dictionary.get("GUI.Format")+" - "+Dictionary.get("GUI.Format_Tooltip")); 599 675 workflow_format.setSelected(Configuration.get("workflow.format", false)); 600 676 workflow_format.setPreferredSize(ROW_SIZE); 601 677 workflow_format.setComponentOrientation(Dictionary.getOrientation()); 678 602 679 JPanel predefined_pane = new JPanel(); 603 JLabel predefined_label = new JLabel(Dictionary.get("Preferences.Workflow.Predefined.Label")); 604 JComboBox predefined_combobox = new JComboBox(predefined); 680 predefined_pane.setComponentOrientation(Dictionary.getOrientation()); 681 682 JLabel predefined_label = new JLabel(Dictionary.get("Preferences.Workflow.Predefined.Label")); 683 predefined_label.setComponentOrientation(Dictionary.getOrientation()); 684 685 JComboBox predefined_combobox = new JComboBox(predefined); 605 686 predefined_combobox.setOpaque(false); 606 687 // Connection … … 630 711 631 712 predefined_pane.setLayout(new BorderLayout(5,0)); 632 predefined_pane.add(predefined_label, BorderLayout. WEST);713 predefined_pane.add(predefined_label, BorderLayout.LINE_START); 633 714 predefined_pane.add(predefined_combobox, BorderLayout.CENTER); 634 715
Note:
See TracChangeset
for help on using the changeset viewer.