Ignore:
Timestamp:
2003-07-25T16:29:35+12:00 (21 years ago)
Author:
jmt12
Message:

Halved log textarea memory use by sharing Document model between both the process and the history text areas. Its not enough though.

File:
1 edited

Legend:

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

    r4933 r5033  
    5050import org.greenstone.gatherer.msm.ElementWrapper;
    5151import org.greenstone.gatherer.util.Utility;
    52 import org.w3c.dom.*;
     52//import org.w3c.dom.*;
    5353/** This class serves as the data holder for all subclasses of option panes, such as Import options or All options. It also contains methods for creating each of the option lines as they would appear in the subpane. Futhermore it has a method for considering all the arguments and generating a <strong>String[]</strong> to allow you to pass them to the <strong>GShell</strong>.
    5454 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    8888
    8989     /** The default constructor creates the few session length options, but either retrieves the rest from the current collection, or creates a default set of options. */
    90     public OptionsPane(JTextArea log, BuildOptions build_options) {
    91     this.log_display = log;
     90    public OptionsPane(JTextArea message_log, BuildOptions build_options) {
     91    this.log_display = new JTextArea(message_log.getDocument());
    9292    this.build_options = build_options;
    9393    this.log_change_listener = new LogChangeListener();
     
    230230
    231231        }
     232
    232233        log_pane.add(new JScrollPane(log_display), BorderLayout.CENTER);
    233234        JLabel log_history_label = new JLabel(get("LogHistory"));
    234235        JPanel log_history_pane = new JPanel();
     236
    235237        log_history_pane.setLayout(new BorderLayout());
    236238        log_history_pane.add(log_history_label, BorderLayout.NORTH);
    237239        log_history_pane.add(list_scroller, BorderLayout.SOUTH);
     240       
    238241        log_pane.add(log_history_pane, BorderLayout.SOUTH);
    239242    }
     
    281284    public void loadSelectedLog(FileEntry fe) {
    282285    ///ystem.out.println("load selected log");
    283     if (is_log_changed) {
    284         saveLogFile(displayed_log.getFile());
    285     } else {
    286         log_display.getDocument().removeDocumentListener(log_change_listener);
     286    if(displayed_log != null) {
     287        if (is_log_changed) {
     288        saveLogFile(displayed_log.getFile());
     289        } else {
     290        log_display.getDocument().removeDocumentListener(log_change_listener);
     291        }
    287292    }
    288293
Note: See TracChangeset for help on using the changeset viewer.