Package com.inet.html

Interface ViewPainter

All Superinterfaces:
Cloneable

public interface ViewPainter extends Cloneable
handles paint commands
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates and Returns a copy of this object.
    default void
    Marks a view as already painted.
    boolean
    handles the paint, then returns whether to run the default painting or not.
    default void
    Resets the state of the painter to 'not yet painted'
    default void
    An alternative way to store the allocation of the parent view without calling paint(Graphics, Shape).
    default boolean
    Returns whether a view was already painted and thus should not be painted again.
  • Method Details

    • paint

      boolean paint(Graphics g, Shape s)
      handles the paint, then returns whether to run the default painting or not.
      NOTE: is only meant to be called for "low-level" views without children.
      Parameters:
      g - graphics
      s - allocated shape to paint in
      Returns:
      true if painting can continue, false if this view should not actually paint itself
      Since:
      1.05
    • clone

      Creates and Returns a copy of this object.
      Returns:
      a copy of this object
      Throws:
      CloneNotSupportedException - Thrown if clone() is not supported by the implementation
      Since:
      1.05
    • wasPainted

      default boolean wasPainted()
      Returns whether a view was already painted and thus should not be painted again. This call does not affect the 'painted' state as paint(Graphics, Shape) does.
      Returns:
      true if painted, false if not yet painted
      Since:
      1.12
    • setAllocation

      default void setAllocation(Rectangle allocation)
      An alternative way to store the allocation of the parent view without calling paint(Graphics, Shape).
      Parameters:
      allocation - the allocation relative to the top left of the root view
      Since:
      1.12
    • markAsPainted

      default void markAsPainted()
      Marks a view as already painted. Has the same effect as calling paint(Graphics, Shape) with a clip where the view is visible.
      Since:
      1.12
    • reset

      default void reset()
      Resets the state of the painter to 'not yet painted'
      Since:
      1.12