Ignore:
Timestamp:
2008-12-26T14:35:15+13:00 (15 years ago)
Author:
kjdon
Message:

interface updated to display right to left for rtl languages. This code is thanks to Amin Hejazi. It seems to be only partially complete. Amin was working with Greenstone 3 so might have missed some panels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/branches/rtl-gli/src/org/greenstone/gatherer/gui/CreatePane.java

    r13595 r18297  
    162162     */
    163163    public CreatePane() {
     164        this.setComponentOrientation(Dictionary.getOrientation());
    164165    log_textarea = new JTextArea();
    165166    log_scroll = new JScrollPane(log_textarea);
    166 
     167       
    167168    // Create components
    168169    card_layout = new CardLayout();
    169170    // Control Pane
    170171    control_pane = new JPanel();
     172        control_pane.setComponentOrientation(Dictionary.getOrientation());
    171173    tree = new OptionTree();
     174        tree.setComponentOrientation(Dictionary.getOrientation());
    172175    button_pane = new JPanel();
     176        button_pane.setComponentOrientation(Dictionary.getOrientation());
    173177
    174178    // Progress Pane
    175179    progress_pane = new JPanel(); // One owner of the bar component
     180        progress_pane.setComponentOrientation(Dictionary.getOrientation());
    176181    bar_area = new JPanel(); // This component will be shared about
     182        bar_area.setComponentOrientation(Dictionary.getOrientation());
    177183
    178184    progress_import_label = new JLabel(Dictionary.get("CreatePane.Import_Progress"));
    179    
     185    progress_import_label.setComponentOrientation(Dictionary.getOrientation());
     186       
    180187    import_monitor = new GImportProgressMonitor();
    181188    Gatherer.c_man.registerImportMonitor(import_monitor);
    182189
    183190    progress_build_label = new JLabel(Dictionary.get("CreatePane.Build_Progress"));
    184    
     191    progress_build_label.setComponentOrientation(Dictionary.getOrientation());
     192       
    185193    build_monitor = new GBuildProgressMonitor(import_monitor.getSharedProgress());
    186194    Gatherer.c_man.registerBuildMonitor(build_monitor);
     
    190198    sbutton_panel = new JPanel();
    191199    sinner_panel = new JPanel();
    192 
     200       
     201        slower_panel.setComponentOrientation(Dictionary.getOrientation());
     202        sbutton_panel.setComponentOrientation(Dictionary.getOrientation());
     203        sinner_panel.setComponentOrientation(Dictionary.getOrientation());
     204       
    193205    //Radio buttons
    194206    incremental_build_radio_button = new JRadioButton(Dictionary.get("CreatePane.Minimal_Build"));
     207        incremental_build_radio_button.setComponentOrientation(Dictionary.getOrientation());
    195208    incremental_build_radio_button.setToolTipText(Dictionary.get("CreatePane.Minimal_Build_Tooltip"));
    196209    full_build_radio_button = new JRadioButton(Dictionary.get("CreatePane.Full_Build"));
     210        full_build_radio_button.setComponentOrientation(Dictionary.getOrientation());
    197211    full_build_radio_button.setToolTipText(Dictionary.get("CreatePane.Full_Build_Tooltip"));
    198212    sincremental_build_radio_button = new JRadioButton(Dictionary.get("CreatePane.Minimal_Build"));
     213        sincremental_build_radio_button.setComponentOrientation(Dictionary.getOrientation());
    199214    sincremental_build_radio_button.setToolTipText(Dictionary.get("CreatePane.Minimal_Build_Tooltip"));
    200215    sfull_build_radio_button = new JRadioButton(Dictionary.get("CreatePane.Full_Build"));
     216        sfull_build_radio_button.setComponentOrientation(Dictionary.getOrientation());
    201217    sfull_build_radio_button.setToolTipText(Dictionary.get("CreatePane.Full_Build_Tooltip"));
    202218
     
    269285    sbuild_type_group.add(sfull_build_radio_button);
    270286    JPanel build_type_pane = new JPanel(new GridLayout(2,1));
     287        build_type_pane.setComponentOrientation(Dictionary.getOrientation());
    271288    build_type_pane.add(full_build_radio_button);
    272289    build_type_pane.add(incremental_build_radio_button);
    273290    JPanel sbuild_type_pane = new JPanel(new GridLayout(2,1));
     291        sbuild_type_pane.setComponentOrientation(Dictionary.getOrientation());
    274292    sbuild_type_pane.add(sfull_build_radio_button);
    275293    sbuild_type_pane.add(sincremental_build_radio_button);
     
    279297    // Build control_pane
    280298    JPanel left = new JPanel();
     299        left.setComponentOrientation(Dictionary.getOrientation());
    281300    left.setBorder(BorderFactory.createEmptyBorder(0,5,5,5));
    282301    left.setLayout(new BorderLayout());
     
    286305
    287306    right = new JPanel();
     307        right.setComponentOrientation(Dictionary.getOrientation());
    288308    right.setBorder(BorderFactory.createEmptyBorder(0,0,5,5));
    289309    right.setLayout(new BorderLayout());
    290310
    291311    JPanel options_area = new JPanel();
     312        options_area.setComponentOrientation(Dictionary.getOrientation());
    292313    options_area.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5,5,5,5), BorderFactory.createTitledBorder(Dictionary.get("CreatePane.Options_Title"))));
    293314    options_area.setLayout(new BorderLayout());
    294     options_area.add(left, BorderLayout.WEST);
     315    options_area.add(left, BorderLayout.LINE_START);
    295316    options_area.add(right, BorderLayout.CENTER);
    296317
    297318    button_pane = new JPanel();
     319        button_pane.setComponentOrientation(Dictionary.getOrientation());
    298320    button_pane.setBorder(BorderFactory.createEmptyBorder(5,10,10,10));
    299321    button_pane.setLayout(new GridLayout(1,4));
     
    308330    // Build progress_pane
    309331    JPanel labels_pane = new JPanel();
     332        labels_pane.setComponentOrientation(Dictionary.getOrientation());
    310333    labels_pane.setLayout(new GridLayout(2,1,0,5));
    311334    labels_pane.add(progress_import_label);
     
    313336
    314337    JPanel monitors_pane = new JPanel();
     338        monitors_pane.setComponentOrientation(Dictionary.getOrientation());
    315339    monitors_pane.setLayout(new GridLayout(2,1,0,5));
    316340    monitors_pane.add(import_monitor.getProgress());
     
    319343    bar_area.setBorder(BorderFactory.createEmptyBorder(10,10,5,10));
    320344    bar_area.setLayout(new BorderLayout(5,5));
    321     bar_area.add(labels_pane, BorderLayout.WEST);
     345    bar_area.add(labels_pane, BorderLayout.LINE_START);
    322346    bar_area.add(monitors_pane, BorderLayout.CENTER);
    323347
     
    337361
    338362    JPanel simple_bar_area = new JPanel(new GridLayout(2,1));
     363        simple_bar_area.setComponentOrientation(Dictionary.getOrientation());
    339364    simple_bar_area.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
    340365    simple_bar_area.add(import_monitor.getSharedProgress());
     
    343368    sinner_panel.setBorder(BorderFactory.createEmptyBorder(5,0,5,0));
    344369    sinner_panel.setLayout(new BorderLayout());
    345     sinner_panel.add(sbuild_type_pane, BorderLayout.WEST);
     370    sinner_panel.add(sbuild_type_pane, BorderLayout.LINE_START);
    346371    //sinner_panel.add(full_build_radio_button, BorderLayout.WEST);
    347372    sinner_panel.add(simple_bar_area, BorderLayout.CENTER);
     
    354379        sargument_configuration_panel = new JPanel();
    355380    }
     381        sargument_configuration_panel.setComponentOrientation(Dictionary.getOrientation());
    356382    sargument_configuration_scroll = new JScrollPane(sargument_configuration_panel);
    357383    sargument_configuration_scroll.setPreferredSize(ARGUMENT_SIZE);
    358    
     384        sargument_configuration_scroll.setComponentOrientation(Dictionary.getOrientation());
     385       
    359386    slower_panel.setLayout(new BorderLayout());
    360387    slower_panel.add(sinner_panel, BorderLayout.NORTH);
     
    364391   
    365392    simple_panel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, sargument_configuration_scroll, slower_panel);
     393        simple_panel.setComponentOrientation(Dictionary.getOrientation());
    366394    // Main pane
    367395    main_pane = new JPanel(card_layout);
     396        main_pane.setComponentOrientation(Dictionary.getOrientation());
    368397    if(current_mode < THRESHOLD) { // Simple mode - add first
    369398        main_pane.add(simple_panel, SIMPLE);
     
    474503        }
    475504        sargument_configuration_scroll = new JScrollPane(sargument_configuration_panel);
     505            sargument_configuration_panel.setComponentOrientation(Dictionary.getOrientation());
     506            sargument_configuration_scroll.setComponentOrientation(Dictionary.getOrientation());
    476507        sargument_configuration_scroll.setPreferredSize(ARGUMENT_SIZE);
    477508        simple_panel.setTopComponent(sargument_configuration_scroll);
     
    590621        sargument_configuration_panel = options_pane.buildBuild(sargument_configuration_panel);
    591622        sargument_configuration_scroll = new JScrollPane(sargument_configuration_panel);
     623            sargument_configuration_scroll.setComponentOrientation(Dictionary.getOrientation());
    592624        sargument_configuration_scroll.setPreferredSize(ARGUMENT_SIZE);
    593625        simple_panel.setTopComponent(sargument_configuration_scroll);
     
    748780    public OptionTree() {
    749781        super();
    750 
     782            this.setComponentOrientation(Dictionary.getOrientation());
    751783        ToolTipManager.sharedInstance().registerComponent(this);
    752784        addTreeSelectionListener(this);
Note: See TracChangeset for help on using the changeset viewer.