Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
50,800
void () { int centerSpacing; // used to center sliders added using BorderLayout.CENTER (bug 4275631) if (slider.getOrientation() == SwingConstants.HORIZONTAL) { centerSpacing = thumbRect.height; if (slider.getPaintLabels()) centerSpacing += getHeightOfTallestLabel(); trackRect.setBounds(contentRect.x + trackBuffer, con...
calculateTrackRect
50,801
void () { super.calculateTickRect(); if (slider.getOrientation() == SwingConstants.HORIZONTAL) { tickRect.y -= JBUIScale.scale(5); } else { if (slider.getComponentOrientation().isLeftToRight()) { tickRect.x -= JBUIScale.scale(5); } else { tickRect.x = trackRect.x + JBUIScale.scale(5); } } }
calculateTickRect
50,802
void () { super.calculateLabelRect(); if (slider.getPaintLabels()) { if (slider.getOrientation() == SwingConstants.VERTICAL) { int distance = JBUIScale.scale(11); // Count tickRect labelRect.x += slider.getComponentOrientation().isLeftToRight() ? distance : -distance; } else { labelRect.y += JBUIScale.scale(6); } } }
calculateLabelRect
50,803
Dimension () { return slider.getOrientation() == SwingConstants.VERTICAL ? new JBDimension(22, 8) : new JBDimension(8, 22); }
getThumbSize
50,804
void (Graphics g) { Graphics2D g2 = (Graphics2D)g.create(); try { g2.translate(thumbRect.x, thumbRect.y); Path2D thumb = new Path2D.Float(Path2D.WIND_NON_ZERO); if (slider.getOrientation() == SwingConstants.VERTICAL) { if (slider.getComponentOrientation().isLeftToRight()) { thumb.moveTo(0, 0); thumb.lineTo(thumbRect.wi...
paintThumb
50,805
int () { return JBUIScale.scale(4); }
getTickLength
50,806
void (Graphics g, Rectangle tickBounds, int x) { Rectangle2D tick = new Rectangle2D.Double(x - 0.5, 0, JBUIScale.scale(1), tickBounds.height); paintSliderTick(g, tick); }
paintMinorTickForHorizSlider
50,807
void (Graphics g, Rectangle tickBounds, int x) { paintMinorTickForHorizSlider(g, tickBounds, x); }
paintMajorTickForHorizSlider
50,808
void (Graphics g, Rectangle tickBounds, int y) { Rectangle2D tick = new Rectangle2D.Double(0, y - 0.5, tickBounds.width, JBUIScale.scale(1)); paintSliderTick(g, tick); }
paintMinorTickForVertSlider
50,809
void (Graphics g, Rectangle tickBounds, int y) { paintMinorTickForVertSlider(g, tickBounds, y); }
paintMajorTickForVertSlider
50,810
void (Graphics g, Rectangle2D shape) { Graphics2D g2 = (Graphics2D)g.create(); try { g2.setColor(ticksColor); g2.fill(shape); } finally { g2.dispose(); } }
paintSliderTick
50,811
void (Graphics g) { ticksColor = UIManager.getColor(slider.isEnabled() ? "Button.intellij.native.borderColor" : "Slider.disabledForeground"); super.paintTicks(g); }
paintTicks
50,812
void (Graphics g) {}
paintFocus
50,813
Color () { if (slider.isEnabled()) { if (slider.getClientProperty(PRESSED_PROPERTY) == Boolean.TRUE) { return UIManager.getColor("Slider.pressedColor"); } else if (slider.getClientProperty(HOVER_PROPERTY) == Boolean.TRUE || slider.hasFocus()) { return UIManager.getColor("Slider.focusedColor"); } else { return UIManager...
getSliderColor
50,814
ComponentUI (JComponent c) { AbstractButton b = (AbstractButton)c; b.setRolloverEnabled(true); return new WinIntelliJCheckBoxUI(); }
createUI
50,815
boolean (AbstractButton b) { return true; }
removeInsetsBeforeLayout
50,816
void (JComponent c, Graphics2D g, AbstractButton b, Rectangle iconRect, boolean selected, boolean enabled) { Graphics2D g2 = (Graphics2D)g.create(); try { ButtonModel bm = b.getModel(); String iconName = isIndeterminate(b) ? "checkBoxIndeterminate" : "checkBox"; DarculaUIUtil.Outline op = DarculaUIUtil.getOutline(b); b...
drawCheckIcon
50,817
boolean (AbstractButton checkBox) { Rectangle cellPosition = (Rectangle)checkBox.getClientProperty(UIUtil.CHECKBOX_ROLLOVER_PROPERTY); return cellPosition != null && cellPosition.getBounds().equals(checkBox.getBounds()); }
isCellRollover
50,818
boolean (AbstractButton checkBox) { Rectangle cellPosition = (Rectangle)checkBox.getClientProperty(UIUtil.CHECKBOX_PRESSED_PROPERTY); return cellPosition != null && cellPosition.getBounds().equals(checkBox.getBounds()); }
isCellPressed
50,819
Icon () { return DEFAULT_ICON; }
getDefaultIcon
50,820
int () { return JBUIScale.scale(4); }
textIconGap
50,821
int (AbstractButton b) { return b.getDisplayedMnemonicIndex(); }
getMnemonicIndex
50,822
ComponentUI (JComponent c) { return new WinIntelliJPasswordFieldUI(); }
createUI
50,823
void () { super.installListeners(); JTextComponent passwordField = getComponent(); hoverListener = new DarculaUIUtil.MouseHoverPropertyTrigger(passwordField, HOVER_PROPERTY); passwordField.addMouseListener(hoverListener); }
installListeners
50,824
void () { super.uninstallListeners(); JTextComponent passwordField = getComponent(); if (hoverListener != null) { passwordField.removeMouseListener(hoverListener); } }
uninstallListeners
50,825
void (Graphics g) { JTextComponent c = getComponent(); Graphics2D g2 = (Graphics2D)g.create(); try { Container parent = c.getParent(); if (c.isOpaque() && parent != null) { g2.setColor(parent.getBackground()); g2.fillRect(0, 0, c.getWidth(), c.getHeight()); } if (c.getBorder() instanceof WinIntelliJTextBorder) { WinInt...
paintBackground
50,826
int (int originHeight) { JComponent component = getComponent(); Insets insets = component.getInsets(); return MINIMUM_HEIGHT.get() + insets.top + insets.bottom; }
getMinimumHeight
50,827
void (PropertyChangeEvent evt) { final Object source = evt.getSource(); if (source instanceof AbstractButton) { if (UIUtil.isHelpButton((JComponent)source)) { ((AbstractButton)source).setOpaque(false); } } }
propertyChange
50,828
ComponentUI (JComponent c) { ((AbstractButton)c).setRolloverEnabled(true); return new WinIntelliJButtonUI(); }
createUI
50,829
void (AbstractButton b) { super.installListeners(b); b.addPropertyChangeListener("JButton.buttonType", helpButtonListener); }
installListeners
50,830
void (AbstractButton b) { b.removePropertyChangeListener("JButton.buttonType", helpButtonListener); super.uninstallListeners(b); }
uninstallListeners
50,831
void (Graphics g, JComponent c) { if (UIUtil.isHelpButton(c)) { Icon help = WinIconLookup.getIcon("winHelp"); Insets i = c.getInsets(); help.paintIcon(c, g, i.left, i.top + (c.getHeight() - help.getIconHeight()) / 2); } else if (c instanceof AbstractButton b) { Graphics2D g2 = (Graphics2D)g.create(); try { Rectangle r ...
paint
50,832
void (AbstractButton b, Rectangle rect) { super.modifyViewRect(b, rect); rect.y -= JBUIScale.scale(1); // Move one pixel up }
modifyViewRect
50,833
int () { return MINIMUM_HEIGHT.get(); }
getMinimumHeight
50,834
void (JComponent button, Graphics g) {}
setupDefaultButton
50,835
void (Graphics g, String text, JComponent c, Rectangle textRect, FontMetrics metrics) { Graphics2D g2 = (Graphics2D)g.create(); try { g2.setColor(UIManager.getColor("Button.disabledText")); UIUtilities.drawStringUnderlineCharAt(c, g2, text, -1, textRect.x + getTextShiftOffset(), textRect.y + metrics.getAscent() + getTe...
paintDisabledText
50,836
Color (AbstractButton button) { Color focusedColor = (Color)button.getClientProperty("JButton.focusedTextColor"); Color textColor = (Color)button.getClientProperty("JButton.textColor"); boolean focusedStyle = button.hasFocus() || button.getModel().isRollover(); if (focusedStyle && focusedColor != null) { return focused...
getButtonTextColor
50,837
int (AbstractButton b) { return b.getDisplayedMnemonicIndex(); }
getMnemonicIndex
50,838
Color (AbstractButton b) { ButtonModel bm = b.getModel(); Color focusedColor = (Color)b.getClientProperty("JButton.focusedBackgroundColor"); if (bm.isPressed()) { return focusedColor != null ? focusedColor : UIManager.getColor("Button.intellij.native.pressedBackgroundColor"); } else if (b.hasFocus() || bm.isRollover())...
getBackgroundColor
50,839
Insets (Component c) { return DarculaUIUtil.isTableCellEditor(c) || DarculaUIUtil.isCompact(c) ? JBUI.insets(1, 1, 1, 4).asUIResource() : JBUI.insets(1).asUIResource(); }
getBorderInsets
50,840
void (Component c, Graphics g, int x, int y, int width, int height) { JComponent jc = (JComponent)c; if (jc.getClientProperty("JTextField.Search.noBorderRing") == Boolean.TRUE) return; Graphics2D g2 = (Graphics2D)g.create(); try { Rectangle r = new Rectangle(x, y, width, height); WinIntelliJTextFieldUI.adjustInWrapperR...
paintBorder
50,841
void (@NotNull EditorMouseEvent e) { editorTextField.putClientProperty(HOVER_PROPERTY, Boolean.TRUE); editorTextField.repaint(); }
mouseEntered
50,842
void (@NotNull EditorMouseEvent e) { editorTextField.putClientProperty(HOVER_PROPERTY, Boolean.FALSE); editorTextField.repaint(); }
mouseExited
50,843
void (Component c, Graphics g, int x, int y, int width, int height) { if (isComboBoxEditor(c)) { g.setColor(c.getBackground()); g.fillRect(x, y, width, height); return; } EditorTextField editorTextField = ComponentUtil.getParentOfType((Class<? extends EditorTextField>)EditorTextField.class, c); if (editorTextField == n...
paintBorder
50,844
Insets (Component c) { if (ComponentUtil.getParentOfType((Class<? extends ComboBoxCompositeEditor>)ComboBoxCompositeEditor.class, c) != null) { return JBInsets.emptyInsets().asUIResource(); } return (DarculaUIUtil.isTableCellEditor(c) ? JBUI.insets(1) : isComboBoxEditor(c) ? JBInsets.create(1, 6) : JBInsets.create(4, 6...
getBorderInsets
50,845
Insets (@NotNull Component component) { return JBUI.insets(1); }
getVisualPaddings
50,846
Border () { return JBUI.Borders.empty(2, 3, 2, 2); }
createInsideBorder
50,847
ComponentUI (JComponent c) { return new WinIntelliJLabelUI(); }
createUI
50,848
boolean (AbstractButton b) { return true; }
removeInsetsBeforeLayout
50,849
ComponentUI (JComponent c) { AbstractButton b = (AbstractButton)c; b.setRolloverEnabled(true); return new WinIntelliJRadioButtonUI(); }
createUI
50,850
void (JComponent c, Graphics2D g, Rectangle iconRect) { AbstractButton b = (AbstractButton)c; ButtonModel bm = b.getModel(); boolean focused = c.hasFocus() || bm.isRollover(); Icon icon = WinIconLookup.getIcon("radio", bm.isSelected(), focused, bm.isEnabled(), false, bm.isPressed()); icon.paintIcon(c, g, iconRect.x, ic...
paintIcon
50,851
Icon () { return DEFAULT_ICON; }
getDefaultIcon
50,852
int (AbstractButton b) { return b.getDisplayedMnemonicIndex(); }
getMnemonicIndex
50,853
ComponentUI (JComponent c) { c.setBorder(BUTTON_BORDER); return new WinOnOffButtonUI(); }
createUI
50,854
Dimension (JComponent c) { Dimension size = new Dimension(BUTTON_SIZE); // Don't scale it twice. JBInsets.addTo(size, BUTTON_BORDER.getBorderInsets(c)); return size; }
getPreferredSize
50,855
Dimension (JComponent c) { return getPreferredSize(c); }
getMaximumSize
50,856
Dimension (JComponent c) { return getPreferredSize(c); }
getMinimumSize
50,857
void (Graphics g, JComponent c) { if (!(c instanceof OnOffButton b)) return; Graphics2D g2 = (Graphics2D)g.create(); try { Insets i = c.getInsets(); Point origin = new Point((c.getWidth() - BUTTON_SIZE.width) / 2 + i.left, (c.getHeight() - BUTTON_SIZE.height) / 2 + i.top); Rectangle outerRect = new Rectangle(origin, BU...
paint
50,858
ComponentUI (JComponent c) { return new WinIntelliJTextFieldUI(); }
createUI
50,859
void () { super.installListeners(); hoverListener = new DarculaUIUtil.MouseHoverPropertyTrigger(getComponent(), HOVER_PROPERTY); getComponent().addMouseListener(hoverListener); }
installListeners
50,860
void () { super.uninstallListeners(); if (hoverListener != null) { getComponent().removeMouseListener(hoverListener); } }
uninstallListeners
50,861
void (Graphics g) { JComponent c = getComponent(); if (ComponentUtil.getParentOfType((Class<? extends JComboBox>)JComboBox.class, (Component)c) != null) return; Graphics2D g2 = (Graphics2D)g.create(); try { g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(Rend...
paintBackground
50,862
void (JComponent c, Graphics2D g2) { g2.setColor(c.isEnabled() ? c.getBackground() : UIManager.getColor("Button.background")); if (!c.isEnabled()) { g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.35f)); } Rectangle r = new Rectangle(c.getSize()); JBInsets.removeFrom(r, JBUI.insets(2)); adjustInWr...
paintTextFieldBackground
50,863
void (Rectangle r, Component c) { if (ComponentUtil.getParentOfType((Class<? extends Wrapper>)Wrapper.class, c) != null && TextFieldWithPopupHandlerUI .isSearchFieldWithHistoryPopup(c)) { int delta = c.getHeight() - c.getPreferredSize().height; if (delta > 0) { delta -= delta % 2 == 0 ? 0 : 1; JBInsets.removeFrom(r, JB...
adjustInWrapperRect
50,864
int (int textHeight) { JComponent c = getComponent(); Insets i = c.getInsets(); return DarculaEditorTextFieldBorder.isComboBoxEditor(c) || ComponentUtil.getParentOfType((Class<? extends JSpinner>)JSpinner.class, (Component)c) != null ? textHeight : MINIMUM_HEIGHT.get() + i.top + i.bottom; }
getMinimumHeight
50,865
int () { return 0; }
getSearchIconGap
50,866
Insets () { Component c = getComponent(); return DarculaUIUtil.isCompact(c) || DarculaUIUtil.isTableCellEditor(c) ? JBInsets.create(0, 3) : JBInsets.create(2, 6); }
getDefaultMargins
50,867
int () { return JBUIScale.scale(3); }
getClearIconGap
50,868
ComponentUI (JComponent c) { return new WinIntelliJComboBoxUI(); }
createUI
50,869
void () { super.installListeners(); if (!comboBox.isEditable()) { comboBox.addMouseListener(mouseListener = new ComboBoxMouseListener()); } }
installListeners
50,870
void () { super.uninstallListeners(); comboBox.removeMouseListener(mouseListener); }
uninstallListeners
50,871
PropertyChangeListener () { return e -> { if ("enabled".equals(e.getPropertyName())) { EditorTextField etf = UIUtil.findComponentOfType((JComponent)editor, EditorTextField.class); if (etf != null) { etf.setBackground(getComboBackground(true)); } } else if ("editable".equals(e.getPropertyName())) { if (e.getNewValue() =...
createPropertyListener
50,872
void (Graphics g, JComponent c) { Graphics2D g2 = (Graphics2D)g.create(); try { Rectangle r = new Rectangle(c.getSize()); if (c.isOpaque()) { Container parent = c.getParent(); if (parent != null) { g2.setColor(DarculaUIUtil.isTableCellEditor(c) && editor != null ? editor.getBackground() : parent.getBackground()); g2.fi...
paint
50,873
Rectangle () { int w = comboBox.getWidth(); int h = comboBox.getHeight(); Insets i = comboBox.getInsets(); int buttonWidth = h; if (arrowButton != null) { buttonWidth = comboBox.getComponentOrientation().isLeftToRight() ? arrowButton.getWidth() - i.right : arrowButton.getWidth() - i.left; } Rectangle rect = (comboBox.g...
rectangleForCurrentValue
50,874
void (Graphics g, Rectangle bounds, boolean hasFocus) { ListCellRenderer<Object> renderer = comboBox.getRenderer(); Component c = renderer.getListCellRendererComponent(listBox, comboBox.getSelectedItem(), -1, false, false); c.setFont(comboBox.getFont()); c.setForeground(comboBox.isEnabled() ? UIManager.getColor("Label....
paintCurrentValue
50,875
Color (boolean opaque) { if (comboBox != null) { Color bg = comboBox.getBackground(); Object value = comboBox.getSelectedItem(); if (comboBox.isEnabled() && comboBox.isEditable() && editor != null) { return UIManager.getColor("TextField.background"); } else if (!comboBox.isEnabled()) { return opaque ? UIManager.getColo...
getComboBackground
50,876
JButton () { JButton button = new BasicArrowButton(SwingConstants.SOUTH) { @Override public Dimension getPreferredSize() { return ARROW_BUTTON_SIZE; } @Override public void paint(Graphics g) { // paint events may still arrive after UI switch until the entire UI is updated if (!LafManager.getInstance().getCurrentUITheme...
createArrowButton
50,877
Dimension () { return ARROW_BUTTON_SIZE; }
getPreferredSize
50,878
void (Graphics g) { // paint events may still arrive after UI switch until the entire UI is updated if (!LafManager.getInstance().getCurrentUIThemeLookAndFeel().getId().equals("win10Light")) { return; } Graphics2D g2 = (Graphics2D)g.create(); try { g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VAL...
paint
50,879
void (MouseEvent e) { if (!comboBox.isEditable()) { comboBox.repaint(); } }
mouseReleased
50,880
Icon (@NotNull JComponent c) { return WinIconLookup.getIcon("comboDropTriangle", false, false, c.isEnabled()); }
getArrowIcon
50,881
void () { super.unconfigureArrowButton(); if (arrowButton != null) { arrowButton.removeMouseListener(buttonReleaseListener); arrowButton.removeMouseListener(buttonHoverListener); } }
unconfigureArrowButton
50,882
ComboBoxEditor () { return new BasicComboBoxEditor.UIResource() { @Override protected JTextField createEditorComponent() { return new JTextField() { @Override public void setText(String s) { if (getText().equals(s)) { return; } super.setText(s); } @Override public Color getBackground() { return getComboBackground(false...
createEditor
50,883
JTextField () { return new JTextField() { @Override public void setText(String s) { if (getText().equals(s)) { return; } super.setText(s); } @Override public Color getBackground() { return getComboBackground(false); } @Override public Border getBorder() { return DEFAULT_EDITOR_BORDER; } @Override public Insets getInset...
createEditorComponent
50,884
void (String s) { if (getText().equals(s)) { return; } super.setText(s); }
setText
50,885
Color () { return getComboBackground(false); }
getBackground
50,886
Border () { return DEFAULT_EDITOR_BORDER; }
getBorder
50,887
Insets () { return DEFAULT_EDITOR_BORDER.getBorderInsets(this); }
getInsets
50,888
Dimension () { Dimension size = super.getPreferredSize(); return new Dimension(size.width, Math.max(JBUIScale.scale(18), size.height)); }
getPreferredSize
50,889
void () { super.configureEditor(); installEditorKeyListener(comboBox.getEditor()); if (editor instanceof JComponent jEditor) { jEditor.setBorder(DEFAULT_EDITOR_BORDER); editorHoverListener = new MouseHoverPropertyTrigger(comboBox, HOVER_PROPERTY); if (editor instanceof JTextComponent) { editor.addMouseListener(editorHo...
configureEditor
50,890
void () { super.unconfigureEditor(); if (editor instanceof JTextComponent) { if (editorHoverListener != null) { editor.removeMouseListener(editorHoverListener); } } else { EditorTextField etf = UIUtil.findComponentOfType((JComponent)editor, EditorTextField.class); if (etf != null) { if (editorHoverListener != null) { e...
unconfigureEditor
50,891
void (Component c, Graphics g, int x, int y, int width, int height) { if (comboBox == null || arrowButton == null) { return; //NPE on LaF change } Graphics2D g2 = (Graphics2D)g.create(); try { checkFocus(); Rectangle r = new Rectangle(x, y, width, height); boolean isCellRenderer = DarculaUIUtil.isTableCellEditor(c); in...
paintBorder
50,892
boolean () { return comboBox != null && comboBox.getClientProperty(HOVER_PROPERTY) == Boolean.TRUE || arrowButton != null && arrowButton.getClientProperty(HOVER_PROPERTY) == Boolean.TRUE; }
isHover
50,893
boolean () { JComponent ec = (JComponent)comboBox.getEditor().getEditorComponent(); EditorTextField etf = UIUtil.findComponentOfType((JComponent)editor, EditorTextField.class); Editor editor = etf != null ? etf.getEditor() : null; return arrowButton != null && arrowButton.getClientProperty(HOVER_PROPERTY) == Boolean.TR...
isEditorHover
50,894
boolean () { return comboBox != null && comboBox.getClientProperty(PRESSED_PROPERTY) == Boolean.TRUE || arrowButton != null && arrowButton.getModel().isPressed(); }
isPressed
50,895
Insets (Component c) { return JBUI.insets(DarculaUIUtil.isTableCellEditor(c) ? 0 : 1).asUIResource(); }
getBorderInsets
50,896
Dimension (Dimension size, Dimension editorSize) { ARROW_BUTTON_SIZE.update(); Insets i = getInsets(); int editorHeight = editorSize != null ? editorSize.height + i.top + i.bottom + padding.top + padding.bottom : 0; int editorWidth = editorSize != null ? editorSize.width + i.left + padding.left + padding.right : 0; edi...
getSizeWithButton
50,897
LayoutManager () { return new BasicComboBoxUI.ComboBoxLayoutManager() { @Override public void layoutContainer(Container parent) { JComboBox<?> cb = (JComboBox<?>)parent; if (arrowButton != null) { if (cb.getComponentOrientation().isLeftToRight()) { arrowButton.setBounds(cb.getWidth() - ARROW_BUTTON_SIZE.width, 0, ARROW...
createLayoutManager
50,898
void (Container parent) { JComboBox<?> cb = (JComboBox<?>)parent; if (arrowButton != null) { if (cb.getComponentOrientation().isLeftToRight()) { arrowButton.setBounds(cb.getWidth() - ARROW_BUTTON_SIZE.width, 0, ARROW_BUTTON_SIZE.width, cb.getHeight()); } else { arrowButton.setBounds(0, 0, ARROW_BUTTON_SIZE.width, cb.ge...
layoutContainer
50,899
void (MouseEvent e) { setPressedProperty(true); }
mousePressed