Arc
is a convenience case class for Arc2D (a subclass of RectangularShape).
The Arrow
class uses Java's Path2D class to create a line with an arrowhead
on the far end.
The Arrow
class uses Java's Path2D class to create a line with an arrowhead
on the far end. The main line is defined by points 'p1' and 'p2'. Points 'p3'
and 'p4' are the corners of the triangular arrowhead.
the starting point for the line/arrow
the ending point for the line/arrow
the length of the arrowhead on the line/arrow
The CurvilinearShape
trait provides a general type for line and curves.
The CurvilinearShape
trait provides a general type for line and curves.
It is analogous to RectangularShape
.
Ellipse
is a convenience case class for Ellipse2D (a subclass of RectangularShape).
Frame
is a convenience class for JFrame
.
The Hexagon class enhances the Path2D.Double class (from the java.awt.geom package) by adding a constructor for building a hexagon given its vertices.
The Hexagon class enhances the Path2D.Double class (from the java.awt.geom package) by adding a constructor for building a hexagon given its vertices.
the six corner points of the hexagon
Line
is a convenience case class for Line2D (a subclass of RectangularShape).
The Octagon class enhances the Path2D.Double class (from the java.awt.geom package) by adding a constructor for building an octagon given its vertices.
The Octagon class enhances the Path2D.Double class (from the java.awt.geom package) by adding a constructor for building an octagon given its vertices.
the eight corner points of the octagon
Panel
is a convenience class for JPanel
.
Path
is a convenience case class for Path2D.
Path
is a convenience case class for Path2D. Its subtypes (case class Polygon, etc.)
are defined in other files in the scala2d package.
The Pentagon class enhances the Path2D.Double class (from the java.awt.geom package) by adding a constructor for building a pentagon given its vertices.
The Pentagon class enhances the Path2D.Double class (from the java.awt.geom package) by adding a constructor for building a pentagon given its vertices.
the five corner points of the pentagon
The Polygon
class enhances the Path2D.Double
class (from the java.awt.geom
package) by adding a constructor for building a polygon given its vertices.
The Polygon
class enhances the Path2D.Double
class (from the java.awt.geom
package) by adding a constructor for building a polygon given its vertices.
the n >= 3 corner points of the polygon
The QArrow
class uses Java's Path2D
class to create a quad curve with an
arrowhead on the far end.
The QArrow
class uses Java's Path2D
class to create a quad curve with an
arrowhead on the far end. The main curve is defined by points 'p1' and 'p2'
along with a control point 'pc'. Points 'p3' and 'p4' are the corners of the
triangular arrowhead.
the starting point for the curve/arc
the control point for the curve/arc
the ending point for the curve/arc
the length of the arrowhead on the curve/arc
The QCurve
class enhances the QuadCurve.Double
class (from the java.awt.geom
package) by allowing entities to move along such quadratic curves as well as
lines.
The QCurve
class enhances the QuadCurve.Double
class (from the java.awt.geom
package) by allowing entities to move along such quadratic curves as well as
lines. Although the curve could be developed as a quadratic function where
'y = ax2 + bx + c'. The following quadratic bezier formulation is used:
p(t) = (x(t), y(t)) = [(1-t)2 * p1] + [2 * (1-t) * t * pc] + [t^2 * p2].
the starting point for the quad curve
the control point for the quad curve
the ending point for the quad curve
whether the quad curve is straight (i.e., a line)
The Quad class enhances the Path2D.Double class (from the java.awt.geom package) by adding a constructor for building a quadrilateral given its vertices.
The Quad class enhances the Path2D.Double class (from the java.awt.geom package) by adding a constructor for building a quadrilateral given its vertices.
the four corner points of the quadrilateral
R2
is a convenience case class for Point2D.
Rectangle
is a convenience case class for Rectangle2D (a subclass of RectangularShape).
RoundRectangle
is a convenience case class for RoundRectangle2D (a subclass of RectangularShape).
ScrollPane
is a convenience class for JScrollPane
.
Table
is a convenience class for JTable
.
The Transform
trait provides a simple technique for transforming
(translation, scaling and rotation) rectangular shapes.
The Triangle class enhances the Path2D.Double class (from the java.awt.geom package) by adding a constructor for building a triangle given its vertices.
The Triangle class enhances the Path2D.Double class (from the java.awt.geom package) by adding a constructor for building a triangle given its vertices.
the three corner points of the triangle
The VizFrame
class puts the canvas in the visualization/drawing frame.
The ArrowTest
object is used to test the Arrow
class.
The Colors
convenience object defines numerous common colors.
The Colors
convenience object defines numerous common colors.
Source of colors: http://www.webmoments.com/colorchart.htm
The ColorsTest
object is used to test the Colors
object.
Useful constants.
The PolygonTest
object tests the Polygon
, Triangle
, Quad
and Hexagon
classes.
The QArrowTest
object is used to test the QArrow
class.
The QCurve
companion object provides formulas used by the QCurve
class.
The QCurveTest
object tests the QCurve
classes' quad curves.
The QCurveTest2
object tests traversals of QCurve
's (quad curves).
The Shapes
object Scala provides type aliases for basic Java2D types.
The scala2d package contains classes, traits and objects for for simple 2D graphics in scala, based upon java_swing, java_awt and java_awt_geom.