Module hw06

Class ListDemoFrame<THost>

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
visitorDemoExercises.listFWVisitorExercises.view.ListDemoFrame<THost>
Type Parameters:
THost - The type of host objects
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class ListDemoFrame<THost> extends JFrame
The view for the ListFW demo app
Author:
swong
See Also:
Serialized Form
  • Field Details

    • serialVersionUID

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

      private JPanel pnlControl
      Control panel
    • tfClassname

      private JTextField tfClassname
    • scrollPaneOutput

      private JScrollPane scrollPaneOutput
      Scroll pane for the visitor output
    • taOutput

      private JTextArea taOutput
      Text area for visitor output
    • lblVisitorClassname

      private JLabel lblVisitorClassname
      Label for visitor class names
    • lblInputParameter

      private JLabel lblInputParameter
      Label for visitor input parameter
    • tfParam

      private JTextField tfParam
      Input for visitor parameter
    • lblRunVisitorOn

      private JLabel lblRunVisitorOn
      Label for host list
    • model

      private IModelAdapter<THost> model
      Adapter to the model
    • cbHosts

      private JComboBox<THost> cbHosts
      Drop list of available hosts
    • btnRun

      private JButton btnRun
      Button to run the visitor
    • lblAccumulator

      private JLabel lblAccumulator
      Label for the accumulators
    • tfAccClassname

      private JTextField tfAccClassname
      Input for accumulator class name
    • btnFoldr

      private JButton btnFoldr
      Button to run Fold Right
    • btnFoldL

      private JButton btnFoldL
      Button to run Fold Left
    • pnlVisitorCtrl

      private JPanel pnlVisitorCtrl
      Panel for visitor control
    • pnlListCtrl

      private JPanel pnlListCtrl
      Panel host list control
    • pnlFoldCtrl

      private JPanel pnlFoldCtrl
      Panel for controlling folding
    • pnlControlSub

      private JPanel pnlControlSub
      Control sub-panel
  • Constructor Details

    • ListDemoFrame

      public ListDemoFrame(IModelAdapter<THost> model, int closeAction)
      Constructor for the view
      Parameters:
      model - The adapter to the model
      closeAction - The window closing action to use. Should be either WindowConstants.EXIT_ON_CLOSE or WindowConstants.HIDE_ON_CLOSE
  • Method Details

    • initGUI

      private void initGUI()
      Initialize the GUI components
    • start

      public void start()
      Start the view, i.e. make it visible.
    • setHosts

      public void setHosts(THost... hosts)
      Set drop list (cbHosts) to hold the given host objects.
      Parameters:
      hosts - A vararg of THosts.