Class ALcdViewComponentPrintable
- All Implemented Interfaces:
ILcdChangeSource
,ILcdDisposable
,ILcdStatusSource
,Printable
,AutoCloseable
- Direct Known Subclasses:
TLcdGXYViewComponentPrintable
,TLspViewComponentPrintable
Component
containing a view component.
It defines the following properties:
- the desired
resolution
in DPI - the
size
of features on paper relative to their size on the screen - the
number of pages
across which the print should be spread out - the
scale
at which to print out the map
print preview
component to preview what the print will look like.- Since:
- 2013.0
-
Field Summary
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
-
Constructor Summary
ModifierConstructorDescriptionprotected
ALcdViewComponentPrintable
(Component aComponent) Creates a new view component printable for the given component. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener
(ILcdChangeListener aListener) Registers the given listener so it will receive change events from this source.void
addPropertyChangeListener
(PropertyChangeListener aListener) Add a PropertyChangeListener to the listener list.void
addStatusListener
(ILcdStatusListener aListener) Adds a listener to be notified of printing progress.abstract TLcdPrintPreview
createPreview
(PageFormat aPageFormat) Creates a preview panel for the given page format.protected final void
fireChangeEvent
(TLcdChangeEvent aEvent) Fires the given change event to any registered change listeners.protected void
Fire an existing PropertyChangeEvent to any registered listeners.protected void
fireStatusEvent
(TLcdStatusEvent aStatusEvent) Fires a status event, thus notifying all listeners that were added usingaddStatusListener(com.luciad.util.ILcdStatusListener)
.Returns the component to print.abstract int
getDPI()
Returns the used dpi.abstract double
Returns the relative size of features (such as icons, labels or line widths) in a view.abstract double
getMapScale
(PageFormat aPageFormat) Returns the map scale (e.g.1:25.000
).abstract int
getPageCountX
(PageFormat aPageFormat) Returns the page count in the x-direction.abstract int
getPageCountY
(PageFormat aPageFormat) Returns the page count in the y-direction.void
removeChangeListener
(ILcdChangeListener aListener) Removes the specified listener so it is no longer notified.void
Remove a PropertyChangeListener from the listener list.void
removeStatusListener
(ILcdStatusListener aListener) Removes a listener from the listeners to be notified of printing progress.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.util.ILcdDisposable
close, dispose
-
Constructor Details
-
ALcdViewComponentPrintable
Creates a new view component printable for the given component.- Parameters:
aComponent
- the component to print.
-
-
Method Details
-
addChangeListener
Description copied from interface:ILcdChangeSource
Registers the given listener so it will receive change events from this source.
In case you need to register a listener which keeps a reference to an object with a shorter life-time than this change source, you can use a
ALcdWeakChangeListener
instance as change listener.- Specified by:
addChangeListener
in interfaceILcdChangeSource
- Parameters:
aListener
- The listener to be notified when a change has happened.- See Also:
-
removeChangeListener
Description copied from interface:ILcdChangeSource
Removes the specified listener so it is no longer notified.- Specified by:
removeChangeListener
in interfaceILcdChangeSource
- Parameters:
aListener
- The listener to remove.
-
fireChangeEvent
Fires the given change event to any registered change listeners.- Parameters:
aEvent
- a change event.
-
addPropertyChangeListener
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.- Parameters:
aListener
- The PropertyChangeListener to be added
-
removePropertyChangeListener
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.- Parameters:
aListener
- The PropertyChangeListener to be removed
-
firePropertyChange
Fire an existing PropertyChangeEvent to any registered listeners. No event is fired if the given event's old and new values are equal and non-null.- Parameters:
aEvent
- The PropertyChangeEvent object.
-
addStatusListener
Adds a listener to be notified of printing progress.- Specified by:
addStatusListener
in interfaceILcdStatusSource
- Parameters:
aListener
- the listener to be notified
-
removeStatusListener
Removes a listener from the listeners to be notified of printing progress.- Specified by:
removeStatusListener
in interfaceILcdStatusSource
- Parameters:
aListener
- the listener that should no longer be notified
-
fireStatusEvent
Fires a status event, thus notifying all listeners that were added usingaddStatusListener(com.luciad.util.ILcdStatusListener)
.- Parameters:
aStatusEvent
- the status event to pass to all listeners.
-
getComponent
Returns the component to print.- Returns:
- the component to print.
-
getPageCountX
Returns the page count in the x-direction.- Parameters:
aPageFormat
- the page format- Returns:
- the page count in the x-direction.
-
getPageCountY
Returns the page count in the y-direction.- Parameters:
aPageFormat
- the page format- Returns:
- the page count in the y-direction.
-
getMapScale
Returns the map scale (e.g.1:25.000
).- Parameters:
aPageFormat
- the page format- Returns:
- the map scale.
-
createPreview
Creates a preview panel for the given page format.- Parameters:
aPageFormat
- the page format to use- Returns:
- a panel visualizing the component
-
getDPI
public abstract int getDPI()Returns the used dpi.- Returns:
- the used dpi.
-
getFeatureScale
public abstract double getFeatureScale()Returns the relative size of features (such as icons, labels or line widths) in a view. The default value is 1.Lower values will make features proportionally smaller (allowing, for instance, more labels to be placed). Higher values will make features proportionally larger (for instance, to make text more readable on very high-resolution displays).
Feature scale may also affect level-of-detail decisions, e.g. for raster layers. Lower feature scales may cause higher detail levels to be shown (and vice versa).
A possible use case is printing a complex CAD drawing, where you would like to reduce the line widths to get a detailed print-out. Use for example
0.25
. Another use case is to make a print-out that will be looked at from a distance. A larger value (e.g.2.0
) makes sure the lines are still visible from a distance.- Returns:
- the used feature scale.
-