Class TLcyPrintPreviewFactory

java.lang.Object
com.luciad.lucy.addons.print.ALcyPrintPreviewFactory<TLcyPrintContext>
com.luciad.lucy.addons.print.TLcyPrintPreviewFactory

public class TLcyPrintPreviewFactory extends ALcyPrintPreviewFactory<TLcyPrintContext>
Factory for the creation of the content of the print preview dialog. This factory was designed so that it is easy to modify small parts of the creation process. This can be done by subclassing this class and overriding certain methods.

The main create function createPrintPreview(com.luciad.lucy.addons.print.TLcyPrintContext, com.luciad.gui.ILcdAction) first creates all actions, all components and then all panels using the functions createAction(int, com.luciad.lucy.addons.print.TLcyPrintContext, com.luciad.gui.ILcdAction), createComponent and createPanel. Then it calls createPrintPreviewContent(), which will create the content of the print preview using the created panels by calling getPanel. And finally it will create the actual content of the print preview dialog.

Note however that ID's are used. This is because there are different types of, for example, panels that can be created: the option panel, the printing area settings panel,... All possible ID's that can be passed to the createPanel method all end with the same suffix "PANEL". The same thing goes for "COMPONENT" (createComponent, getComponent) and "ACTION" (createAction, getAction.

As an example, imagine you want to change the behaviour of the options panel. Browsing this class learns there is a OPTIONS_PANEL constant. Because it ends with "PANEL", this constant can only be passed to the createPanel method. Therefore we can override the method createPanel, check if the ID is OPTIONS_PANEL and return a custom panel. Or use super.createComponent and change some settings before returning it. If you want to remove the component completely, you can simply return null.

The method createPrintPreview should not be overridden without using the super function. Changing the layout of the content of the print preview dialog can be done by overriding createPrintPreviewContent. The internal elements are already created and should be retrieved by calling getComponent.

Note that this class requires a default constructor to be able to configure it in the configuration file of the print add-on.

  • Field Details

    • PRINTER_SETTINGS_PANEL

      public static final int PRINTER_SETTINGS_PANEL
      The id for creating the printer settings panel. It allows to choose the printer and the page layout.
      See Also:
    • PRINTING_AREA_PANEL

      public static final int PRINTING_AREA_PANEL
      The id for creating the settings panel corresponding to the printing area. It allows the user to select the number of pages, the scale, ...
      See Also:
    • OPTIONS_PANEL

      public static final int OPTIONS_PANEL
      The id for creating the options panel. The options panel is itself composed out of all widgets that correspond to OPTIONS_*_COMPONENT constants. It allows for example to toggle the visibility of the overview, legend, header text, ...
      See Also:
    • PAGE_PREVIEW_PANEL

      public static final int PAGE_PREVIEW_PANEL
      The id for creating the panel that shows the preview of the actual page that are going to be printed. The page preview panel is itself composed out of all widgets that correspond to PAGE_PREVIEW_PANEL_*_COMPONENT constants, except for PAGE_PREVIEW_PANEL_PRINT_COMPONENT and PAGE_PREVIEW_PANEL_CLOSE_COMPONENT.
      See Also:
    • PAGE_PREVIEW_PANEL_MAIN_COMPONENT

      public static final int PAGE_PREVIEW_PANEL_MAIN_COMPONENT
      Most important part of PAGE_PREVIEW_PANEL that shows the actual pages.
      See Also:
    • PAGE_PREVIEW_PANEL_PRINT_COMPONENT

      public static final int PAGE_PREVIEW_PANEL_PRINT_COMPONENT
      Part of PAGE_PREVIEW_PANEL that shows the print button. It uses the PRINT_ACTION to create that button.
      See Also:
    • PAGE_PREVIEW_PANEL_CLOSE_COMPONENT

      public static final int PAGE_PREVIEW_PANEL_CLOSE_COMPONENT
      Part of PAGE_PREVIEW_PANEL that shows the close button. It uses the close action given as a parameter to this factory to create that button.
      See Also:
    • PAGE_PREVIEW_PANEL_SCALE_COMPONENT

      public static final int PAGE_PREVIEW_PANEL_SCALE_COMPONENT
      Part of PAGE_PREVIEW_PANEL that allows to choose the page preview scale.
      See Also:
    • OPTIONS_PANEL_HEADER_TEXT_COMPONENT

      public static final int OPTIONS_PANEL_HEADER_TEXT_COMPONENT
      Part of OPTIONS_PANEL that allows to change the visibility of the header text.
      See Also:
    • OPTIONS_PANEL_LEGEND_COMPONENT

      public static final int OPTIONS_PANEL_LEGEND_COMPONENT
      Part of OPTIONS_PANEL that allows to change the visibility of the legend.
      See Also:
    • OPTIONS_PANEL_OVERVIEW_COMPONENT

      public static final int OPTIONS_PANEL_OVERVIEW_COMPONENT
      Part of OPTIONS_PANEL that allows to change the visibility of the overview.
      See Also:
    • OPTIONS_PANEL_SCALE_ICON_COMPONENT

      public static final int OPTIONS_PANEL_SCALE_ICON_COMPONENT
      Part of OPTIONS_PANEL that allows to change the visibility of the scale icon.
      See Also:
    • OPTIONS_PANEL_SCALE_TEXT_COMPONENT

      public static final int OPTIONS_PANEL_SCALE_TEXT_COMPONENT
      Part of OPTIONS_PANEL that allows to change the visibility of the scale text.
      See Also:
    • OPTIONS_PANEL_CROP_MARKS_COMPONENT

      public static final int OPTIONS_PANEL_CROP_MARKS_COMPONENT
      Part of OPTIONS_PANEL that allows to change the visibility of the crop marks.
      See Also:
    • OPTIONS_PANEL_POSITION_MARKS_COMPONENT

      public static final int OPTIONS_PANEL_POSITION_MARKS_COMPONENT
      Part of OPTIONS_PANEL that allows to change the visibility of the position marks.
      See Also:
    • OPTIONS_PANEL_RASTERIZATION_QUALITY_COMPONENT

      public static final int OPTIONS_PANEL_RASTERIZATION_QUALITY_COMPONENT
      Part of OPTIONS_PANEL that allows to change the rasterization quality.
      See Also:
    • OPTIONS_PANEL_PRINT_FACTOR_COMPONENT

      public static final int OPTIONS_PANEL_PRINT_FACTOR_COMPONENT
      Part of OPTIONS_PANEL that allows to change the print factor.
      See Also:
    • OPTIONS_PANEL_TITLE_TEXT_COMPONENT

      public static final int OPTIONS_PANEL_TITLE_TEXT_COMPONENT
      Part of OPTIONS_PANEL that allows to modify the visibility of the title component.
      See Also:
    • OPTIONS_PANEL_TITLE_TEXT_FIELD_COMPONENT

      public static final int OPTIONS_PANEL_TITLE_TEXT_FIELD_COMPONENT
      Part of OPTIONS_PANEL that allows to modify the title component text.
      See Also:
    • OPTIONS_PANEL_MODIFIABLE_HEADER_COMPONENT

      public static final int OPTIONS_PANEL_MODIFIABLE_HEADER_COMPONENT
      Part of OPTIONS_PANEL that allows to modify the visibility of the header text component. The difference with the OPTIONS_PANEL_HEADER_TEXT_COMPONENT is that the text controlled by this component can be modified by the user in the UI.
      Since:
      2016.1.1
      See Also:
    • OPTIONS_PANEL_MODIFIABLE_HEADER_TEXT_FIELD_COMPONENT

      public static final int OPTIONS_PANEL_MODIFIABLE_HEADER_TEXT_FIELD_COMPONENT
      Part of OPTIONS_PANEL that allows to modify the header text.
      Since:
      2016.1.1
      See Also:
    • OPTIONS_PANEL_CLASSIFICATION_COMPONENT

      public static final int OPTIONS_PANEL_CLASSIFICATION_COMPONENT
      Part of OPTIONS_PANEL that allows to modify the visibility of the classification banner component.
      Since:
      2016.1.1
      See Also:
    • OPTIONS_PANEL_CLASSIFICATION_COMBO_BOX_COMPONENT

      public static final int OPTIONS_PANEL_CLASSIFICATION_COMBO_BOX_COMPONENT
      Part of OPTIONS_PANEL that allows to modify the classification.
      Since:
      2016.1.1
      See Also:
  • Constructor Details

    • TLcyPrintPreviewFactory

      public TLcyPrintPreviewFactory()
      Default constructor. Creates a new TLcyPrintPreviewFactory. Note that you will have to set an ILcyLucyEnv before this instance can be used.

      Note that this class requires a default constructor to be able to configure it in the configuration file of the print add-on.

    • TLcyPrintPreviewFactory

      public TLcyPrintPreviewFactory(ILcyLucyEnv aLucyEnv)
      Creates a new TLcyPrintPreviewFactory.
      Parameters:
      aLucyEnv - The lucy environment, contextual information.
  • Method Details