|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--guk.editIM.GTRenderer
The graphical user interface helpers for the GlyphTable.
Implements a scroll helper and something that is almost
a TableCellRenderer. Used by GlyphTable
.
Field Summary | |
(package private) java.awt.Color[] |
bgColor
similar as fgColor, but for the background color. |
(package private) java.awt.Color[] |
fgColor
The precomputed color for each glyph. |
(package private) MenuHelpers |
menu
|
(package private) javax.swing.JTable |
myTable
some abstraction-breaking variables that help us to remote- control the table in which we are loaded. |
(package private) javax.swing.JViewport |
myViewport
knowing our own viewport allows us to scroll the table for which we are the data model. |
(package private) java.util.Hashtable |
usedSlots
For efficiency, we keep an handle to the main data structure of the GlyphTable for which we are rendering. |
(package private) GTVisibility |
visor
The visor objects keeps track of which internal rows are externally visible and how row numbers are mapped. |
Constructor Summary | |
GTRenderer(java.util.Hashtable contents,
GTVisibility visitor)
The constructor initializes the colors. |
Method Summary | |
java.awt.Component |
getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column,
java.awt.Component renderer)
The renderer: Take old renderer and improve the ToolTip and maybe other things before passing on the result. |
void |
processCommand(java.lang.String command,
int modifiers,
boolean checked)
Process command strings. |
void |
scrollTo(int row)
Scroll the viewport to a certain glyph / internal row. |
void |
setScroller(javax.swing.JViewport vp,
javax.swing.JTable tab,
MenuHelpers theMenu)
Know which table we belong to and which viewport, so that we can remote control them. |
Methods inherited from class java.lang.Object |
|
Field Detail |
java.util.Hashtable usedSlots
GTVisibility visor
java.awt.Color[] fgColor
java.awt.Color[] bgColor
javax.swing.JTable myTable
javax.swing.JViewport myViewport
MenuHelpers menu
Constructor Detail |
public GTRenderer(java.util.Hashtable contents, GTVisibility visitor)
contents
- The hashtable from which we can read the
contents of the table in native format, for highlighting.visitor
- An instance of GTVisibility, to know the
mapping of visible to internal rows.menuHelper
- A MenuHelpers instance for font and
color calculations.Method Detail |
public void setScroller(javax.swing.JViewport vp, javax.swing.JTable tab, MenuHelpers theMenu)
vp
- The viewport in which we can be seen, used for program
controlled scrolling.tab
- The table to which we belong to (to know the layout,
for scrolling).theMenu
- Can be set if you want a specific font setting.public void scrollTo(int row)
row
- The internal row number (glyph) to which we should
scroll. You have to set a viewport or nothing will scroll.public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column, java.awt.Component renderer)
WARNING: TableModels normally do not implement TableCellRenderer and this exception (activated via table.setDefaultRenderer(...)) means that we have to be CAREFUL with coordinates: JTable and renderer stuff uses VIEW coordinates, but the Model uses MODEL coordinates. The user may have swapped (by dragging) the columns!
(Unicode needs HTML 4.0 to render, JLabels - the the used TableCellRenderers are derived from them - only render ISO-8859-1 HTML 3.2, so we see boxes for nonprintable chars when HTML highlighting is active).
renderer
- A basis for our calculations. The real
getTableCellRendererComponent method does not have this extra.TableCellRenderer
public void processCommand(java.lang.String command, int modifiers, boolean checked)
process a command sent by e.g. the GUI menu system: jumpto 1234 (scrolls to that glyph). jumpfield CHAR (scrolls to that glyph - char may be escaped).
modifiers
- Modifiers use the normal ActionEvent bit masks.checked
- Some commands use this as additional boolean input.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |