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/DownloadPane.java

    r17651 r18370  
    9393    public DownloadPane() {
    9494    super();
    95 
     95        JScrollPane scrol_tmp;
     96        this.setComponentOrientation(Dictionary.getOrientation());
    9697    // TODO: Download the WDownload and the download panel fixed!!
    9798        getter = new DownloadScrollPane();
    9899        getter.start();
    99     list_scroll = getter.getDownloadJobList();
    100 
     100    list_scroll = getter.getDownloadJobList();     
     101        list_scroll.setComponentOrientation(Dictionary.getOrientation());
    101102    // TODO should use Vector to store all loaded downloads!!
    102103    String lang = Configuration.getLanguage();
     
    110111    // Creation
    111112    tree = new DesignTree();
     113        tree.setComponentOrientation(Dictionary.getOrientation());
    112114    options_pane = new JPanel();
    113 
     115        options_pane.setComponentOrientation(Dictionary.getOrientation());
    114116   
    115117    JButton clear_cache_button = new GLIButton(Dictionary.get("Mirroring.ClearCache"), Dictionary.get("Mirroring.ClearCache_Tooltip"));
     
    139141    // Add to Panel
    140142    JPanel button_pane = new JPanel();
     143        button_pane.setComponentOrientation(Dictionary.getOrientation());
    141144    button_pane.setLayout(new FlowLayout(FlowLayout.CENTER,20,5));
    142145    button_pane.setBorder(BorderFactory.createEtchedBorder());
     
    147150
    148151    JPanel tree_pane = new JPanel();
     152        tree_pane.setComponentOrientation(Dictionary.getOrientation());
    149153    tree_pane.setLayout(new BorderLayout());
    150         tree_pane.add(new JScrollPane(tree), BorderLayout.CENTER);
     154        scrol_tmp = new JScrollPane(tree);
     155        scrol_tmp.setComponentOrientation(Dictionary.getOrientation());
     156        tree_pane.add(scrol_tmp, BorderLayout.CENTER);
    151157    tree_pane.setPreferredSize(TREE_SIZE);
    152158 
     
    158164
    159165    JScrollPane options_scroll_pane = new JScrollPane(options_pane);
     166        options_scroll_pane.setComponentOrientation(Dictionary.getOrientation());
    160167    JSplitPane mode_pane = new JSplitPane();
     168        mode_pane.setComponentOrientation(Dictionary.getOrientation());
    161169    mode_pane.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
    162     mode_pane.add(tree_pane,JSplitPane.LEFT);
    163     mode_pane.add(options_scroll_pane,JSplitPane.RIGHT);
    164     mode_pane.setDividerLocation(TREE_SIZE.width);
     170        if (Dictionary.getOrientation().isLeftToRight()){
     171            mode_pane.add(tree_pane,JSplitPane.LEFT);
     172            mode_pane.add(options_scroll_pane,JSplitPane.RIGHT);
     173            mode_pane.setDividerLocation(TREE_SIZE.width);
     174        }else{
     175            mode_pane.add(tree_pane,JSplitPane.RIGHT);
     176            mode_pane.add(options_scroll_pane,JSplitPane.LEFT);
     177            mode_pane.setDividerLocation(1);
     178        }
     179       
    165180   
    166181    JPanel edit_pane = new JPanel();
     182        edit_pane.setComponentOrientation(Dictionary.getOrientation());
    167183    edit_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(2,0,0,0), BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Download Setting"), BorderFactory.createEmptyBorder(2,2,2,2))));
    168184    edit_pane.setLayout(new BorderLayout());
     
    188204    private void addHeader(String name, Color color, JPanel target_pane) {
    189205    JPanel header = new JPanel();
     206        header.setComponentOrientation(Dictionary.getOrientation());
    190207    header.setBackground(color);
    191208    JPanel inner_pane = new JPanel();
     209        inner_pane.setComponentOrientation(Dictionary.getOrientation());
    192210    inner_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5,5,5,5), BorderFactory.createRaisedBevelBorder()));
    193211    inner_pane.setBackground(color);
    194212    JLabel header_label = new JLabel("<html><strong>" + name + "</strong></html>");
     213        header_label.setComponentOrientation(Dictionary.getOrientation());
    195214    header_label.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
    196215    header_label.setHorizontalAlignment(JLabel.CENTER);
     
    353372    /** Behaviour Functions */
    354373    public void afterDisplay() {
    355     ready = true;
     374    ready = true;       
    356375    }
    357376
Note: See TracChangeset for help on using the changeset viewer.