Package muntjac :: Package terminal :: Module paintable :: Class IPaintable
[hide private]
[frames] | no frames]

Class IPaintable

source code

         object --+    
                  |    
util.IEventListener --+
                      |
                     IPaintable

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.


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
paint(self, target)
Paints the IPaintable into a UIDL stream.
source code
 
requestRepaint(self)
Requests that the paintable should be repainted as soon as possible.
source code
 
setDebugId(self, idd)
Adds an unique id for component that get's transferred to terminal for testing purposes.
source code
 
getDebugId(self)
Get's currently set debug identifier
source code
 
addListener(self, listener, iface=None)
Adds repaint request listener.
source code
 
addCallback(self, callback, eventType=None, *args) source code
 
removeListener(self, listener, iface)
Removes repaint request listener.
source code
 
removeCallback(self, callback, eventType=None) source code
 
requestRepaintRequests(self)
Request sending of repaint events on any further visible changes.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

paint(self, target)

source code 

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

It 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 - the target UIDL stream where the component should paint itself to.
Raises:

setDebugId(self, idd)

source code 

Adds an unique id for component that get's transferred to terminal for testing purposes. Keeping identifiers unique throughout the Application instance is on programmers responsibility.

Note, that with the current terminal implementation the identifier cannot be changed while the component is visible. This means that the identifier should be set before the component is painted for the first time and kept the same while visible in the client.

Parameters:
  • idd - A short (< 20 chars) alphanumeric id

getDebugId(self)

source code 

Get's currently set debug identifier

Returns:
current debug id, null if not set

addListener(self, listener, iface=None)

source code 

Adds 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 - the listener to be added.

removeListener(self, listener, iface)

source code 

Removes repaint request listener.

Parameters:
  • listener - the listener to be removed.

requestRepaintRequests(self)

source code 

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).