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
changeSupportFields inherited from interface com.luciad.gui.ILcdAction
DEFAULT, LONG_DESCRIPTION, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SHOW_ACTION_NAME, SMALL_ICON, VISIBLE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newTLcdPrintComponentActionwithout an initialComponent.TLcdPrintComponentAction(Component aComponent) Creates a newTLcdPrintComponentActionfor 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 TypeMethodDescriptionvoidactionPerformed(ActionEvent aActionEvent) booleanReturns whether a border is drawn around the component.Returns the component to be printed.booleanReturns whether crop marks are drawn on multi-page prints.booleanReturns whether layered rendering is forced.booleanReturns whether layered rendering is enabled.Returns the origin of the component on the page.Return the page format.booleanReturns whether positioning marks are drawn on multi-page prints.Returns the printer job.intReturns the maximum number of pixels in a strip of the rasterized layer.doubleReturns the quality factor for the rasterized layer.booleanReturns whether rasterized rendering is enabled.doublegetScale()Returns the scale of the component on the page.voidsetBorder(boolean aBorder) Specifies whether to draw a border around the component.voidsetComponent(Component aComponent) Sets the component to be printed.voidsetCropMarks(boolean aCropMarks) Specifies whether to draw crop marks on multi-page prints.voidsetForceLayeredRendering(boolean aForceLayeredRendering) Specifies whether to force layered rendering, rather than only using it when necessary.voidsetLayeredRendering(boolean aLayeredRendering) Specifies whether to use layered rendering, when necessary.voidSets the origin of the component on the page.voidsetPageFormat(PageFormat aPageFormat) Sets the page format.voidsetPositioningMarks(boolean aPositioningMarks) Specifies whether to draw positioning marks on multi-page prints.voidsetPrinterJob(PrinterJob aPrinterJob) Sets the printer job.voidsetRasterizedLayerMaximumStripSize(int aRasterizedLayerMaximumStripSize) Sets the maximum number of pixels in a strip of the rasterized layer.voidsetRasterizedLayerQualityFactor(double aRasterizedLayerQualityFactor) Sets the quality factor for the rasterized layer.voidsetRasterizedRendering(boolean aRasterizedRendering) Specifies whether to use rasterized rendering, when necessary.voidsetScale(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, setTraceOnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.gui.ILcdAction
getValue, isEnabled, putValue, setEnabledMethods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
TLcdPrintComponentAction
public TLcdPrintComponentAction()Creates a newTLcdPrintComponentActionwithout an initialComponent. -
TLcdPrintComponentAction
Creates a newTLcdPrintComponentActionfor 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, ornullto let the user select one.aPageFormat- the page format to be used, ornullto 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:
actionPerformedin interfaceActionListener
-