Commit 540c4883 authored by h2b's avatar h2b

Cell-based factory methods added to screen.

parent 8f5c5856
......@@ -20,6 +20,7 @@ package de.h2b.scala.lib.simgraf
import scala.concurrent.Future
import de.h2b.scala.lib.simgraf.driver.{ AwtScreenDriver, ScreenDriver }
import de.h2b.scala.lib.simgraf.layout.Cell
/**
* Provides screen (pixel) graphics.
......@@ -298,9 +299,17 @@ object Screen {
* defaults to empty string)
* @return a new screen based on a default driver
*/
def apply (p0: Pixel, width: Int, height: Int, title: String = ""): Screen =
def apply (p0: Pixel, width: Int, height: Int, title: String = ""): Screen =
awt(p0, width, height, title)
/**
* @param cell defines location, width and height of this screen
* @param title window title (will not reduce the drawing area)
* @return a new screen based on AWT driver
*/
def apply (cell: Cell, title: String): Screen =
apply(cell.origin, cell.width, cell.height, title)
/**
* @param p0 location of the upper-left corner on the screen
* @param width horizontal dimension
......@@ -312,5 +321,13 @@ object Screen {
def awt (p0: Pixel, width: Int, height: Int, title: String = ""): Screen =
new Screen(p0, width, height, title) with AwtScreenDriver
/**
* @param cell defines location, width and height of this screen
* @param title window title (will not reduce the drawing area)
* @return a new screen based on AWT driver
*/
def awt (cell: Cell, title: String): Screen =
awt(cell.origin, cell.width, cell.height, title)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment