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

    r14045 r18297  
    118118    public WriteCDImagePrompt() {
    119119    super(Gatherer.g_man, true);
     120        this.setComponentOrientation(Dictionary.getOrientation());
    120121    cancel_button = new GLIButton(Dictionary.get("General.Close"), Dictionary.get("General.Close_Tooltip"));
    121122   
    122123    details_textarea = new JTextArea(Dictionary.get("DeleteCollectionPrompt.No_Collection"));
    123     details_textarea.setEditable(false);
     124    details_textarea.setComponentOrientation(Dictionary.getOrientation());
     125        details_textarea.setEditable(false);
    124126   
    125127    details_label = new JLabel(Dictionary.get("DeleteCollectionPrompt.Collection_Details"));
    126    
     128    details_label.setComponentOrientation(Dictionary.getOrientation());
     129       
    127130    instructions_textarea = new JTextArea(Dictionary.get("WriteCDImagePrompt.Instructions"));
     131        instructions_textarea.setComponentOrientation(Dictionary.getOrientation());
    128132    instructions_textarea.setCaretPosition(0);
    129133    instructions_textarea.setEditable(false);
     
    135139    list = new CheckList(true);
    136140    list_label = new JLabel(Dictionary.get("DeleteCollectionPrompt.Collection_List"));
    137    
    138     ok_button = new GLIButton(Dictionary.get("WriteCDImagePrompt.Export"), Dictionary.get("WriteCDImagePrompt.Export_Tooltip"));
    139    
     141    list_label.setComponentOrientation(Dictionary.getOrientation());
     142       
     143    ok_button = new GLIButton(Dictionary.get("WriteCDImagePrompt.Export"), Dictionary.get("WriteCDImagePrompt.Export_Tooltip"));           
     144       
    140145    title_field = new JTextField();
     146        title_field.setComponentOrientation(Dictionary.getOrientation());
    141147    // Dictionary.setTooltip(title_field, "WriteCDImagePrompt.CD_Name_Tooltip");
    142148    title_label = new JLabel(Dictionary.get("WriteCDImagePrompt.CD_Name"));
    143    
     149    title_label.setComponentOrientation(Dictionary.getOrientation());
    144150
    145151    estimated_size_field = new JTextField();
     152        estimated_size_field.setComponentOrientation(Dictionary.getOrientation());
    146153    estimated_size_field.setEditable(false);
    147154
     
    152159    estimated_size_field.setBackground(Configuration.getColor("coloring.collection_tree_background", false));
    153160    estimated_size_label = new JLabel(Dictionary.get("WriteCDImagePrompt.Size_Label"));
    154    
     161    estimated_size_label.setComponentOrientation(Dictionary.getOrientation());
     162       
    155163    scanForCollections();
    156     list.setListData(all_collections);
     164    list.setListData(all_collections);       
    157165
    158166    prompt = this;
     
    172180    noinstall_button = new JRadioButton(Dictionary.get("WriteCDImagePrompt.NoInstall"));
    173181    noinstall_button.setToolTipText(Dictionary.get("WriteCDImagePrompt.NoInstall_Tooltip"));
    174    
     182    noinstall_button.setComponentOrientation(Dictionary.getOrientation());
    175183   
    176184    install_button = new JRadioButton(Dictionary.get("WriteCDImagePrompt.Install"));
    177185    install_button.setToolTipText(Dictionary.get("WriteCDImagePrompt.Install_Tooltip"));
    178    
    179 
    180    
     186    install_button.setComponentOrientation(Dictionary.getOrientation());
     187       
    181188    }
    182189
     
    203210    public boolean display() {
    204211
     212        JScrollPane scrol_tmp;
    205213    // Radio buttons
    206     ButtonGroup radio_group = new ButtonGroup();
     214    ButtonGroup radio_group = new ButtonGroup();       
    207215    radio_group.add(install_button);
    208216    install_button.setSelected(true);
     
    211219    // Top pane
    212220    JPanel instructions_pane = new JPanel(new BorderLayout());
     221        instructions_pane.setComponentOrientation(Dictionary.getOrientation());
    213222    instructions_pane.setBorder(BorderFactory.createEmptyBorder(5,5,0,5));
    214     instructions_pane.add(new JScrollPane(instructions_textarea), BorderLayout.CENTER);
     223        scrol_tmp = new JScrollPane(instructions_textarea);
     224        scrol_tmp.setComponentOrientation(Dictionary.getOrientation());
     225    instructions_pane.add(scrol_tmp, BorderLayout.CENTER);
    215226   
    216227    title_label.setBorder(BorderFactory.createEmptyBorder(0,5,0,15));
    217228
    218229    JPanel title_pane = new JPanel(new BorderLayout());
    219     title_pane.add(title_label, BorderLayout.WEST);
     230        title_pane.setComponentOrientation(Dictionary.getOrientation());
     231    title_pane.add(title_label, BorderLayout.LINE_START);
    220232    title_pane.add(title_field, BorderLayout.CENTER);
    221233    title_pane.setBorder(BorderFactory.createEmptyBorder(5,0,5,0));
    222234
    223235    JPanel radio_pane = new JPanel(new GridLayout(2,1));
     236        radio_pane.setComponentOrientation(Dictionary.getOrientation());
    224237    install_button.setBackground(Configuration.getColor("coloring.collection_heading_background", true));
    225238    noinstall_button.setBackground(Configuration.getColor("coloring.collection_heading_background", true));
    226239    radio_pane.add(install_button);
    227     radio_pane.add(noinstall_button);
    228    
    229    
     240    radio_pane.add(noinstall_button);       
     241       
    230242    JPanel options_pane = new JPanel(new BorderLayout());
     243        options_pane.setComponentOrientation(Dictionary.getOrientation());
    231244    options_pane.add(title_pane, BorderLayout.NORTH);
    232245    options_pane.add(radio_pane, BorderLayout.CENTER);
     
    235248    // Central pane
    236249    JPanel list_pane = new JPanel(new BorderLayout());
     250        list_pane.setComponentOrientation(Dictionary.getOrientation());
    237251    list_pane.add(list_label, BorderLayout.NORTH);
    238     list_pane.add(new JScrollPane(list), BorderLayout.CENTER);
     252        scrol_tmp =new JScrollPane(list);
     253        scrol_tmp.setComponentOrientation(Dictionary.getOrientation());
     254    list_pane.add(scrol_tmp, BorderLayout.CENTER);
    239255    list_pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
    240256
    241257    JPanel details_pane = new JPanel(new BorderLayout());
    242258    details_pane.add(details_label, BorderLayout.NORTH);
    243     details_pane.add(new JScrollPane(details_textarea), BorderLayout.CENTER);
     259        scrol_tmp =new JScrollPane(details_textarea);
     260        scrol_tmp.setComponentOrientation(Dictionary.getOrientation());
     261    details_pane.add(scrol_tmp, BorderLayout.CENTER);
    244262    details_pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    245 
     263       
    246264    JPanel central_pane = new JPanel(new GridLayout(2, 1));
     265        central_pane.setComponentOrientation(Dictionary.getOrientation());
    247266    central_pane.add(list_pane);
    248267    central_pane.add(details_pane);
     
    251270    // Lower pane
    252271    JPanel estimated_size_pane = new JPanel(new BorderLayout());
    253     estimated_size_pane.add(estimated_size_label, BorderLayout.WEST);
     272        estimated_size_pane.setComponentOrientation(Dictionary.getOrientation());
     273    estimated_size_pane.add(estimated_size_label, BorderLayout.LINE_START);
    254274    estimated_size_pane.add(estimated_size_field, BorderLayout.CENTER);
    255275    estimated_size_pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
    256276
    257277    JPanel button_pane = new JPanel(new GridLayout(1, 2));
     278        button_pane.setComponentOrientation(Dictionary.getOrientation());
    258279    button_pane.add(ok_button);
    259280    button_pane.add(cancel_button);
    260281    button_pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    261 
     282       
    262283    JPanel lower_pane = new JPanel(new BorderLayout());
     284        lower_pane.setComponentOrientation(Dictionary.getOrientation());
    263285    lower_pane.add(estimated_size_pane, BorderLayout.NORTH);
    264286    lower_pane.add(button_pane, BorderLayout.SOUTH);
     
    267289    // Final.
    268290    JPanel content_pane = (JPanel)this.getContentPane();
     291        content_pane.setComponentOrientation(Dictionary.getOrientation());
    269292    content_pane.setLayout(new BorderLayout());
    270293    content_pane.add(instructions_pane, BorderLayout.NORTH);
    271294    content_pane.add(central_pane, BorderLayout.CENTER);
    272295    content_pane.add(lower_pane, BorderLayout.SOUTH);
    273 
     296       
    274297    // Center and display.
    275298    Dimension screen_size = Configuration.screen_size;
     
    600623        public ProgressDialog() {
    601624        super(Gatherer.g_man, Dictionary.get("WriteCDImagePrompt.Title"), true);
     625                this.setComponentOrientation(Dictionary.getOrientation());
    602626        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    603627        setSize(size);
    604628        JPanel content_pane = (JPanel) getContentPane();
     629                content_pane.setComponentOrientation(Dictionary.getOrientation());
    605630        JLabel progress_label = new JLabel(Dictionary.get("WriteCDImagePrompt.Progress_Label"));
    606        
     631        progress_label.setComponentOrientation(Dictionary.getOrientation());
     632               
    607633        JProgressBar progress_bar = new JProgressBar();
     634                progress_bar.setComponentOrientation(Dictionary.getOrientation());
    608635        progress_bar.setIndeterminate(true);
    609636        content_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
Note: See TracChangeset for help on using the changeset viewer.