use of org.compiere.print.layout.Page in project adempiere by adempiere.
the class View method getDrillDown.
// getPaperHeight
/**
* Get Drill Down
* @param absolutePoint point
* @return Drill Down
*/
public MQuery getDrillDown(Point absolutePoint) {
int pageNo = (int) getPageNoAt(absolutePoint);
Rectangle pageRectangle = getRectangleOfPage(pageNo, false);
Point relativePoint = new Point((int) (absolutePoint.x / getScale() - pageRectangle.x), (int) (absolutePoint.y / getScale() - pageRectangle.y));
Page page = (Page) m_layout.getPages().get(pageNo - 1);
//
log.config("Relative=" + relativePoint + ", " + page);
// log.config("AbsolutePoint=" + absolutePoint + ", PageNo=" + pageNo + ", pageRectangle=" + pageRectangle);
MQuery retValue = page.getDrillDown(relativePoint);
if (retValue == null)
retValue = m_layout.getHeaderFooter().getDrillDown(relativePoint);
return retValue;
}
use of org.compiere.print.layout.Page in project adempiere by adempiere.
the class View method getDrillAcross.
// getDrillDown
/**
* Get Drill Across
* @param absolutePoint point
* @return Drill Across
*/
public MQuery getDrillAcross(Point absolutePoint) {
int pageNo = (int) getPageNoAt(absolutePoint);
Rectangle pageRectangle = getRectangleOfPage(pageNo);
Point relativePoint = new Point((int) (absolutePoint.x / getScale() - pageRectangle.x), (int) (absolutePoint.y / getScale() - pageRectangle.y));
Page page = (Page) m_layout.getPages().get(pageNo - 1);
//
log.config("Relative=" + relativePoint + ", " + page);
// log.config("AbsolutePoint=" + absolutePoint + ", PageNo=" + pageNo + ", pageRectangle=" + pageRectangle);
return page.getDrillAcross(relativePoint);
}
use of org.compiere.print.layout.Page in project adempiere by adempiere.
the class View method paintComponent.
// IsArchivable
/**
* Paint Component
* @param g Graphics
*/
public void paintComponent(Graphics g) {
// log.fine( "View.paintComponent", g.getClip());
Graphics2D g2D = (Graphics2D) g;
g2D.scale(getScale(), getScale());
Rectangle bounds = g2D.getClipBounds();
//
g2D.setColor(COLOR_BACKGROUND);
g2D.fillRect(bounds.x, bounds.y, bounds.width, bounds.height);
// for all pages
for (int page = 0; page < m_layout.getPages().size(); page++) {
Rectangle pageRectangle = getRectangleOfPage(page + 1, false);
if (bounds.intersects(pageRectangle)) {
Page p = (Page) m_layout.getPages().get(page);
// sets context
p.paint(g2D, pageRectangle, true, false);
m_layout.getHeaderFooter().paint(g2D, pageRectangle, true);
}
// paint page
}
// for all pages
}
Aggregations