Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Performance for selection and scrolling
Performance for selection and scrolling [message #1403117] Mon, 21 July 2014 12:57 Go to next message
Alexander Klatt is currently offline Alexander KlattFriend
Messages: 56
Registered: April 2014
Member
Hi,

NatTable provides exactly the functionality that I need for my application.
However, one drawback is that the cell selection and scrolling behavior is a bit
laggy. I did not find any information on this issue. Is there any way to boost
performance for this (e.g. disable font changing on selection) ?
I would appreciate any advice!

[Updated on: Mon, 21 July 2014 12:57]

Report message to a moderator

Re: Performance for selection and scrolling [message #1403121 is a reply to message #1403117] Mon, 21 July 2014 13:11 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1721
Registered: July 2012
Senior Member
You did not find any information on this issue, because you are the first person mentioning it.

What exactly do you mean? Selecting a range of cells, trying to scroll in a direction? Or what do you want to boost?

I don't think disabling the font changing would change anything here, as on selection the cell needs to be rerendered. Maybe there is too much rerendered, but in that case it is a general issue in NatTable you can not "boost" yourself.
Re: Performance for selection and scrolling [message #1403122 is a reply to message #1403121] Mon, 21 July 2014 13:32 Go to previous messageGo to next message
Alexander Klatt is currently offline Alexander KlattFriend
Messages: 56
Registered: April 2014
Member
Yes, I am talking about for example drag-selecting a range of cells. Maybe I am just too picky Smile, but in the Nebula Grid, this is more fluent.
Re: Performance for selection and scrolling [message #1403126 is a reply to message #1403122] Mon, 21 July 2014 13:58 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1721
Registered: July 2012
Senior Member
Please open a ticket.
Re: Performance for selection and scrolling [message #1403134 is a reply to message #1403126] Mon, 21 July 2014 15:18 Go to previous messageGo to next message
Alexander Klatt is currently offline Alexander KlattFriend
Messages: 56
Registered: April 2014
Member
I don't know where to open a ticket. But the reason for the slow selection performance is because of the default drag selection event.
With the following code, the selection is smooth:

This does not work yet though, if the table is not scrolled to the top.
    private class BodyDragSelection implements IDragMode {
        @Override
        public void mouseUp(NatTable natTable, MouseEvent event) {
        }
        
        @Override
        public void mouseMove(NatTable natTable, MouseEvent event) {
            SelectionLayer selectionLayer = ((MyBodyLayerStack) gridLayer.getBodyLayer()).getSelectionLayer();
            selectionLayer.getSelectionModel().clearSelection();
            selectionLayer.selectCell(selectionLayer.getColumnPositionByX(event.x - gridLayer.getCornerLayer().getWidth()), selectionLayer.getRowPositionByY(event.y - gridLayer.getCornerLayer().getHeight()), true, false);
            natTable.redraw();
        }
        
        @Override
        public void mouseDown(NatTable natTable, MouseEvent event) {
            SelectionLayer selectionLayer = ((MyBodyLayerStack) gridLayer.getBodyLayer()).getSelectionLayer();
            int startRowIndex = selectionLayer.getRowPositionByY(event.y - gridLayer.getCornerLayer().getHeight());
            int startColumnIndex = selectionLayer.getColumnPositionByX(event.x - gridLayer.getCornerLayer().getWidth());
            selectionLayer.clear();
            selectionLayer.moveSelectionAnchor(startColumnIndex, startRowIndex);
            selectionLayer.selectCell(startColumnIndex, startRowIndex, true, false);
            natTable.redraw();
        }
    }

[Updated on: Mon, 21 July 2014 15:22]

Report message to a moderator

Re: Performance for selection and scrolling [message #1403136 is a reply to message #1403134] Mon, 21 July 2014 15:25 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1721
Registered: July 2012
Senior Member
You open a bug here: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=NatTable

Open it for NatTable Core and version 1.1.0

If you find a solution for the issue, try to fix it in core and contribute as explained here: https://www.eclipse.org/nattable/documentation.php?page=contribution_guide
Previous Topic:Column Header selection when body has one row
Next Topic:Persistance of NATTABLE ignoring Filter
Goto Forum:
  


Current Time: Fri Jul 03 23:59:03 GMT 2015

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

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