scalafx.event

MultipleShapeDrawingDemo

object MultipleShapeDrawingDemo extends JFXApp

Demo illustrating use of event handler subscription.

User can draw rectangles, ellipses, or lines. Shape type is selected by pressing corresponding toggle button. For the sake of simplicity of the demo code, only one instance of shape of each type is used. User draws a shape by pressing and dragging a mouse.

Each shape type has its own mouse event handler. Only one handler is used at a time. Handlers are implemented using a simple method MouseEvent => Unit. When switching handlers, previous handler, if any, is cancelled using a Subscription pattern.

Linear Supertypes
JFXApp, DelayedInit, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MultipleShapeDrawingDemo
  2. JFXApp
  3. DelayedInit
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. trait MouseHandler extends AnyRef

  2. trait ShapeDrawInteractor extends MouseHandler

    Encapsulates common behaviour of interaction when drawing a shape based on two points.

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object EllipseInteractor extends ShapeDrawInteractor

    Handles drawing of ellipses

  7. object LineInteractor extends ShapeDrawInteractor

    Handles drawing of lines

  8. object RectangleInteractor extends ShapeDrawInteractor

    Handles drawing of rectangles

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def delayedInit(x: ⇒ Unit): Unit

    Definition Classes
    JFXApp → DelayedInit
  12. val drawingPane: Pane

  13. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  18. var init: () ⇒ Unit

    Definition Classes
    JFXApp
  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. def main(args: Array[String]): Unit

    Definition Classes
    JFXApp
  21. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  24. lazy val parameters: Parameters

    Attributes
    protected
    Definition Classes
    JFXApp
  25. var stage: PrimaryStage

    Definition Classes
    JFXApp
  26. def stopApp(): Unit

    Definition Classes
    JFXApp
  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  28. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from JFXApp

Inherited from DelayedInit

Inherited from AnyRef

Inherited from Any

Ungrouped