void (Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D)g; if (!myReferencePainter.isLeftAligned()) { int start = Math.max(myGraphWidth, getWidth() - myReferencePainter.getSize().width); myReferencePainter.paint(g2d, start, 0, getHeight()); } else { myReferencePainter.paint(g2d, myGraphWidth, 0, getHeight()); } myPainter.draw(g2d, myPrintElements); }