Packages

  • package root

    ScalaFX is a UI DSL written within the Scala Language that sits on top of JavaFX 2.x and and JavaFX 8.

    ScalaFX is a UI DSL written within the Scala Language that sits on top of JavaFX 2.x and and JavaFX 8. This means that every ScalaFX application is also a valid Scala application. By extension it supports full interoperability with Java and can run anywhere the Java Virtual Machine (JVM) and JavaFX 2.0 or JavaFX 8 are supported.

    Package Structure

    ScalaFX package structure corresponds to JavaFX package structure, for instance scalafx.animation corresponds to javafx.animation.

    Example Usage

    A basic ScalaFX application is created creating an object that is an instance of JFXApp. Following Java FX theatre metaphor, it contains a stage that contains a scene. A stage roughly corresponds to a window in a typical UI environment. The scene holds UI content presented to the user. In the example below, the content is a pane with a single label component.

    package hello
    
    import scalafx.application.JFXApp
    import scalafx.application.JFXApp.PrimaryStage
    import scalafx.geometry.Insets
    import scalafx.scene.Scene
    import scalafx.scene.control.Label
    import scalafx.scene.layout.BorderPane
    
    object HelloWorld extends JFXApp {
      stage = new PrimaryStage {
        title = "Hello"
        scene = new Scene {
          root = new BorderPane {
            padding = Insets(25)
            center = new Label("Hello World")
          }
        }
      }
    }
    Definition Classes
    root
  • package scalafx

    Base package for ScalaFX classes.

    Base package for ScalaFX classes.

    Definition Classes
    root
  • package scene

    Wraps javafx.scene package.

    Wraps javafx.scene package.

    Definition Classes
    scalafx
  • package canvas

    Wraps javafx.scene.canvas package.

    Wraps javafx.scene.canvas package.

    Definition Classes
    scene
  • Canvas
  • CanvasIncludes
  • GraphicsContext

class GraphicsContext extends SFXDelegate[javafx.scene.canvas.GraphicsContext]

Source
GraphicsContext.scala
Linear Supertypes
SFXDelegate[javafx.scene.canvas.GraphicsContext], AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GraphicsContext
  2. SFXDelegate
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new GraphicsContext(delegate: javafx.scene.canvas.GraphicsContext)

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. def appendSVGPath(s: String): Unit

    Appends an SVG Path string to the current path.

  5. def applyEffect(e: Effect): Unit

    Applies the given effect to the entire canvas.

  6. def arc(centerX: Double, centerY: Double, radiusX: Double, radiusY: Double, startAngle: Double, length: Double): Unit

    Adds path elements to the current path to make an arc that uses Euclidean degrees.

  7. def arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double): Unit

    Adds segments to the current path to make an arc.

  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def beginPath(): Unit

    Starts a Path

  10. def bezierCurveTo(xc1: Double, yc1: Double, xc2: Double, yc2: Double, x1: Double, y1: Double): Unit

    Adds segments to the current path to make a cubic bezier curve.

  11. def canvas: Canvas

    Gets the Canvas that the GraphicsContext is issuing draw commands to.

  12. def clearRect(x: Double, y: Double, w: Double, h: Double): Unit

    Clears a portion of the canvas with a transparent color value.

  13. def clip(): Unit

    Clips using the current path

  14. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  15. def closePath(): Unit

    Closes the path.

  16. val delegate: javafx.scene.canvas.GraphicsContext

    JavaFX object to be wrapped.

    JavaFX object to be wrapped.

    Definition Classes
    GraphicsContextSFXDelegate
  17. def drawImage(img: Image, sx: Double, sy: Double, sw: Double, sh: Double, dx: Double, dy: Double, dw: Double, dh: Double): Unit

    Draws the current source rectangle of the given image to the given destination rectangle of the Canvas.

  18. def drawImage(img: Image, x: Double, y: Double, w: Double, h: Double): Unit

    Draws an image into the given destination rectangle of the canvas.

  19. def drawImage(img: Image, x: Double, y: Double): Unit

    Draws an image at the given x, y position using the width and height of the given image.

  20. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. def equals(ref: Any): Boolean

    Verifies if a object is equals to this delegate.

    Verifies if a object is equals to this delegate.

    ref

    Object to be compared.

    returns

    if the other object is equals to this delegate or not.

    Definition Classes
    SFXDelegate → AnyRef → Any
  22. def fill: Paint

    the current fill attribute.

  23. def fillArc(x: Double, y: Double, w: Double, h: Double, startAngle: Double, arcExtent: Double, closure: ArcType): Unit

    Fills an arc using the current fill paint.

  24. def fillOval(x: Double, y: Double, w: Double, h: Double): Unit

    Fills an oval using the current fill paint.

  25. def fillPath(): Unit

    Fills the path with the current fill paint.

    Fills the path with the current fill paint. This method is correspondent to fill() method in JavaFx class.

  26. def fillPolygon(points: Seq[(Double, Double)]): Unit

    Fills a polygon with the given points using the currently set fill paint.

  27. def fillPolygon(xPoints: Array[Double], yPoints: Array[Double], nPoints: Int): Unit

    Fills a polygon with the given points using the currently set fill paint.

  28. def fillRect(x: Double, y: Double, w: Double, h: Double): Unit

    Fills a rectangle using the current fill paint.

  29. def fillRoundRect(x: Double, y: Double, w: Double, h: Double, arcWidth: Double, arcHeight: Double): Unit

    Fills a rounded rectangle using the current fill paint.

  30. def fillRule: FillRule

    the filling rule constant for determining the interior of the path.

  31. def fillRule_=(fillRule: FillRule): Unit
  32. def fillText(text: String, x: Double, y: Double, maxWidth: Double): Unit

    Fills text and includes a maximum width of the string.

  33. def fillText(text: String, x: Double, y: Double): Unit

    Fills the given string of text at position x, y (0,0 at top left) with the current fill paint attribute.

  34. def fill_=(p: Paint): Unit
  35. def font: Font

    the current Font.

  36. def font_=(f: Font): Unit
  37. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  38. def getEffect(e: Effect): Effect

    Gets a copy of the effect to be applied after the next draw call.

  39. def getTransform(xform: Affine): Affine

    Returns a copy of the current transform.

  40. def getTransform: Affine

    Returns a copy of the current transform.

  41. def globalAlpha: Double

    the current global alpha.

  42. def globalAlpha_=(alpha: Double): Unit
  43. def globalBlendMode: BlendMode

    the global blend mode.

  44. def globalBlendMode_=(op: BlendMode): Unit
  45. def hashCode(): Int

    returns

    The delegate hashcode

    Definition Classes
    SFXDelegate → AnyRef → Any
  46. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  47. def lineCap: StrokeLineCap

    the current stroke line cap.

  48. def lineCap_=(cap: StrokeLineCap): Unit
  49. def lineJoin: StrokeLineJoin

    the current stroke line join.

  50. def lineJoin_=(join: StrokeLineJoin): Unit
  51. def lineTo(x1: Double, y1: Double): Unit

    Adds segments to the current path to make a line at the given x,y coordinate.

  52. def lineWidth: Double

    the current line width.

  53. def lineWidth_=(lw: Double): Unit
  54. def miterLimit: Double

    the current miter limit.

  55. def miterLimit_=(ml: Double): Unit
  56. def moveTo(x0: Double, y0: Double): Unit

    Issues a move command for the current path to the given x,y coordinate.

  57. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  58. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  59. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  60. def pixelWriter: PixelWriter

    Returns a PixelWriter object that can be used to modify the pixels of the Canvas associated with this GraphicsContext.

  61. def pointInPath(x: Double, y: Double): Boolean

    Returns true if the the given x,y point is inside the path.

  62. def quadraticCurveTo(xc: Double, yc: Double, x1: Double, y1: Double): Unit

    Adds segments to the current path to make a quadratic curve.

  63. def rect(x: Double, y: Double, w: Double, h: Double): Unit

    Adds path elements to the current path to make a rectangle.

  64. def restore(): Unit

    Pops the state off of the stack, setting the following attributes to their value at the time when that state was pushed onto the stack.

  65. def rotate(degrees: Double): Unit

    Rotates the current transform in degrees.

  66. def save(): Unit

    Saves the following attributes onto a stack.

  67. def scale(x: Double, y: Double): Unit

    Scales the current transform by x, y.

  68. def setEffect(e: Effect): Unit

    Sets the effect to be applied after the next draw call, or null to disable effects.

  69. def setTransform(mxx: Double, myx: Double, mxy: Double, myy: Double, mxt: Double, myt: Double): Unit

    Sets the current transform.

  70. def setTransform(xform: Affine): Unit

    Sets the current transform.

  71. def stroke: Paint

    the current stroke.

  72. def strokeArc(x: Double, y: Double, w: Double, h: Double, startAngle: Double, arcExtent: Double, closure: ArcType): Unit

    Strokes an Arc using the current stroke paint.

  73. def strokeLine(x1: Double, y1: Double, x2: Double, y2: Double): Unit

    Strokes a line using the current stroke paint.

  74. def strokeOval(x: Double, y: Double, w: Double, h: Double): Unit

    Strokes an oval using the current stroke paint.

  75. def strokePath(): Unit

    Strokes the path with the current stroke paint.

    Strokes the path with the current stroke paint. This method is correspondent to stroke() method in JavaFx class.

  76. def strokePolygon(points: Seq[(Double, Double)]): Unit

    Strokes a polygon with the given points using the currently set stroke paint.

  77. def strokePolygon(xPoints: Array[Double], yPoints: Array[Double], nPoints: Int): Unit

    Strokes a polygon with the given points using the currently set stroke paint.

  78. def strokePolyline(points: Seq[(Double, Double)]): Unit

    Draws a polyline with the given points using the currently set stroke paint attribute.

  79. def strokePolyline(xPoints: Array[Double], yPoints: Array[Double], nPoints: Int): Unit

    Draws a polyline with the given points using the currently set stroke paint attribute.

  80. def strokeRect(x: Double, y: Double, w: Double, h: Double): Unit

    Strokes a rectangle using the current stroke paint.

  81. def strokeRoundRect(x: Double, y: Double, w: Double, h: Double, arcWidth: Double, arcHeight: Double): Unit

    Strokes a rounded rectangle using the current stroke paint.

  82. def strokeText(text: String, x: Double, y: Double, maxWidth: Double): Unit

    Draws text with stroke paint and includes a maximum width of the string.

  83. def strokeText(text: String, x: Double, y: Double): Unit

    draws the given string of text at position x, y (0,0 at top left) with the current stroke paint attribute.

  84. def stroke_=(s: Paint): Unit
  85. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  86. def textAlign: TextAlignment

    the current TextAlignment.

  87. def textAlign_=(align: TextAlignment): Unit
  88. def textBaseline: VPos

    the current Text Baseline.

  89. def textBaseline_=(baseline: VPos): Unit
  90. def toString(): String

    returns

    Returns the original delegate's toString() adding a [SFX] prefix.

    Definition Classes
    SFXDelegate → AnyRef → Any
  91. def transform(mxx: Double, myx: Double, mxy: Double, myy: Double, mxt: Double, myt: Double): Unit

    Concatenates the input with the current transform.

  92. def transform(xform: Affine): Unit

    Concatenates the input with the current transform.

  93. def translate(x: Double, y: Double): Unit

    Translates the current transform by x, y.

  94. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  95. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  96. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from SFXDelegate[javafx.scene.canvas.GraphicsContext]

Inherited from AnyRef

Inherited from Any

Ungrouped