com.sage.accpac.sm
Interface Meter


public interface Meter

meters show progress.

Currently the issue of multiple copies of the same listener is ill-defined. The intent is to move to a set-based model but the current default implementation is list-based. That means currently if a listener is added more than once it will be called that many times. That will be changed as soon as feasible.

Thread safety
Thread-safe

Nested Class Summary
static class Meter.State
          Enumeration of possible states
 
Method Summary
 void addEventListener(MeterEventListener l)
          add the given listener to the meter
 void cancel()
          request that the underlying process cancel
 java.lang.String getCaption()
          returns the caption of the meter.
 boolean getHasGauge()
          returns whether the meter has a gauge.
 boolean getHasLabel()
          returns whether the meter has a label showing
 java.lang.String getLabel()
          returns the label, if there is one
 double getLevel()
          gets the current level of the gauge
 double getMaximumLevel()
          gets the maximum level of the gauge
 double getMinimumLevel()
          gets the minimum level of the gauge
 Meter.State getState()
          gets the current state of the meter
 boolean isCancelable()
          gets whether the meter can be cancelled
 void removeEventListener(MeterEventListener l)
          removes a listener previously added by addEventListener(MeterEventListener).
 

Method Detail

addEventListener

void addEventListener(MeterEventListener l)
add the given listener to the meter

Parameters:
l - the MeterEventListener listener
See Also:
removeEventListener(MeterEventListener)

cancel

void cancel()
request that the underlying process cancel

Throws:
java.lang.IllegalStateException - if the meter can not be cancelled
See Also:
isCancelable()

getCaption

java.lang.String getCaption()
returns the caption of the meter.

The caption does not change.

Returns:
the caption of the meter

getHasGauge

boolean getHasGauge()
returns whether the meter has a gauge.

Even if this returns false the gauge-related methods will still return a value

Returns:
true if the meter has a gauge

getHasLabel

boolean getHasLabel()
returns whether the meter has a label showing

Returns:
true if the meter has a label
See Also:
getLabel()

getLabel

java.lang.String getLabel()
returns the label, if there is one

Returns:
the label, if there is one, and blank otherwise

getLevel

double getLevel()
gets the current level of the gauge

Returns:
a double representing the level of the gauge

getMaximumLevel

double getMaximumLevel()
gets the maximum level of the gauge

The maximum level may change during the life of the meter

Returns:
a double representing the maximum level

getMinimumLevel

double getMinimumLevel()
gets the minimum level of the gauge

The minimum level may change during the life of the meter

Returns:
a double representing the minimum level

getState

Meter.State getState()
gets the current state of the meter

Returns:
a Meter.State representing the current state of the meter

isCancelable

boolean isCancelable()
gets whether the meter can be cancelled

Returns:
true if the meter can be cancelled
See Also:
cancel()

removeEventListener

void removeEventListener(MeterEventListener l)
removes a listener previously added by addEventListener(MeterEventListener).

Parameters:
l - the MeterEventListener listener that was added and is to be removed


Copyright © 2011 Sage Software, Inc. All rights reserved.