org.eadge.extractpdfexcel.debug.display.JPanelRectangles Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pdf-to-excel Show documentation
Show all versions of pdf-to-excel Show documentation
A Java library used to convert PDF to Excel.
The newest version!
package org.eadge.extractpdfexcel.debug.display;
import org.eadge.extractpdfexcel.data.geom.Rectangle2;
import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
/**
* Created by eadgyo on 27/07/16.
*
* Draw rect
*/
public class JPanelRectangles extends JPanel
{
private ArrayList rectangles = null;
public void setRectangles(ArrayList rectangles)
{
this.rectangles = rectangles;
}
@Override
protected void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
g.setColor(Color.GRAY);
for (Rectangle2 rect : rectangles)
{
DisplayTools.drawRect(g2d, rect);
}
}
}