Chart FX for Java 6.5

SoftwareFX.ChartFX
Class ImageBackground

java.lang.Object
  extended by SoftwareFX.ChartFX.ImageBackground
All Implemented Interfaces:
IAdornment

public final class ImageBackground
extends java.lang.Object
implements IAdornment

Provides access to the ImageBackground object.

The ImageBackground Class is used to set an image for the background of a chart. Using the BackObject property supported by the Chart object, developers may configure a selected image, with other attributes, to the chart:

ImageBackground ib = new ImageBackground();
ib.setBackColor(Color.RED);
ib.setMode(ImageMode.CENTER);
ib.setImage(java.awt.Toolkit.getDefaultToolkit().getImage("C:\\Image.bmp"));
chart1.setBackObject(ib);


Constructor Summary
ImageBackground()
           
ImageBackground(java.awt.Image image)
           
ImageBackground(java.lang.String path)
           
 
Method Summary
 void draw(java.awt.Graphics2D graphics2D, java.awt.Rectangle r, java.awt.Color clrExternal)
          Used to draw a Chart FX ImageBackground on a selected device context.
 java.awt.Color getBackColor()
          Gets the BackColor.
 java.awt.Image getImage()
          Gets the Image.
 int getMode()
          Gets the Mode.
 void setBackColor(java.awt.Color value)
          Gets or sets the backcolor when an ImageBackground object uses a picture with transparency.
 void setImage(java.awt.Image value)
          Gets or sets a image for the ImageBackground object.
 void setMode(int value)
          Gets or sets the rendering style for the image used as the ImageBackground.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageBackground

public ImageBackground()

ImageBackground

public ImageBackground(java.lang.String path)

ImageBackground

public ImageBackground(java.awt.Image image)
Method Detail

draw

public void draw(java.awt.Graphics2D graphics2D,
                 java.awt.Rectangle r,
                 java.awt.Color clrExternal)

Used to draw a Chart FX ImageBackground on a selected device context.

Remarks:
  • This method allows you to draw an ImageBackground to a selected device context without ever assigning the ImageBackground object to a chart.

  • Parameters:
    graphics2D -
    r - A Rectangle object specifying the desired position and size of the border.
    clrExternal - The external color for the border.

    getBackColor

    public java.awt.Color getBackColor()

    Gets the BackColor. For more detail see setBackColor(java.awt.Color).


    getImage

    public java.awt.Image getImage()

    Gets the Image. For more detail see setImage(java.awt.Image).


    getMode

    public int getMode()

    Gets the Mode. For more detail see setMode(int).


    setBackColor

    public void setBackColor(java.awt.Color value)

    Gets or sets the backcolor when an ImageBackground object uses a picture with transparency.

    Remarks:
  • Use the setImage(java.awt.Image) property to configure the picture file to be used for the ImageBackground.

  • The setMode(int) property is used to get or set the rendering style for the background image.

  • For more information regarding the Color type, please refer to the Java API Documentation.

  • See Also:
    setImage(java.awt.Image), setMode(int)

    setImage

    public void setImage(java.awt.Image value)

    Gets or sets a image for the ImageBackground object.

    Remarks:
  • To make the background image viewable, you may wish to configure the ChartCore.setInsideColor(java.awt.Color) of the chart to be transparent.

  • You may need to adjust the AxisSectionBase.setTextColor(java.awt.Color) and Chart.setFont(java.awt.Font) within the chart when using this property to make the chart readable.

  • The ImageBackground object is applied to a chart using the ChartCore.setBackObject(SoftwareFX.ChartFX.IAdornment) property. A GradientBackground may be assigned to the background using the BackObject property as well.

  • Use the setBackColor(java.awt.Color) property of the ImageBackground class to set a background color for images using transparency.ChartCore.setBackColor(java.awt.Color)

  • For more information regarding the Image type, please refer to the Java API Documentation.

  • An image has been set as the ChartCore.setBackObject(SoftwareFX.ChartFX.IAdornment) for the chart below:

  • See Also:
    ChartCore.setInsideColor(java.awt.Color), AxisSectionBase.setTextColor(java.awt.Color), Chart.setFont(java.awt.Font), ChartCore.setBackObject(SoftwareFX.ChartFX.IAdornment), setBackColor(java.awt.Color), GradientBackground

    setMode

    public void setMode(int value)

    Gets or sets the rendering style for the image used as the ImageBackground.

    Values:
    ImageMode : These values describe how an image will be displayed in the chart background when using the BackgroundImage property.
    ValueDescription
    ImageMode.STRETCHStretches or shrinks an image to fit in the chart background area.
    ImageMode.CLIPPEDPlaces the top left corner of the image in the top left corner of the chart background area.
    ImageMode.TILETiles an image in the chart background.
    ImageMode.CENTERCenters an image in the chart background.
    ImageMode.WATERMARKCreates a watermark with the configured background image.

    Remarks:
  • This property is used to set the style for the picture configured with the setImage(java.awt.Image) property.

  • Use the setBackColor(java.awt.Color) property of the ImageBackground class to set a background color for images using transparency.

  • See Also:
    setImage(java.awt.Image), setBackColor(java.awt.Color)

    http://www.softwarefx.com

    2007 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
    All other names are trademarks or registered trademarks of their respective owners.