Search in sources :

Example 66 with Component

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);
    }
}
Also used : Component(java.awt.Component) TopComponent(com.intellij.openapi.wm.IdeGlassPane.TopComponent)

Example 67 with Component

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;
}
Also used : Dimension(java.awt.Dimension) Component(java.awt.Component)

Example 68 with Component

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());
    });
}
Also used : JComboBoxFixture(org.fest.swing.fixture.JComboBoxFixture) ResourceComponent(com.android.tools.idea.editors.theme.ui.ResourceComponent) Component(java.awt.Component) NotNull(org.jetbrains.annotations.NotNull)

Example 69 with Component

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();
    });
}
Also used : ResourceComponent(com.android.tools.idea.editors.theme.ui.ResourceComponent) ResourceComponent(com.android.tools.idea.editors.theme.ui.ResourceComponent) Component(java.awt.Component) NotNull(org.jetbrains.annotations.NotNull)

Example 70 with Component

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();
    });
}
Also used : JComboBoxFixture(org.fest.swing.fixture.JComboBoxFixture) ResourceComponent(com.android.tools.idea.editors.theme.ui.ResourceComponent) Component(java.awt.Component) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

Component (java.awt.Component)645 JComponent (javax.swing.JComponent)163 Dimension (java.awt.Dimension)81 JLabel (javax.swing.JLabel)65 JPanel (javax.swing.JPanel)60 Insets (java.awt.Insets)55 Point (java.awt.Point)55 TableCellRenderer (javax.swing.table.TableCellRenderer)47 Container (java.awt.Container)46 JScrollPane (javax.swing.JScrollPane)42 JTable (javax.swing.JTable)36 JButton (javax.swing.JButton)35 BorderLayout (java.awt.BorderLayout)34 GridBagConstraints (java.awt.GridBagConstraints)34 JTextComponent (javax.swing.text.JTextComponent)34 GridBagLayout (java.awt.GridBagLayout)33 Color (java.awt.Color)32 JList (javax.swing.JList)31 TableColumn (javax.swing.table.TableColumn)31 MouseEvent (java.awt.event.MouseEvent)27