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
resolutionin DPI - the
sizeof features on paper relative to their size on the screen - the
number of pagesacross which the print should be spread out - the
scaleat 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
ConstructorsModifierConstructorDescriptionprotectedALcdViewComponentPrintable(Component aComponent) Creates a new view component printable for the given component. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChangeListener(ILcdChangeListener aListener) Registers the given listener so it will receive change events from this source.voidaddPropertyChangeListener(PropertyChangeListener aListener) Add a PropertyChangeListener to the listener list.voidaddStatusListener(ILcdStatusListener aListener) Adds a listener to be notified of printing progress.abstract TLcdPrintPreviewcreatePreview(PageFormat aPageFormat) Creates a preview panel for the given page format.protected final voidfireChangeEvent(TLcdChangeEvent aEvent) Fires the given change event to any registered change listeners.protected voidFire an existing PropertyChangeEvent to any registered listeners.protected voidfireStatusEvent(TLcdStatusEvent aStatusEvent) Fires a status event, thus notifying all listeners that were added usingaddStatusListener(com.luciad.util.ILcdStatusListener).Returns the component to print.abstract intgetDPI()Returns the used dpi.abstract doubleReturns the relative size of features (such as icons, labels or line widths) in a view.abstract doublegetMapScale(PageFormat aPageFormat) Returns the map scale (e.g.1:25.000).abstract intgetPageCountX(PageFormat aPageFormat) Returns the page count in the x-direction.abstract intgetPageCountY(PageFormat aPageFormat) Returns the page count in the y-direction.voidremoveChangeListener(ILcdChangeListener aListener) Removes the specified listener so it is no longer notified.voidRemove a PropertyChangeListener from the listener list.voidremoveStatusListener(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, waitMethods 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:ILcdChangeSourceRegisters 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
ALcdWeakChangeListenerinstance as change listener.- Specified by:
addChangeListenerin interfaceILcdChangeSource- Parameters:
aListener- The listener to be notified when a change has happened.- See Also:
-
removeChangeListener
Description copied from interface:ILcdChangeSourceRemoves the specified listener so it is no longer notified.- Specified by:
removeChangeListenerin 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:
addStatusListenerin interfaceILcdStatusSource- Parameters:
aListener- the listener to be notified
-
removeStatusListener
Removes a listener from the listeners to be notified of printing progress.- Specified by:
removeStatusListenerin 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.
-