package edu.calpoly.cpe205.fetter;
import javax.swing.*;
import java.io.*;
import java.awt.*;
/**
* A class that defines behaviors needed to represent a view of the
* ETAMainModel. All methods defined in ETAViewAbstract are implemented as
* no-ops, or if they return an Object, they return null; derived classes
* can extend this class and override only the methods of interest.
*
* @see edu.calpoly.cpe205.fetter.ETAMainModel
*/
// Author: Michael Hebron
// Version History
// Nov 18, 2000 - comments/pseudocode added
// Feb 9, 2001 - (Phillip Hansen) performed code walkthrough
abstract public class ETAViewAbstract extends JDialog
{
public ETAViewAbstract(JDialog parent)
{
super((parent == null) ? new JDialog() : parent);
}
/**
* Sets the description label of the object being inspected in the Object Inspector window
* Pre-conditions: none
* Post-conditions: the Description label of the Object Inspector will be set
* @param description description of the object being inspected
*/
public void setInspectDescription(String description)
{
// NOTHING
}
/**
* Creates a new FieldRow and adds it to the
* collection of FieldRows the view is responsible for displaying.
*
* This function also registers the ParameterObjectComboBoxes of the new * FieldRow as a ParameterDataListener of the ETAMainModel.
* Pre-conditions: none
* Post-conditions: The view has a new FieldRow that it's responsible for
* displaying. The combo boxes in the new FieldRow become ParameterDataListeners
* of the ETAMainModel
* @param fieldData a FieldDataInterface for the FieldRow that
* is being added for the View to display
*/
public void addFieldRow(FieldDataInterface fieldData)
{
// NOTHING
}
/**
* Creates a new MethodRow and adds it to the collection of MethodRows the
* view is responsible for displaying.
*
* This function also registers the ParameterObjectComboBoxes of the new * MethodRow as a ParameterDataListener of the ETAMainModel.
* Pre-conditions: none
* Post-conditions: The view has a new MethodRow that it's responsible for
* displaying. The combo boxes in the new Method Row become
* ParameterDataListeners of the ETAMainModel
* @param methodData a MethodDataInterface for the MethodRow that
* is being added for the View to display
* @return an interface to the newly added MethodRow
*/
public MethodRowInterface addMethodRow(MethodDataInterface methodData)
{
// RETURN null
return null;
}
/**
* Creates a new ParameterRow and adds it to the collection of ParameterRows the
* view is responsible for displaying.
*
* Pre-conditions: none
* Post-conditions: The view has a new ParameterRow that it's responsible for
* displaying
* @param parameterData a ParameterDataInterface for the ParameterRow that
* is being added for the View to display
*/
public void addParameterRow(ParameterDataInterface paramData)
{
// NOTHING
}
/**
* Creates a new ReturnedRow and adds it to the collection of ReturnedRows the
* view is responsible for displaying.
*
* Pre-conditions: none
* Post-conditions: The view has a new ReturnedRow that it's responsible for
* displaying
* @param returnedData a ReturnedDataInterface for the ReturnedRow that
* is being added for the View to display
*/
public void addReturnedRow(ReturnedDataInterface retData)
{
// NOTHING
}
/**
* Removes the parameterRow associated with ParameterDataInterface
* paramData
*
* If the view has no ParameterRow representing paramData
* this method does nothing.
*
* Pre-conditions: none
* Post-conditions: The view no longer displays the information representing
* paramData
* @param paramData the ParameterDataInterface for the ParameterRow that
* is going to be removed from the view
*/
public void removeParameterRow(ParameterDataInterface paramData)
{
// NOTHING
}
/**
* Removes the returnedRow associated with ReturnedDataInterface
* retData
*
* If the view has no ReturnedRow representing retData
* this method does nothing.
*
* Pre-conditions: none
* Post-conditions: The view no longer displays the information representing
* retData
*/
public void removeReturnedRow(ReturnedDataInterface retData)
{
// NOTHING
}
/**
* Tells the view to display a preview of the GUI object
* previewObject
*
* Pre-conditions: none
* Post-conditions: The view becomes responsible for displaying a preview of
* previewObject
* @param previewObject The GUI object that a preview will be displayed for
*/
public void setPreviewComponent(Component previewObject)
{
// NOTHING
}
/**
* Clears the view of its FieldRows
*
* Pre-conditions: none
* Post-conditions: The view is no longer displaying FieldRows
*/
public void clearFields()
{
// NOTHING
}
/**
* Clears the view of its MethodRows
*
* Pre-conditions: none
* Post-conditions: The view is no longer displaying MethodRows
*/
public void clearMethods()
{
// NOTHING
}
/**
* Clears the view of its Component Preview panel
*
* Pre-conditions: none
* Post-conditions: The view is no longer displaying a Component Preview panel
*/
public void clearPreview()
{
// NOTHING
}
/**
* Enables/disables the view's GUI components to allow/disallow the user to
* test the main test object
*
* Pre-conditions: none
* Post-conditions: The view's GUI components for displaying/invoking methods
* and displaying/editing fields become enabled/disabled
* @param enable a boolean, where true enables the components and false
* disables them
*/
public void enableMainTest(boolean enable)
{
// NOTHING
}
/**
* Enables/disables the view's GUI components to allow/disallow the user
* to change the values stored in the main test object's fields, or to
* call the main test object's methods
*
* Pre-conditions: none
* Post-conditions: The view's GUI components for displaying/editing fields
* become enabled/disabled
*/
public void setEditable(boolean edit)
{
// NOTHING
}
/**
* Lays out the GUI components of the view
*
* This method is meant to be called only once, right after construction
* of the view
* Pre-conditions: The view hasn't had layoutGUI called on it before
* Post-conditions: All of the view's GUI components become layed out in
* an orderly fashion
*/
public void layoutGUI()
{
// NOTHING
}
/**
* Returns the OutputStream used for outputting messages to the Session Log tab
* of the Status panel
* @return the OutputStream used for outputting messages to the Session Log
*/
public OutputStream getLogOutputStream()
{
// RETURN null
return null;
}
/**
* Returns the OutputStream used for outputting informational messages from the
* ETA to the Output tab of the Status panel
* @return the OutputStream used for outputting error messages to the Output
* tab of the Status panel
*/
public OutputStream getOutOutputStream()
{
// RETURN null
return null;
}
/**
* Returns the OutputStream used for outputting error messages from the ETA
* to the Messages tab of the Status panel
* @return the OutputStream used for outputting error messages from the main
* test object to the Messages tab of the Status panel
*/
public OutputStream getErrOutputStream()
{
// RETURN null
return null;
}
/**
* Sets the model that this class is a view for
*
* Pre-condition: none
* Post-condition: The view becomes responsible for displaying
* model's data
* @param model The ETAMainModel whose data the view becomes responsible for
* displaying
*/
public void setModel(ETAMainModel model)
{
// NOTHING
}
/**
* A reference to the model that this class is a view of
*/
protected ETAMainModel model;
}