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

    r13681 r18297  
    4343    super(Gatherer.g_man, true);
    4444    set_dialog = this;
    45    
     45    this.setComponentOrientation(Dictionary.getOrientation());
    4646    setJMenuBar(new SimpleMenuBar("selectingmetadatasets"));
    4747    setSize(SIZE);
     
    5656    }
    5757    JPanel content_pane = (JPanel) getContentPane();
     58        content_pane.setComponentOrientation(Dictionary.getOrientation());
    5859        content_pane.setOpaque(true);
    5960   
    6061    JLabel current_metadata_sets_label = new JLabel(Dictionary.get("MetadataSetDialog.Current_Sets"));
    61     current_metadata_sets_label.setOpaque(true);
     62    current_metadata_sets_label.setComponentOrientation(Dictionary.getOrientation());
     63        current_metadata_sets_label.setOpaque(true);
    6264    current_set_list = new JList(current_metadata_model);
     65        current_set_list.setComponentOrientation(Dictionary.getOrientation());
    6366    current_set_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    6467
    6568    JPanel button_pane = new JPanel();
     69        button_pane.setComponentOrientation(Dictionary.getOrientation());
    6670    add_button = new GLIButton(Dictionary.get("MetadataSetDialog.Add"), Dictionary.get("MetadataSetDialog.Add_Tooltip"));
    6771    add_button.setEnabled(true);
     
    98102    content_pane.setLayout(new BorderLayout());
    99103    content_pane.add(current_metadata_sets_label, BorderLayout.NORTH);
    100     content_pane.add(new JScrollPane(current_set_list), BorderLayout.CENTER);
     104        JScrollPane scrol_tmp;
     105        scrol_tmp = new JScrollPane(current_set_list);
     106        scrol_tmp.setComponentOrientation(Dictionary.getOrientation());
     107    content_pane.add(scrol_tmp, BorderLayout.CENTER);
    101108    content_pane.add(button_pane, BorderLayout.SOUTH);
    102109   
     
    202209    public AddMetadataSetPrompt() {
    203210        super(Gatherer.g_man, true);
     211            this.setComponentOrientation(Dictionary.getOrientation());
    204212        add_set_dialog = this;
    205213        setModal(true);
     
    211219
    212220        JPanel center_pane = new JPanel();
     221            center_pane.setComponentOrientation(Dictionary.getOrientation());
    213222        JPanel sets_pane = new JPanel();
     223            sets_pane.setComponentOrientation(Dictionary.getOrientation());
    214224        JLabel sets_label = new JLabel(Dictionary.get("MetadataSetDialog.Available_Sets"));
     225            sets_label.setComponentOrientation(Dictionary.getOrientation());
    215226        sets_label.setOpaque(false);
    216227       
    217228        available_sets_list = new JList(getValidSetModel());
     229            available_sets_list.setComponentOrientation(Dictionary.getOrientation());
    218230        available_sets_list.addListSelectionListener(new AvailableSetListSelectionListener());
    219231        available_sets_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     232           
    220233        JPanel elements_pane = new JPanel();
     234            elements_pane.setComponentOrientation(Dictionary.getOrientation());
    221235        JLabel elements_label = new JLabel(Dictionary.get("MetadataSetDialog.Elements"));
    222        
     236        elements_label.setComponentOrientation(Dictionary.getOrientation());
     237           
    223238        elements_list = new JList();
     239            elements_list.setComponentOrientation(Dictionary.getOrientation());
    224240        elements_list.setCellRenderer(new MetadataElementListCellRenderer());
    225241        elements_list.setBackground(Configuration.getColor("coloring.collection_tree_background", false));
     
    229245       
    230246        JPanel button_pane = new JPanel();
     247            button_pane.setComponentOrientation(Dictionary.getOrientation());
    231248        add_button = new GLIButton(Dictionary.get("MetadataSetDialog.Add_Set"), Dictionary.get("MetadataSetDialog.Add_Set_Tooltip"));
    232249        add_button.setEnabled(false);
     
    283300       
    284301        JPanel content_pane = (JPanel) getContentPane();
     302            content_pane.setComponentOrientation(Dictionary.getOrientation());
    285303        content_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    286304        content_pane.setLayout(new BorderLayout());
     
    292310        setLocation((screen_size.width - ADD_SIZE.width) / 2, (screen_size.height - ADD_SIZE.height) / 2);
    293311        setVisible(true);
    294        
    295 
    296        
     312               
    297313    }
    298314   
     
    368384        public void actionPerformed(ActionEvent event) {
    369385        JFileChooser chooser = new JFileChooser(new File(Gatherer.getGLIMetadataDirectoryPath()));
     386                chooser.setComponentOrientation(Dictionary.getOrientation());
    370387        chooser.setFileFilter(new MetadataSet.MetadataSetFileFilter());
    371388        chooser.setDialogTitle(Dictionary.get("MetadataSetDialog.Add_Title"));
Note: See TracChangeset for help on using the changeset viewer.