@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;
 }
Beispiel #2
0
 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();
 }
Beispiel #3
0
 public boolean panelIsInClip(Panel panel) {
   Box panelClip = panel.getAbsoluteBounds();
   return panelClip != null && clip.intersects(panelClip);
 }