com.timjohnstondev.unitconverter.view.listener
Class FactorChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.timjohnstondev.unitconverter.view.listener.FactorChangeEvent
All Implemented Interfaces:
Serializable

public class FactorChangeEvent
extends EventObject

FactorChangeEvent is used to notify interested parties that factor has changed.

See Also:
Serialized Form

Field Summary
static int CLEAR_FACTOR_ACTION
          Tells the listeners to clear the factor displays
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
FactorChangeEvent(Object eventSource, int newAction)
          Constructs a FactorChangeEvent object and sets the action.
FactorChangeEvent(Object eventSource, String value, BigDecimal mw)
          Constructs a FactorChangeEvent object and sets the conversion value.
 
Method Summary
 int getAction()
          Returns the event's action
 String getCoversion()
          Returns the conversion factor value
 BigDecimal getMolecularWeight()
          Returns the molecular weight, default is 1
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLEAR_FACTOR_ACTION

public static final int CLEAR_FACTOR_ACTION
Tells the listeners to clear the factor displays

See Also:
Constant Field Values
Constructor Detail

FactorChangeEvent

public FactorChangeEvent(Object eventSource,
                         int newAction)
Constructs a FactorChangeEvent object and sets the action.

Parameters:
eventSource - the originator of the event
newAction - the action to be performed by listeners

FactorChangeEvent

public FactorChangeEvent(Object eventSource,
                         String value,
                         BigDecimal mw)
Constructs a FactorChangeEvent object and sets the conversion value.

Parameters:
eventSource - the originator of the event
value - the conversion factor value
mw - the molecular weight
Method Detail

getCoversion

public final String getCoversion()
Returns the conversion factor value

Returns:
the conversion factor value

getAction

public final int getAction()
Returns the event's action

Returns:
the event's action

getMolecularWeight

public final BigDecimal getMolecularWeight()
Returns the molecular weight, default is 1

Returns:
the molecular weight, default is 1


Copyright © 2009 Tim Johnston Development, LLC. All Rights Reserved.