com.steema.teechart.drawing
Class ChartBrush

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.drawing.ChartBrush

public final class ChartBrush
extends TeeBase

Title: ChartBrush class

Description: Common Chart Brush (pattern) used to fill polygons and rectangles.

Copyright (c) 2005-2012 by Steema Software SL. All Rights Reserved.

Company: Steema Software SL


Field Summary
protected  Color color
           
protected  Color defaultColor
           
protected  boolean defaultVisible
           
protected  boolean visible
           
 
Fields inherited from class com.steema.teechart.TeeBase
chart, InternalUse
 
Constructor Summary
ChartBrush(IBaseChart c)
           
ChartBrush(IBaseChart c, boolean startVisible)
           
ChartBrush(IBaseChart c, Color aColor)
           
ChartBrush(IBaseChart c, Color aColor, boolean startVisible)
           
 
Method Summary
protected  void applyDark(Color aColor, int quantity)
           
 void applyDark(int quantity)
           
 void assign(ChartBrush b)
           
 void clearImage()
          Clears the ChartBrush element from all associated bitmap images.
 Color getColor()
          Determines the color used to fill a zone.
 Color getForegroundColor()
          Color to fill inner portions of Brush, when Solid is false.
 Gradient getGradient()
          Fill Gradient.
 boolean getGradientVisible()
           
 Image getImage()
          Image to use for fill.
 ImageMode getImageMode()
          Drawing Brush Image Style.
 Rectangle getImageRect()
           
 boolean getImageTransparent()
          The Brush image will be Transparent when true.
 boolean getSolid()
          Fills using Color only.
 HatchStyle getStyle()
          Determines the style in which the zone is filled or patterned using both Color and ForegroundColor.
 int getTransparency()
          The Transparency level from 0 to 100%.
 boolean getVisible()
          Determines if the brush will draw lines or not.
 boolean getWrapTile()
          Drawing Brush Image Style.
 void invalidate()
          Use invalidate when the entire canvas needs to be repainted.
 void loadImage(java.io.InputStream stream)
          Loads a bitmap into a ChartBrush element from the specified stream.
 void loadImage(java.lang.String fileName)
          Loads a bitmap into a ChartBrush element from the specified path.
 void reset()
           
 void setChart(IBaseChart c)
          Chart associated with this object.
 void setColor(Color value)
          Specifies the color used to fill a zone.
 void setDefaultColor(Color value)
           
 void setDefaultVisible(boolean value)
           
 void setForegroundColor(Color value)
          Specifies the Color to fill inner portions of Brush, when Solid is false.
 void setGradient(Gradient value)
          Sets the Gradient fill.
 void setImage(Image value)
          Image to use for fill.
 void setImageMode(ImageMode value)
          Drawing Brush Image Style.
 void setImageTransparent(boolean value)
          Sets the Brush image to Transparent.
 void setSolid(boolean value)
          Fills using Color only.
 void setStyle(HatchStyle value)
          Determines the style in which the zone is filled or patterned using both Color and ForegroundColor.
 void setTransparency(int value)
          Sets Transparency level from 0 to 100%.
 void setVisible(boolean value)
          Determines if the brush will draw lines or not.
 void setWrapTile(boolean value)
          Drawing Brush Image Style.
 
Methods inherited from class com.steema.teechart.TeeBase
getChart, setBooleanProperty, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

visible

protected boolean visible

color

protected Color color

defaultColor

protected transient Color defaultColor

defaultVisible

protected transient boolean defaultVisible
Constructor Detail

ChartBrush

public ChartBrush(IBaseChart c,
                  boolean startVisible)

ChartBrush

public ChartBrush(IBaseChart c)

ChartBrush

public ChartBrush(IBaseChart c,
                  Color aColor)

ChartBrush

public ChartBrush(IBaseChart c,
                  Color aColor,
                  boolean startVisible)
Method Detail

reset

public void reset()

assign

public void assign(ChartBrush b)

setDefaultColor

public void setDefaultColor(Color value)

setChart

public void setChart(IBaseChart c)
Description copied from class: TeeBase
Chart associated with this object.

Overrides:
setChart in class TeeBase
Parameters:
c - IBaseChart

getTransparency

public int getTransparency()
The Transparency level from 0 to 100%.
Transparency is a value between 0 and 100 which sets the transparency percentage with respect to foreground versus background.
Default value: 0

Returns:
int

setTransparency

public void setTransparency(int value)
Sets Transparency level from 0 to 100%.
Default value: 0

Parameters:
value - int

getSolid

public boolean getSolid()
Fills using Color only. Does not use Foreground color.
Default value: true

Returns:
boolean

setSolid

public void setSolid(boolean value)
Fills using Color only. Does not use Foreground color.
Default value: true

Parameters:
value - boolean

getImageTransparent

public boolean getImageTransparent()
The Brush image will be Transparent when true.
Default value: false

Returns:
boolean

setImageTransparent

public void setImageTransparent(boolean value)
Sets the Brush image to Transparent.
Default value: false

Parameters:
value - boolean

getGradientVisible

public boolean getGradientVisible()

getGradient

public Gradient getGradient()
Fill Gradient.
Gradient specifies the colors used to fill a zone. The zone is filled using these three colors: StartColor, MidColor and EndColor. You can control the drawing output by setting Gradient.Direction.
Use the Visible property to show / hide filling.
Default value: null

Returns:
Gradient

setGradient

public void setGradient(Gradient value)
Sets the Gradient fill.
Default value: null

Parameters:
value - Gradient

invalidate

public void invalidate()
Use invalidate when the entire canvas needs to be repainted.
When more than one region within the canvas needs repainting, Invalidate will cause the entire window to be repainted in a single pass, avoiding flicker caused by redundant repaints. There is no performance penalty for calling Invalidate multiple times before the control is actually repainted.

Overrides:
invalidate in class TeeBase

getImageMode

public ImageMode getImageMode()
Drawing Brush Image Style.
Default value: Stretch

Returns:
ImageMode

setImageMode

public void setImageMode(ImageMode value)
Drawing Brush Image Style.
Default value: Stretch

Parameters:
value - ImageMode

getImageRect

public Rectangle getImageRect()

getWrapTile

public boolean getWrapTile()
Drawing Brush Image Style.
Default value: Tile

Returns:
boolean

setWrapTile

public void setWrapTile(boolean value)
Drawing Brush Image Style.
Default value: Tile

Parameters:
value - boolean

getForegroundColor

public Color getForegroundColor()
Color to fill inner portions of Brush, when Solid is false.
Default value: SILVER

Returns:
Color

setForegroundColor

public void setForegroundColor(Color value)
Specifies the Color to fill inner portions of Brush, when Solid is false.
Default value: SILVER

Parameters:
value - Color

applyDark

protected void applyDark(Color aColor,
                         int quantity)

applyDark

public void applyDark(int quantity)

getColor

public Color getColor()
Determines the color used to fill a zone.

Returns:
Color

setColor

public void setColor(Color value)
Specifies the color used to fill a zone.

Parameters:
value - Color

getVisible

public boolean getVisible()
Determines if the brush will draw lines or not.

Returns:
boolean

setVisible

public void setVisible(boolean value)
Determines if the brush will draw lines or not.

Parameters:
value - boolean

setDefaultVisible

public void setDefaultVisible(boolean value)

getStyle

public HatchStyle getStyle()
Determines the style in which the zone is filled or patterned using both Color and ForegroundColor.
Default value: HatchStyle.BackwardDiagonal

Returns:
HatchStyle

setStyle

public void setStyle(HatchStyle value)
Determines the style in which the zone is filled or patterned using both Color and ForegroundColor.
Default value: HatchStyle.BackwardDiagonal

Parameters:
value - HatchStyle

getImage

public Image getImage()
Image to use for fill.
Default value: null

Returns:
Image

setImage

public void setImage(Image value)
Image to use for fill.
Default value: null

Parameters:
value - Image

loadImage

public void loadImage(java.lang.String fileName)
Loads a bitmap into a ChartBrush element from the specified path.

Parameters:
fileName - String

loadImage

public void loadImage(java.io.InputStream stream)
Loads a bitmap into a ChartBrush element from the specified stream.

Parameters:
stream - InputStream

clearImage

public void clearImage()
Clears the ChartBrush element from all associated bitmap images.