Skip to content

Commit

Permalink
#4 MuliRowPanel shows grid lines, use AlternateStriping Highlighter
Browse files Browse the repository at this point in the history
TODO Renderer + Editor, derzeit
- DefaultTableRenderer
- kein Editor
  • Loading branch information
homebeaver committed Nov 20, 2019
1 parent f8922bc commit 16c529c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions client/src/main/java/com/klst/gossip/MuliRowPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import org.compiere.model.GridTab;
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.decorator.Highlighter;
import org.jdesktop.swingx.decorator.HighlighterFactory;
import org.jdesktop.swingx.renderer.DefaultTableRenderer;

Expand All @@ -23,6 +24,14 @@ public class MuliRowPanel extends JXTable { // JXTable extends JTable implements
private static final long serialVersionUID = 4527635643876059507L;
private static final Logger LOG = Logger.getLogger(MuliRowPanel.class.getName());

// Layout:
// - Grid lines
private static final boolean showHorizontalLines = true;
private static final boolean showVerticalLines = true;
// - Highlighter aka Decorator, die org.jdesktop.swingx.decorator.HighlighterFactory bietet mehrere an
// SimpleStriping, AlternateStriping, ... siehe dort
private static Highlighter highlighter = HighlighterFactory.createAlternateStriping();

// factory method aus org.jdesktop.swingx.demos.table.XTableDemo , erweitert, wird in Tab gebraucht
// dm ist GenericDataModel
// TODO wieso gridTab - es ist doch in GenericDataModel gekapselt
Expand All @@ -42,9 +51,8 @@ private MuliRowPanel(TableModel dm, GridTab gridTab) {
setColumnControlVisible(true); // column control to the trailing corner of the scroll pane

// replace grid lines with striping
setShowGrid(false, false); // (boolean showHorizontalLines, boolean showVerticalLines)
addHighlighter(HighlighterFactory.createAlternateStriping());
// oder HighlighterFactory.createSimpleStriping()
setShowGrid(showHorizontalLines, showVerticalLines);
addHighlighter(highlighter);

setDefaultRenderer(Object.class, new DefaultTableRenderer());
}
Expand Down

0 comments on commit 16c529c

Please sign in to comment.