public abstract class ALcdViewComponentPrintable extends Object implements Printable, ILcdChangeSource, ILcdDisposable, ILcdStatusSource
Component
containing a view component.
It defines the following properties:
resolution
in DPIsize
of features on paper relative to their size on the screennumber of pages
across which the print should be spread outscale
at which to print out the mapprint preview
component to preview what the print will look like.NO_SUCH_PAGE, PAGE_EXISTS
Modifier | Constructor and Description |
---|---|
protected |
ALcdViewComponentPrintable(Component aComponent)
Creates a new view component printable for the given component.
|
Modifier and Type | Method and Description |
---|---|
void |
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 void |
fireChangeEvent(TLcdChangeEvent aEvent)
Fires the given change event to any registered change listeners.
|
protected void |
firePropertyChange(PropertyChangeEvent aEvent)
Fire an existing PropertyChangeEvent to any registered listeners.
|
protected void |
fireStatusEvent(TLcdStatusEvent aStatusEvent)
Fires a status event, thus notifying all listeners that were added using
addStatusListener(com.luciad.util.ILcdStatusListener) . |
Component |
getComponent()
Returns the component to print.
|
abstract int |
getDPI()
Returns the used dpi.
|
abstract double |
getFeatureScale()
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 |
removePropertyChangeListener(PropertyChangeListener aListener)
Remove a PropertyChangeListener from the listener list.
|
void |
removeStatusListener(ILcdStatusListener aListener)
Removes a listener from the listeners to be notified of printing progress.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, dispose
protected ALcdViewComponentPrintable(Component aComponent)
aComponent
- the component to print.public void addChangeListener(ILcdChangeListener aListener)
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.
addChangeListener
in interface ILcdChangeSource
aListener
- The listener to be notified when a change has happened.ILcdChangeSource.removeChangeListener(ILcdChangeListener)
,
ALcdWeakChangeListener
public void removeChangeListener(ILcdChangeListener aListener)
ILcdChangeSource
removeChangeListener
in interface ILcdChangeSource
aListener
- The listener to remove.protected final void fireChangeEvent(TLcdChangeEvent aEvent)
aEvent
- a change event.public void addPropertyChangeListener(PropertyChangeListener aListener)
aListener
- The PropertyChangeListener to be addedpublic void removePropertyChangeListener(PropertyChangeListener aListener)
aListener
- The PropertyChangeListener to be removedprotected void firePropertyChange(PropertyChangeEvent aEvent)
aEvent
- The PropertyChangeEvent object.public void addStatusListener(ILcdStatusListener aListener)
addStatusListener
in interface ILcdStatusSource
aListener
- the listener to be notifiedpublic void removeStatusListener(ILcdStatusListener aListener)
removeStatusListener
in interface ILcdStatusSource
aListener
- the listener that should no longer be notifiedprotected void fireStatusEvent(TLcdStatusEvent aStatusEvent)
addStatusListener(com.luciad.util.ILcdStatusListener)
.aStatusEvent
- the status event to pass to all listeners.public Component getComponent()
public abstract int getPageCountX(PageFormat aPageFormat)
aPageFormat
- the page formatpublic abstract int getPageCountY(PageFormat aPageFormat)
aPageFormat
- the page formatpublic abstract double getMapScale(PageFormat aPageFormat)
1:25.000
).aPageFormat
- the page formatpublic abstract TLcdPrintPreview createPreview(PageFormat aPageFormat)
aPageFormat
- the page format to usepublic abstract int getDPI()
public abstract double getFeatureScale()
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.