CarSim Docs
Fall 2025
API

# CarSim

o1.carsim.gui.CarSim
object CarSim extends SimpleSwingApplication, Everpresent

The singleton object `CarSim` represents the CarSim application, which allows its user to simulate simple car behavior (movement, fueling). The object serves as an entry point for the application, and can be run to start up the user interface.

NOTE TO STUDENTS: In this course, you don’t need to understand how this object works on the inside. It’s enough to know that you can use this file to start the program.

## Attributes

Graph
Supertypes
  trait Everpresent
  class SimpleSwingApplication
  class SwingApplication
  trait Reactor
  class Object
  trait Matchable
  class Any
  Show all
Self type
  CarSim.type

## Members list

### Value members

#### Concrete methods

def top: Frame

A GUI application's version of the main method. Called by the default main method implementation provided by this class. Implement to return the top-level frame of this application.

A GUI application's version of the main method. Called by the default main method implementation provided by this class. Implement to return the top-level frame of this application.

## Attributes

#### Inherited methods

def deafTo(ps: Publisher*): Unit

Installed reaction won't receive events from the given publisher anylonger.

Installed reaction won't receive events from the given publisher anylonger.

## Attributes

Inherited from:
  Reactor

def listenTo(ps: Publisher*): Unit

Listen to the given publisher as long as `deafTo` isn't called for them.

Listen to the given publisher as long as `deafTo` isn't called for them.

## Attributes

Inherited from:
  Reactor

def main(args: Array[String]): Unit

Initializes the application and runs the given program.

Initializes the application and runs the given program.

## Attributes

Inherited from:
  SwingApplication

def quit(): Unit

Finalizes the application by calling `shutdown` and exits.

Finalizes the application by calling `shutdown` and exits.

## Attributes

Inherited from:
  SwingApplication

def resourceFromClassloader(path: String): URL

## Attributes

Inherited from:
  SimpleSwingApplication

def resourceFromUserDirectory(path: String): File

## Attributes

Inherited from:
  SimpleSwingApplication

def shutdown(): Unit

Called before the application is exited. Override to customize.

Called before the application is exited. Override to customize.

## Attributes

Inherited from:
  SwingApplication

override def startup(args: Array[String]): Unit

Calls `top`, packs the frame, and displays it.

Calls `top`, packs the frame, and displays it.

## Attributes

Definition Classes
  O1AppDefaults -> SimpleSwingApplication -> SwingApplication
Inherited from:
  O1AppDefaults (hidden)

#### Inherited fields

val reactions: Reactions

All reactions of this reactor.

All reactions of this reactor.

## Attributes

Inherited from:
  Reactor