org.millstone.base.terminal
Interface Paintable

All Superinterfaces:
java.util.EventListener
All Known Subinterfaces:
Component, ComponentContainer, ErrorMessage, Layout
All Known Implementing Classes:
AbstractComponent, AbstractComponentContainer, Buffered.SourceException, CompositeErrorMessage, CustomComponent, CustomLayout, GridLayout, OrderedLayout, SystemError, UserError, Validator.InvalidValueException

public interface Paintable
extends java.util.EventListener

Interface implemented by all classes that can be painted. Classes implementing this interface know how to output themselves to a UIDL stream and that way describing to the terminal how it should be displayed in the UI.

Since:
3.0
Version:
3.0.3
Author:
IT Mill Ltd.

Nested Class Summary
static class Paintable.RepaintRequestEvent
          Repaint request event is thrown when the paintable needs to be repainted.
static interface Paintable.RepaintRequestListener
          Listen repaint requests.
 
Method Summary
 void addListener(Paintable.RepaintRequestListener listener)
          Add repaint request listener.
 void paint(PaintTarget target)
          Paints the paintable into a UIDL stream.
 void removeListener(Paintable.RepaintRequestListener listener)
          Remove repaint request listener.
 void requestRepaint()
          Requests that the paintable should be repainted as soon as possible.
 void requestRepaintRequests()
          Request sending of repaint events on any further visible changes.
 

Method Detail

paint

public void paint(PaintTarget target)
           throws PaintException

Paints the paintable into a UIDL stream. This method creates the UIDL sequence describing it and outputs it to the given UIDL stream.

It's is called when the contents of the component should be painted in response to the component first being shown or having been altered so that its visual representation is changed.

Parameters:
target - target UIDL stream where the component should paint itself to
Throws:
PaintException - if the paint operation failed
InvalidUIDLException - if incorrect UIDL is writted, and the error can be dealt with inside this method call.

requestRepaint

public void requestRepaint()
Requests that the paintable should be repainted as soon as possible.


addListener

public void addListener(Paintable.RepaintRequestListener listener)
Add repaint request listener. In order to assure that no repaint requests are missed, the new repaint listener should paint the paintable right after adding itself as listener.

Parameters:
listener - to be added

removeListener

public void removeListener(Paintable.RepaintRequestListener listener)
Remove repaint request listener.

Parameters:
listener - to be removed

requestRepaintRequests

public void requestRepaintRequests()
Request sending of repaint events on any further visible changes. Normally the paintable only send up to one repaint request for listeners after paint as the paintable as the paintable assumes that the listeners already know about the repaint need. This method resets the assumtion. Paint implicitly does the assumtion reset functionality implemented by this method. This method is normally used only by the terminals to note paintables about implicit repaints (painting the component without actually invoking paint method).



Copyright © 2000,2001,2002 IT Mill Ltd. All Rights Reserved.