LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingPrintManager

java.lang.Object
  extended by leon.view.print.LyPrintManager
      extended by leon.view.win.swing.LySwingPrintManager

public class LySwingPrintManager
extends LyPrintManager

Interface for AWT and Swing printing.


Field Summary
static java.lang.String __VERSION
           
 
Fields inherited from class leon.view.print.LyPrintManager
BOTTOM_MARGIN, DEBUG_TO_SCREEN, LEFT_MARGIN, PAGE_HEIGHT, PAGE_WIDTH, PRINT_TABLE_FONT_REDUCTION, RIGHT_MARGIN, TOP_MARGIN
 
Constructor Summary
LySwingPrintManager(LyEnvironment environment, LyPrintDataInterface printDataInterface, java.util.Properties properties)
          Class constructor of a print manager object.
 
Method Summary
 void end()
          (non-Javadoc).
static java.lang.String formatString(java.lang.String str, java.awt.FontMetrics fm, int width, char sep)
          Formats the specified string before drawing it to the output.
static java.awt.Dimension getSize(java.lang.String str, java.awt.FontMetrics fm)
          Gets the size of a String, in pixels, for the specified font.
 int print(java.lang.Object object, java.util.Vector<java.lang.Object> fields, int fontReduction, int startPage)
          Prints a LyObject instance.
 void print(java.util.Vector<LyObject> objects, java.util.Vector<java.lang.Object> fields, int fontReduction)
          (non-Javadoc).
static int printFooter(java.awt.Component component, java.awt.Graphics g, java.awt.Dimension size, java.lang.String left_str, java.lang.String middle_str, java.lang.String right_str, LyEnvironment environment)
          Draws the footer of the view.
static int printHeader(java.awt.Component component, java.awt.Graphics g, java.awt.Dimension size, java.lang.String left_logo, java.lang.String title, java.lang.String right_logo, LyEnvironment environment)
          Draws the page header with a logo to the left, title in the middle and logo to the right.
 boolean wasCancelled()
          (non-Javadoc).
 
Methods inherited from class leon.view.print.LyPrintManager
getEnvironment, getFormat, getSupportName, isInFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LySwingPrintManager

public LySwingPrintManager(LyEnvironment environment,
                           LyPrintDataInterface printDataInterface,
                           java.util.Properties properties)
Class constructor of a print manager object.

Parameters:
environment - the current environment
printDataInterface - the interface to use for printing
properties - the properties of the printing manager
Method Detail

printHeader

public static int printHeader(java.awt.Component component,
                              java.awt.Graphics g,
                              java.awt.Dimension size,
                              java.lang.String left_logo,
                              java.lang.String title,
                              java.lang.String right_logo,
                              LyEnvironment environment)
Draws the page header with a logo to the left, title in the middle and logo to the right.

Parameters:
component - client component that handle images
g - printer handler
size - usable print size in the view
left_logo - the left logo image name
title - centered title
right_logo - the right logo image name
environment - the current environment
Returns:
effective drawing size (with margins)

printFooter

public static int printFooter(java.awt.Component component,
                              java.awt.Graphics g,
                              java.awt.Dimension size,
                              java.lang.String left_str,
                              java.lang.String middle_str,
                              java.lang.String right_str,
                              LyEnvironment environment)
Draws the footer of the view.

Parameters:
component - client component
g - printer handler
size - usable print size in the view
left_str - the left message
middle_str - the center message
right_str - the right message
environment - the current environment, not used in this implementation
Returns:
effective drawing size (with margins)

getSize

public static java.awt.Dimension getSize(java.lang.String str,
                                         java.awt.FontMetrics fm)
Gets the size of a String, in pixels, for the specified font. This string may have several lines separated with \n.

Parameters:
str - the original String
fm - the font metrics used to compute the string size
Returns:
the width (in pixels) of the String

formatString

public static java.lang.String formatString(java.lang.String str,
                                            java.awt.FontMetrics fm,
                                            int width,
                                            char sep)
Formats the specified string before drawing it to the output.

Parameters:
str - the string to print
fm - the font metrics of the current font
width - the maximum width of the drawing
sep - character separator used to aggregate the result
Returns:
the formatted string with the specified separator

end

public void end()
(non-Javadoc).

Specified by:
end in class LyPrintManager
See Also:
LyPrintManager.end()

wasCancelled

public boolean wasCancelled()
(non-Javadoc).

Specified by:
wasCancelled in class LyPrintManager
Returns:
True if cancelled, false otherwise.
See Also:
LyPrintManager.wasCancelled()

print

public int print(java.lang.Object object,
                 java.util.Vector<java.lang.Object> fields,
                 int fontReduction,
                 int startPage)
Prints a LyObject instance.

Specified by:
print in class LyPrintManager
Parameters:
object - the LyObject to print
fields - the list of fields to print
fontReduction - font reduction factor
startPage - the page number to start printing
Returns:
the number of pages drawn for the given object
See Also:
LyPrintManager.print(Object, Vector, int, int)

print

public void print(java.util.Vector<LyObject> objects,
                  java.util.Vector<java.lang.Object> fields,
                  int fontReduction)
(non-Javadoc).

Specified by:
print in class LyPrintManager
Parameters:
objects - List of printed objects.
fields - List of printed fields
fontReduction - Font reduction factor.
See Also:
LyPrintManager.print(java.util.Vector, java.util.Vector, int)

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com