treebolic.generator.domtree
Class Renderer

java.lang.Object
  extended by treebolic.generator.domtree.Renderer
All Implemented Interfaces:
javax.swing.tree.TreeCellRenderer
Direct Known Subclasses:
Renderer

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

Renderer

Author:
Bernard Bou

Field Summary
private static long serialVersionUID
           
private static javax.swing.ImageIcon theDefaultIcon
          Default icon
private static javax.swing.text.SimpleAttributeSet theDefaultNameStyle
          Style for node name
private static javax.swing.text.SimpleAttributeSet theDefaultValueStyle
          Style for node data
private static javax.swing.ImageIcon theElementIcon
          Element icon
private static javax.swing.text.SimpleAttributeSet theElementNameStyle
          Style for element name
private static javax.swing.text.SimpleAttributeSet theElementValueStyle
          Style for element data
protected  javax.swing.JLabel theIconComponent
          Icon subcomponent
private  java.util.regex.Pattern theIdPattern
          Patterns
private static javax.swing.text.SimpleAttributeSet theIdStyle
          Style for id data
protected  javax.swing.JPanel thePanel
          Renderer component
protected  java.util.List<java.util.regex.Pattern> thePatterns
          Pattern list
protected  java.util.Map<java.util.regex.Pattern,javax.swing.text.SimpleAttributeSet> thePatternToStyleMap
          Styles for patterns
protected  javax.swing.JTextPane theTextComponent
          Text sub component
private static javax.swing.ImageIcon theTextIcon
          Text icon
 
Constructor Summary
Renderer()
          Constructor
 
Method Summary
protected  void applyStyleToPatterns(java.lang.String thisString, int thisOffset)
          Apply styles to patterns
protected  javax.swing.Icon getIconStyle(org.w3c.dom.Node thisNode)
          Get icon for node
protected  javax.swing.text.SimpleAttributeSet getNameStyle(org.w3c.dom.Node thisNode)
          Get name style for node
 java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree, java.lang.Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus)
           
protected  javax.swing.text.SimpleAttributeSet getValueStyle(org.w3c.dom.Node thisNode)
          Get value style for node
protected  DefaultDecorator makeDecorator(org.w3c.dom.Node thisNode)
          Make node decorator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

theElementIcon

private static javax.swing.ImageIcon theElementIcon
Element icon


theTextIcon

private static javax.swing.ImageIcon theTextIcon
Text icon


theDefaultIcon

private static javax.swing.ImageIcon theDefaultIcon
Default icon


theElementNameStyle

private static javax.swing.text.SimpleAttributeSet theElementNameStyle
Style for element name


theElementValueStyle

private static javax.swing.text.SimpleAttributeSet theElementValueStyle
Style for element data


theDefaultNameStyle

private static javax.swing.text.SimpleAttributeSet theDefaultNameStyle
Style for node name


theDefaultValueStyle

private static javax.swing.text.SimpleAttributeSet theDefaultValueStyle
Style for node data


theIdStyle

private static javax.swing.text.SimpleAttributeSet theIdStyle
Style for id data


theIdPattern

private java.util.regex.Pattern theIdPattern
Patterns


thePatterns

protected java.util.List<java.util.regex.Pattern> thePatterns
Pattern list


thePatternToStyleMap

protected java.util.Map<java.util.regex.Pattern,javax.swing.text.SimpleAttributeSet> thePatternToStyleMap
Styles for patterns


thePanel

protected javax.swing.JPanel thePanel
Renderer component


theIconComponent

protected javax.swing.JLabel theIconComponent
Icon subcomponent


theTextComponent

protected javax.swing.JTextPane theTextComponent
Text sub component

Constructor Detail

Renderer

public Renderer()
Constructor

Method Detail

getTreeCellRendererComponent

public java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree,
                                                       java.lang.Object value,
                                                       boolean sel,
                                                       boolean expanded,
                                                       boolean leaf,
                                                       int row,
                                                       boolean hasFocus)
Specified by:
getTreeCellRendererComponent in interface javax.swing.tree.TreeCellRenderer

applyStyleToPatterns

protected void applyStyleToPatterns(java.lang.String thisString,
                                    int thisOffset)
Apply styles to patterns

Parameters:
thisString - value string
thisOffset - offset of value in text

makeDecorator

protected DefaultDecorator makeDecorator(org.w3c.dom.Node thisNode)
Make node decorator

Parameters:
thisNode - node
Returns:
node decorator

getNameStyle

protected javax.swing.text.SimpleAttributeSet getNameStyle(org.w3c.dom.Node thisNode)
Get name style for node

Parameters:
thisNode - node
Returns:
style

getValueStyle

protected javax.swing.text.SimpleAttributeSet getValueStyle(org.w3c.dom.Node thisNode)
Get value style for node

Parameters:
thisNode - node
Returns:
style

getIconStyle

protected javax.swing.Icon getIconStyle(org.w3c.dom.Node thisNode)
Get icon for node

Parameters:
thisNode - node
Returns:
style