Module hw06

Class DemoFrame<CBoxItem>

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
visitorDemoExercises.basicVisitorDemo.view.DemoFrame<CBoxItem>
Type Parameters:
CBoxItem - The type of object to put into the JComboBox.
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class DemoFrame<CBoxItem> extends JFrame
The view for the Visitor Demo system
Author:
swong
See Also:
Serialized Form
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
      Constant Field Values
    • centerSplitPane

      private JSplitPane centerSplitPane
      Dual output display panes
    • visitorTF

      private JTextField visitorTF
      Input TF for the visitor class name
    • executeBtn

      private JButton executeBtn
      Button to execute the visitor
    • hostCBx

      private JComboBox<CBoxItem> hostCBx
      Drop list of available hosts
    • controlPnl

      private JPanel controlPnl
      Main control panel
    • outputTA

      private JTextArea outputTA
      Output text area
    • textSPane

      private JScrollPane textSPane
      Scroll pane for long text output
    • canvasPnl

      private JPanel canvasPnl
      Canvas to draw on for graphical outputs
    • model

      private IModelAdapter<CBoxItem> model
      Adapter to the model
  • Constructor Details

    • DemoFrame

      public DemoFrame(int closeAction, IModelAdapter<CBoxItem> model)
      The constructor for the class
      Parameters:
      closeAction - The action to take when the window is closed.
      model - The adapter interface back out to the model.
  • Method Details

    • start

      public void start()
      Starts the view. Populates the JComboBox with values obtained from the model
    • initGUI

      private void initGUI()
      Utility method to initialize the system.