Class PViewDataChangeEvent

java.lang.Object
java.util.EventObject
java.awt.AWTEvent
com.portal.bas.PViewDataChangeEvent
All Implemented Interfaces:
Serializable

public class PViewDataChangeEvent extends AWTEvent implements Serializable
PViewDataChangeEvent is the mechanism by which a controller tells a view that it needs to display new data, and what that data is.
Version:
5
Author:
Larry Lynch-Freshner
See Also:
  • Field Details

    • REPLACE

      public static final int REPLACE
      A constant that indicates the current data needs to be replaced with the new data.
      See Also:
    • ADD_BEFORE

      public static final int ADD_BEFORE
      A constant that indicates the new data needs to be inserted before the existing data.
      See Also:
  • Constructor Details

    • PViewDataChangeEvent

      public PViewDataChangeEvent(Object src, String dataObjName, Object data)
      Creates an instance of PViewDataChangeEvent that replaces old data with the data.
      Parameters:
      src - the event source
      dataObjName - the name of data that has changed
      data - the new data
    • PViewDataChangeEvent

      public PViewDataChangeEvent(Object src, String dataObjName, int index, Object data)
      Creates an instance of PViewDataChangeEvent that replaces old indexed data with new data, beginning at the specified location.
      Parameters:
      src - the event source
      dataObjName - the name of data that has changed
      index - the index of the data
      data - the new data
    • PViewDataChangeEvent

      public PViewDataChangeEvent(Object src, String dataObjName, int doWhat, int index, Object data)
      Creates an instance of PViewDataChangeEvent that determines whether new data should replace or be inserted before the old data that is at the specified index.
      Parameters:
      src - the event source
      dataObjName - the name of data that has changed
      doWhat - how to change data in the view
      index - the index of the data
      data - the new data
  • Method Details

    • isIndexed

      public boolean isIndexed()
      Tests to determine whether the data uses an index.
      Returns:
      True if an index is used; false otherwise.
    • getHowChanged

      public int getHowChanged()
      Gets the value that tells how the data has changed.
      Returns:
      A value that indicates whether the new data replaces the old or should be inserted before it.
    • getIndex

      public int getIndex()
      Gets the data's index value.
      Returns:
      The index for the data.
    • getDataName

      public String getDataName()
      Gets the name of the data.
      Returns:
      A String with the name of the data.
    • getData

      public Object getData()
      Gets the data.
      Returns:
      The data.