Changeset 5340 for trunk/gli


Ignore:
Timestamp:
2003-08-29T09:50:08+12:00 (21 years ago)
Author:
jmt12
Message:

Fixed a bug that prevented Design view from being loaded by itself

Location:
trunk/gli/src/org/greenstone/gatherer/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/GConfigPane.java

    r4933 r5340  
    8282    }
    8383    public void gainFocus() {
    84     cdm.gainFocus();
     84    if(cdm == null && Gatherer.c_man.ready()) {
     85        // Retrieve the new config manager.
     86        cdm = Gatherer.c_man.getCollection().cdm;
     87        // Display it.
     88        cdm.display(this);
     89    }
     90    if(cdm != null) {
     91        cdm.gainFocus();
     92    }
    8593    }
    8694
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r5337 r5340  
    396396        this.setTitle(Utility.PROGRAM_NAME + ": " + get("Collection.No_Collection"));
    397397        }
    398                 // Pretty corner icon
     398        // Pretty corner icon
    399399        this.setIconImage(Utility.getImage("gatherer_small.gif").getImage());
    400                 // BorderLayout for the main screen. I'll try my best to avoid t
    401                 // hese in subcomponents as they're space greedy.
     400        // BorderLayout for the main screen. I'll try my best to avoid t
     401        // hese in subcomponents as they're space greedy.
    402402        content_pane.setLayout(new BorderLayout());
    403                 // Create the menu-bar and stick it up the top.
     403        // Create the menu-bar and stick it up the top.
    404404        menu_bar = new MenuBar(new MenuListenerImpl());
    405405        content_pane.add(menu_bar, BorderLayout.NORTH);
    406                 // Create the tabbed pane and plop it in the center where it will
    407                 // expand to consume all available space like any good gas would.
     406        // Create the tabbed pane and plop it in the center where it will
     407        // expand to consume all available space like any good gas would.
    408408        tab_pane = new JTabbedPane();
    409409        tab_pane.addChangeListener(this);
    410410        tab_pane.setFont(Gatherer.config.getFont("general.font", false));
    411411
    412                 // May have to play with the order in which tabs are added.
     412        // May have to play with the order in which tabs are added.
     413        browser_pane = new BrowsingPane();
    413414        if(Gatherer.config.get("workflow.browse", true)) {
    414         browser_pane = new BrowsingPane();
    415415        tab_pane.addTab(get("Browser"), Utility.getImage("browsing.gif"), browser_pane);
    416416        tab_pane.setEnabledAt(tab_pane.indexOfComponent(browser_pane), Gatherer.config.get("workflow.browse", false));
    417417        }
    418418
     419        mirror_pane = new MirrorPane();
    419420        if(Gatherer.config.get("workflow.mirror", true)) {
    420         mirror_pane = new MirrorPane();
    421421        tab_pane.addTab(get("Mirroring"), Utility.getImage("mirroring.gif"), mirror_pane);
    422422        tab_pane.setEnabledAt(tab_pane.indexOfComponent(mirror_pane), Gatherer.config.get("workflow.mirror", false));
    423423        }
    424424
     425        collection_pane = new CollectionPane(workspace_tree_sync, collection_tree_sync);
     426        collection_pane.display();
    425427        if(Gatherer.config.get("workflow.gather", true)) {
    426         collection_pane = new CollectionPane(workspace_tree_sync, collection_tree_sync);
    427         collection_pane.display();
    428428        tab_pane.addTab(get("Collection"), Utility.getImage("collection.gif"), collection_pane);
    429429        tab_pane.setEnabledAt(tab_pane.indexOfComponent(collection_pane), Gatherer.config.get("workflow.gather", false));
    430430        }
    431431
     432        metaedit_pane = new MetaEditPane(collection_tree_sync);
     433        metaedit_pane.display();
    432434        if(Gatherer.config.get("workflow.enrich", true)) {
    433         metaedit_pane = new MetaEditPane(collection_tree_sync);
    434         metaedit_pane.display();
    435435        tab_pane.addTab(get("MetaEdit"), Utility.getImage("metaedit.gif"), metaedit_pane);
    436436        tab_pane.setEnabledAt(tab_pane.indexOfComponent(metaedit_pane), false);
    437437        }
    438438
     439        config_pane = new GConfigPane();
     440        config_pane.display();
    439441        if(Gatherer.config.get("workflow.design", true)) {
    440         config_pane = new GConfigPane();
    441         config_pane.display();
    442442        tab_pane.addTab(get("Build"), Utility.getImage("build.gif"), config_pane);
    443443        tab_pane.setEnabledAt(tab_pane.indexOfComponent(config_pane), false);
     
    449449        }
    450450
     451        create_pane = new CreatePane();
     452        create_pane.display();
    451453        if(Gatherer.config.get("workflow.create", true)) {
    452         create_pane = new CreatePane();
    453         create_pane.display();
    454454        tab_pane.addTab(get("Create"), Utility.getImage("build session.gif"), create_pane);
    455455        tab_pane.setEnabledAt(tab_pane.indexOfComponent(create_pane), false);
    456456        }
    457457
     458        preview_pane = new PreviewPane();
     459        preview_pane.display();
    458460        if(Gatherer.config.get("workflow.preview", true)) {
    459         preview_pane = new PreviewPane();
    460         preview_pane.display();
    461461        tab_pane.addTab(get("Preview"), Utility.getImage("final.gif"), preview_pane);
    462462        tab_pane.setEnabledAt(tab_pane.indexOfComponent(preview_pane), false);
    463463        }
    464464
    465                 // Find the first tab that is enabled and select that.
     465        // Find the first tab that is enabled and select that.
    466466        boolean found = false;
    467467        for(int i = 0; !found && i < tab_pane.getTabCount(); i++) {
     
    473473
    474474        content_pane.add(tab_pane, BorderLayout.CENTER);
    475                 // Drive a sessionReady event to update all controls to reflect current collection status.
     475        // Drive a sessionReady event to update all controls to reflect current collection status.
    476476        collectionChanged(Gatherer.c_man.ready());
    477477    }
    478478    catch (Exception e) {
    479479        Gatherer.printStackTrace(e);
    480                 // The GUI failing to build is a app killer
     480        // The GUI failing to build is a app killer
    481481        e.printStackTrace();
    482482        System.exit(1);
Note: See TracChangeset for help on using the changeset viewer.