object mutable
This package contains the version of View
s that we primarily use in O1: views to
mutable domain models.
The top-level package o1 provides an alias to the ViewFrame class in this
package, so it is available to students as View
simply by importing o1._
.
There is an alternative implementation of View
s in o1.gui.immutable.
- Alphabetic
- By Inheritance
- mutable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait HasReplaceableModel[Model] extends HasModelField[Model]
Add this trait on a view to enable discarding its model object for another.
- type View[Model <: AnyRef] = ViewFrame[Model]
An alias for ViewFrame, which is the default sort of
View
.An alias for ViewFrame, which is the default sort of
View
. (Cf. the alternative, ViewComponent.) - abstract class ViewComponent[Model <: AnyRef] extends ViewImpl.ViewComponent[Model] with ControlDefaults[Model]
A Swing-embeddable view (complete with a picture, a ticking clock, event handlers, etc.).
- abstract class ViewFrame[Model <: AnyRef] extends ViewImpl.ViewFrame[Model] with ControlDefaults[Model]
This class provides a framework for building simple GUIs.
This class provides a framework for building simple GUIs. Each instance of the class is a graphical view to an object that represents a particular domain; that object is the model of the view. A
ViewFrame
displays the model as graphics within a GUI frame.This class is available under the alias
View
in the top-level package o1, so students can access it simply by importingo1._
.The key method in the class is makePic, which the view calls automatically and repeatedly to determine which Pic to display in the frame at each moment in time. Concrete view objects must add an implementation for this abstract method.
A view listens to GUI events within the frame, but it doesn’t really do anything when notified of an event; concrete instances of the class can override this behavior by overriding one of the “on methods” (
onClick
,onMouseMove
, etc.). The view also runs an internal clock and can react to the passing of time (onTick
).Just creating a view object is not enough to display it onscreen and start the clock; see the start method.
- Model
the type of the model object
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString: String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.