gvSIG bugs #2744

Record column is too narrow in the table documents

Added by Antonio Falciano almost 10 years ago. Updated over 9 years ago.

Status:Closed% Done:

0%

Priority:NormalSpent time:-
Assignee:-
Category:Document table
Target version:2.1.0-2255-testing
Severity:Minor Add-on version:
gvSIG version:2.1.0 Add-on build:
gvSIG build:2239 Add-on resolve version:
Operative System: Add-on resolve build:
Keywords: Proyecto:
Has patch:Yes Hito:
Add-on name:Unknown

Description

Record column is too narrow in the table documents (see the screenshot in attachment).

rec_column.png (41.7 KB) Antonio Falciano, 07/29/2014 12:42 PM

RowHeaderRenderer.patch Magnifier (1.04 KB) Antonio Falciano, 10/28/2014 07:21 AM

rowheader_workaround.png (12.5 KB) Antonio Falciano, 10/28/2014 07:24 AM

974
1122

Associated revisions

Revision 41830
Added by Joaquín del Cerro Murciano over 9 years ago

refs #2744. Record column is too narrow in the table documents

History

#1 Updated by Antonio Falciano over 9 years ago

Priority: High

The record column width is fixed (i.e. not resizeable), so the record number becomes not visible starting from 10.

#2 Updated by Joaquín del Cerro Murciano over 9 years ago

Hola Antonio,
en linux funciona correctamente. Ahora mismo no tengo un entorno de desarrollo en Windows y no he conseguido arreglarlo para Windows.
El codigo que lo crea la cabecera de las lineas esta en:

https://redmine.gvsig.net/redmine/projects/gvsig-desktop/repository/entry/trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.fmap.control/src/main/java/org/gvsig/fmap/mapcontrol/dal/feature/swing/FeatureTablePanel.java#L308

    private static class RowHeaderRenderer extends JButton implements ListCellRenderer {

        private JTable table = null;
        private final Dimension dimension = new Dimension();

        RowHeaderRenderer(JTable table) {
            JTableHeader header = table.getTableHeader();
            setOpaque(true);
            setBorder(UIManager.getBorder("TableHeader.cellBorder"));
            setHorizontalAlignment(CENTER);
            setForeground(header.getForeground());
            setBackground(header.getBackground());
            setFont(header.getFont());
            this.table = table;
            //                                               1234567
            Rectangle2D r = this.getFont().getStringBounds( "_______", new FontRenderContext(null,true,true));
            this.dimension.width = (int) r.getWidth();
        }

        public Component getListCellRendererComponent(JList list, Object value,
                int index, boolean isSelected, boolean cellHasFocus) {
            setText((value == null) ? "" : value.toString());
            this.dimension.height = this.table.getRowHeight(index);
            this.setPreferredSize(this.dimension);
            return this;
        }

    }

Intenta reservar espacio para al menos 7 digitos en la cabecera, de hecho en linux lo hace, y no entiendo por que en Windows no. Aparentemente tiene espacio de sobra para mas de dos digitos.
Cuando tenga tiempo prepare un entorno de desarrollo para windows y vere que puede ser.

Ademas tampoco tengo claro ahora mismo como hacer que esa columna sea resizeable.

#3 Updated by Antonio Falciano over 9 years ago

Hi Joaquín,
thanks for your useful suggestions. As temporary workaround in order to increase the limit of viewable record index in Windows, it could be used the preferred width of the table header (patch in attachment). But it allows to view only until the 99999th record index (screenshot). So the row header should be resizeable to bypass this limit eventually.

#4 Updated by Álvaro Anguix over 9 years ago

  • Has patch set to Yes

#5 Updated by Joaquín del Cerro Murciano over 9 years ago

  • Target version changed from 2.1.0-2259-rc3 to 2.1.0-2255-testing

#6 Updated by Antonio Falciano over 9 years ago

  • Status changed from New to Closed

Also available in: Atom PDF