Style Intelligence v12.0

inetsoft.report
Class TOC

java.lang.Object
  extended by inetsoft.report.TOC
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
TOC.Classic, TOC.Default, TOC.Distinctive, TOC.Fancy, TOC.Formal, TOC.Modern, TOC.Simple

public abstract class TOC
extends Object
implements Serializable, Cloneable

A TOC object represents a 'table of contents' in a report. The TOC class defines the attributes of the table of contents, such as the font, alignment, indent, leader, etc. A number of predefined table of contents styles are available, and can be used without any programming:

   report.addTOC(TOC.FORMAL);
If a custom table of contents style is needed, a new class can be derived from the TOC class, or one of the predefined classes.

See Also:
Serialized Form

Nested Class Summary
static class TOC.Classic
          'Classic' table of contents style.
static class TOC.Default
          'Default' table of contents style.
static class TOC.Distinctive
          'Distinctive' table of contents style.
static class TOC.Fancy
          'Fancy' table of contents style.
static class TOC.Formal
          'Formal' table of contents style.
static class TOC.Modern
          'Modern' table of contents style.
static class TOC.Simple
          'Simple' table of contents style.
 
Field Summary
protected  Color background
           
static TOC CLASSIC
          'Classic' table of contents style.
static TOC DEFAULT
          Default table of contents style.
protected  Font defFn
           
static TOC DISTINCTIVE
          'Distinctive' table of contents style.
static TOC FANCY
          'Fancy' table of contents style.
protected  Color foreground
           
static TOC FORMAL
          'Formal' table of contents style.
protected  String formatStr
           
static TOC MODERN
          'Modern' table of contents style.
static TOC SIMPLE
          'Simple' table of contents style.
 
Constructor Summary
TOC()
          Create a TOC class.
 
Method Summary
 Object clone()
          Make a copy of this object.
 int getAlignment(int level)
          Get the heading alignment.
 Color getBackground()
          Get the background color.
 Font getBaseFont()
          Get the base font of the table of contents.
 Font getFont(int level)
          Get the font for the toc level.
 Color getForeground()
          Get the foreground color.
 double getIndent(int level)
          Get the heading indentation.
 int getLeader(int level)
          Get the leader style for the toc level.
 Hashtable getLevelSpacings()
          Get the level spacings.
 String getPageFormat()
          Get the page number format.
 int getSeparator(int level)
          Get the separator for the toc level.
 boolean isPageNumberRight()
          Check if page number should be right aligned.
 void setBackground(Color background)
          Set the background color.
 void setBaseFont(Font font)
          Set the base font for the table of contents elements.
 void setForeground(Color foreground)
          Set the foreground color.
 void setLevelSpacings(Hashtable levelSpacing)
          Set the level spacings.
 void setPageFormat(String format)
          Set the page number format.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defFn

protected Font defFn

foreground

protected Color foreground

background

protected Color background

formatStr

protected String formatStr

DEFAULT

public static final TOC DEFAULT
Default table of contents style.


CLASSIC

public static final TOC CLASSIC
'Classic' table of contents style.


DISTINCTIVE

public static final TOC DISTINCTIVE
'Distinctive' table of contents style.


FANCY

public static final TOC FANCY
'Fancy' table of contents style.


MODERN

public static final TOC MODERN
'Modern' table of contents style.


FORMAL

public static final TOC FORMAL
'Formal' table of contents style.


SIMPLE

public static final TOC SIMPLE
'Simple' table of contents style.

Constructor Detail

TOC

public TOC()
Create a TOC class.

Method Detail

setBaseFont

public void setBaseFont(Font font)
Set the base font for the table of contents elements.

Parameters:
font - base font.

getBaseFont

public Font getBaseFont()
Get the base font of the table of contents.

Returns:
base font.

getForeground

public Color getForeground()
Get the foreground color.


setForeground

public void setForeground(Color foreground)
Set the foreground color.

Parameters:
foreground - foreground color.

getBackground

public Color getBackground()
Get the background color.

Returns:
background color.

setBackground

public void setBackground(Color background)
Set the background color.

Parameters:
background - background color.

getPageFormat

public String getPageFormat()
Get the page number format.

Returns:
page number format.

setPageFormat

public void setPageFormat(String format)
Set the page number format.

Parameters:
format - page number format.

getLevelSpacings

public Hashtable getLevelSpacings()
Get the level spacings.

Returns:
level spacings.

setLevelSpacings

public void setLevelSpacings(Hashtable levelSpacing)
Set the level spacings. The keys of the Hashtable should be "1", "2", etc.

Parameters:
levelSpacing - spacings of levels.

getIndent

public double getIndent(int level)
Get the heading indentation.

Parameters:
level - the heading level. Starts from 1.
Returns:
indentation in inches.

getAlignment

public int getAlignment(int level)
Get the heading alignment.

Parameters:
level - the heading level. Starts from 1.
Returns:
alignment flag.

getFont

public Font getFont(int level)
Get the font for the toc level.

Parameters:
level - the heading level. Starts from 1.
Returns:
heading font.

getSeparator

public int getSeparator(int level)
Get the separator for the toc level. If a value other than NONE is returned, a separator is added below every heading of the specified level.

Parameters:
level - the heading level. Starts from 1.
Returns:
heading separator.

getLeader

public int getLeader(int level)
Get the leader style for the toc level. If a value other than NONE is returned, a line is drawn between the heading and the page number.

Parameters:
level - the heading level. Starts from 1.
Returns:
leader line style.

isPageNumberRight

public boolean isPageNumberRight()
Check if page number should be right aligned.

Returns:
true if page number is right aligned.

clone

public Object clone()
Make a copy of this object.

Overrides:
clone in class Object

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.