VerticalLayout creates a SimView and a command line Terminal a command line Terminal for interactive scripting; also an area to show a graph, and an area to put controls. Defines regular expressions for easy Terminal scripting of these objects using short names such as terminal, simCanvas, graphCanvas.

Defines functions showGraph, showControls, showTerminal, which are used for the checkboxes with those names; these functions appear in Terminal when they are executed. These functions can also be called from the Terminal, and therefore saved in Terminal command storage, preserving what the state of what is visible.

Element IDs

VerticalLayout constructor takes an argument that specifies the names of the HTML elements to look for in the HTML document; these elements are where the user interface of the simulation is created. This allows for having two separate instances of the same simulation running concurrently on a single page.

These are the names expected to be in the element IDs object:

  • term_output
  • term_input
  • sim_applet
  • div_graph
  • graph_controls
  • show_graph
  • sim_controls
  • show_controls
  • form_terminal
  • label_terminal
  • show_terminal
  • show_hide_form
  • images_dir

Oct 2014: increased size of simCanvas and graphCanvas so that they look better when stretched to large sizes on large screens.

Hierarchy (view full)

Implements

Constructors

Methods

  • Sets whether this Subject will broadcast events, typically used to temporarily disable broadcasting. Intended to be used in situations where a subclass overrides a method that broadcasts an event. This allows the subclass to prevent the superclass broadcasting that event, so that the subclass can broadcast the event when the method is completed.

    Parameters

    • value: boolean

      whether this Subject should broadcast events

    Returns boolean

    the previous value

  • Returns a minimal string representation of this object, usually giving just identity information like the class name and name of the object.

    For an object whose main purpose is to represent another Printable object, it is recommended to include the result of calling toStringShort on that other object. For example, calling toStringShort() on a DisplayShape might return something like this:

    DisplayShape{polygon:Polygon{'chain3'}}
    

    Returns string

    a minimal string representation of this object.

Generated using TypeDoc