Class TextPiece

java.lang.Object
org.eclipse.nebula.paperclips.core.text.internal.TextPiece
All Implemented Interfaces:
PrintPiece, TextPrintPiece

public class TextPiece
extends java.lang.Object
implements TextPrintPiece
  • Constructor Summary

    Constructors 
    Constructor Description
    TextPiece​(org.eclipse.swt.graphics.Device device, TextStyle style, java.lang.String[] text, org.eclipse.swt.graphics.Point size, int ascent)  
  • Method Summary

    Modifier and Type Method Description
    void dispose()
    Disposes the system resources allocated by this PrintPiece.
    int getAscent()
    Returns the ascent of the first line of text, in pixels.
    org.eclipse.swt.graphics.Point getSize()
    Returns the dimensions of this PrintPiece, in pixels.
    void paint​(org.eclipse.swt.graphics.GC gc, int x, int y)
    Draws this PrintPiece on the given graphics device, at the given coordinates.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TextPiece

      public TextPiece​(org.eclipse.swt.graphics.Device device, TextStyle style, java.lang.String[] text, org.eclipse.swt.graphics.Point size, int ascent)
  • Method Details

    • getSize

      public org.eclipse.swt.graphics.Point getSize()
      Description copied from interface: PrintPiece
      Returns the dimensions of this PrintPiece, in pixels.
      Specified by:
      getSize in interface PrintPiece
      Returns:
      the dimensions of this PrintPiece, in pixels.
    • getAscent

      public int getAscent()
      Description copied from interface: TextPrintPiece
      Returns the ascent of the first line of text, in pixels.
      Specified by:
      getAscent in interface TextPrintPiece
      Returns:
      the ascent of the first line of text, in pixels.
    • paint

      public void paint​(org.eclipse.swt.graphics.GC gc, int x, int y)
      Description copied from interface: PrintPiece
      Draws this PrintPiece on the given graphics device, at the given coordinates.
      Specified by:
      paint in interface PrintPiece
      Parameters:
      gc - a graphics context for the graphics device.
      x - the x coordinate where this PrintPiece will be drawn.
      y - the x coordinate where this PrintPiece will be drawn.
    • dispose

      public void dispose()
      Description copied from interface: PrintPiece
      Disposes the system resources allocated by this PrintPiece. The dispose method is not a permanent disposal of a PrintPiece. It is intended to reclaim system resources, however future calls to paint(GC,int,int) may require that the resources be allocated again.
      Specified by:
      dispose in interface PrintPiece