package edu.calpoly.cpe205.fetter; import javax.swing.*; import java.util.*; import java.io.*; import java.lang.reflect.*; import java.lang.*; import java.awt.*; import javax.swing.event.*; import java.awt.event.*; /** * This class is used to manage the "Object Inspector" dialog, which displays * information about the fields of a Test Data Item or of a Returned Object. */ // Author: Phillip Hansen // Version History: // Nov 18, 2000 - added psuedo code and description // Nov 30, 2000 - (Mike Hebron) updated class description // Jan 17, 2001 - Wes Strickland added calls in contructor and inspect for Stage One release // also added stub to instantiateMVC() for Stage One release // Feb 8, 2001 - Wes Strickland added comments and moved braces for Stage Two release public class ObjectInspector extends ETA { /** * This will create an object inspector dialog that will allow the user to inspect the * selected parameter. *
* Pre-conditions: none
* Post-conditions: none
* @param parent The Dialog from which the dialog is displayed
*/
public ObjectInspector(JDialog parent)
{
// CALL super constructor with parent and true
super(true);
}
/**
* Constructs the view and the model
*
* Pre-conditions: none
* Post-conditions: view refers to ETAInspectorView
*/
protected void instantiateMVC()
{
// SET model to NEW ETAMainModel
// SET view to NEW ETAInspectorView
view = new ETAInspectorView(ETA.theETA.view);
model = new ETAMainModel();
}
/**
* Displays the fields of the object
*
* Pre-condition: none
* Post-condition: none
* @param obj object to be inspected
* @param description description of object being inspected
* @param editable boolean stating whether the user will be able to edit the object or not
*/
public void inspect(Object obj, String description, boolean editable)
{
// SET inspectee to obj
// CALL loadObject of model with obj
// CALL setInspectDescription of view with description
// CALL setEditable of view with editable
inspectee = obj;
model.loadObject(obj);
view.setInspectDescription(description);
view.setEditable(editable);
}
/**
* sets the visibility of the object inspector
*
* Pre-conditions: none
* Post-conditions: none
* @param visible the visibility of the object inspector
*/
public void setVisible(boolean visible)
{
view.setVisible(visible);
}
/**
* Reference to the object being inspected
*/
protected Object inspectee; //Create a reference to object being inspected
/** @link dependency */
/*#ETAInspectorView lnkETAInspectorView;*/
}