Search in sources :

Example 1 with ToolWindowsPane

use of com.intellij.openapi.wm.impl.ToolWindowsPane in project intellij-community by JetBrains.

the class BalloonLayoutImpl method doLayout.

private void doLayout(List<Balloon> balloons, int startX, int bottomY) {
    int y = bottomY;
    ToolWindowsPane pane = UIUtil.findComponentOfType(myParent, ToolWindowsPane.class);
    if (pane != null) {
        y -= pane.getBottomHeight();
    }
    if (myParent instanceof IdeRootPane) {
        y -= ((IdeRootPane) myParent).getStatusBarHeight();
    }
    for (Balloon balloon : balloons) {
        Rectangle bounds = new Rectangle(getSize(balloon));
        y -= bounds.height;
        bounds.setLocation(startX - bounds.width, y);
        balloon.setBounds(bounds);
    }
}
Also used : IdeRootPane(com.intellij.openapi.wm.impl.IdeRootPane) Balloon(com.intellij.openapi.ui.popup.Balloon) ToolWindowsPane(com.intellij.openapi.wm.impl.ToolWindowsPane)

Example 2 with ToolWindowsPane

use of com.intellij.openapi.wm.impl.ToolWindowsPane in project intellij-community by JetBrains.

the class BalloonLayoutImpl method relayout.

private void relayout() {
    final Dimension size = myLayeredPane.getSize();
    JBInsets.removeFrom(size, myInsets);
    final Rectangle layoutRec = new Rectangle(new Point(myInsets.left, myInsets.top), size);
    List<ArrayList<Balloon>> columns = createColumns(layoutRec);
    while (columns.size() > 1) {
        remove(myBalloons.get(0), true);
        columns = createColumns(layoutRec);
    }
    ToolWindowsPane pane = UIUtil.findComponentOfType(myParent, ToolWindowsPane.class);
    JComponent layeredPane = pane != null ? pane.getMyLayeredPane() : null;
    int eachColumnX = (layeredPane == null ? myLayeredPane.getWidth() : layeredPane.getX() + layeredPane.getWidth()) - 4;
    doLayout(columns.get(0), eachColumnX + 4, (int) myLayeredPane.getBounds().getMaxY());
}
Also used : ToolWindowsPane(com.intellij.openapi.wm.impl.ToolWindowsPane)

Aggregations

ToolWindowsPane (com.intellij.openapi.wm.impl.ToolWindowsPane)2 Balloon (com.intellij.openapi.ui.popup.Balloon)1 IdeRootPane (com.intellij.openapi.wm.impl.IdeRootPane)1