public class PrintingEvent extends Event implements IEventArgs
com.yworks.yfiles.canvas.CanvasPrinter
to
inform clients when a page is about to be printed or after it was printed.
The event holds information about the render context for the initial printed content,
the currently printed node (that is, the Node object that is passed to PrinterJob.printPage(javafx.print.PageLayout, javafx.scene.Node)
),
the current row and column of the raster printing (in case of multiple pages)
as well as general information of the current printing process.
Listening for this event can be used to make customizations to the node of the printing process. Modifying other values carried along with this event has no effect.
com.yworks.yfiles.canvas.CanvasPrinter#addPrintingListener(com.yworks.util.EventHandler)
,
com.yworks.yfiles.canvas.CanvasPrinter#addPrintedListener(com.yworks.util.EventHandler)
,
Serialized FormModifier and Type | Field and Description |
---|---|
static EventType<PrintingEvent> |
ANY
Common supertype for all printing event types.
|
static EventType<PrintingEvent> |
POSTPROCESS
Event type for the event that can be used to make customizations to the node to print on a specific page after the
page was
printed . |
static EventType<PrintingEvent> |
PREPROCESS
Event type for the event that can be used to make customizations to the node to print on a specific page before the
page is
printed . |
consumed, eventType, NULL_SOURCE_TARGET, target
source
EMPTY
Constructor and Description |
---|
PrintingEvent(IRenderContext context,
EventType<PrintingEvent> eventType,
Node node,
int row,
int col,
CanvasPrinter.PrintInfo printInfo)
Initializes a new instance of the
PrintingEvent class. |
Modifier and Type | Method and Description |
---|---|
int |
getColumn()
Gets the index of the column of the page that is about to be or was printed.
|
IRenderContext |
getContext()
Gets the context that was used initially to create the node that is being printed.
|
Node |
getNode()
Returns the node to be printed.
|
CanvasPrinter.PrintInfo |
getPrintInfo()
Gets the
com.yworks.yfiles.canvas.CanvasPrinter.PrintInfo of the printing process. |
int |
getRow()
Gets the index of the row of the page that is about to be or was printed.
|
clone, consume, copyFor, fireEvent, getEventType, getTarget, isConsumed
getSource, toString
public static final EventType<PrintingEvent> ANY
public static final EventType<PrintingEvent> POSTPROCESS
printed
.public static final EventType<PrintingEvent> PREPROCESS
printed
.public PrintingEvent(IRenderContext context, EventType<PrintingEvent> eventType, Node node, int row, int col, CanvasPrinter.PrintInfo printInfo)
PrintingEvent
class.context
- The initial context which can be modified by the event handlers.eventType
- Either PREPROCESS
or POSTPROCESS
.node
- The node that is currently being printed.row
- The index of the row of the page that is about to be or was printed.col
- The index of the column of the page that is about to be or was printed.printInfo
- Information about the printing process in general.public int getColumn()
public IRenderContext getContext()
public Node getNode()
public CanvasPrinter.PrintInfo getPrintInfo()
com.yworks.yfiles.canvas.CanvasPrinter.PrintInfo
of the printing process.public int getRow()