Packages

  • package o1

    O1Library is a toolkit designed for the course Programming 1 (a.k.a. O1) at Aalto University.

    O1Library is a toolkit designed for the course Programming 1 (a.k.a. O1) at Aalto University. It contains an assortment of tools; most prominently, it provides a framework for simple graphical programming and utilities for playing sound.

    This is the front page of O1Library’s documentation. However, this is probably not the best place to start learning about O1Library as a student. That’s because the relevant content of this library is introduced bit by bit in the chapters of O1’s custom ebook alongside the associated programming concepts and assignments.

    You may still find this documentation useful as a reference. You can also find some optional content here that you may wish to try.

    This front page lists the content available in the top-level package called simply o1. These tools are available with the simple command import o1._ in your Scala programs. Some of them you’ll use a lot; some of them you won’t necessarily need at all.

    The tools listed here are actually implemented in a number of subpackages (o1.gui, o1.sound, etc.); what you see here are just “shortcut aliases” to those actual implementations. The aliases are here to make that convenient import command work and to provide you with this list of links to some of the more commonly used tools in O1Library. The subpackages also contain additional content not listed here.

    O1Library has been developed by Aleksi Lukkarinen and Juha Sorva. Several of the key components in o1.gui and o1.world are built upon Aleksi’s Scala Media Computation Library. Some parts of O1Library draw inspiration from the “teachpacks” of the Racket programming language.

    We are grateful to Riku Autio, Joonatan Honkamaa, Juhani Numminen, Leo Varis, Veera Kahva, and anonymous students for bug reports and fixes. We thank Otto Seppälä for helpful discussions.

    Definition Classes
    root
  • package gui

    This package contains tools for building simple GUIs.

    This package contains tools for building simple GUIs. The toolkit is particularly well suited to constructing GUIs that display information as 2D images and/or geometric shapes. It is not designed for demanding graphical needs that call for high efficiency. Some of the tools in this package are built on the Swing GUI library, and the two libraries can be used in combination.

    Some of the types in this package have aliases in the top-level package o1, so they are accessible to students simply via import o1._. Some of the package contents are not available in the top-level package or included in this documentation.

    Please note: One of this package’s key components (views) comes in multiple varieties, which which are defined in the subpackages o1.gui.mutable and o1.gui.immutable and not listed below. The View that is most commonly used in O1 (and aliased as o1.View in the top-level package) is o1.gui.mutable.ViewFrame.

    Definition Classes
    o1
  • package colors

    This package contains Color constants.

    This package contains Color constants. They cover all the colors listed in the W3C’s CSS Color Module specification (July 5th, 2017); there are some additional ones as well.

    All the colors are fully opaque, except Transparent, which is fully transparent.

    The contents of this package are aliased in the top-level package o1 so that they are accessible to students simply via import o1._.

    Definition Classes
    gui
  • package event

    This package exists in order to provide aliases to event classes in Swing and to add some methods to Swing’s InputEvent via o1.gui.event.ConvenientInputEvent.

    This package exists in order to provide aliases to event classes in Swing and to add some methods to Swing’s InputEvent via o1.gui.event.ConvenientInputEvent.

    The contents of this package are aliased in the top-level package o1, so that they are accessible to students simply via* import o1._.

    Definition Classes
    gui
  • package layout

    The package o1.gui.layout contains utilities that make it more convenient to lay out components in simple GridBagPanels from Scala's Swing library.

    The package o1.gui.layout contains utilities that make it more convenient to lay out components in simple GridBagPanels from Scala's Swing library. These utilities are used internally by some of the given GUIs in O1.

    NOTE TO STUDENTS: In this course, you don't need to understand how this package works or can be used.

    Definition Classes
    gui
  • Animation
  • Color
  • DefaultFrameSettings
  • Dialog
  • Escapable
  • Pic
  • SimpleFrame
  • TerminatesOnClose
  • View
  • immutable
  • mutable
t

o1.gui

Escapable

trait Escapable extends Frame

Give this convenience trait to a Swing GUI frame to make it close when the Escape key is pressed.

Linear Supertypes
Frame, RichWindow, Window, RootPanel, Container, UIElement, LazyPublisher, Publisher, Reactor, Proxy, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Escapable
  2. Frame
  3. RichWindow
  4. Window
  5. RootPanel
  6. Container
  7. UIElement
  8. LazyPublisher
  9. Publisher
  10. Reactor
  11. Proxy
  12. AnyRef
  13. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. trait InterfaceMixin extends scala.swing.RichWindow.InterfaceMixin
    Definition Classes
    RichWindow

Value Members

  1. def background: scala.swing.Color
    Definition Classes
    UIElement
  2. def background_=(c: scala.swing.Color): Unit
    Definition Classes
    UIElement
  3. def bounds: Rectangle
    Definition Classes
    UIElement
  4. def bounds_=(rect: Rectangle): Unit
    Definition Classes
    Window
  5. def centerOnScreen(): Unit
    Definition Classes
    Window
  6. def close(): Unit
    Definition Classes
    Window
  7. def closeOperation(): Unit
    Definition Classes
    Window
  8. def componentOrientation: ComponentOrientation
    Definition Classes
    UIElement
  9. def componentOrientation_=(x: ComponentOrientation): Unit
    Definition Classes
    UIElement
  10. def contents: Seq[Component]
    Definition Classes
    RootPanel → Container
  11. def contents_=(c: Component): Unit
    Definition Classes
    Window → RootPanel
  12. def cursor: Cursor
    Definition Classes
    UIElement
  13. def cursor_=(c: Cursor): Unit
    Definition Classes
    UIElement
  14. def deafTo(ps: Publisher*): Unit
    Definition Classes
    Reactor
  15. def defaultButton: Option[Button]
    Definition Classes
    Window
  16. def defaultButton_=(b: Option[Button]): Unit
    Definition Classes
    Window
  17. def defaultButton_=(b: Button): Unit
    Definition Classes
    Window
  18. def displayable: Boolean
    Definition Classes
    UIElement
  19. def dispose(): Unit
    Definition Classes
    Window
  20. def equals(that: Any): Boolean
    Definition Classes
    Proxy → Any
  21. val escape: Int
  22. val escapeStroke: KeyStroke
  23. def font: Font
    Definition Classes
    UIElement
  24. def font_=(f: Font): Unit
    Definition Classes
    UIElement
  25. def foreground: scala.swing.Color
    Definition Classes
    UIElement
  26. def foreground_=(c: scala.swing.Color): Unit
    Definition Classes
    UIElement
  27. def hashCode(): Int
    Definition Classes
    Proxy → Any
  28. def iconImage: Image
    Definition Classes
    Frame
  29. def iconImage_=(i: Image): Unit
    Definition Classes
    Frame
  30. def iconified: Boolean
    Definition Classes
    Frame
  31. def iconify(): Unit
    Definition Classes
    Frame
  32. def ignoreRepaint: Boolean
    Definition Classes
    UIElement
  33. def ignoreRepaint_=(b: Boolean): Unit
    Definition Classes
    UIElement
  34. def listenTo(ps: Publisher*): Unit
    Definition Classes
    Reactor
  35. def locale: Locale
    Definition Classes
    UIElement
  36. def location: Point
    Definition Classes
    UIElement
  37. def locationOnScreen: Point
    Definition Classes
    UIElement
  38. def location_=(p: Point): Unit
    Definition Classes
    Window
  39. def maximize(): Unit
    Definition Classes
    Frame
  40. def maximized: Boolean
    Definition Classes
    Frame
  41. def maximumSize: Dimension
    Definition Classes
    UIElement
  42. def maximumSize_=(x: Dimension): Unit
    Definition Classes
    UIElement
  43. def menuBar: MenuBar
    Definition Classes
    RichWindow
  44. def menuBar_=(m: MenuBar): Unit
    Definition Classes
    RichWindow
  45. def minimumSize: Dimension
    Definition Classes
    UIElement
  46. def minimumSize_=(x: Dimension): Unit
    Definition Classes
    UIElement
  47. def open(): Unit
    Definition Classes
    Window
  48. def owner: Window
    Definition Classes
    Window
  49. def pack(): Escapable.this.type
    Definition Classes
    Window
  50. lazy val peer: JFrame with InterfaceMixin
    Definition Classes
    Frame → RichWindow → Window → RootPanel → UIElement
  51. def preferredSize: Dimension
    Definition Classes
    UIElement
  52. def preferredSize_=(x: Dimension): Unit
    Definition Classes
    UIElement
  53. def publish(e: Event): Unit
    Definition Classes
    Publisher
  54. val reactions: Reactions
    Definition Classes
    Reactor
  55. def repaint(rect: Rectangle): Unit
    Definition Classes
    UIElement
  56. def repaint(): Unit
    Definition Classes
    UIElement
  57. def resizable: Boolean
    Definition Classes
    RichWindow
  58. def resizable_=(b: Boolean): Unit
    Definition Classes
    RichWindow
  59. def self: Any
    Definition Classes
    UIElement → Proxy
  60. def setLocationRelativeTo(c: UIElement): Unit
    Definition Classes
    Window
  61. def showing: Boolean
    Definition Classes
    UIElement
  62. def size: Dimension
    Definition Classes
    UIElement
  63. def size_=(size: Dimension): Unit
    Definition Classes
    Window
  64. def subscribe(listener: Reaction): Unit
    Definition Classes
    LazyPublisher → Publisher
  65. def title: String
    Definition Classes
    RichWindow
  66. def title_=(s: String): Unit
    Definition Classes
    RichWindow
  67. def toString: String
    Definition Classes
    Proxy → Any
  68. def toolkit: Toolkit
    Definition Classes
    UIElement
  69. def uniconify(): Unit
    Definition Classes
    Frame
  70. def unmaximize(): Unit
    Definition Classes
    Frame
  71. def unsubscribe(listener: Reaction): Unit
    Definition Classes
    LazyPublisher → Publisher
  72. def validate(): Unit
    Definition Classes
    UIElement
  73. def visible: Boolean
    Definition Classes
    UIElement
  74. def visible_=(b: Boolean): Unit
    Definition Classes
    UIElement
  75. val wholeWindowScope: Int