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 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
  • package parallel

    This package provides parallel versions of some shapes.

    This package provides parallel versions of some shapes.

    These shapes have the same interface as their sequential counterparts.

    By implementing the FutureTracking trait, some control is given when some concurrent operation is done.

    Definition Classes
    shapes
    Since

    1.1.0

  • Arc
  • Circle
  • Collage
  • Coloring
  • Dot
  • Drawable
  • Ellipse
  • Enclosing
  • Fillable
  • Function
  • Grid
  • Line
  • MultivaluedFunction
  • Plus
  • Polygonal
  • Rectangle
  • Shape
  • Square
  • Text

case class Rectangle(p1: Point, p2: Point) extends Drawable with Fillable with Product with Serializable

A rectangle specified by diagonal opposite corners.

Linear Supertypes
Serializable, Serializable, Product, Equals, Fillable, Drawable, Shape, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Rectangle
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Fillable
  7. Drawable
  8. Shape
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Rectangle(p1: Point, p2: Point)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def draw(w: World): Unit

    Draws this shape within the specified world using its active color.

    Draws this shape within the specified world using its active color.

    Definition Classes
    RectangleDrawable
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def fill(w: World): Unit

    Fills this shape within the specified world using its active color.

    Fills this shape within the specified world using its active color.

    Definition Classes
    RectangleFillable
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  15. val p1: Point
  16. val p2: Point
  17. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  18. def union(other: Shape): Collage

    Puts this shape and the specified other shape into a collage, starting with this shape.

    Puts this shape and the specified other shape into a collage, starting with this shape.

    Definition Classes
    Shape
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Fillable

Inherited from Drawable

Inherited from Shape

Inherited from AnyRef

Inherited from Any

Ungrouped