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

    r13520 r18370  
    127127    this.group = new DragGroup();
    128128    this.file_queue = Gatherer.f_man.getQueue();
    129 
     129        this.setComponentOrientation(org.greenstone.gatherer.Dictionary.getOrientation());
    130130    // Create components.
    131131    stop_action = new GLIButton(Dictionary.get("Collection.Stop"), Dictionary.get("Collection.Stop_Tooltip"));
     
    207207    workspace_pane.setPreferredSize(TREE_SIZE);
    208208    workspace_pane.setSize(TREE_SIZE);
     209        workspace_pane.setComponentOrientation(Dictionary.getOrientation());
    209210
    210211    workspace_label = new JLabel(Dictionary.get("Collection.Workspace"));
     
    212213    workspace_label.setBackground(Configuration.getColor("coloring.workspace_heading_background", false));
    213214    workspace_label.setForeground(Configuration.getColor("coloring.workspace_heading_foreground", false));
    214    
     215    workspace_label.setComponentOrientation(Dictionary.getOrientation());
     216       
    215217    workspace_tree = new WorkspaceTree();
     218        workspace_tree.setComponentOrientation(Dictionary.getOrientation());
    216219    group.add(workspace_tree);
    217220    workspace_scroll = new JScrollPane(workspace_tree);
     221        workspace_scroll.setComponentOrientation(Dictionary.getOrientation());
    218222    workspace_filter = workspace_tree.getFilter();
    219 
     223        workspace_filter.setComponentOrientation(Dictionary.getOrientation());
     224       
    220225    card_layout = new CardLayout();
    221226
     
    225230    collection_pane.setPreferredSize(TREE_SIZE);
    226231    collection_pane.setSize(TREE_SIZE);
    227 
     232        collection_pane.setComponentOrientation(Dictionary.getOrientation());
     233       
    228234    collection_label = new JLabel(Dictionary.get("Collection.Collection"));
    229235    collection_label.setOpaque(true);
    230    
     236    collection_label.setComponentOrientation(Dictionary.getOrientation());
     237       
    231238    collection_tree = Gatherer.c_man.getCollectionTree();
    232239    collection_tree.setEnabled(Gatherer.c_man.getCollectionTreeModel() != null);
     
    235242
    236243    tree_pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    237 
     244        tree_pane.setComponentOrientation(Dictionary.getOrientation());
    238245    // No collection loaded pane
    239246    JPanel no_collection_pane = new JPanel();
    240247    no_collection_pane.setBackground(Color.lightGray);
    241 
     248        no_collection_pane.setComponentOrientation(Dictionary.getOrientation());
     249       
    242250    JLabel no_collection_label = new JLabel(Dictionary.get("Collection.Collection"));
    243251    no_collection_label.setBackground(Color.lightGray);
    244252    no_collection_label.setForeground(Color.black);
    245253    no_collection_label.setOpaque(true);
     254        no_collection_label.setComponentOrientation(Dictionary.getOrientation());
    246255   
    247256    JPanel no_collection_loaded_panel = new JPanel();
    248257    no_collection_loaded_panel.setBorder(BorderFactory.createLineBorder(Color.black));
    249258    no_collection_loaded_panel.setBackground(Color.lightGray);
    250 
     259        no_collection_loaded_panel.setComponentOrientation(Dictionary.getOrientation());
     260       
    251261    JLabel no_collection_loaded_label = new JLabel(Dictionary.get("Collection.No_Collection_Loaded"));
    252262    no_collection_loaded_label.setHorizontalAlignment(JLabel.CENTER);
    253263    no_collection_loaded_label.setVerticalAlignment(JLabel.CENTER);
    254    
     264    no_collection_loaded_label.setComponentOrientation(Dictionary.getOrientation());
     265       
    255266    // Status pane
    256267    control_pane = new JPanel();
    257 
     268        control_pane.setComponentOrientation(Dictionary.getOrientation());
     269       
    258270    JPanel inner_pane = new JPanel();
    259271    inner_pane.setSize(STATUS_SIZE);
    260 
     272        inner_pane.setComponentOrientation(Dictionary.getOrientation());
     273       
    261274    card_pane = new JPanel();
     275        card_pane.setComponentOrientation(Dictionary.getOrientation());
     276       
    262277    JPanel file_pane = new JPanel();
     278        file_pane.setComponentOrientation(Dictionary.getOrientation());
     279       
    263280    JPanel progress_pane = new JPanel();
     281        progress_pane.setComponentOrientation(Dictionary.getOrientation());
     282       
    264283    JLabel file_status = file_queue.getFileStatus();
    265 
     284        file_status.setComponentOrientation(Dictionary.getOrientation());
     285       
    266286    JProgressBar progress_bar = file_queue.getProgressBar();
    267 
     287        progress_bar.setComponentOrientation(Dictionary.getOrientation());
     288       
    268289    JPanel button_pane = new JPanel();
    269 
     290        button_pane.setComponentOrientation(Dictionary.getOrientation());
    270291    RecycleBin recycle_bin = Gatherer.recycle_bin;
    271292    recycle_bin.addActionListener(this);
     
    295316    card_pane.add(collection_pane, COLLECTION_LOADED_CARD);
    296317
    297     tree_pane.add(workspace_pane, JSplitPane.LEFT);
    298     tree_pane.add(card_pane, JSplitPane.RIGHT);
     318        if (Dictionary.getOrientation().isLeftToRight()){
     319            tree_pane.add(workspace_pane, JSplitPane.LEFT);
     320            tree_pane.add(card_pane, JSplitPane.RIGHT);
     321        }else{
     322            tree_pane.add(workspace_pane, JSplitPane.RIGHT);
     323            tree_pane.add(card_pane, JSplitPane.LEFT);
     324        }
     325       
     326       
    299327    tree_pane.setDividerLocation(TREE_SIZE.width - 10);
    300328
     
    302330    file_pane.setLayout(new BorderLayout());
    303331    file_pane.add(file_status, BorderLayout.CENTER);
    304     file_pane.add(stop_action, BorderLayout.EAST);
     332    file_pane.add(stop_action, BorderLayout.LINE_END);
    305333
    306334    progress_pane.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
     
    318346    control_pane.setLayout(new BorderLayout());
    319347    control_pane.add(inner_pane, BorderLayout.CENTER);
    320     control_pane.add(button_pane, BorderLayout.EAST);
     348    control_pane.add(button_pane, BorderLayout.LINE_END);
    321349
    322350    this.setLayout(new BorderLayout());
Note: See TracChangeset for help on using the changeset viewer.