gvSIG bugs #2744
Record column is too narrow in the table documents
Status: | Closed | % Done: | 0% | |
---|---|---|---|---|
Priority: | Normal | Spent 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).
Associated revisions
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:
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
- Target version set to 2.1.0-2259-rc3
- File rowheader_workaround.png added
- File RowHeaderRenderer.patch added
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