private void mousePressedInTextArea(MouseEvent e) { if (e.isConsumed()) return; AbstractLeftColumn column = getTextColumnByX(e.getX()); if (column != null) { column.mousePressed(e); e.consume(); } }
private AbstractLeftColumn getTextColumnByX(int x) { for (AbstractLeftColumn column : myLeftColumns) { int columnX = column.getX(); if (columnX <= x && columnX + column.getWidth() > x) { return column; } } return null; }
private void mouseMovedInTextArea(MouseEvent e) { myMouseIsInFoldingArea = false; AbstractLeftColumn textColumn = getTextColumnByX(e.getX()); if (textColumn != null) { setCursor(textColumn.getCursor(e)); } else { setCursor(null); } }
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); }
public void dispose() { for (AbstractFoldingAreaPainter painter : myFoldingAreaPainters) { painter.dispose(); } for (AbstractLeftColumn column : myLeftColumns) { column.dispose(); } if (MPSToolTipManager.getInstance() != null) { MPSToolTipManager.getInstance().unregisterComponent(this); } }
@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; }
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); } }