Package snap.view

Class LineView

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable

public class LineView extends View
A View subclass to draw a line.
  • Constructor Details

    • LineView

      public LineView()
      Creates a new LineView.
    • LineView

      public LineView(double x0, double y0, double x1, double y1)
      Creates a new LineView for given points.
  • Method Details

    • getX0

      public double getX0()
      Returns the first point x.
    • getY0

      public double getY0()
      Returns the first point y.
    • getX1

      public double getX1()
      Returns the second point x.
    • getY1

      public double getY1()
      Returns the second point y.
    • getLine

      public Line getLine()
      Returns the line.
    • setLine

      public void setLine(double x0, double y0, double x1, double y1)
      Sets the line.
    • setLineInParent

      public void setLineInParent(double x0, double y0, double x1, double y1)
      Sets the line.
    • resetLine

      protected void resetLine()
      Resets the line from bounds.
    • getOriginPos

      public Pos getOriginPos()
      Returns the origin position.
    • getBoundsShape

      public Line getBoundsShape()
      Override to return path as bounds shape.
      Overrides:
      getBoundsShape in class View
    • setWidth

      public void setWidth(double aValue)
      Override to reset line.
      Overrides:
      setWidth in class View
    • setHeight

      public void setHeight(double aValue)
      Override to reset line.
      Overrides:
      setHeight in class View