Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Bug in CellPainterDecorator
Bug in CellPainterDecorator [message #1018745] Thu, 14 March 2013 11:57 Go to next message
karishma Agarwal is currently offline karishma AgarwalFriend
Messages: 28
Registered: June 2011
Junior Member
I think this is a bug in CellPainterDecorator class.

public void paintCell(ILayerCell cell, GC gc, Rectangle adjustedCellBounds, IConfigRegistry configRegistry) {
Rectangle baseCellPainterBounds = this.paintDecorationDependent ?
getBaseCellPainterBounds(cell, gc, adjustedCellBounds, configRegistry) : adjustedCellBounds;

*********
}


The paintCell function considers the value of paintDecorationDependent while calculating the value of baseCellPainterBounds .

However the getCellPainterAt() method does not consider the value of paintDecorationDependent while calculation of the same.

public ICellPainter getCellPainterAt(int x, int y, ILayerCell cell, GC gc, Rectangle adjustedCellBounds, IConfigRegistry configRegistry) {

***********
} else {
Rectangle baseCellPainterBounds = getBaseCellPainterBounds(cell, gc, adjustedCellBounds, configRegistry);

***********

}

Due to this,suppose if I am combining two TreeCheckBoxPainters and passing the value of paintDecorationDependent as false, then the getCellPainterAt() method calculates the wrong bounds and hence if we click on the base checkBox, matches function in CellPainterMouseEventMatcher class returns false.

Thanks,
Karishma.
Re: Bug in CellPainterDecorator [message #1018758 is a reply to message #1018745] Thu, 14 March 2013 12:24 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Sounds reasonable ... have you tested this fix locally or do you have some example to verify that this fixes your issue?
Re: Bug in CellPainterDecorator [message #1018796 is a reply to message #1018758] Thu, 14 March 2013 13:37 Go to previous messageGo to next message
karishma Agarwal is currently offline karishma AgarwalFriend
Messages: 28
Registered: June 2011
Junior Member
Yes.. After changing the code to

Rectangle baseCellPainterBounds = this.paintDecorationDependent ?
getBaseCellPainterBounds(cell, gc, adjustedCellBounds, configRegistry) : adjustedCellBounds;

in getCellPainterAt() method, its working as expected in the table which i am working on.
Re: Bug in CellPainterDecorator [message #1018836 is a reply to message #1018796] Thu, 14 March 2013 14:54 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
I created a ticket for this and fixed it right away in master.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=403349

Thanks for reporting and validating
Previous Topic:Hyperlinks in cells
Next Topic:Bug in VerticalTextPainter.paintCell()
Goto Forum:
  


Current Time: Fri Apr 26 02:24:09 GMT 2024

Powered by FUDForum. Page generated in 0.02848 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top