ru.novosoft.dc.rtf.dom
Class ShadingContext

java.lang.Object
  |
  +--ru.novosoft.dc.rtf.dom.ShadingContext
Direct Known Subclasses:
CellContext, CharacterContext, ParagraphContext, RowContext

public class ShadingContext
extends java.lang.Object
implements java.lang.Cloneable

The basic class for cell, paragraph, and character formatting contexts. It contains common properties for all mensioned contexts, namely the Shading object.


Constructor Summary
protected ShadingContext()
          Protected constructor is used in enherited classes.
 
Method Summary
 java.lang.Object clone()
          Create a clone of this context.
 void defineShadingBackground(ColorTable table, RTFColor color)
          Define a background color for shading.
 void defineShadingFill(ColorTable table, RTFColor color)
          Define a fill color for shading.
 void defineShadingStyle(ColorTable table, int style)
          Define a new pattern/shading style.
 boolean equals(java.lang.Object obj)
          Compare this context with another context and return true if contexts coinside in their shadings.
 void exportTo(org.w3c.dom.Element elem, java.lang.String tagName)
          Export the contents of this object to the specified DOM element.
 void reset()
          Reset the context to its default state (remove shading).
 Shading shading()
          Return a current shading or null if shading does not specified.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShadingContext

protected ShadingContext()
Protected constructor is used in enherited classes.
Method Detail

defineShadingStyle

public final void defineShadingStyle(ColorTable table,
                                     int style)
Define a new pattern/shading style.
Parameters:
table - a color table
style - a pattern/shading style (see Shading)

defineShadingBackground

public final void defineShadingBackground(ColorTable table,
                                          RTFColor color)
Define a background color for shading.
Parameters:
table - a color table
color - a background color

defineShadingFill

public final void defineShadingFill(ColorTable table,
                                    RTFColor color)
Define a fill color for shading.
Parameters:
table - a color table
color - a fill color

shading

public final Shading shading()
Return a current shading or null if shading does not specified.

reset

public void reset()
Reset the context to its default state (remove shading). This method is overlapped in subclasses to provide more actions on reset.

clone

public java.lang.Object clone()
Create a clone of this context.
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Compare this context with another context and return true if contexts coinside in their shadings. This method is overlapped in subclasses to provide more comparison.
Overrides:
equals in class java.lang.Object

exportTo

public void exportTo(org.w3c.dom.Element elem,
                     java.lang.String tagName)
Export the contents of this object to the specified DOM element.