//
// StatusEvent.java
//

/*
LOCI Common package: utilities for I/O, reflection and miscellaneous tasks.
Copyright (C) 2005-@year@ Melissa Linkert, Curtis Rueden and Chris Allan.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

package loci.common;

/**
 * A event indicating a status update.
 *
 * <dl><dt><b>Source code:</b></dt>
 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/common/src/loci/common/StatusEvent.java">Trac</a>,
 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/common/src/loci/common/StatusEvent.java">SVN</a></dd></dl>
 */
public class StatusEvent {

  // -- Fields --

  /** Current progress value. */
  protected int progress;

  /** Current progress maximum. */
  protected int maximum;

  /** Current status message. */
  protected String status;

  /** Whether or not this is a warning event. */
  protected boolean warning;

  // -- Constructor --

  /** Constructs a status event. */
  public StatusEvent(String message) {
    this(-1, -1, message);
  }

  /** Constructs a status event. */
  public StatusEvent(String message, boolean warn) {
    this(-1, -1, message, warn);
  }

  /** Constructs a status event. */
  public StatusEvent(int progress, int maximum, String message) {
    this(progress, maximum, message, false);
  }

  /** Constructs a status event. */
  public StatusEvent(int progress, int maximum, String message, boolean warn) {
    this.progress = progress;
    this.maximum = maximum;
    status = message;
    warning = warn;
  }

  // -- StatusEvent API methods --

  /** Gets progress value. Returns -1 if progress is unknown. */
  public int getProgressValue() { return progress; }

  /** Gets progress maximum. Returns -1 if progress is unknown. */
  public int getProgressMaximum() { return maximum; }

  /** Gets status message. */
  public String getStatusMessage() { return status; }

  /** Returns whether or not this is a warning event. */
  public boolean isWarning() { return warning; }

}

@@ -2641,10 +2641,345 @@
 ing; %7D%0A%0A
+  // -- Object API methods --%0A%0A  @Override%0A  public String toString() %7B%0A    StringBuilder sb = new StringBuilder();%0A    sb.append(%22Status%22);%0A    sb.append(%22: progress=%22 + progress);%0A    sb.append(%22, maximum=%22 + maximum);%0A    sb.append(%22, warning=%22 + warning);%0A    sb.append(%22, status='%22 + status + %22'%22);%0A    return sb.toString();%0A  %7D%0A%0A
 %7D%0A

Add toString method to StatusEvent, for debugging.