O1Library Docs
Fall 2023
Docs API

# ViewFrameImpl

o1.gui.viewimpl.ViewFrameImpl
abstract class ViewFrameImpl[Model <: Matchable](val initialState: Model, tickRate: Double, val title: String, initialDelay: Int, val terminateOnClose: Boolean, val closeWhenDone: Boolean, val refreshPolicy: RefreshPolicy)

## Attributes

Graph
Supertypes
  class Object
  trait Matchable
  class Any
Known subtypes
  class ViewFrame[Model]
  class Traced[TraceData]
  class ViewFrame[Model]
  class Traced[TraceData]
Self type
  ViewFrameImpl[Model]

## Members list

### Value members

#### Concrete methods

final def adjustSpeed(newTickRate: Double): Unit

Sets a new tick rate for the view, replacing any previously set by the constructor or this method.

Sets a new tick rate for the view, replacing any previously set by the constructor or this method.

## Attributes

final def close(): Unit

Closes the view: stops it (as per stop), does any onClose effects, hides the GUI window, and possibly terminates the entire application (as per the constructor parameter).

Closes the view: stops it (as per stop), does any onClose effects, hides the GUI window, and possibly terminates the entire application (as per the constructor parameter).

## Attributes

def icon: Option[Pic]

The icon to be displayed in the title bar of this view’s GUI frame.

The icon to be displayed in the title bar of this view’s GUI frame.

## Attributes

final def icon_=(icon: Option[Pic]): Unit

Sets the icon to be displayed in the title bar of this view’s GUI frame.

Sets the icon to be displayed in the title bar of this view’s GUI frame.

## Parameters

icon

  a picture to be used as the icon; if `None`, en empty icon image will be displayed

## Attributes

final def icon_=(icon: Pic): Unit

Sets the icon to be displayed in the title bar of this view’s GUI frame.

Sets the icon to be displayed in the title bar of this view’s GUI frame.

## Parameters

icon

  a picture to be used as the icon

## Attributes

def onClose(): Unit

Causes an effect when the view’s GUI window is closed for any reason. By default, this method does nothing.

Causes an effect when the view’s GUI window is closed for any reason. By default, this method does nothing.

## Attributes

final def refresh(): Unit

Programmatically requests an update to the graphics of the view (even though no clock tick or triggering GUI event occurred).

Programmatically requests an update to the graphics of the view (even though no clock tick or triggering GUI event occurred).

## Attributes

final def simulate(tickLimit: Int): Unit

Runs the view as if by calling start except that it runs “headless”, with no actual GUI window visible and independently of a real-time clock. A number of simulated clock ticks are immediately sent to the view; this continues until either the view determines it is done or a predetermined maximum number of ticks has been reached.

Runs the view as if by calling start except that it runs “headless”, with no actual GUI window visible and independently of a real-time clock. A number of simulated clock ticks are immediately sent to the view; this continues until either the view determines it is done or a predetermined maximum number of ticks has been reached.

## Parameters

tickLimit

  the maximum number of ticks to simulate; `Int.MaxValue` (which is the default) means there is no such limit

## Attributes

final def start(): Unit

Starts the view: loads the model in the GUI window, makes the window visible oncreen, and starts the clock. Cf. simulate.

Starts the view: loads the model in the GUI window, makes the window visible oncreen, and starts the clock. Cf. simulate.

## Attributes

final def stop(): Unit

Stops the view: stops the clock, stops listening to events, and disposes of the GUI window. A stopped view cannot be restarted.

Stops the view: stops the clock, stops listening to events, and disposes of the GUI window. A stopped view cannot be restarted.

## Attributes

override def toString: String

Returns a brief textual description of the view.

Returns a brief textual description of the view.

## Attributes

Definition Classes
  Any

final def tooltip: String

the tooltip text to be displayed while the mouse hovers on the view

the tooltip text to be displayed while the mouse hovers on the view

## Attributes

final def tooltip_=(newText: String): Unit

Sets the tooltip text to be displayed while the mouse hovers on the view.

Sets the tooltip text to be displayed while the mouse hovers on the view.

## Attributes

final def visible: Boolean

whether this view’s GUI frame is visible onscreen

whether this view’s GUI frame is visible onscreen

## Attributes

final def visible_=(desiredVisibility: Boolean): Unit

Sets whether this view’s GUI frame is visible onscreen.

Sets whether this view’s GUI frame is visible onscreen.

## Attributes

#### Concrete fields

val closeWhenDone: Boolean
val refreshPolicy: RefreshPolicy
val terminateOnClose: Boolean
protected val title: String