Packages

  • package root
    Definition Classes
    root
  • package de
    Definition Classes
    root
  • package h2b
    Definition Classes
    de
  • package scala
    Definition Classes
    h2b
  • package lib
    Definition Classes
    scala
  • package simgraf

    This is a Scala library of graphics utilities.

    This is a Scala library of graphics utilities. It is focused on simple drawing of shapes and functions without the need of instructing the graphics system by a dozen or so settings before a simple picture is shown. It is not meant to program graphical user interfaces with buttons, menus and so on.

    The World

    A World provides graphics in world coordinates. For instance,

    val w = World(p1, p2)(p0, w, h, title)

    defines a world that has a coordinate system with a Point p1 in the lower-left corner and the upper-right corner at p2. All operations ensure clipping to that area, so that it is safe to use coordinates outside of it.

    The second parameter group defines the location on the screen: p0 denotes the upper left Pixel, w and h the width and the height of the window in pixels and title gives a window title (that will not reduce the drawing area).

    A Point defines a location in the world coordinate system using two doubles, while a Pixel denotes a location on the screen by means of two integers.

    Note that the y axis of the world coordinate system is directed from bottom to top while at the screen level it is vice versa.

    So, for example

    val w = World(Point(-100,-100), Point(100,100))(Pixel(0,0), 200, 200, "Circle")

    defines a world with x and y axis both ranging from -100 to +100 shown in a window of size 200x200 pixels at the upper left corner of the screen titled "Circle".

    Once you have a world, you can execute several methods on it: plot a point or clear the world to a specified color, use moveTo or drawTo for plotter-like operations and -- at the highest abstraction -- draw or fill shapes of type Drawable or Fillable, respectively.

    Each world maintains an activeColor which can be set and is used for most drawings and fillings until it is changed (except for those that use their own color).

    To fill a circle of color Magenta and radius 75.0 around the origin of our world w on a white background, we write:

    w.clear(Color.White)
    w.activeColor = Color.Magenta
    w.fill(Circle(Point(0,0), 75.0))

    That's it: with these three lines of code and the definition of w above you get a graphic on the screen.

    The Screen

    A Screen provides direct pixel graphics. It is the back end of World.

    It can be used on its own if no world coordinate system is needed and bare screen-pixel coordinates shall be applied instead. Though, there are no fancy general shape-oriented draw and fill operations as World has to offer, but only some primitives like setPixel, drawLine, drawSquare, fillSquare, moveTo or drawTo.

    Definition Classes
    lib
  • package driver
    Definition Classes
    simgraf
  • package event

    This package constitutes a high-level abstraction of input (e.g., keyboard or mouse) events using an actor event bus.

    This package constitutes a high-level abstraction of input (e.g., keyboard or mouse) events using an actor event bus.

    Such events, if triggered by the drivers, are published to the global event stream of this package and can be retrieved by subscribing to the stream object.

    Also, there is a Subscriber actor that can be used to handle events. Since version 1.3.0, it's companion object defines to methods for screens and worlds with a PartialFunction[Event, Unit] as a parameter.

    So, for example, you just can write

    	  Subscriber.to(world) {
    	    case e: Event ⇒ println(e)
    	  }

    to print out all events occurring on the specified world.

    To get the triggering enabled, the withEvents factory methods of World or Screen have to be used.

    Note that the program doesn't terminate by itself on closing all screens if the event package is used. This is due to background processes still listening to the event stream. For explicit termination call the terminate method on the package object's system value; this can be done, e. g., by subscribing to all screens or worlds and using a termination event like this:

    Subscriber.to(world1, world2) {
      case KeyEvent(k) if k=='q' ⇒
        world1.screen.close()
        world2.screen.close()
        println("terminating...")
        system.terminate()
      case _: Event ⇒ ()
    }
    Definition Classes
    simgraf
    Since

    1.2.0

  • package layout

    A package collecting some tools for positioning elements on the screen.

    A package collecting some tools for positioning elements on the screen.

    It contains a Cell (a rectangular area) and a GridLayout of cells organized into rows and columns as this:

    ----------------------------
    | cell | cell | cell | ... |
    ----------------------------
    | cell | cell | cell | ... |
    ----------------------------
    | cell | cell | cell | ... |
    ----------------------------
    | ...  | ...  | ...  | ... |
    ----------------------------
    

    Various factory methods are provided that construct grid layouts from a sample cell, within a cell or on the whole screen.

    Definition Classes
    simgraf
    Since

    1.1.0

  • package shapes

    Shapes are used for the World's draw and fill methods.

    Shapes are used for the World's draw and fill methods. A shape can extend the Shape.Drawable or Shape.Fillable trait or both, which makes it applicable to the according method.

    The package comes with a variety of predefined shapes ranging from simple figures like Line, Rectangle or Circle to higher-order ones like Function or even Grid which draws a simple coordinate system into the world.

    Of course, you can define your own shapes. Just implement the Shape.Drawable or Shape.Fillable trait(s).

    Definition Classes
    simgraf
  • Color
  • ColorIterator
  • Pixel
  • Point
  • PointStore
  • Screen
  • World

class ColorIterator extends Iterator[Color]

Provides an iterator over standard colors.

The iterator cycles over the available color sequence, so it always has a next color.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ColorIterator
  2. Iterator
  3. TraversableOnce
  4. GenTraversableOnce
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class GroupedIterator[B >: A] extends AbstractIterator[Seq[B]] with Iterator[Seq[B]]
    Definition Classes
    Iterator

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def ++[B >: Color](that: ⇒ GenTraversableOnce[B]): Iterator[B]
    Definition Classes
    Iterator
  4. def /:[B](z: B)(op: (B, Color) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  5. def :\[B](z: B)(op: (Color, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  6. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. def addString(b: StringBuilder): StringBuilder
    Definition Classes
    TraversableOnce
  8. def addString(b: StringBuilder, sep: String): StringBuilder
    Definition Classes
    TraversableOnce
  9. def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder
    Definition Classes
    TraversableOnce
  10. def aggregate[B](z: ⇒ B)(seqop: (B, Color) ⇒ B, combop: (B, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. def buffered: BufferedIterator[Color]
    Definition Classes
    Iterator
  13. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. def collect[B](pf: PartialFunction[Color, B]): Iterator[B]
    Definition Classes
    Iterator
    Annotations
    @migration
    Migration

    (Changed in version 2.8.0) collect has changed. The previous behavior can be reproduced with toSeq.

  15. def collectFirst[B](pf: PartialFunction[Color, B]): Option[B]
    Definition Classes
    TraversableOnce
  16. def contains(elem: Any): Boolean
    Definition Classes
    Iterator
  17. def copyToArray[B >: Color](xs: Array[B], start: Int, len: Int): Unit
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  18. def copyToArray[B >: Color](xs: Array[B]): Unit
    Definition Classes
    TraversableOnce → GenTraversableOnce
  19. def copyToArray[B >: Color](xs: Array[B], start: Int): Unit
    Definition Classes
    TraversableOnce → GenTraversableOnce
  20. def copyToBuffer[B >: Color](dest: Buffer[B]): Unit
    Definition Classes
    TraversableOnce
  21. def corresponds[B](that: GenTraversableOnce[B])(p: (Color, B) ⇒ Boolean): Boolean
    Definition Classes
    Iterator
  22. def count(p: (Color) ⇒ Boolean): Int
    Definition Classes
    TraversableOnce → GenTraversableOnce
  23. def drop(n: Int): Iterator[Color]
    Definition Classes
    Iterator
  24. def dropWhile(p: (Color) ⇒ Boolean): Iterator[Color]
    Definition Classes
    Iterator
  25. def duplicate: (Iterator[Color], Iterator[Color])
    Definition Classes
    Iterator
  26. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  28. val exclude: Seq[Color]
  29. def exists(p: (Color) ⇒ Boolean): Boolean
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  30. def filter(p: (Color) ⇒ Boolean): Iterator[Color]
    Definition Classes
    Iterator
  31. def filterNot(p: (Color) ⇒ Boolean): Iterator[Color]
    Definition Classes
    Iterator
  32. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  33. def find(p: (Color) ⇒ Boolean): Option[Color]
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  34. def flatMap[B](f: (Color) ⇒ GenTraversableOnce[B]): Iterator[B]
    Definition Classes
    Iterator
  35. def fold[A1 >: Color](z: A1)(op: (A1, A1) ⇒ A1): A1
    Definition Classes
    TraversableOnce → GenTraversableOnce
  36. def foldLeft[B](z: B)(op: (B, Color) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  37. def foldRight[B](z: B)(op: (Color, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  38. def forall(p: (Color) ⇒ Boolean): Boolean
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  39. def foreach[U](f: (Color) ⇒ U): Unit
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  40. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  41. def grouped[B >: Color](size: Int): GroupedIterator[B]
    Definition Classes
    Iterator
  42. def hasDefiniteSize: Boolean
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  43. def hasNext: Boolean
    Definition Classes
    ColorIterator → Iterator
  44. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  45. def indexOf[B >: Color](elem: B, from: Int): Int
    Definition Classes
    Iterator
  46. def indexOf[B >: Color](elem: B): Int
    Definition Classes
    Iterator
  47. def indexWhere(p: (Color) ⇒ Boolean, from: Int): Int
    Definition Classes
    Iterator
  48. def indexWhere(p: (Color) ⇒ Boolean): Int
    Definition Classes
    Iterator
  49. def isEmpty: Boolean
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  50. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  51. def isTraversableAgain: Boolean
    Definition Classes
    Iterator → GenTraversableOnce
  52. def length: Int
    Definition Classes
    Iterator
  53. def map[B](f: (Color) ⇒ B): Iterator[B]
    Definition Classes
    Iterator
  54. def max[B >: Color](implicit cmp: Ordering[B]): Color
    Definition Classes
    TraversableOnce → GenTraversableOnce
  55. def maxBy[B](f: (Color) ⇒ B)(implicit cmp: Ordering[B]): Color
    Definition Classes
    TraversableOnce → GenTraversableOnce
  56. def min[B >: Color](implicit cmp: Ordering[B]): Color
    Definition Classes
    TraversableOnce → GenTraversableOnce
  57. def minBy[B](f: (Color) ⇒ B)(implicit cmp: Ordering[B]): Color
    Definition Classes
    TraversableOnce → GenTraversableOnce
  58. def mkString: String
    Definition Classes
    TraversableOnce → GenTraversableOnce
  59. def mkString(sep: String): String
    Definition Classes
    TraversableOnce → GenTraversableOnce
  60. def mkString(start: String, sep: String, end: String): String
    Definition Classes
    TraversableOnce → GenTraversableOnce
  61. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  62. def next(): Color
    Definition Classes
    ColorIterator → Iterator
  63. def nonEmpty: Boolean
    Definition Classes
    TraversableOnce → GenTraversableOnce
  64. final def notify(): Unit
    Definition Classes
    AnyRef
  65. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  66. def padTo[A1 >: Color](len: Int, elem: A1): Iterator[A1]
    Definition Classes
    Iterator
  67. def partition(p: (Color) ⇒ Boolean): (Iterator[Color], Iterator[Color])
    Definition Classes
    Iterator
  68. def patch[B >: Color](from: Int, patchElems: Iterator[B], replaced: Int): Iterator[B]
    Definition Classes
    Iterator
  69. def product[B >: Color](implicit num: Numeric[B]): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  70. def reduce[A1 >: Color](op: (A1, A1) ⇒ A1): A1
    Definition Classes
    TraversableOnce → GenTraversableOnce
  71. def reduceLeft[B >: Color](op: (B, Color) ⇒ B): B
    Definition Classes
    TraversableOnce
  72. def reduceLeftOption[B >: Color](op: (B, Color) ⇒ B): Option[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  73. def reduceOption[A1 >: Color](op: (A1, A1) ⇒ A1): Option[A1]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  74. def reduceRight[B >: Color](op: (Color, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  75. def reduceRightOption[B >: Color](op: (Color, B) ⇒ B): Option[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  76. def reversed: List[Color]
    Attributes
    protected[this]
    Definition Classes
    TraversableOnce
  77. def sameElements(that: Iterator[_]): Boolean
    Definition Classes
    Iterator
  78. def scanLeft[B](z: B)(op: (B, Color) ⇒ B): Iterator[B]
    Definition Classes
    Iterator
  79. def scanRight[B](z: B)(op: (Color, B) ⇒ B): Iterator[B]
    Definition Classes
    Iterator
  80. def seq: Iterator[Color]
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  81. def size: Int
    Definition Classes
    TraversableOnce → GenTraversableOnce
  82. def sizeHintIfCheap: Int
    Attributes
    protected[scala.collection]
    Definition Classes
    GenTraversableOnce
  83. def slice(from: Int, until: Int): Iterator[Color]
    Definition Classes
    Iterator
  84. def sliceIterator(from: Int, until: Int): Iterator[Color]
    Attributes
    protected
    Definition Classes
    Iterator
  85. def sliding[B >: Color](size: Int, step: Int): GroupedIterator[B]
    Definition Classes
    Iterator
  86. def span(p: (Color) ⇒ Boolean): (Iterator[Color], Iterator[Color])
    Definition Classes
    Iterator
  87. def sum[B >: Color](implicit num: Numeric[B]): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  88. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  89. def take(n: Int): Iterator[Color]
    Definition Classes
    Iterator
  90. def takeWhile(p: (Color) ⇒ Boolean): Iterator[Color]
    Definition Classes
    Iterator
  91. def to[Col[_]](implicit cbf: CanBuildFrom[Nothing, Color, Col[Color]]): Col[Color]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  92. def toArray[B >: Color](implicit arg0: ClassTag[B]): Array[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  93. def toBuffer[B >: Color]: Buffer[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  94. def toIndexedSeq: IndexedSeq[Color]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  95. def toIterable: Iterable[Color]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  96. def toIterator: Iterator[Color]
    Definition Classes
    Iterator → GenTraversableOnce
  97. def toList: List[Color]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  98. def toMap[T, U](implicit ev: <:<[Color, (T, U)]): Map[T, U]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  99. def toSeq: Seq[Color]

    Converts this iterator to a sequence.

    Converts this iterator to a sequence.

    Although this iterator is of infinite size, this version of toSeq terminates and returns the underlying color sequence.

    Definition Classes
    ColorIterator → TraversableOnce → GenTraversableOnce
  100. def toSet[B >: Color]: Set[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  101. def toStream: Stream[Color]
    Definition Classes
    Iterator → GenTraversableOnce
  102. def toString(): String
    Definition Classes
    Iterator → AnyRef → Any
  103. def toTraversable: Traversable[Color]
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  104. def toVector: Vector[Color]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  105. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  106. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  107. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  108. def withFilter(p: (Color) ⇒ Boolean): Iterator[Color]
    Definition Classes
    Iterator
  109. def zip[B](that: Iterator[B]): Iterator[(Color, B)]
    Definition Classes
    Iterator
  110. def zipAll[B, A1 >: Color, B1 >: B](that: Iterator[B], thisElem: A1, thatElem: B1): Iterator[(A1, B1)]
    Definition Classes
    Iterator
  111. def zipWithIndex: Iterator[(Color, Int)]
    Definition Classes
    Iterator

Inherited from Iterator[Color]

Inherited from TraversableOnce[Color]

Inherited from GenTraversableOnce[Color]

Inherited from AnyRef

Inherited from Any

Ungrouped