Package com.luciad.gui
Class TLcdPrintComponentAction
java.lang.Object
com.luciad.gui.ALcdAction
com.luciad.gui.TLcdPrintComponentAction
- All Implemented Interfaces:
ILcdAction
,ILcdPropertyChangeSource
,ActionListener
,Serializable
,EventListener
This
ILcdAction
prints the contents of a given
Component
. If the printer and page format aren't specified,
the user is presented with menus to select them.- See Also:
-
Field Summary
Fields inherited from class com.luciad.gui.ALcdAction
changeSupport
Fields inherited from interface com.luciad.gui.ILcdAction
DEFAULT, LONG_DESCRIPTION, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SHOW_ACTION_NAME, SMALL_ICON, VISIBLE
-
Constructor Summary
ConstructorDescriptionCreates a newTLcdPrintComponentAction
without an initialComponent
.TLcdPrintComponentAction
(Component aComponent) Creates a newTLcdPrintComponentAction
for a given initialComponent
.TLcdPrintComponentAction
(Component aComponent, PrinterJob aPrinterJob, PageFormat aPageFormat) Creates a Print action with a component to print and a specified PageFormat on the printed page. -
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerformed
(ActionEvent aActionEvent) boolean
Returns whether a border is drawn around the component.Returns the component to be printed.boolean
Returns whether crop marks are drawn on multi-page prints.boolean
Returns whether layered rendering is forced.boolean
Returns whether layered rendering is enabled.Returns the origin of the component on the page.Return the page format.boolean
Returns whether positioning marks are drawn on multi-page prints.Returns the printer job.int
Returns the maximum number of pixels in a strip of the rasterized layer.double
Returns the quality factor for the rasterized layer.boolean
Returns whether rasterized rendering is enabled.double
getScale()
Returns the scale of the component on the page.void
setBorder
(boolean aBorder) Specifies whether to draw a border around the component.void
setComponent
(Component aComponent) Sets the component to be printed.void
setCropMarks
(boolean aCropMarks) Specifies whether to draw crop marks on multi-page prints.void
setForceLayeredRendering
(boolean aForceLayeredRendering) Specifies whether to force layered rendering, rather than only using it when necessary.void
setLayeredRendering
(boolean aLayeredRendering) Specifies whether to use layered rendering, when necessary.void
Sets the origin of the component on the page.void
setPageFormat
(PageFormat aPageFormat) Sets the page format.void
setPositioningMarks
(boolean aPositioningMarks) Specifies whether to draw positioning marks on multi-page prints.void
setPrinterJob
(PrinterJob aPrinterJob) Sets the printer job.void
setRasterizedLayerMaximumStripSize
(int aRasterizedLayerMaximumStripSize) Sets the maximum number of pixels in a strip of the rasterized layer.void
setRasterizedLayerQualityFactor
(double aRasterizedLayerQualityFactor) Sets the quality factor for the rasterized layer.void
setRasterizedRendering
(boolean aRasterizedRendering) Specifies whether to use rasterized rendering, when necessary.void
setScale
(double aScale) Sets the scale of the component on the page.Methods inherited from class com.luciad.gui.ALcdAction
addPropertyChangeListener, firePropertyChange, getDisplayName, getIcon, getLongDescription, getName, getShortDescription, getValue, isEnabled, isTraceOn, putValue, registerInstance, removePropertyChangeListener, setClassTraceOn, setDisplayName, setEnabled, setIcon, setLongDescription, setName, setShortDescription, setTraceOn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.gui.ILcdAction
getValue, isEnabled, putValue, setEnabled
Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
TLcdPrintComponentAction
public TLcdPrintComponentAction()Creates a newTLcdPrintComponentAction
without an initialComponent
. -
TLcdPrintComponentAction
Creates a newTLcdPrintComponentAction
for a given initialComponent
.- Parameters:
aComponent
- the component to be printed.
-
TLcdPrintComponentAction
public TLcdPrintComponentAction(Component aComponent, PrinterJob aPrinterJob, PageFormat aPageFormat) Creates a Print action with a component to print and a specified PageFormat on the printed page.- Parameters:
aComponent
- the component to be printed.aPrinterJob
- the printer to be used, ornull
to let the user select one.aPageFormat
- the page format to be used, ornull
to let the user select one.
-
-
Method Details
-
setPrinterJob
Sets the printer job. -
getPrinterJob
Returns the printer job. -
setPageFormat
Sets the page format. -
getPageFormat
Return the page format. -
setComponent
Sets the component to be printed. -
getComponent
Returns the component to be printed.- See Also:
-
setOrigin
Sets the origin of the component on the page. The default isnull
, meaning that the component is automatically centered on the page. -
getOrigin
Returns the origin of the component on the page.- See Also:
-
setScale
public void setScale(double aScale) Sets the scale of the component on the page. A scale of 1.0 maps one unit of the component (a pixel) to one unit of the printer graphics (typically 1/72"). Larger scales increase the size of the component on the print, smaller scales decrease the size. A value of 0.0 automatically scales the component so that it fits on the imageable part of the paper. This is also the default. -
getScale
public double getScale()Returns the scale of the component on the page.- See Also:
-
setBorder
public void setBorder(boolean aBorder) Specifies whether to draw a border around the component. The default istrue
. -
getBorder
public boolean getBorder()Returns whether a border is drawn around the component. -
setCropMarks
public void setCropMarks(boolean aCropMarks) Specifies whether to draw crop marks on multi-page prints. The default istrue
. -
getCropMarks
public boolean getCropMarks()Returns whether crop marks are drawn on multi-page prints. -
setPositioningMarks
public void setPositioningMarks(boolean aPositioningMarks) Specifies whether to draw positioning marks on multi-page prints. The default istrue
. -
getPositioningMarks
public boolean getPositioningMarks()Returns whether positioning marks are drawn on multi-page prints. -
setRasterizedRendering
public void setRasterizedRendering(boolean aRasterizedRendering) Specifies whether to use rasterized rendering, when necessary. This technique improves memory usage of prints that contain transparent and translucent elements. Rasterized rendering is enabled by default. -
getRasterizedRendering
public boolean getRasterizedRendering()Returns whether rasterized rendering is enabled.- See Also:
-
setLayeredRendering
public void setLayeredRendering(boolean aLayeredRendering) Specifies whether to use layered rendering, when necessary. This technique improves memory usage and quality of prints that contain transparent and translucent elements. Layered rendering is enabled by default. -
getLayeredRendering
public boolean getLayeredRendering()Returns whether layered rendering is enabled.- See Also:
-
setForceLayeredRendering
public void setForceLayeredRendering(boolean aForceLayeredRendering) Specifies whether to force layered rendering, rather than only using it when necessary. While producing files that may be larger than strictly necessary, forcing layered rendering can be useful to avoid the possible small discrepancies between filled graphics as they are painted on the screen and as they are painted by the printer driver. More specifically, filled polygons or parts of polygons with zero thickness may look different on the screen and in print. Layered rendering is not forced by default. -
getForceLayeredRendering
public boolean getForceLayeredRendering()Returns whether layered rendering is forced.- See Also:
-
setRasterizedLayerQualityFactor
public void setRasterizedLayerQualityFactor(double aRasterizedLayerQualityFactor) Sets the quality factor for the rasterized layer. By default (with a factor of 1.0), when rasterization is required in the layered rendering technique, an image buffer the size of the component is created. Larger factors increase the width and height of the image buffer proportionally, increasing the quality of the rasterized layer. Of course, larger factors also increase the printing time and the size of the printer output file. -
getRasterizedLayerQualityFactor
public double getRasterizedLayerQualityFactor()Returns the quality factor for the rasterized layer.- See Also:
-
setRasterizedLayerMaximumStripSize
public void setRasterizedLayerMaximumStripSize(int aRasterizedLayerMaximumStripSize) Sets the maximum number of pixels in a strip of the rasterized layer. If the layered rendering technique performs rasterization, an image buffer with a size proportional to the size of the component is created. In order to reduce memory usage of the printing system, the full buffer can be replaced by small strips that are processed subsequently. A value of 0 indicates not to use strips. The default maximum number of pixels is 106. -
getRasterizedLayerMaximumStripSize
public int getRasterizedLayerMaximumStripSize()Returns the maximum number of pixels in a strip of the rasterized layer.- See Also:
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
-