org.scilab.forge.scirenderer.texture
Class BufferedImageTextureDrawingTools

java.lang.Object
  extended by org.scilab.forge.scirenderer.texture.BufferedImageTextureDrawingTools
All Implemented Interfaces:
TextureDrawingTools

public class BufferedImageTextureDrawingTools
extends java.lang.Object
implements TextureDrawingTools

Implementation of TextureDrawingTools. This implementation create a TextureBufferedImage an fill it with texture drawing.

Author:
Pierre Lando

Constructor Summary
BufferedImageTextureDrawingTools(java.awt.Dimension textureSize)
          Default constructor.
 
Method Summary
 void accept(TextureDrawer textureDrawer)
          Ask this image to accept a texture drawer.
 void clear(Color color)
          Clear the sprite with the given color.
 void draw(javax.swing.Icon icon, int x, int y)
          Draw the given Icon at the given position.
 void draw(TextEntity textEntity, int x, int y)
          Draw the given text at the given position with the given appearance.
 void drawCircle(int x, int y, int diameter, Appearance appearance)
          Draw a circle.
 void drawPolyline(int[] coordinates, Appearance appearance)
          Draw a polyline.
 void fillDisc(int x, int y, int diameter, Color color)
          Fill a disc of given diameter, centered at (x, y) with the given appearance.
 void fillPolygon(int[] coordinates, Appearance appearance)
          Fill a polygon.
 TextureBufferedImage getImage()
          Return the image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferedImageTextureDrawingTools

public BufferedImageTextureDrawingTools(java.awt.Dimension textureSize)
Default constructor.

Parameters:
textureSize - the texture size.
Method Detail

accept

public void accept(TextureDrawer textureDrawer)
Ask this image to accept a texture drawer. This image will contain the drawing of the given drawer.

Parameters:
textureDrawer - the given texture drawer.

drawPolyline

public void drawPolyline(int[] coordinates,
                         Appearance appearance)
Description copied from interface: TextureDrawingTools
Draw a polyline.

Specified by:
drawPolyline in interface TextureDrawingTools
Parameters:
coordinates - polyline's point coordinates.
appearance - the used appearance.

fillPolygon

public void fillPolygon(int[] coordinates,
                        Appearance appearance)
Description copied from interface: TextureDrawingTools
Fill a polygon.

Specified by:
fillPolygon in interface TextureDrawingTools
Parameters:
coordinates - polygon's point coordinates.
appearance - the used appearance.

drawCircle

public void drawCircle(int x,
                       int y,
                       int diameter,
                       Appearance appearance)
Description copied from interface: TextureDrawingTools
Draw a circle.

Specified by:
drawCircle in interface TextureDrawingTools
Parameters:
x - the x coordinate of the circle center.
y - the y coordinate of the circle center.
diameter - the circle diameter.
appearance - the circle appearance.

fillDisc

public void fillDisc(int x,
                     int y,
                     int diameter,
                     Color color)
Description copied from interface: TextureDrawingTools
Fill a disc of given diameter, centered at (x, y) with the given appearance.

Specified by:
fillDisc in interface TextureDrawingTools
Parameters:
x - the x coordinate of the disc center.
y - the y coordinate of the disc center.
diameter - the disc diameter.
color - the disc color.

draw

public void draw(TextEntity textEntity,
                 int x,
                 int y)
Description copied from interface: TextureDrawingTools
Draw the given text at the given position with the given appearance.

Specified by:
draw in interface TextureDrawingTools
Parameters:
textEntity - the text entity to draw.
x - the x text position.
y - the y text position.

draw

public void draw(javax.swing.Icon icon,
                 int x,
                 int y)
Description copied from interface: TextureDrawingTools
Draw the given Icon at the given position.

Specified by:
draw in interface TextureDrawingTools
Parameters:
icon - the given icon to paint.
x - the x text position.
y - the y text position.

clear

public void clear(Color color)
Description copied from interface: TextureDrawingTools
Clear the sprite with the given color.

Specified by:
clear in interface TextureDrawingTools
Parameters:
color - the new background color.

getImage

public TextureBufferedImage getImage()
Return the image.

Returns:
the image.