object immutable
This package contains a version of View
s that is not much used in O1: views to immutable
domain models. In O1, the other implementation in o1.gui.mutable is more relevant.
- Alphabetic
- By Inheritance
- immutable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type View[Model] = 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] 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] 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 objects that represent the states of a domain model; those states can be (but are not required to be) immutable objects. A
ViewFrame
displays the model as graphics within a GUI frame.Note to students: this is not the view class that we commonly use in O1 but an alternative implementation. For the usual
View
, see here.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.
Please note that even though this class is designed to work with immutable model states, the actual
ViewFrame
is not itself immutable.- Model
the type of the states of the model
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.