Class ScenePrinter
java.lang.Object
org.netbeans.api.visual.print.ScenePrinter
A class used to print a Scene to a printer. Multiple convenience methods are
provided to initiate the print with various constraints.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Scaling strategies to be used for printing a scene. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Print the scene exactly as it is.static void
Print the Scene with specific scaling percentages for the horizontal and vertical direction.static void
print
(Scene scene, PageFormat format) Print the Scene with provided PageFormat.static void
print
(Scene scene, PageFormat format, Rectangle region) Print a specific section of the Scene according to the provided Format.static void
print
(Scene scene, PageFormat format, ScenePrinter.ScaleStrategy scaleStrategy) Print the Scene with the provided format and scale type.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.static void
print
(Scene scene, ScenePrinter.ScaleStrategy scaleStrategy) Print the Scene with the default PageFormat and the provided scale type.
-
Method Details
-
print
Print the scene exactly as it is. There is to be no scaling or special formatting.- Parameters:
scene
- The Scene to be printed.
-
print
Print the Scene with provided PageFormat.- Parameters:
scene
- The Scene to be printed.format
- format used for printing Scene.
-
print
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
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
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
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.
-