package cl.jtv;
/*
 * DrawingMachinesArea.java
 *
 * Created on 14 de febrero de 2003, 01:42 AM
 */

/**
 *
 * @author  Administrador
 * @version 
 */
import javax.swing.*;
import java.awt.*;
import java.awt.print.*;
import java.util.*;


public abstract class DrawingMachinesArea extends JPanel implements Printable{

    public Vector currentMachineComponents;
    /** Creates new DrawingMachinesArea */
    public DrawingMachinesArea() {
        super();
    }

    public int print(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int param) throws java.awt.print.PrinterException {
        if (param >= 1) {
            return Printable.NO_SUCH_PAGE;
	}
        
        Graphics2D g2 = (Graphics2D) graphics; 

      //To see the button on the printed page, you
      //must translate the printer graphics context
      //into the imageable area
        g2.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
        //g2.scale(0.99,0.75);
        g2.scale(0.5, 0.5);
        g2.setFont(Maquina.FONT_TRP10);
        for(int i=0;i<currentMachineComponents.size();i++) 
            ((Maquina)currentMachineComponents.get(i)).dibujar(g2);
        //g2.setFont(Maquina.FONT_AP10);
        g2.setFont(Maquina.FONT_TRP10);
        g2.drawString(((Vector2)currentMachineComponents).getNombreLargo(),20,30);
        return Printable.PAGE_EXISTS;
        
        
    }
}
