Class ElementPainter

Direct Known Subclasses:
ConnectionPainter, TopicPainter

public abstract class ElementPainter
extends IPublisher
  • Constructor Details

    • ElementPainter

      public ElementPainter​(Element element)
  • Method Details

    • getElement

      public Element getElement()
    • draw

      public abstract void draw​(Graphics2D g)
      Draws the wrapped Element on the canvas Graphics g.
      Parameters:
      g - Graphics canvas to paint on.
    • elementAt

      public abstract boolean elementAt​(Point p)
      Returns true if the element's shape includes the passed Point.
      Parameters:
      p - Point where the interaction happened.
      Returns:
      True if the element was clicked, false otherwise.
    • getShape

      public abstract Shape getShape()
      The final painted Shape. May be null.
      Returns:
      The final painted Shape. May be null.