Class ScenePrinter

java.lang.Object
org.netbeans.api.visual.print.ScenePrinter

public final class ScenePrinter extends Object
A class used to print a Scene to a printer. Multiple convenience methods are provided to initiate the print with various constraints.
  • Method Details

    • print

      public static void print(Scene scene)
      Print the scene exactly as it is. There is to be no scaling or special formatting.
      Parameters:
      scene - The Scene to be printed.
    • print

      public static void print(Scene scene, PageFormat format)
      Print the Scene with provided PageFormat.
      Parameters:
      scene - The Scene to be printed.
      format - format used for printing Scene.
    • print

      public static void print(Scene scene, ScenePrinter.ScaleStrategy scaleStrategy)
      Print the Scene with the default PageFormat and the provided scale type.
      Parameters:
      scene - The Scene to be printed.
      scaleStrategy - Value representing the scaling strategy to use for the printing.
    • print

      public static void print(Scene scene, double scaleX, double scaleY)
      Print the Scene with specific scaling percentages for the horizontal and vertical direction.
      Parameters:
      scene - The Scene to be printed.
      scaleX - scaling percentage in the horizontal dimension.
      scaleY - scaling percentage in the vertical dimension.
    • print

      public static void print(Scene scene, PageFormat format, ScenePrinter.ScaleStrategy scaleStrategy)
      Print the Scene with the provided format and scale type.
      Parameters:
      scene - The Scene to be printed.
      format - Format used for printing Scene.
      scaleStrategy - Value representing the scaling strategy to use for the printing.
    • print

      public static void print(Scene scene, PageFormat format, Rectangle region)
      Print a specific section of the Scene according to the provided Format.
      Parameters:
      scene - The Scene to be printed.
      format - Format used for printing Scene.
      region - The rectangle representing the are of the Scene to be printed.
    • print

      public static void print(Scene scene, PageFormat format, ScenePrinter.ScaleStrategy scaleStrategy, double scaleX, double scaleY, boolean selectedOnly, boolean visibleOnly, Rectangle region, List<LayerWidget> hiddenLayers)
      This is the master print call. All other print calls in this class pass through to here after setting the appropriate parameters. Note that the scale type parameter take precedent over the horizontal and vertical scaling percentages. Therefore, if the scale type was "SCALE_TO_FIT_Y", then the values of horizontal and vertical scaling percentages would not be used.
      Parameters:
      scene - The Scene to be printed.
      format - format used for printing Scene. If null then a new default PageFormat is created.
      scaleStrategy - value representing the how to scale the printing.
      scaleX - Directly set the horizontal scale percentage. This parameter is only used when the scale strategy is ScaleStrategy.SCALE_PERCENT. Otherwise it is ignored.
      scaleY - Directly set the vertical scale percentage. This parameter is only used when the scale strategy is ScaleStrategy.SCALE_PERCENT. Otherwise it is ignored.
      selectedOnly - Print only the objects from the Scene that have been selected. Note that in this case the Scene must be an instnace of an ObjectScene since this is required to determine the selected objects.
      visibleOnly - Print only the object in the visible window.
      region - The rectangle representing the are of the Scene to be printed.
      hiddenLayers - Layer that are not to be printed. Might be used to hide the background while printing.