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

    r13801 r18297  
    8383    public EnrichPane()
    8484    {
    85     // Create the metadata value tree pane
    86     metadata_value_tree_pane = new MetadataValueTreePane();
     85    this.setComponentOrientation(Dictionary.getOrientation());
     86        // Create the metadata value tree pane
     87    metadata_value_tree_pane = new MetadataValueTreePane();       
    8788    metadata_value_tree_pane.addMetadataValueTreeSelectionListener(new MetadataValueTreeSelectionListener());
    8889
    8990    // Create metadata value table pane
    90     metadata_value_table_pane = new MetadataValueTablePane();
     91    metadata_value_table_pane = new MetadataValueTablePane();     
    9192    metadata_value_table_pane.addMetadataValueTableListSelectionListener(new MetadataValueTableListSelectionListener());
    9293    metadata_value_table_pane.addMetadataValueTableMouseListener(new MetadataValueTableMouseListener());
     
    100101    public void afterDisplay()
    101102    {
    102     external_split.setDividerLocation(0.3);
     103        if (Dictionary.getOrientation().isLeftToRight()){
     104            external_split.setDividerLocation(0.3);
     105        }else{
     106            external_split.setDividerLocation(0.7);
     107        }
    103108    }
    104109
     
    112117    {
    113118    JPanel left_hand_pane = new JPanel(new BorderLayout());
     119        left_hand_pane.setComponentOrientation(Dictionary.getOrientation());
    114120    GLIButton metadata_set_button = new GLIButton(Dictionary.get("EnrichPane.ManageMetadataSets"), Dictionary.get("EnrichPane.ManageMetadataSets_Tooltip"));
    115121    metadata_set_button.addActionListener(new ActionListener() {
     
    124130    // Collection Tree
    125131    collection_pane = new JPanel(new BorderLayout());
     132     //   collection_pane.setComponentOrientation(Dictionary.getOrientation());
    126133    collection_pane.setMinimumSize(MINIMUM_SIZE);
    127134    collection_pane.setPreferredSize(COLLECTION_TREE_SIZE);
    128135
    129136    collection_label = new JLabel(Dictionary.get("Collection.No_Collection"));
     137        collection_label.setComponentOrientation(Dictionary.getOrientation());
    130138    collection_label.setOpaque(true);
    131139
    132140    collection_tree = Gatherer.c_man.getCollectionTree();
    133141    collection_tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
    134     collection_tree.addTreeSelectionListener(this);
     142    collection_tree.addTreeSelectionListener(this);
     143        collection_tree.setComponentOrientation(Dictionary.getOrientation());
    135144    collection_filter = collection_tree.getFilter();
    136 
    137145    external_split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    138 
     146        external_split.setComponentOrientation(Dictionary.getOrientation());
    139147    // Layout
    140148    collection_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(3,3,3,3), BorderFactory.createLoweredBevelBorder()));
    141149    collection_pane.setMinimumSize(MINIMUM_SIZE);
    142150    collection_pane.setPreferredSize(new Dimension(Gatherer.g_man.getSize().width / 3, Gatherer.g_man.getSize().height));
    143 
     151        collection_pane.setComponentOrientation(Dictionary.getOrientation());
    144152    // Collection Pane
    145153    collection_pane.add(collection_label, BorderLayout.NORTH);
     
    148156    metadata_editing_pane.setBorder(BorderFactory.createEmptyBorder(0,5,5,5));
    149157    metadata_editing_pane.setDividerSize(8);
    150 
     158        metadata_editing_pane.setComponentOrientation(Dictionary.getOrientation());
     159       
    151160    metadata_editing_pane.add(metadata_value_table_pane, JSplitPane.TOP);
    152161    metadata_editing_pane.add(metadata_value_tree_pane, JSplitPane.BOTTOM);
     
    155164    left_hand_pane.add(collection_pane, BorderLayout.CENTER);
    156165    left_hand_pane.add(metadata_set_button, BorderLayout.SOUTH);
    157     external_split.add(left_hand_pane, JSplitPane.LEFT);
    158     external_split.add(metadata_editing_pane, JSplitPane.RIGHT);
     166        if (Dictionary.getOrientation().isLeftToRight()){
     167            external_split.add(left_hand_pane, JSplitPane.LEFT);
     168            external_split.add(metadata_editing_pane, JSplitPane.RIGHT);
     169        }else{
     170            external_split.add(left_hand_pane, JSplitPane.RIGHT);
     171            external_split.add(metadata_editing_pane, JSplitPane.LEFT);
     172        }
    159173
    160174
Note: See TracChangeset for help on using the changeset viewer.