Package limelight.ui.model.inputs.painting

Source Code of limelight.ui.model.inputs.painting.TextPanelCaretPainter

//- Copyright © 2008-2011 8th Light, Inc. All Rights Reserved.
//- Limelight and all included source files are distributed under terms of the MIT License.

package limelight.ui.model.inputs.painting;

import limelight.util.Box;

import java.awt.*;

public class TextPanelCaretPainter extends TextPanelPainter
{
  public static TextPanelPainter instance = new TextPanelCaretPainter();

  private TextPanelCaretPainter()
  {
  }

  public void paint(Graphics2D graphics, limelight.ui.model.text.TextModel model)
  {
    if(!model.isCaretOn() || model.hasSelection())
      return;

    Box caret = model.getCaretShape();
    graphics.setColor(model.getContainer().getStyle().getCompiledTextColor().getColor());
    graphics.fill(caret);
  }
}
TOP

Related Classes of limelight.ui.model.inputs.painting.TextPanelCaretPainter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.