@Override public Box getCaretShape() { TextLocation caretLocation = getCaretLocation(); TypedLayout line = getLines().get(caretLocation.line); Box caretShape = line.getCaretShape(caretLocation.index); caretShape.translate(getXOffset(line), getY(caretLocation)); return caretShape; }
public PaintJob(Box clip, Color background) { bufferCache = Context.instance().bufferedImageCache; bufferedImagePool = Context.instance().bufferedImagePool; this.clip = clip; buffer = bufferedImagePool.acquire(clip.getSize()); rootGraphics = buffer.createGraphics(); rootGraphics.setBackground(background); rootGraphics.clearRect(0, 0, clip.width, clip.height); composite = rootGraphics.getComposite(); }
public boolean panelIsInClip(Panel panel) { Box panelClip = panel.getAbsoluteBounds(); return panelClip != null && clip.intersects(panelClip); }