Changeset 18587 for gli


Ignore:
Timestamp:
2009-02-23T15:16:20+13:00 (15 years ago)
Author:
kjdon
Message:

GLI three modes change: partition index will now be visible in LIbrarian mode (and whole design pane not available in assistant mode) so removing the card layout and message pane cos it will never be disabled now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/cdm/SubcollectionManager.java

    r18412 r18587  
    128128     * @param mode the new mode as an int
    129129     */
    130     public void modeChanged(int mode) {
    131     if(controls != null) {
    132         ((SubcollectionControl)controls).modeChanged(mode);
    133     }
    134     }   
     130     public void modeChanged(int mode) {
     131     }   
    135132
    136133    /** Method to remove the given subcollection.
     
    157154    implements Control, ChangeListener
    158155    {
    159     private CardLayout card_layout;
    160156    private JButton add_button;
    161157    private JButton remove_button;
     
    163159    private JComboBox source_combobox;
    164160    private JList subcollection_list;
    165     private JPanel border_pane;
    166161    private JTabbedPane tabbed_pane;
    167162    private JTextField flags_field;
     
    176171        JPanel header_pane = new DesignPaneHeader("CDM.GUI.Subcollections", "partitionindexes");
    177172
    178         border_pane = new JPanel();
    179         card_layout = new CardLayout();
    180             border_pane.setComponentOrientation(Dictionary.getOrientation());
    181            
    182            
    183173        tabbed_pane = new JTabbedPane();
    184174        tabbed_pane.addChangeListener(this);
     
    258248        JLabel subcollection_list_label = new JLabel(Dictionary.get("CDM.SubcollectionManager.Assigned"));
    259249        subcollection_list_label.setComponentOrientation(Dictionary.getOrientation());
    260         // Create a message pane which explains why these controls are not currently active
    261         JPanel message_pane = new JPanel();
    262             message_pane.setComponentOrientation(Dictionary.getOrientation());
    263            
    264         String args[] = new String[3];
    265         args[0] = Configuration.getModeAsString();
    266         args[1] = Dictionary.get("Preferences.Mode.Systems");
    267         args[2] = Dictionary.get("Preferences.Mode.Expert");
    268         JTextArea message_textarea = new JTextArea(Dictionary.get("CDM.SubcollectionManager.Partitions_Disabled", args));
    269         message_textarea.setComponentOrientation(Dictionary.getOrientation());
    270            
    271         message_textarea.setEditable(false);
    272         message_textarea.setHighlighter(null); // Prevent highlighting
    273         message_textarea.setLineWrap(true);
    274         message_textarea.setOpaque(false); // Make it transparent
    275         message_textarea.setWrapStyleWord(true);
    276250
    277251        // Add listeners
     
    329303        tabbed_pane.addTab(Dictionary.get("CDM.SubcollectionManager.Subindex_Controls"), (JPanel) CollectionDesignManager.subcollectionindex_manager.getControls());
    330304        tabbed_pane.addTab(Dictionary.get("CDM.SubcollectionManager.Language_Controls"), (JPanel) CollectionDesignManager.language_manager.getControls());
    331             JPanel tmp ;
    332         message_pane.setBorder(BorderFactory.createEmptyBorder(0,5,5,5));
    333         message_pane.setLayout(new GridLayout(3,1,0,0));
    334             tmp =new JPanel();
    335             tmp.setComponentOrientation(Dictionary.getOrientation());
    336         message_pane.add(tmp);
    337         message_pane.add(message_textarea);
    338             tmp = new JPanel();
    339             tmp.setComponentOrientation(Dictionary.getOrientation());
    340         message_pane.add(tmp);
    341 
    342         border_pane.setLayout(card_layout);
    343         if(Configuration.getMode() > Configuration.LIBRARIAN_MODE) {
    344         border_pane.add(tabbed_pane, ENABLED_CONTROLS);
    345         border_pane.add(message_pane, DISABLED_CONTROLS);
    346         }
    347         else {
    348         border_pane.add(message_pane, DISABLED_CONTROLS);
    349         border_pane.add(tabbed_pane, ENABLED_CONTROLS);
    350         }
    351305
    352306        setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
    353307        setLayout(new BorderLayout());
    354308        add(header_pane, BorderLayout.NORTH);
    355         add(border_pane, BorderLayout.CENTER);
     309        add(tabbed_pane, BorderLayout.CENTER);
    356310    }
    357311       
     
    372326    }
    373327   
    374     /** Called when the detail mode has changed which in turn controls if any of the partition controls are visible, or if they are instead replaced with a message explaining why they are not.
    375      * @param mode the new mode as an int
    376      */
    377     public void modeChanged(int mode) {
    378         if(mode > Configuration.LIBRARIAN_MODE) {
    379         card_layout.show(border_pane, ENABLED_CONTROLS);
    380         }
    381         else {
    382         card_layout.show(border_pane, DISABLED_CONTROLS);
    383         }
    384     }
    385 
    386328    public void stateChanged(ChangeEvent event)
    387329    {
Note: See TracChangeset for help on using the changeset viewer.