Trait

ch.waan.mcddpui.api

View

Related Doc: package api

Permalink

trait View[T] extends AnyRef

base trait for all views.

This trait does not discriminate between multi-frame and single-view UI solutions.

View Life-Cycle

A view be either unbound or bound and unpacked or packed.

The binding state of a view describes whether or not a view is bound to a CommandExecutor. Whenever a view is unbound, no reference to an executor may be retained and no commands may be dispatched from the view. Whenever a view is bound, it must retain a reference to exactly one executor. This is the executor the view may dispatch commands to. As long as a view is bound, it may dispatch commands.

The packing state of a view describes whether or not a view is active. An active (unpacked) view must be visible and focused. Interactions with the view are allowed, and the view must be bound. At any time exactly one view may be active. An inactive (packed) view may be visible or invisible, however no direct interaction with the view is allowed. An inactive view may therefore never dispatch any commands - even when bound. There is however one exception to this rule:

Transitions
  1. When starting the application, all views should be constructed and initialised as far as possible. After startup all views should be packed and unbound
  2. When a view enters the view stack, it is bound but remains packed
  3. When a view reaches the top of the stack, it is bound and unpacked
  4. When a view leaves the top of the stack, it is bound and packed
  5. When a view leaves the view stack, it is unbound and packed
Updates

During UI updates the views are updated in the order they appear in the view stack. If a view is applicable to multiple entries in the view stack, the top-most one will be used. If multiple view are applicable to the same entry, the first matching view is used. The views are checked in the order they were registered.

The update cycle operates according to a simple procedure:

  1. Try to assign a view to every entry in the view stack. Entries near the head of the view stack are prioritised, and views are prioritised in the order they were registered.
  2. Assert that the top-most entry of the view stack has a view assigned.
  3. Pack the view that was previously assigned to the top-most entry of the stack if it it is not again assigned to the top-most element.
  4. Unbind all views that were assigned previously, that have no (new assignment).
  5. Update all assigned views.
  6. Bind all views that previously had no assignment.
  7. Unpack the view assigned to the top-most element if it is packed.
T

the data type of the data structure

Version

1.1 (0.2.0), 2016-03-02

Since

MCDDPUI 0.2.0

Linear Supertypes
AnyRef, Any
Known Subclasses
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. View
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def bind(executor: CommandExecutor[UIUniverse[T]]): Unit

    Permalink

    binds the view to a CommandExecutor

    binds the view to a CommandExecutor

    this method may only be called when the view is unbound

    executor

    the executor to bind the view to. may not be null

    Annotations
    @throws( ... ) @throws( ... )
    Exceptions thrown

    IllegalStateException if the view is already bound

    NullPointerException if the executor is null

  2. abstract def isApplicable(v: ViewData): Boolean

    Permalink

    checks if the view is applicable to the given ViewData instance

    checks if the view is applicable to the given ViewData instance

    This is used to assign views to elements in the view stack.

    v

    the ViewData instance to check the applicability for

    returns

    true if this view is applicable to the given v. false otherwise

  3. abstract def isBound: Boolean

    Permalink

    indicates whether the view is currently bound or unbound

  4. abstract def isPacked: Boolean

    Permalink

    indicates whether the view is currently packed or unpacked

  5. abstract def pack: Unit

    Permalink

    packs the view

    packs the view

    this method may only be called when the view is unpacked

    Annotations
    @throws( ... )
    Exceptions thrown

    IllegalStateException if the view is already packed

  6. abstract def unbind: Unit

    Permalink

    unbinds the view from the currently bound CommandExecutor

    unbinds the view from the currently bound CommandExecutor

    this method may only be called when the view is bound

    Annotations
    @throws( ... )
    Exceptions thrown

    IllegalStateException if the view is already unbound

  7. abstract def unpack: Unit

    Permalink

    unpacks the view

    unpacks the view

    this method may only be called when the view is packed

    Annotations
    @throws( ... )
    Exceptions thrown

    IllegalStateException if the view is already unpacked

  8. abstract def update(data: T, viewData: ViewData, props: HashMap[String, String]): Unit

    Permalink

    updates the view

    updates the view

    data

    the operational data to update from

    viewData

    the ViewData instance the view is assigned to

    props

    the global UI property hash map

    Annotations
    @throws( ... )
    Exceptions thrown

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from View[T] to any2stringadd[View[T]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (View[T], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from View[T] to ArrowAssoc[View[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (View[T]) ⇒ Boolean, msg: ⇒ Any): View[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from View[T] to Ensuring[View[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (View[T]) ⇒ Boolean): View[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from View[T] to Ensuring[View[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ Any): View[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from View[T] to Ensuring[View[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): View[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from View[T] to Ensuring[View[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from View[T] to StringFormat[View[T]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. def [B](y: B): (View[T], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from View[T] to ArrowAssoc[View[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from View[T] to any2stringadd[View[T]]

Inherited by implicit conversion StringFormat from View[T] to StringFormat[View[T]]

Inherited by implicit conversion Ensuring from View[T] to Ensuring[View[T]]

Inherited by implicit conversion ArrowAssoc from View[T] to ArrowAssoc[View[T]]

Ungrouped