JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.cell.renderers
Class JCWordWrapCellRenderer

java.lang.Object
  |
  +--com.klg.jclass.cell.renderers.JCWordWrapCellRenderer
All Implemented Interfaces:
JCCellRenderer, JCLightCellRenderer, Serializable

public class JCWordWrapCellRenderer
extends Object
implements JCLightCellRenderer

A multi-line String cell renderer that will wrap lines to fit the cell contraints.

See Also:
JCStringCellRenderer, Serialized Form

Field Summary
protected  boolean drawClipArrowOutline
           
protected  com.klg.jclass.cell.Utilities utilities
           
 
Constructor Summary
JCWordWrapCellRenderer()
           
 
Method Summary
 void draw(Graphics gc, com.klg.jclass.cell.JCCellInfo cellInfo, Object o, boolean selected)
          Used to draw a String using word-wrap logic.
 int getHeight(FontMetrics fm, String s)
          Returns the height required to paint the String.
 Dimension getPreferredSize(Graphics gc, com.klg.jclass.cell.JCCellInfo cellInfo, Object o)
          Determines the preferred size of the cell.
 int getWidth(FontMetrics fm, String text)
          Returns the width required to paint a multi-line String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

utilities

protected com.klg.jclass.cell.Utilities utilities

drawClipArrowOutline

protected boolean drawClipArrowOutline
Constructor Detail

JCWordWrapCellRenderer

public JCWordWrapCellRenderer()
Method Detail

draw

public void draw(Graphics gc,
                 com.klg.jclass.cell.JCCellInfo cellInfo,
                 Object o,
                 boolean selected)
Used to draw a String using word-wrap logic.

Specified by:
draw in interface JCLightCellRenderer
Parameters:
gc - graphics context to use for drawing
cellInfo - cell property information
o - the object to be rendered
selected - if true, the selected foreground color is used

getHeight

public int getHeight(FontMetrics fm,
                     String s)
Returns the height required to paint the String.

Parameters:
fm -
s -
Returns:
height required to paint the String

getWidth

public int getWidth(FontMetrics fm,
                    String text)
Returns the width required to paint a multi-line String.

Parameters:
fm -
text -
Returns:
width required to paint a multi-line String

getPreferredSize

public Dimension getPreferredSize(Graphics gc,
                                  com.klg.jclass.cell.JCCellInfo cellInfo,
                                  Object o)
Determines the preferred size of the cell.

Specified by:
getPreferredSize in interface JCLightCellRenderer
Parameters:
gc - the graphics context
cellInfo - cell property information
o - the object to be rendered
Returns:
java.awt.Dimension instance containing preferred height and width

Copyright © 2004 Quest Software Inc..
All rights reserved.