Ignore:
Timestamp:
2009-01-12T13:04:29+13:00 (15 years ago)
Author:
kjdon
Message:

committed code submitted by Amin Hedjazi for making the GLI right to left. I worked on this code on the rtl-gli branch, then merged the branch back to the trunk at revision 18368. The branch code was slightly different in a couple of places where it shouldn't have been. So don't use the branch code next time. Start a new branch.

File:
1 edited

Legend:

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

    r17940 r18370  
    167167     */
    168168    public CreatePane() {
     169        this.setComponentOrientation(Dictionary.getOrientation());
    169170    log_textarea = new JTextArea();
    170171    log_scroll = new JScrollPane(log_textarea);
    171 
     172       
    172173    // Create components
    173174    card_layout = new CardLayout();
    174175    // Control Pane
    175176    control_pane = new JPanel();
     177        control_pane.setComponentOrientation(Dictionary.getOrientation());
    176178    tree = new OptionTree();
     179        tree.setComponentOrientation(Dictionary.getOrientation());
    177180    button_pane = new JPanel();
     181        button_pane.setComponentOrientation(Dictionary.getOrientation());
    178182
    179183    // Progress Pane
    180184    progress_pane = new JPanel(); // One owner of the bar component
     185        progress_pane.setComponentOrientation(Dictionary.getOrientation());
    181186    bar_area = new JPanel(); // This component will be shared about
     187        bar_area.setComponentOrientation(Dictionary.getOrientation());
    182188
    183189    progress_import_label = new JLabel(Dictionary.get("CreatePane.Import_Progress"));
    184    
     190    progress_import_label.setComponentOrientation(Dictionary.getOrientation());
     191       
    185192    import_monitor = new GImportProgressMonitor();
    186193    Gatherer.c_man.registerImportMonitor(import_monitor);
    187194
    188195    progress_build_label = new JLabel(Dictionary.get("CreatePane.Build_Progress"));
    189    
     196    progress_build_label.setComponentOrientation(Dictionary.getOrientation());
     197       
    190198    build_monitor = new GBuildProgressMonitor(import_monitor.getSharedProgress());
    191199    Gatherer.c_man.registerBuildMonitor(build_monitor);
     
    202210    sbutton_panel = new JPanel();
    203211    sinner_panel = new JPanel();
    204 
     212       
     213        slower_panel.setComponentOrientation(Dictionary.getOrientation());
     214        sbutton_panel.setComponentOrientation(Dictionary.getOrientation());
     215        sinner_panel.setComponentOrientation(Dictionary.getOrientation());
     216       
    205217    //Radio buttons
    206218    incremental_build_radio_button = new JRadioButton(Dictionary.get("CreatePane.Minimal_Build"));
     219        incremental_build_radio_button.setComponentOrientation(Dictionary.getOrientation());
    207220    incremental_build_radio_button.setToolTipText(Dictionary.get("CreatePane.Minimal_Build_Tooltip"));
    208221    full_build_radio_button = new JRadioButton(Dictionary.get("CreatePane.Full_Build"));
     222        full_build_radio_button.setComponentOrientation(Dictionary.getOrientation());
    209223    full_build_radio_button.setToolTipText(Dictionary.get("CreatePane.Full_Build_Tooltip"));
    210224    sincremental_build_radio_button = new JRadioButton(Dictionary.get("CreatePane.Minimal_Build"));
     225        sincremental_build_radio_button.setComponentOrientation(Dictionary.getOrientation());
    211226    sincremental_build_radio_button.setToolTipText(Dictionary.get("CreatePane.Minimal_Build_Tooltip"));
    212227    sfull_build_radio_button = new JRadioButton(Dictionary.get("CreatePane.Full_Build"));
     228        sfull_build_radio_button.setComponentOrientation(Dictionary.getOrientation());
    213229    sfull_build_radio_button.setToolTipText(Dictionary.get("CreatePane.Full_Build_Tooltip"));
    214230
     
    283299    sbuild_type_group.add(sfull_build_radio_button);
    284300    JPanel build_type_pane = new JPanel(new GridLayout(2,1));
     301        build_type_pane.setComponentOrientation(Dictionary.getOrientation());
    285302    build_type_pane.add(full_build_radio_button);
    286303    build_type_pane.add(incremental_build_radio_button);
    287304    JPanel sbuild_type_pane = new JPanel(new GridLayout(2,1));
     305        sbuild_type_pane.setComponentOrientation(Dictionary.getOrientation());
    288306    sbuild_type_pane.add(sfull_build_radio_button);
    289307    sbuild_type_pane.add(sincremental_build_radio_button);
     
    293311    // Build control_pane
    294312    JPanel left = new JPanel();
     313        left.setComponentOrientation(Dictionary.getOrientation());
    295314    left.setBorder(BorderFactory.createEmptyBorder(0,5,5,5));
    296315    left.setLayout(new BorderLayout());
     
    300319
    301320    right = new JPanel();
     321        right.setComponentOrientation(Dictionary.getOrientation());
    302322    right.setBorder(BorderFactory.createEmptyBorder(0,0,5,5));
    303323    right.setLayout(new BorderLayout());
    304324
    305325    JPanel options_area = new JPanel();
     326        options_area.setComponentOrientation(Dictionary.getOrientation());
    306327    options_area.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5,5,5,5), BorderFactory.createTitledBorder(Dictionary.get("CreatePane.Options_Title"))));
    307328    options_area.setLayout(new BorderLayout());
    308     options_area.add(left, BorderLayout.WEST);
     329    options_area.add(left, BorderLayout.LINE_START);
    309330    options_area.add(right, BorderLayout.CENTER);
    310331
    311332    button_pane = new JPanel();
     333        button_pane.setComponentOrientation(Dictionary.getOrientation());
    312334    button_pane.setBorder(BorderFactory.createEmptyBorder(5,10,10,10));
    313335    button_pane.setLayout(new GridLayout(1,4));
     
    322344    // Build progress_pane
    323345    JPanel labels_pane = new JPanel();
     346        labels_pane.setComponentOrientation(Dictionary.getOrientation());
    324347    labels_pane.setLayout(new GridLayout(2,1,0,5));
    325348    labels_pane.add(progress_import_label);
     
    327350
    328351    JPanel monitors_pane = new JPanel();
     352        monitors_pane.setComponentOrientation(Dictionary.getOrientation());
    329353    monitors_pane.setLayout(new GridLayout(2,1,0,5));
    330354    monitors_pane.add(import_monitor.getProgress());
     
    333357    bar_area.setBorder(BorderFactory.createEmptyBorder(10,10,5,10));
    334358    bar_area.setLayout(new BorderLayout(5,5));
    335     bar_area.add(labels_pane, BorderLayout.WEST);
     359    bar_area.add(labels_pane, BorderLayout.LINE_START);
    336360    bar_area.add(monitors_pane, BorderLayout.CENTER);
    337361
     
    351375
    352376    JPanel simple_bar_area = new JPanel(new GridLayout(2,1));
     377        simple_bar_area.setComponentOrientation(Dictionary.getOrientation());
    353378    simple_bar_area.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
    354379    simple_bar_area.add(import_monitor.getSharedProgress());
     
    357382    sinner_panel.setBorder(BorderFactory.createEmptyBorder(5,0,5,0));
    358383    sinner_panel.setLayout(new BorderLayout());
    359     sinner_panel.add(sbuild_type_pane, BorderLayout.WEST);
     384    sinner_panel.add(sbuild_type_pane, BorderLayout.LINE_START);
    360385    //sinner_panel.add(full_build_radio_button, BorderLayout.WEST);
    361386    sinner_panel.add(simple_bar_area, BorderLayout.CENTER);
     
    371396        sargument_configuration_panel = new JPanel();
    372397    }
     398        sargument_configuration_panel.setComponentOrientation(Dictionary.getOrientation());
    373399    sargument_configuration_scroll = new JScrollPane(sargument_configuration_panel);
    374400    sargument_configuration_scroll.setPreferredSize(ARGUMENT_SIZE);
    375    
     401        sargument_configuration_scroll.setComponentOrientation(Dictionary.getOrientation());
     402       
    376403    slower_panel.setLayout(new BorderLayout());
    377404    slower_panel.add(sinner_panel, BorderLayout.NORTH);
     
    381408   
    382409    simple_panel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, sargument_configuration_scroll, slower_panel);
     410        simple_panel.setComponentOrientation(Dictionary.getOrientation());
    383411    // Main pane
    384412    main_pane = new JPanel(card_layout);
     413        main_pane.setComponentOrientation(Dictionary.getOrientation());
    385414    if(current_mode < THRESHOLD) { // Simple mode - add first
    386415        main_pane.add(simple_panel, SIMPLE);
     
    494523        }
    495524        sargument_configuration_scroll = new JScrollPane(sargument_configuration_panel);
     525            sargument_configuration_panel.setComponentOrientation(Dictionary.getOrientation());
     526            sargument_configuration_scroll.setComponentOrientation(Dictionary.getOrientation());
    496527        sargument_configuration_scroll.setPreferredSize(ARGUMENT_SIZE);
    497528        simple_panel.setTopComponent(sargument_configuration_scroll);
     
    634665        //}
    635666        sargument_configuration_scroll = new JScrollPane(sargument_configuration_panel);
     667            sargument_configuration_scroll.setComponentOrientation(Dictionary.getOrientation());
    636668        sargument_configuration_scroll.setPreferredSize(ARGUMENT_SIZE);
    637669        simple_panel.setTopComponent(sargument_configuration_scroll);
     
    913945    public OptionTree() {
    914946        super();
    915 
     947            this.setComponentOrientation(Dictionary.getOrientation());
    916948        ToolTipManager.sharedInstance().registerComponent(this);
    917949        addTreeSelectionListener(this);
Note: See TracChangeset for help on using the changeset viewer.