Class ALcdViewComponentPrintable

java.lang.Object
com.luciad.view.swing.ALcdViewComponentPrintable
All Implemented Interfaces:
ILcdChangeSource, ILcdDisposable, ILcdStatusSource, Printable, AutoCloseable
Direct Known Subclasses:
TLcdGXYViewComponentPrintable, TLspViewComponentPrintable

public abstract class ALcdViewComponentPrintable extends Object implements Printable, ILcdChangeSource, ILcdDisposable, ILcdStatusSource
Prints the contents of a given 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
In addition, it allows creating a print preview component to preview what the print will look like.
Since:
2013.0
  • Constructor Details

    • ALcdViewComponentPrintable

      protected ALcdViewComponentPrintable(Component aComponent)
      Creates a new view component printable for the given component.
      Parameters:
      aComponent - the component to print.
  • Method Details

    • addChangeListener

      public void addChangeListener(ILcdChangeListener aListener)
      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 interface ILcdChangeSource
      Parameters:
      aListener - The listener to be notified when a change has happened.
      See Also:
    • removeChangeListener

      public void removeChangeListener(ILcdChangeListener aListener)
      Description copied from interface: ILcdChangeSource
      Removes the specified listener so it is no longer notified.
      Specified by:
      removeChangeListener in interface ILcdChangeSource
      Parameters:
      aListener - The listener to remove.
    • fireChangeEvent

      protected final void fireChangeEvent(TLcdChangeEvent aEvent)
      Fires the given change event to any registered change listeners.
      Parameters:
      aEvent - a change event.
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener aListener)
      Add a PropertyChangeListener to the listener list. The listener is registered for all properties.
      Parameters:
      aListener - The PropertyChangeListener to be added
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener aListener)
      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

      protected void firePropertyChange(PropertyChangeEvent aEvent)
      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

      public void addStatusListener(ILcdStatusListener aListener)
      Adds a listener to be notified of printing progress.
      Specified by:
      addStatusListener in interface ILcdStatusSource
      Parameters:
      aListener - the listener to be notified
    • removeStatusListener

      public void removeStatusListener(ILcdStatusListener aListener)
      Removes a listener from the listeners to be notified of printing progress.
      Specified by:
      removeStatusListener in interface ILcdStatusSource
      Parameters:
      aListener - the listener that should no longer be notified
    • fireStatusEvent

      protected void fireStatusEvent(TLcdStatusEvent aStatusEvent)
      Fires a status event, thus notifying all listeners that were added using addStatusListener(com.luciad.util.ILcdStatusListener).
      Parameters:
      aStatusEvent - the status event to pass to all listeners.
    • getComponent

      public Component getComponent()
      Returns the component to print.
      Returns:
      the component to print.
    • getPageCountX

      public abstract int getPageCountX(PageFormat aPageFormat)
      Returns the page count in the x-direction.
      Parameters:
      aPageFormat - the page format
      Returns:
      the page count in the x-direction.
    • getPageCountY

      public abstract int getPageCountY(PageFormat aPageFormat)
      Returns the page count in the y-direction.
      Parameters:
      aPageFormat - the page format
      Returns:
      the page count in the y-direction.
    • getMapScale

      public abstract double getMapScale(PageFormat aPageFormat)
      Returns the map scale (e.g. 1:25.000).
      Parameters:
      aPageFormat - the page format
      Returns:
      the map scale.
    • createPreview

      public abstract TLcdPrintPreview createPreview(PageFormat aPageFormat)
      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.