com.jrefinery.report.targets.table.excel
Class ExcelToolLibrary

java.lang.Object
  |
  +--com.jrefinery.report.targets.table.excel.ExcelToolLibrary

public class ExcelToolLibrary
extends java.lang.Object

POI Excel utility methods.

Author:
Heiko Evermann

Constructor Summary
ExcelToolLibrary()
           
 
Method Summary
static short getNearestColor(java.awt.Color awtColor)
          Find a suitable color for the cell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExcelToolLibrary

public ExcelToolLibrary()
Method Detail

getNearestColor

public static short getNearestColor(java.awt.Color awtColor)
Find a suitable color for the cell. The algorithm searches all available triplets, weighted by tripletvalue and tripletdifference to the other triplets. The color wins, which has the smallest triplet difference and where all triplets are nearest to the requested color. Damn, why couldn't these guys from microsoft implement a real color system.

Parameters:
awtColor - the awt color that should be transformed into an Excel color.
Returns:
the excel color index that is nearest to the supplied color.