net.sf.taverna.t2.partition.ui
Class TableTreeNodeRenderer

java.lang.Object
  extended by net.sf.taverna.t2.partition.ui.TableTreeNodeRenderer
All Implemented Interfaces:
javax.swing.tree.TreeCellRenderer

public abstract class TableTreeNodeRenderer
extends java.lang.Object
implements javax.swing.tree.TreeCellRenderer


Constructor Summary
TableTreeNodeRenderer(javax.swing.tree.TreeCellRenderer nodeRenderer, int nodeWidth)
          Construct a new TableTreeNodeRenderer
 
Method Summary
abstract  TableTreeNodeColumn[] getColumns()
          Override and implement to get the list of columns for a given partition node - currently assumes all partitions use the same column structure which I need to fix so it doesn't take a partition as argument (yet).
 java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree, java.lang.Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
          Do the magic!
 void setBlendFactor(int blendFactor)
          The blend factor determines how strong the colour component is in the shadow and highlight colours used in the bevelled boxes, the ratio of black / white to colour is 1 : blendFactor
 void setBorderColour(java.awt.Color borderColour)
          Set the colour to be used to draw the borders if they are displayed at all.
 void setDrawBorders(boolean drawingBorders)
          Set whether the renderer will draw borders around the table cells - if this is false the table still has the bevelled edges of the cell painters so will still look semi-bordered.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableTreeNodeRenderer

public TableTreeNodeRenderer(javax.swing.tree.TreeCellRenderer nodeRenderer,
                             int nodeWidth)
Construct a new TableTreeNodeRenderer

Parameters:
nodeRenderer - The inner renderer used to render the node labels
nodeWidth - Width of the cell space into which the node label is rendered in the table header and row nodes
Method Detail

setBorderColour

public void setBorderColour(java.awt.Color borderColour)
Set the colour to be used to draw the borders if they are displayed at all. Defaults to black.


setBlendFactor

public void setBlendFactor(int blendFactor)
The blend factor determines how strong the colour component is in the shadow and highlight colours used in the bevelled boxes, the ratio of black / white to colour is 1 : blendFactor

Parameters:
blendFactor -

setDrawBorders

public void setDrawBorders(boolean drawingBorders)
Set whether the renderer will draw borders around the table cells - if this is false the table still has the bevelled edges of the cell painters so will still look semi-bordered. Defaults to true if not otherwise set.

Parameters:
drawingBorders -

getColumns

public abstract TableTreeNodeColumn[] getColumns()
Override and implement to get the list of columns for a given partition node - currently assumes all partitions use the same column structure which I need to fix so it doesn't take a partition as argument (yet).

Returns:
an array of column specifications used to drive the renderer

getTreeCellRendererComponent

public java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree,
                                                       java.lang.Object value,
                                                       boolean selected,
                                                       boolean expanded,
                                                       boolean leaf,
                                                       int row,
                                                       boolean hasFocus)
Do the magic!

Specified by:
getTreeCellRendererComponent in interface javax.swing.tree.TreeCellRenderer