Class Repainter

java.lang.Object
VASSAL.tools.imageop.Repainter
All Implemented Interfaces:
ImageOpObserver, OpObserver<BufferedImage>

public class Repainter extends Object implements ImageOpObserver
An ImageOpObserver which repaints Components. This class stores a reference to a Component and a rectangle of that component which will be repainted when imageOpChange(VASSAL.tools.imageop.ImageOp, boolean) is called and success is true.
Since:
3.1.0
Author:
Joel Uckelman
  • Field Details

    • c

      protected final Component c
    • x

      protected final int x
    • y

      protected final int y
    • w

      protected final int w
    • h

      protected final int h
  • Constructor Details

    • Repainter

      public Repainter(Component c, int x, int y, int w, int h)
      Creates a Repainter for the specified component and rectangle. Repainters will usually be constructed during paint operations on the Event Dispatch Thread, and so will be created in enormous quantities. In order to minimize object creation, always use this constructor rather Repainter(Component c, Rectangle r), except in the case where the Rectangle already exists.
      Parameters:
      c - the component to repaint
      x - the x coordinate of the upper-left corner of the rectangle to repaint
      y - the y coordinate of the upper-left corner of the rectangle to repaint
      w - the width of the rectangle to repaint
      h - the height of the rectangle to repaint
      Throws:
      IllegalArgumentException - if c == null
    • Repainter

      public Repainter(Component c, Rectangle r)
      Creates a Repainter for the specified component and area.
      Parameters:
      c - the component to be repainted
      r - the area to be repainted
      Throws:
      IllegalArgumentException - if c == null
  • Method Details