Class GhostImageFigure

java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.draw2d.GhostImageFigure
All Implemented Interfaces:
IFigure

public class GhostImageFigure extends Figure
A figure used to render a partly transparent copy of an original source figure. This class is pretty much based on a sample, posted within the GEF newsgroup (http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg15158.html), although we decided to not cache the ghost image itself (but only its image data), so the figure does not have to be disposed (and may thus directly extend Figure rather than ImageFigure).
Since:
3.6
  • Constructor Details

    • GhostImageFigure

      public GhostImageFigure(IFigure source, int alpha, RGB transparency)
      The single constructor.
      Parameters:
      source - The original figure that will be used to render the ghost image.
      alpha - The desired transparency value, to be forwarded to Graphics.setAlpha(int).
      transparency - The RBG value of the color that is to be regarded as transparent. May be null.
  • Method Details

    • paintFigure

      protected void paintFigure(Graphics graphics)
      Description copied from class: Figure
      Paints this Figure's primary representation, or background. Changes made to the graphics to the graphics current state will not affect the subsequent calls to Figure.paintClientArea(Graphics) and Figure.paintBorder(Graphics). Furthermore, it is safe to call graphics.restoreState() within this method, and doing so will restore the graphics to its original state upon entry.
      Overrides:
      paintFigure in class Figure
      Parameters:
      graphics - The Graphics used to paint
      See Also: