package jetbrains.mps.debugger.core.breakpoints;

/*Generated by MPS */

import jetbrains.mps.annotations.GeneratedClass;
import jetbrains.mps.debugger.core.DebuggerCellPainter;
import java.awt.Color;
import jetbrains.mps.openapi.editor.EditorComponent;
import jetbrains.mps.editor.runtime.style.StyleAttributes;
import jetbrains.mps.openapi.editor.style.Style;
import jetbrains.mps.nodeEditor.AdditionalPainter;
import jetbrains.mps.debugger.core.CurrentLinePositionComponentEx;

@GeneratedClass(node = "r:e85e5755-b656-44cc-a19b-af0b99b30b13(jetbrains.mps.debugger.core.breakpoints)/8589065642488591173", model = "r:e85e5755-b656-44cc-a19b-af0b99b30b13(jetbrains.mps.debugger.core.breakpoints)")
public abstract class BreakpointPainterEx<B> extends DebuggerCellPainter<B> {
  private static final Color CELL_BACKGROUND_COLOR = new Color(255, 200, 200, 50);
  protected final B myBreakpoint;
  public BreakpointPainterEx(B breakpoint) {
    myBreakpoint = breakpoint;
  }
  @Override
  protected Color getCellBackgroundColor(EditorComponent ec) {
    return CELL_BACKGROUND_COLOR;
  }
  @Override
  protected Color getStripeBackgroundColor(EditorComponent ec) {
    return getMyStyle(ec).get(StyleAttributes.TEXT_BACKGROUND_COLOR);
  }
  @Override
  protected Color getFrameColor(EditorComponent ec) {
    return getStripeBackgroundColor(ec).darker();
  }
  private Style getMyStyle(EditorComponent ec) {
    return ec.getStyleRegistry().getStyle("BREAKPOINT");
  }
  @Override
  public boolean isAbove(AdditionalPainter painter, jetbrains.mps.nodeEditor.EditorComponent component) {
    if (painter instanceof CurrentLinePositionComponentEx) {
      return false;
    }
    return super.isAbove(painter, component);
  }
  @Override
  public B getItem() {
    return myBreakpoint;
  }
}
