Esempio n. 1
0
 @Override
 public void paintSelection(
     Graphics g, Color c, boolean drawBorder, ParentSettings parentSettings) {
   List<? extends EditorCell> selectionCells = myCellLayout.getSelectionCells(this);
   if (selectionCells != null) {
     ParentSettings selection = isSelectionPaintedOnAncestor(parentSettings);
     for (EditorCell cell : selectionCells) {
       if (g.hitClip(cell.getX(), cell.getY(), cell.getWidth(), cell.getHeight())) {
         ((jetbrains.mps.nodeEditor.cells.EditorCell) cell).paintSelection(g, c, false, selection);
       }
     }
   } else {
     List<Rectangle> selection = myCellLayout.getSelectionBounds(this);
     g.setColor(c);
     for (Rectangle part : selection) {
       g.fillRect(part.x, part.y, part.width, part.height);
     }
   }
 }
Esempio n. 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);
  }
Esempio n. 3
0
 @Override
 public TextBuilder renderText() {
   return myCellLayout.doLayoutText(this);
 }
Esempio n. 4
0
 @Override
 public boolean canBePossiblyFolded() {
   return myCanBeFolded && myCellLayout.canBeFolded();
 }
Esempio n. 5
0
 @Override
 protected void relayoutImpl() {
   myCellLayout.doLayout(this);
   myAscent = myCellLayout.getAscent(this);
   myDescent = myCellLayout.getDescent(this);
 }