ReportCat 1.1

li.netcat.print.util
Class ScalePrint

java.lang.Object
  extended byli.netcat.print.util.WrappedPrint
      extended byli.netcat.print.util.ScalePrint
All Implemented Interfaces:
Print

public class ScalePrint
extends WrappedPrint

This Print is used to scale a given Print by an arbitrary value. When the scale mode is set to MODE_AUTO_WIDTH, the scale factor is automatically adjusted, when the preferred with of the Print is greater than the available width.

This class needs the functionality of Graphics2D.

Author:
Arthur Marxer

Field Summary
static int MODE_ABSOLUTE
          This constant defines the default scale mode as absolute.
static int MODE_AUTO_WIDTH
          This constant defines the default scale mode to be automatic according to the width.
 
Constructor Summary
ScalePrint(Print print)
          Constructs a new ScalePrint to scale the given print.
ScalePrint(Print print, double scale)
          Constructs a new ScalePrint to scale the given print.
ScalePrint(Print print, double scale, int scaleMode)
          Constructs a new ScalePrint to scale the given print.
ScalePrint(Print print, int scaleMode)
          Constructs a new ScalePrint to scale the given print.
 
Method Summary
 java.awt.Dimension getPreferredSize(java.awt.Graphics g)
          Returns the preferred size of the Print.
 PrintIterator getPrintIterator()
          Factory method, that produces a PrintIerator.
 double getScale()
          Returns the scale in x and in y direction.
 int getScaleMode()
          Returns the scale mode property.
 void setScale(double scale)
          Sets the scale factor.
 void setScaleMode(int scaleMode)
          Sets the scaleMode property.
 
Methods inherited from class li.netcat.print.util.WrappedPrint
getPrint, setPrint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_ABSOLUTE

public static final int MODE_ABSOLUTE
This constant defines the default scale mode as absolute.

See Also:
Constant Field Values

MODE_AUTO_WIDTH

public static final int MODE_AUTO_WIDTH
This constant defines the default scale mode to be automatic according to the width. i.e. the scale is automatically adjusted when the available width is smaller than the preferred width.

See Also:
Constant Field Values
Constructor Detail

ScalePrint

public ScalePrint(Print print)
Constructs a new ScalePrint to scale the given print. The scale mode is set to MODE_AUTO_WIDTH and the scale factor is set to 1.0.

Parameters:
print - The print to be scaled.

ScalePrint

public ScalePrint(Print print,
                  double scale)
Constructs a new ScalePrint to scale the given print. The scale mode is set to MODE_ABSOLUTE.

Parameters:
print - The print to be scaled.
scale - The scale factor in x and in y direction, must be > 0.0.

ScalePrint

public ScalePrint(Print print,
                  int scaleMode)
Constructs a new ScalePrint to scale the given print.

Parameters:
print - The print to be scaled.
scaleMode - One of the constants MODE_*.

ScalePrint

public ScalePrint(Print print,
                  double scale,
                  int scaleMode)
Constructs a new ScalePrint to scale the given print.

Parameters:
print - The print to be scaled.
scale - The scale factor in x and in y direction, must be > 0.0.
scaleMode - One of the constants MODE_*.
Method Detail

setScale

public void setScale(double scale)
Sets the scale factor.

Parameters:
scale - The scale factor in x and in y direction, must be > 0.0.

getScale

public double getScale()
Returns the scale in x and in y direction.

Returns:
The scale in x and in y direction.

getScaleMode

public int getScaleMode()
Returns the scale mode property.

Returns:
One of MODE_*.

setScaleMode

public void setScaleMode(int scaleMode)
Sets the scaleMode property.

Parameters:
scaleMode - One of the constants MODE_*.

getPreferredSize

public java.awt.Dimension getPreferredSize(java.awt.Graphics g)
Description copied from interface: Print
Returns the preferred size of the Print.

Specified by:
getPreferredSize in interface Print
Overrides:
getPreferredSize in class WrappedPrint

getPrintIterator

public PrintIterator getPrintIterator()
Description copied from interface: Print
Factory method, that produces a PrintIerator. The PrintIterator is used like an enumeration to generate all Prints.

Specified by:
getPrintIterator in interface Print
Overrides:
getPrintIterator in class WrappedPrint

ReportCat 1.1

Copyright © 2003 - 2005 NetCat Inc.. All rights reserved. Feedback

Print,Printing,Printer,Java,Java Print,SDK,Java Printing,Printing Java,Print Java,Library,Java Library,Print Library,Report,Reports,Java Report,Java Programming,Java Output,Layout,Page,API,Preview,Print Preview,Content,A4,Free,Output,Header,Footer,Download,Package,Jar,Evaluation, Print,Printing,Printer,Java,Java Print,SDK,Java Printing,Printing Java,Print Java,Library,Java Library,Print Library,Report,Reports,Java Report,Java Programming,Java Output,Layout,Page,API,Preview,Print Preview,Content,A4,Free,Output,Header,Footer,Download,Package,Jar,Evaluation, Print,Printing,Printer,Java,Java Print,SDK,Java Printing,Printing Java,Print Java,Library,Java Library,Print Library,Report,Reports,Java Report,Java Programming,Java Output,Layout,Page,API,Preview,Print Preview,Content,A4,Free,Output,Header,Footer,Download,Package,Jar,Evaluation