sos.reports
Class DefaultTheme

java.lang.Object
  |
  +--sos.reports.DefaultTheme
All Implemented Interfaces:
Theme

public class DefaultTheme
extends java.lang.Object
implements Theme

An implementation of Theme that delegates to an underlying instance of javax.swing.text.StyleContext.

Since:
1.0

Constructor Summary
DefaultTheme()
          Creates a DefaultTheme with a default name and an empty style context.
DefaultTheme(java.lang.String name)
          Creates a DefaultTheme with the specified name and an empty style context.
DefaultTheme(java.lang.String name, javax.swing.text.StyleContext styleContext)
          Creates a DefaultTheme with the specified name and style context.
DefaultTheme(javax.swing.text.StyleContext styleContext)
          Creates a DefaultTheme with a default name and the specified style context.
 
Method Summary
 java.lang.String getName()
          Returns the localized name of this theme.
 javax.swing.text.Style getStyle(java.lang.String name)
          Returns the style (or null, if none) associated with the specified name.
 javax.swing.text.StyleContext getStyleContext()
          Returns the style context to which this theme delegates.
 java.util.Set getStyleNames()
          Returns the names of all of the styles in this theme.
 java.lang.String toString()
          Returns a string representation of this theme.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultTheme

public DefaultTheme()
Creates a DefaultTheme with a default name and an empty style context.

See Also:
DefaultTheme(String,StyleContext)

DefaultTheme

public DefaultTheme(java.lang.String name)
Creates a DefaultTheme with the specified name and an empty style context.

Parameters:
name - localized name of this theme
See Also:
DefaultTheme(String,StyleContext)

DefaultTheme

public DefaultTheme(javax.swing.text.StyleContext styleContext)
Creates a DefaultTheme with a default name and the specified style context.

Parameters:
styleContext - style context that holds this theme's styles
See Also:
DefaultTheme(String,StyleContext)

DefaultTheme

public DefaultTheme(java.lang.String name,
                    javax.swing.text.StyleContext styleContext)
Creates a DefaultTheme with the specified name and style context.

Parameters:
name - localized name of this theme
styleContext - style context that holds this theme's styles
Throws:
java.lang.NullPointerException - if styleContext is null
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Theme
Returns the localized name of this theme.

Specified by:
getName in interface Theme
Returns:
this theme's name

getStyle

public javax.swing.text.Style getStyle(java.lang.String name)
Description copied from interface: Theme
Returns the style (or null, if none) associated with the specified name.

Specified by:
getStyle in interface Theme
Parameters:
name - name of the style for which to fetch
Returns:
the style named name, or null if no such style exists in this theme

getStyleContext

public javax.swing.text.StyleContext getStyleContext()
Returns the style context to which this theme delegates.

Returns:
this theme's style context

getStyleNames

public java.util.Set getStyleNames()
Description copied from interface: Theme
Returns the names of all of the styles in this theme.

Specified by:
getStyleNames in interface Theme
Returns:
an immutable unordered set of this theme's style names

toString

public java.lang.String toString()
Returns a string representation of this theme.

Overrides:
toString in class java.lang.Object
Returns:
this theme's name


Copyright 2003, 2004 Side of Software (SOS). All rights reserved.