com.gargoylesoftware.base.gui

Class TableLayoutDebuggingPanel

public class TableLayoutDebuggingPanel extends JPanel

A special panel that when used with a TableLayout, will draw all the table cell boundaries. This is intended for use when debugging only.

Version: $Revision: 1.4 $

Author: Mike Bowler

Field Summary
booleangridLinesEnabled_
ColorlineColor_
static longserialVersionUID
Constructor Summary
TableLayoutDebuggingPanel()
Create a new panel with a default line colour of red.
TableLayoutDebuggingPanel(LayoutManager layout)
Create a new panel with the specified layout and a default line colour of red.
Method Summary
protected voidassertNotNull(String fieldName, Object fieldValue)
Verify that the specified value is not null.
ColorgetLineColor()
Return the current line colour.
booleanisGridLinesEnabled()
Return true if the grid lines are enabled.
voidpaint(Graphics g)
Override the painting logic to draw the gridlines.
voidsetGridLinesEnabled(boolean enabled)
Set whether or not the grid lines are visible.
voidsetLineColor(Color lineColor)
Set the line colour.

Field Detail

gridLinesEnabled_

private boolean gridLinesEnabled_

lineColor_

private Color lineColor_

serialVersionUID

private static final long serialVersionUID

Constructor Detail

TableLayoutDebuggingPanel

public TableLayoutDebuggingPanel()
Create a new panel with a default line colour of red.

TableLayoutDebuggingPanel

public TableLayoutDebuggingPanel(LayoutManager layout)
Create a new panel with the specified layout and a default line colour of red.

Parameters: layout The new layout manager.

Method Detail

assertNotNull

protected final void assertNotNull(String fieldName, Object fieldValue)
Verify that the specified value is not null. If it is then throw an exception

Parameters: fieldName The name of the field to check fieldValue The value of the field to check

Throws: DetailedNullPointerException If fieldValue is null

getLineColor

public Color getLineColor()
Return the current line colour.

Returns: the line colour.

isGridLinesEnabled

public boolean isGridLinesEnabled()
Return true if the grid lines are enabled.

Returns: true if the grid lines are enabled.

paint

public void paint(Graphics g)
Override the painting logic to draw the gridlines.

Parameters: g The graphics object.

setGridLinesEnabled

public void setGridLinesEnabled(boolean enabled)
Set whether or not the grid lines are visible. Default is true.

Parameters: enabled True if the grid lines are to be shown.

setLineColor

public void setLineColor(Color lineColor)
Set the line colour.

Parameters: lineColor The new line colour.