unbbayes.controller
Class PrintNet

java.lang.Object
  extended by unbbayes.controller.PrintNet
All Implemented Interfaces:
Pageable, Printable

public class PrintNet
extends Object
implements Printable, Pageable

Useful class for printing a view of a graphic-mode network


Field Summary
protected  JComponent net
           
protected  PageFormat pageFormat
           
protected  Rectangle rect
           
protected  String title
           
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.print.Pageable
UNKNOWN_NUMBER_OF_PAGES
 
Constructor Summary
PrintNet(String title, JComponent net, Rectangle rect, PageFormat pf)
           
 
Method Summary
 int getNumberOfPages()
          Calculate the number of pages it will take to print the entire Network
 PageFormat getPageFormat(int index)
           
 Printable getPrintable(int index)
           
protected  void paintComponent(Graphics g)
          Paint / print a portion of the component
 int print(Graphics g, PageFormat pf, int index)
          Perform the printing here
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

net

protected JComponent net

pageFormat

protected PageFormat pageFormat

rect

protected Rectangle rect

title

protected String title
Constructor Detail

PrintNet

public PrintNet(String title,
                JComponent net,
                Rectangle rect,
                PageFormat pf)
Method Detail

print

public int print(Graphics g,
                 PageFormat pf,
                 int index)
Perform the printing here

Specified by:
print in interface Printable

paintComponent

protected void paintComponent(Graphics g)
Paint / print a portion of the component


getNumberOfPages

public int getNumberOfPages()
Calculate the number of pages it will take to print the entire Network

Specified by:
getNumberOfPages in interface Pageable

getPrintable

public Printable getPrintable(int index)
Specified by:
getPrintable in interface Pageable

getPageFormat

public PageFormat getPageFormat(int index)
Specified by:
getPageFormat in interface Pageable


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.