Animated (blinking) row background in Power Table

I don't believe that this could be done reliably with the configureCell extension function alone since it doesn't fire unless triggered by some event that would require the cells to be painted, but from my experience working with tables, I can imagine quite a few approaches that would probably work.

Just taking a quick look at the problem, I was able to get the effect you are looking for with the following procedure:
• Add a custom Boolean propery to the power table called 'blink'
• Add a timer component to the window
• Add the following script to the timer component's action performed event handler:

powerTable = event.source.parent.getComponent('Power Table') #Change this path to match your project
if powerTable.blink:
	powerTable.blink = False
else:
	powerTable.blink = True
powerTable.table.getModel().fireTableDataChanged() #This line can be anything that will trigger a repaint

• Finally, script the configureCell extension function as needed. In my test project, I used the following:

#def configureCell([...]):
	if selected:
		return {'background': self.selectionBackground}
	elif self.blink:
		return {'background': 'white'}
	else:
		return {'background': '#DDDDDD'}

Here is the result:

3 Likes