Class Repainter
java.lang.Object
VASSAL.tools.imageop.Repainter
- All Implemented Interfaces:
ImageOpObserver,OpObserver<BufferedImage>
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCallback which is run when the observedOpis cancelled.voidfailed(Op<BufferedImage> op, ExecutionException e) Callback which is run when the observedOpfails.voidimageOpChange(ImageOp op, boolean success) Called when theImageOpunder observation completes.voidCallback which is run when the observedOpis interrupted.voidsucceeded(Op<BufferedImage> op, BufferedImage img) Callback which is run when the observedOpcompletes successfully.
-
Field Details
-
c
-
x
protected final int x -
y
protected final int y -
w
protected final int w -
h
protected final int h
-
-
Constructor Details
-
Repainter
Creates aRepainterfor 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 ratherRepainter(Component c, Rectangle r), except in the case where theRectanglealready exists.- Parameters:
c- the component to repaintx- the x coordinate of the upper-left corner of the rectangle to repainty- the y coordinate of the upper-left corner of the rectangle to repaintw- the width of the rectangle to repainth- the height of the rectangle to repaint- Throws:
IllegalArgumentException- ifc == null
-
Repainter
Creates aRepainterfor the specified component and area.- Parameters:
c- the component to be repaintedr- the area to be repainted- Throws:
IllegalArgumentException- ifc == null
-
-
Method Details
-
imageOpChange
Called when theImageOpunder observation completes.- Specified by:
imageOpChangein interfaceImageOpObserver- Parameters:
op- theImageOpbeing observedsuccess- repaint theComponentifftrue
-
succeeded
Description copied from interface:OpObserverCallback which is run when the observedOpcompletes successfully.- Specified by:
succeededin interfaceOpObserver<BufferedImage>- Parameters:
op- the successfully completedOpimg- the value of theOp
-
cancelled
Description copied from interface:OpObserverCallback which is run when the observedOpis cancelled.- Specified by:
cancelledin interfaceOpObserver<BufferedImage>- Parameters:
op- the cancelledOpe- theCancellationExceptionthrown when theOpwas cancelled
-
interrupted
Description copied from interface:OpObserverCallback which is run when the observedOpis interrupted.- Specified by:
interruptedin interfaceOpObserver<BufferedImage>- Parameters:
op- the interruptedOpe- theInterruptedExceptionthrown when theOpwas interrupted
-
failed
Description copied from interface:OpObserverCallback which is run when the observedOpfails.- Specified by:
failedin interfaceOpObserver<BufferedImage>- Parameters:
op- the failedOpe- theExecutionExceptionthrown when theOpfailed
-