use of java.awt.Component in project intellij-community by JetBrains.
the class JBScrollBar method setValue.
@Override
public void setValue(int value) {
int delay = 0;
Component parent = getParent();
if (parent instanceof JBScrollPane) {
JBScrollPane pane = (JBScrollPane) parent;
JViewport viewport = pane.getViewport();
if (viewport != null && ScrollSettings.isEligibleFor(viewport.getView()) && ScrollSettings.isInterpolationEligibleFor(this)) {
delay = pane.getInitialDelay(getValueIsAdjusting());
}
}
if (delay > 0) {
myInterpolator.setTarget(value, delay);
} else {
super.setValue(value);
}
}
use of java.awt.Component in project intellij-community by JetBrains.
the class VerticalLayout method layout.
private int layout(ArrayList<Component> list, int y, int width, Insets insets) {
for (Component component : list) {
if (component.isVisible()) {
Dimension size = component.getPreferredSize();
int x = 0;
if (myAlignment == -1) {
size.width = width;
} else if (myAlignment != SwingConstants.LEFT) {
x = width - size.width;
if (myAlignment == SwingConstants.CENTER) {
x /= 2;
}
}
component.setBounds(x + insets.left, y + insets.top, size.width, size.height);
y += size.height + myGap;
}
}
return y;
}
use of java.awt.Component in project android by JetBrains.
the class ThemeEditorTableFixture method getComboBoxContentsAt.
@NotNull
public List<String> getComboBoxContentsAt(@NotNull final TableCell cell) {
return GuiQuery.getNonNull(() -> {
Component renderer = rendererComponentAt(cell);
checkState(renderer instanceof JComponent, "not a %s: %s", JComponent.class.getSimpleName(), renderer);
JComboBoxFixture comboBox = new JComboBoxFixture(robot(), robot().finder().findByType((JComponent) renderer, JComboBox.class));
return ImmutableList.copyOf(comboBox.contents());
});
}
use of java.awt.Component in project android by JetBrains.
the class ThemeEditorTableFixture method attributeNameAt.
@NotNull
public String attributeNameAt(@NotNull final TableCell cell) {
return GuiQuery.getNonNull(() -> {
Component renderer = rendererComponentAt(cell);
checkState(renderer instanceof ResourceComponent, "not a %s: %s", ResourceComponent.class.getSimpleName(), renderer);
return new ResourceComponentFixture(robot(), (ResourceComponent) renderer).getLabelText();
});
}
use of java.awt.Component in project android by JetBrains.
the class ThemeEditorTableFixture method getComboBoxSelectionAt.
@NotNull
public String getComboBoxSelectionAt(@NotNull final TableCell cell) {
return GuiQuery.getNonNull(() -> {
Component renderer = rendererComponentAt(cell);
checkState(renderer instanceof JComponent, "not a %s: %s", JComponent.class.getSimpleName(), renderer);
JComboBoxFixture comboBox = new JComboBoxFixture(robot(), robot().finder().findByType((JComponent) renderer, JComboBox.class));
return comboBox.selectedItem();
});
}
Aggregations