Class CompositePiece
- java.lang.Object
-
- org.eclipse.nebula.paperclips.core.CompositePiece
-
- All Implemented Interfaces:
PrintPiece
public class CompositePiece extends java.lang.Object implements PrintPiece
A composite PrintPiece for displaying child PrintPieces. This class is especially useful for Print implementations that perform layout of multiple child Prints.
-
-
Field Summary
Fields Modifier and Type Field Description private CompositeEntry[]entriesprivate org.eclipse.swt.graphics.Pointsize
-
Constructor Summary
Constructors Constructor Description CompositePiece(java.util.List<CompositeEntry> entries)Constructs a composite PrintPiece with the given entries.CompositePiece(java.util.List<CompositeEntry> entries, org.eclipse.swt.graphics.Point size)Constructs a composite PrintPiece with the given entries and minimum size.CompositePiece(CompositeEntry[] entries)Constructs a CompositePiece with the given entries.CompositePiece(CompositeEntry[] entries, org.eclipse.swt.graphics.Point size)Constructs a CompositePrintPiece with the given entries and explicit size.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.util.List<CompositeEntry>createList(CompositeEntry[] entries)voiddispose()Disposes the system resources allocated by this PrintPiece.org.eclipse.swt.graphics.PointgetSize()Returns the dimensions of this PrintPiece, in pixels.voidpaint(org.eclipse.swt.graphics.GC gc, int x, int y)Draws this PrintPiece on the given graphics device, at the given coordinates.
-
-
-
Field Detail
-
size
private final org.eclipse.swt.graphics.Point size
-
entries
private final CompositeEntry[] entries
-
-
Constructor Detail
-
CompositePiece
public CompositePiece(CompositeEntry[] entries)
Constructs a CompositePiece with the given entries.- Parameters:
entries- an array of entries that make up this PrintPiece.
-
CompositePiece
public CompositePiece(CompositeEntry[] entries, org.eclipse.swt.graphics.Point size)
Constructs a CompositePrintPiece with the given entries and explicit size. This constructor will increase the explicit size to completely contain any child entries which extend outside the given size.- Parameters:
entries- an array of entries that make up this PrintPiece.size-
-
CompositePiece
public CompositePiece(java.util.List<CompositeEntry> entries)
Constructs a composite PrintPiece with the given entries.- Parameters:
entries- an array of entries that make up this PrintPiece.
-
CompositePiece
public CompositePiece(java.util.List<CompositeEntry> entries, org.eclipse.swt.graphics.Point size)
Constructs a composite PrintPiece with the given entries and minimum size.- Parameters:
entries- a list of CompositeEntry objects describing the child PrintPieces.size- a hint indicating the minimum size that should be reported from getSize(). This constructor increase this size to fit any entries that extend outside the given size.
-
-
Method Detail
-
createList
private static java.util.List<CompositeEntry> createList(CompositeEntry[] entries)
-
getSize
public org.eclipse.swt.graphics.Point getSize()
Description copied from interface:PrintPieceReturns the dimensions of this PrintPiece, in pixels.- Specified by:
getSizein interfacePrintPiece- Returns:
- the dimensions of this PrintPiece, in pixels.
-
paint
public void paint(org.eclipse.swt.graphics.GC gc, int x, int y)Description copied from interface:PrintPieceDraws this PrintPiece on the given graphics device, at the given coordinates.- Specified by:
paintin interfacePrintPiece- 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:PrintPieceDisposes 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:
disposein interfacePrintPiece
-
-