예제 #1
0
  @Override
  public void paint(Graphics g, ParentSettings parentSettings) {
    ParentSettings settings = isSelectionPaintedOnAncestor(parentSettings);
    if (!settings.isSelectionPainted()) {
      settings = (paintBackground(g, parentSettings));
    }
    paintSelectionIfRequired(g, parentSettings);
    paintContent(g, parentSettings);

    for (EditorCell child : this) {
      if (g.hitClip(child.getX(), child.getY(), child.getWidth(), child.getHeight())) {
        ((jetbrains.mps.nodeEditor.cells.EditorCell) child).paint(g, settings);
      }
    }
    paintDecorations(g);
  }
예제 #2
0
  @Override
  public ParentSettings paintBackground(Graphics g, ParentSettings parentSettings) {
    if (!parentSettings.isSkipBackground()) {
      if (getCellBackgroundColor() != null) {
        g.setColor(getCellBackgroundColor());
        List<Rectangle> selection = myCellLayout.getSelectionBounds(this);
        for (Rectangle part : selection) {
          g.fillRect(part.x, part.y, part.width, part.height);
        }
      }
    }
    boolean hasMessages = false;

    List<EditorMessage> messages = getMessages(EditorMessage.class);
    for (EditorMessage message : messages) {
      if (message != null && message.isBackground()) {
        message.paint(g, getEditor(), this);
        hasMessages = true;
      }
    }
    return ParentSettings.createBackgroundlessSetting(hasMessages).combineWith(parentSettings);
  }