Esempio n. 1
0
 private void mousePressedInTextArea(MouseEvent e) {
   if (e.isConsumed()) return;
   AbstractLeftColumn column = getTextColumnByX(e.getX());
   if (column != null) {
     column.mousePressed(e);
     e.consume();
   }
 }
Esempio n. 2
0
 private AbstractLeftColumn getTextColumnByX(int x) {
   for (AbstractLeftColumn column : myLeftColumns) {
     int columnX = column.getX();
     if (columnX <= x && columnX + column.getWidth() > x) {
       return column;
     }
   }
   return null;
 }
Esempio n. 3
0
 private void mouseMovedInTextArea(MouseEvent e) {
   myMouseIsInFoldingArea = false;
   AbstractLeftColumn textColumn = getTextColumnByX(e.getX());
   if (textColumn != null) {
     setCursor(textColumn.getCursor(e));
   } else {
     setCursor(null);
   }
 }
Esempio n. 4
0
 private void recalculateTextColumnWidth() {
   int initialOffset = getTextColumnOffset();
   int offset = initialOffset;
   for (AbstractLeftColumn column : myLeftColumns) {
     column.setX(offset);
     column.relayout();
     offset += column.getWidth();
   }
   myTextColumnWidth = Math.max(MIN_LEFT_TEXT_WIDTH, offset - initialOffset);
 }
Esempio n. 5
0
 public void dispose() {
   for (AbstractFoldingAreaPainter painter : myFoldingAreaPainters) {
     painter.dispose();
   }
   for (AbstractLeftColumn column : myLeftColumns) {
     column.dispose();
   }
   if (MPSToolTipManager.getInstance() != null) {
     MPSToolTipManager.getInstance().unregisterComponent(this);
   }
 }
Esempio n. 6
0
 @Override
 public String getMPSTooltipText(MouseEvent e) {
   if (isInFoldingArea(e)) {
     for (AbstractFoldingAreaPainter painter : myFoldingAreaPainters) {
       if (painter.getToolTipText() != null) {
         return painter.getToolTipText();
       }
     }
   } else if (isInTextArea(e)) {
     AbstractLeftColumn column = getTextColumnByX(e.getX());
     if (column != null) {
       return column.getTooltipText(e);
     }
   } else {
     EditorMessageIconRenderer iconRenderer = getIconRendererUnderMouse(e);
     if (iconRenderer != null) {
       return iconRenderer.getTooltipText();
     }
   }
   return null;
 }
Esempio n. 7
0
 private void paintTextColumns(Graphics g, Rectangle clipBounds) {
   if (!hasIntersection(getTextColumnOffset(), myTextColumnWidth, clipBounds)) {
     return;
   }
   for (AbstractLeftColumn column : myLeftColumns) {
     if (clipBounds.x > column.getX() + column.getWidth()) {
       continue;
     }
     column.paint(g);
     //  COLORS: find out where it is and remove hardcoded color
     UIUtil.drawVDottedLine(
         (Graphics2D) g,
         myRightToLeft ? column.getX() : column.getX() + column.getWidth() - 1,
         (int) clipBounds.getMinY(),
         (int) clipBounds.getMaxY(),
         getBackground(),
         Color.GRAY);
   }
 }