ru.novosoft.dc.rtf.dom.objects
Class Shading

java.lang.Object
  |
  +--ru.novosoft.dc.rtf.dom.objects.Shading

public final class Shading
extends java.lang.Object
implements java.lang.Cloneable

The color shading class. It consists of the fill color, background color, and pattern style. Negative pattern style means shading with a special named pattern. A nonnegative style value in the range of 0..10000 means mixing of the background and fill color in hundredths of persent: 0 means shading with the pure background color, 10000 means shading with the pure fill color, 5000 means fifty-fifty shading, and so on.


Field Summary
static byte BACKWARD_DIAGONAL
          Backward diagonal background pattern (////).
static byte CROSS
          Cross background pattern.
static byte DARK_BACKWARD_DIAGONAL
          Dark backward diagonal background pattern (////).
static byte DARK_CROSS
          Dark cross background pattern.
static byte DARK_DIAGONAL_CROSS
          Dark diagonal cross background pattern.
static byte DARK_FORWARD_DIAGONAL
          Dark forward diagonal background pattern (\\\\).
static byte DARK_HORIZONTAL
          Dark horizontal background pattern.
static byte DARK_VERTICAL
          Dark vertical background pattern.
static byte DIAGONAL_CROSS
          Diagonal cross background pattern.
static byte FORWARD_DIAGONAL
          Forward diagonal background pattern (\\\\).
static byte HORIZONTAL
          Horizontal background pattern.
static byte VERTICAL
          Vertical background pattern.
 
Constructor Summary
Shading(RTFColor background, RTFColor fill)
          Construct a shading with initial values for background and fill colors.
 
Method Summary
 java.lang.Object clone()
          Creates a shallow copy of this object.
 boolean equals(java.lang.Object obj)
          Compare this shading with another shading and return true if shadings coinside.
 void exportTo(org.w3c.dom.Element elem, java.lang.String tagName)
          Export the contents of this object to the specified DOM element.
 RTFColor getBackgroundColor()
          Return the background color.
 RTFColor getFillColor()
          Return the fill color.
 int getStyle()
          Return the pattern/shading style.
 RTFColor mixedColor()
          Return a specially mixed color for the named pattern case and a color mixed in the specified ratio for the shading case.
 void setBackgroundColor(RTFColor value)
          Set the background color.
 void setFillColor(RTFColor value)
          Set the fill color.
 void setStyle(int value)
          Set pattern or shading style.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HORIZONTAL

public static final byte HORIZONTAL
Horizontal background pattern.

VERTICAL

public static final byte VERTICAL
Vertical background pattern.

FORWARD_DIAGONAL

public static final byte FORWARD_DIAGONAL
Forward diagonal background pattern (\\\\).

BACKWARD_DIAGONAL

public static final byte BACKWARD_DIAGONAL
Backward diagonal background pattern (////).

CROSS

public static final byte CROSS
Cross background pattern.

DIAGONAL_CROSS

public static final byte DIAGONAL_CROSS
Diagonal cross background pattern.

DARK_HORIZONTAL

public static final byte DARK_HORIZONTAL
Dark horizontal background pattern.

DARK_VERTICAL

public static final byte DARK_VERTICAL
Dark vertical background pattern.

DARK_FORWARD_DIAGONAL

public static final byte DARK_FORWARD_DIAGONAL
Dark forward diagonal background pattern (\\\\).

DARK_BACKWARD_DIAGONAL

public static final byte DARK_BACKWARD_DIAGONAL
Dark backward diagonal background pattern (////).

DARK_CROSS

public static final byte DARK_CROSS
Dark cross background pattern.

DARK_DIAGONAL_CROSS

public static final byte DARK_DIAGONAL_CROSS
Dark diagonal cross background pattern.
Constructor Detail

Shading

public Shading(RTFColor background,
               RTFColor fill)
Construct a shading with initial values for background and fill colors. Usually, the background color is white and the fill color is black. The default pattern style is set to zero.
Method Detail

setStyle

public final void setStyle(int value)
Set pattern or shading style. A negative value means a named pattern and a nonnegative value means shading in hundredths of persent.

getStyle

public final int getStyle()
Return the pattern/shading style.

setBackgroundColor

public final void setBackgroundColor(RTFColor value)
Set the background color.

getBackgroundColor

public final RTFColor getBackgroundColor()
Return the background color.

setFillColor

public final void setFillColor(RTFColor value)
Set the fill color.

getFillColor

public final RTFColor getFillColor()
Return the fill color.

mixedColor

public final RTFColor mixedColor()
Return a specially mixed color for the named pattern case and a color mixed in the specified ratio for the shading case.

clone

public java.lang.Object clone()
Creates a shallow copy of this object.
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Compare this shading with another shading and return true if shadings coinside.
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.