use of com.intellij.ui.components.JBLayeredPane in project android by JetBrains.
the class DataReducerVisualTest method createLayeredSelection.
private JLayeredPane createLayeredSelection(JComponent host) {
JBLayeredPane layeredPane = new JBLayeredPane();
layeredPane.add(host);
layeredPane.add(mySelection);
layeredPane.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
JLayeredPane host = (JLayeredPane) e.getComponent();
if (host != null) {
Dimension dim = host.getSize();
for (Component c : host.getComponents()) {
c.setBounds(0, 0, dim.width, dim.height);
}
}
}
});
return layeredPane;
}
use of com.intellij.ui.components.JBLayeredPane in project android by JetBrains.
the class FlameGraphVisualTest method createMockTimeline.
private JLayeredPane createMockTimeline() {
JBLayeredPane timelinePane = new JBLayeredPane() {
@Override
public Dimension getMaximumSize() {
Dimension max = super.getMaximumSize();
max.height = getPreferredSize().height;
return max;
}
};
timelinePane.add(mAxis);
timelinePane.add(mLineChart);
timelinePane.add(mSelector);
timelinePane.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
JLayeredPane host = (JLayeredPane) e.getComponent();
if (host != null) {
Dimension dim = host.getSize();
for (Component c : host.getComponents()) {
if (c instanceof AxisComponent) {
AxisComponent axis = (AxisComponent) c;
switch(axis.getOrientation()) {
case LEFT:
case BOTTOM:
case RIGHT:
case TOP:
axis.setBounds(AXIS_SIZE, dim.height - AXIS_SIZE, dim.width - AXIS_SIZE * 2, AXIS_SIZE);
break;
}
} else {
c.setBounds(AXIS_SIZE, AXIS_SIZE, dim.width - AXIS_SIZE * 2, dim.height - AXIS_SIZE * 2);
}
}
}
}
});
timelinePane.setPreferredSize(new Dimension(Integer.MAX_VALUE, 100));
return timelinePane;
}
use of com.intellij.ui.components.JBLayeredPane in project android by JetBrains.
the class ThreadCallsVisualTest method createMockTimeline.
private JLayeredPane createMockTimeline() {
JBLayeredPane timelinePane = new JBLayeredPane() {
@Override
public Dimension getMaximumSize() {
Dimension max = super.getMaximumSize();
max.height = getPreferredSize().height;
return max;
}
};
timelinePane.add(mAxis);
timelinePane.add(mLineChart);
timelinePane.add(mSelector);
timelinePane.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
JLayeredPane host = (JLayeredPane) e.getComponent();
if (host != null) {
Dimension dim = host.getSize();
for (Component c : host.getComponents()) {
if (c instanceof AxisComponent) {
AxisComponent axis = (AxisComponent) c;
switch(axis.getOrientation()) {
case LEFT:
case BOTTOM:
case RIGHT:
case TOP:
axis.setBounds(AXIS_SIZE, dim.height - AXIS_SIZE, dim.width - AXIS_SIZE * 2, AXIS_SIZE);
break;
}
} else {
c.setBounds(AXIS_SIZE, AXIS_SIZE, dim.width - AXIS_SIZE * 2, dim.height - AXIS_SIZE * 2);
}
}
}
}
});
timelinePane.setPreferredSize(new Dimension(Integer.MAX_VALUE, 100));
return timelinePane;
}
use of com.intellij.ui.components.JBLayeredPane in project android by JetBrains.
the class ThreadsSegment method setCenterContent.
@Override
protected void setCenterContent(@NotNull JPanel panel) {
JLayeredPane centerPane = new JBLayeredPane();
JScrollPane scrollPane = new JBScrollPane(mThreadsList);
centerPane.add(scrollPane);
centerPane.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
JLayeredPane host = (JLayeredPane) e.getComponent();
if (host != null) {
Dimension dim = host.getSize();
for (Component c : host.getComponents()) {
c.setBounds(0, 0, dim.width, dim.height);
}
}
}
});
panel.add(centerPane, BorderLayout.CENTER);
}
Aggregations