Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
282,900 | int (int value) { value = JBUIScale.scale(value); return switch (UIUtil.getComponentStyle(myScrollBar)) { case LARGE -> (int)(value * 1.15); case SMALL -> (int)(value * 0.857); case MINI -> (int)(value * 0.714); case REGULAR -> value; }; } | scale |
282,901 | void (JComponent c) { myScrollBar = (JScrollBar)c; ScrollBarPainter.setBackground(c); myScrollBar.setOpaque(false); myScrollBar.setFocusable(false); myScrollBar.addMouseListener(myListener); myScrollBar.addMouseMotionListener(myListener); myScrollBar.getModel().addChangeListener(myListener); myScrollBar.addPropertyChan... | installUI |
282,902 | void (JComponent c) { myAnimationBehavior.onUninstall(); myScrollTimer.stop(); myScrollBar.removeFocusListener(myListener); myScrollBar.removePropertyChangeListener(myListener); myScrollBar.getModel().removeChangeListener(myListener); myScrollBar.removeMouseMotionListener(myListener); myScrollBar.removeMouseListener(my... | uninstallUI |
282,903 | Dimension (JComponent c) { int thickness = getThickness(); Alignment alignment = Alignment.get(c); Dimension preferred = new Dimension(thickness, thickness); if (alignment == Alignment.LEFT || alignment == Alignment.RIGHT) { preferred.height += preferred.height; addPreferredHeight(preferred, ComponentUtil.getClientProp... | getPreferredSize |
282,904 | void (Dimension preferred, Component component) { if (component != null) { Dimension size = component.getPreferredSize(); preferred.width += size.width; if (preferred.height < size.height) preferred.height = size.height; } } | addPreferredWidth |
282,905 | void (Dimension preferred, Component component) { if (component != null) { Dimension size = component.getPreferredSize(); preferred.height += size.height; if (preferred.width < size.width) preferred.width = size.width; } } | addPreferredHeight |
282,906 | void (Graphics g, JComponent c) { Alignment alignment = Alignment.get(c); if (alignment != null && g instanceof Graphics2D) { Color background = !isOpaque(c) ? null : c.getBackground(); if (background != null) { g.setColor(background); g.fillRect(0, 0, c.getWidth(), c.getHeight()); } Rectangle bounds = new Rectangle(c.... | paint |
282,907 | void (boolean animate) { int value = 0; int min = myScrollBar.getMinimum(); int max = myScrollBar.getMaximum(); int range = max - min; if (range <= 0) { myThumb.bounds.setBounds(0, 0, 0, 0); } else if (VERTICAL == myScrollBar.getOrientation()) { int extent = myScrollBar.getVisibleAmount(); int height = Math.max(convert... | updateThumbBounds |
282,908 | int () { return isValueCached ? myCachedValue : myScrollBar.getValue(); } | getValue |
282,909 | int (double newRange, double oldValue, double oldRange) { return (int)(.5 + newRange * oldValue / oldRange); } | convert |
282,910 | int (int value, int min, int max) { return Math.max(min, Math.min(value, max)); } | adjust |
282,911 | void (int x, int y) { if (isTrackContains(x, y)) { if (!isOverTrack) myAnimationBehavior.onTrackHover(isOverTrack = true); boolean hover = isThumbContains(x, y); if (isOverThumb != hover) myAnimationBehavior.onThumbHover(isOverThumb = hover); } else { updateMouseExit(); } } | updateMouse |
282,912 | void () { if (isOverThumb) myAnimationBehavior.onThumbHover(isOverThumb = false); if (isOverTrack) myAnimationBehavior.onTrackHover(isOverTrack = false); } | updateMouseExit |
282,913 | boolean (MouseEvent event) { if (isTrackClickable()) return false; // redispatch current event to the view Container parent = myScrollBar.getParent(); if (parent instanceof JScrollPane pane) { Component view = pane.getViewport().getView(); if (view != null) { Point point = event.getLocationOnScreen(); SwingUtilities.co... | redispatchIfTrackNotClickable |
282,914 | void (MouseEvent e) { if (myScrollBar != null && myScrollBar.isEnabled()) redispatchIfTrackNotClickable(e); } | mouseClicked |
282,915 | void (MouseEvent event) { if (myScrollBar == null || !myScrollBar.isEnabled()) return; if (redispatchIfTrackNotClickable(event)) return; if (SwingUtilities.isRightMouseButton(event)) return; isValueCached = true; myCachedValue = myScrollBar.getValue(); myScrollBar.setValueIsAdjusting(true); myMouseX = event.getX(); myM... | mousePressed |
282,916 | void (MouseEvent event) { if (isDragging) updateMouse(event.getX(), event.getY()); if (myScrollBar == null || !myScrollBar.isEnabled()) return; if (redispatchIfTrackNotClickable(event)) return; if (SwingUtilities.isRightMouseButton(event)) return; isDragging = false; myOffset = 0; myScrollTimer.stop(); isValueCached = ... | mouseReleased |
282,917 | void (MouseEvent event) { if (myScrollBar == null || !myScrollBar.isEnabled()) return; if (myThumb.bounds.isEmpty() || SwingUtilities.isRightMouseButton(event)) return; if (isDragging) { setValueFrom(event); } else { myMouseX = event.getX(); myMouseY = event.getY(); updateMouse(myMouseX, myMouseY); startScrollTimerIfNe... | mouseDragged |
282,918 | void (MouseEvent event) { if (myScrollBar == null || !myScrollBar.isEnabled()) return; if (!isDragging) updateMouse(event.getX(), event.getY()); } | mouseMoved |
282,919 | void (MouseEvent event) { if (myScrollBar == null || !myScrollBar.isEnabled()) return; if (!isDragging) updateMouseExit(); } | mouseExited |
282,920 | void (ActionEvent event) { if (myScrollBar == null) { myScrollTimer.stop(); } else { scroll(isReversed); if (!myThumb.bounds.isEmpty()) { if (isReversed ? !isMouseBeforeThumb() : !isMouseAfterThumb()) { myScrollTimer.stop(); } } int value = myScrollBar.getValue(); if (isReversed ? value <= myScrollBar.getMinimum() : va... | actionPerformed |
282,921 | void (FocusEvent event) { repaint(); } | focusGained |
282,922 | void (FocusEvent event) { repaint(); } | focusLost |
282,923 | void (ChangeEvent event) { updateThumbBounds(false); // TODO: update mouse isValueCached = false; repaint(); } | stateChanged |
282,924 | void (PropertyChangeEvent event) { String name = event.getPropertyName(); if ("model".equals(name)) { BoundedRangeModel oldModel = (BoundedRangeModel)event.getOldValue(); BoundedRangeModel newModel = (BoundedRangeModel)event.getNewValue(); oldModel.removeChangeListener(this); newModel.addChangeListener(this); } if ("mo... | propertyChange |
282,925 | void (MouseEvent event) { int x = event.getX(); int y = event.getY(); int thumbMin, thumbMax, thumbPos; if (VERTICAL == myScrollBar.getOrientation()) { thumbMin = myTrack.bounds.y; thumbMax = myTrack.bounds.y + myTrack.bounds.height - myThumb.bounds.height; thumbPos = MathUtil.clamp(y - myOffset, thumbMin, thumbMax); i... | setValueFrom |
282,926 | void () { if (!myScrollTimer.isRunning()) { if (isReversed ? isMouseBeforeThumb() : isMouseAfterThumb()) { myScrollTimer.start(); } } } | startScrollTimerIfNecessary |
282,927 | boolean () { return VERTICAL == myScrollBar.getOrientation() ? isMouseOnTop() : myScrollBar.getComponentOrientation().isLeftToRight() ? isMouseOnLeft() : isMouseOnRight(); } | isMouseBeforeThumb |
282,928 | boolean () { return VERTICAL == myScrollBar.getOrientation() ? isMouseOnBottom() : myScrollBar.getComponentOrientation().isLeftToRight() ? isMouseOnRight() : isMouseOnLeft(); } | isMouseAfterThumb |
282,929 | boolean () { return myMouseY < myThumb.bounds.y; } | isMouseOnTop |
282,930 | boolean () { return myMouseX < myThumb.bounds.x; } | isMouseOnLeft |
282,931 | boolean () { return myMouseX > myThumb.bounds.x + myThumb.bounds.width; } | isMouseOnRight |
282,932 | boolean () { return myMouseY > myThumb.bounds.y + myThumb.bounds.height; } | isMouseOnBottom |
282,933 | void (boolean reversed) { int delta = myScrollBar.getBlockIncrement(reversed ? -1 : 1); if (reversed) delta = -delta; int oldValue = myScrollBar.getValue(); int newValue = oldValue + delta; if (delta > 0 && newValue < oldValue) { newValue = myScrollBar.getMaximum(); } else if (delta < 0 && newValue > oldValue) { newVal... | scroll |
282,934 | JBBox () { return new JBBox(BoxLayout.Y_AXIS); } | createVerticalBox |
282,935 | JBBox () { return new JBBox(BoxLayout.X_AXIS); } | createHorizontalBox |
282,936 | AccessibleContext () { if (accessibleContext == null) { return new AccessibleJBBox(); } return accessibleContext; } | getAccessibleContext |
282,937 | AccessibleRole () { return AccessibleRole.PANEL; } | getAccessibleRole |
282,938 | ScrollBarAnimationBehavior () { return new MacScrollBarAnimationBehavior( new Computable<>() { @Override public JScrollBar compute() { return myScrollBar; } }, myTrack.animator, myThumb.animator); } | createBaseAnimationBehavior |
282,939 | JScrollBar () { return myScrollBar; } | compute |
282,940 | void (JComponent c) { super.installUI(c); updateStyle(Style.CURRENT.getValue()); processReferences(this, null, null); AWTEventListener listener = MOVEMENT_LISTENER.getAndSet(null); // add only one movement listener if (listener != null) Toolkit.getDefaultToolkit().addAWTEventListener(listener, AWTEvent.MOUSE_MOTION_EVE... | installUI |
282,941 | void (JComponent c) { processReferences(null, this, null); super.uninstallUI(c); } | uninstallUI |
282,942 | void (AWTEvent event) { if (event != null && MouseEvent.MOUSE_MOVED == event.getID()) { Object source = event.getSource(); if (source instanceof Component) { JScrollPane pane = ComponentUtil.getParentOfType((Class<? extends JScrollPane>)JScrollPane.class, (Component)source); if (pane != null) { pauseThumbAnimation(pane... | eventDispatched |
282,943 | void (JScrollBar bar) { Object object = bar == null ? null : bar.getUI(); if (object instanceof MacScrollBarUI ui) { if (0 < ui.myAnimationBehavior.getThumbFrame()) ui.myAnimationBehavior.onThumbMove(); } } | pauseThumbAnimation |
282,944 | void (MacScrollBarUI toAdd, MacScrollBarUI toRemove, List<? super MacScrollBarUI> list) { synchronized (UI) { Iterator<Reference<MacScrollBarUI>> iterator = UI.iterator(); while (iterator.hasNext()) { Reference<MacScrollBarUI> reference = iterator.next(); MacScrollBarUI ui = reference.get(); if (ui == null || ui == toR... | processReferences |
282,945 | void (Style style) { if (myScrollBar != null) { myScrollBar.setOpaque(style != Style.Overlay); myScrollBar.revalidate(); myScrollBar.repaint(); myAnimationBehavior.onThumbMove(); } } | updateStyle |
282,946 | ID (String name, Pointer pointer, Callback callback) { ID delegateClass = allocateObjcClassPair(getObjcClass("NSObject"), name); if (!ID.NIL.equals(delegateClass)) { if (!addMethod(delegateClass, pointer, callback, "v@")) { throw new RuntimeException("Cannot add observer method"); } registerObjcClassPair(delegateClass)... | createDelegate |
282,947 | Behavior () { ID defaults = invoke("NSUserDefaults", "standardUserDefaults"); invoke(defaults, "synchronize"); ID behavior = invoke(defaults, "boolForKey:", nsString("AppleScrollerPagingBehavior")); Behavior value = 1 == behavior.intValue() ? JumpToSpot : NextPage; Logger.getInstance(MacScrollBarUI.class).debug("scroll... | produce |
282,948 | String () { return "scroll bar behavior"; } | toString |
282,949 | void () { Style oldStyle = getValue(); if (SystemInfoRt.isMac && !Registry.is("ide.mac.disableMacScrollbars", false)) { super.run(); } Style newStyle = getValue(); if (newStyle != oldStyle) { List<MacScrollBarUI> list = new ArrayList<>(); processReferences(null, null, list); for (MacScrollBarUI ui : list) { ui.updateSt... | run |
282,950 | Style () { ID style = invoke(getObjcClass("NSScroller"), "preferredScrollerStyle"); Style value = 1 == style.intValue() ? Overlay : Legacy; Logger.getInstance(MacScrollBarUI.class).debug("scroll bar style ", value, " from ", style); return value; } | produce |
282,951 | String () { return "scroll bar style"; } | toString |
282,952 | void (ID self, Pointer selector, ID event) { Logger.getInstance(MacScrollBarUI.class).debug("update ", this); EdtInvocationManager.invokeLaterIfNeeded(this); } | callback |
282,953 | void () { myValue = callMac(this); } | run |
282,954 | void () { } | onLoadingStart |
282,955 | void () { } | onLoadingFinish |
282,956 | boolean () { return Registry.is("idea.true.smooth.scrolling.interpolation", false); } | isInterpolationEnabledByRegistry |
282,957 | void (Font font) { myText.setFont(font); } | setTextFont |
282,958 | void (@NlsContexts.Label String text) { myText.setText(text); } | setText |
282,959 | String () { return myText.getText(); } | getText |
282,960 | void (Icon icon) { myIcon.setIcon(icon); } | setIcon |
282,961 | Icon () { return myIcon.getIcon(); } | getIcon |
282,962 | void () { myIcon.setIcon(PlatformIcons.COMBOBOX_ARROW_ICON); } | setRegularIcon |
282,963 | void () { myIcon.setIcon(AllIcons.General.ArrowDown); } | setSelectionIcon |
282,964 | void (Color color) { super.setForeground(color); //noinspection ConstantConditions if (myText != null) { // null when called from the constructor of the superclass myText.setForeground(color); } } | setForeground |
282,965 | void (boolean enabled) { super.setEnabled(enabled); myText.setEnabled(enabled); myIcon.setEnabled(enabled); } | setEnabled |
282,966 | int () { final int columns = getColumnCount(); return columns == 0 ? 0 : getSize() / columns + 1; } | getRowCount |
282,967 | int () { return Math.min(myMaxColumns, getSize()); } | getColumnCount |
282,968 | int (int row, int column) { final int columns = getColumnCount(); return columns == 0 ? -1 : row * columns + column; } | toListIndex |
282,969 | int (int listIndex) { return listIndex % myMaxColumns; } | getColumn |
282,970 | int (int listIndex) { return listIndex / myMaxColumns; } | getRow |
282,971 | JComponent () { return myAnchor; } | getAnchor |
282,972 | void (@Nullable JComponent anchor) { this.myAnchor = anchor; } | setAnchor |
282,973 | Dimension () { Dimension size = super.getPreferredSize(); if (myAnchor != null && myAnchor != this) { Dimension anchorSize = myAnchor.getPreferredSize(); size.width = Math.max(size.width, anchorSize.width); size.height = Math.max(size.height, anchorSize.height); } return size; } | getPreferredSize |
282,974 | Dimension () { Dimension size = super.getMinimumSize(); if (myAnchor != null && myAnchor != this) { Dimension anchorSize = myAnchor.getMinimumSize(); size.width = Math.max(size.width, anchorSize.width); size.height = Math.max(size.height, anchorSize.height); } return size; } | getMinimumSize |
282,975 | boolean (@NotNull Icon icon) { if (StartupUiUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) { return false; } ButtonUI ui = getUI(); if (ui instanceof BasicRadioButtonUI) { Icon defaultIcon = ((BasicRadioButtonUI) ui).getDefaultIcon(); if (defaultIcon != null) { MergedIcon mergedIcon = new MergedIcon(defaultIcon,... | setTextIcon |
282,976 | void (Component c, Graphics g, int x, int y) { paintIconAlignedCenter(c, g, x, y, myLeftIcon); paintIconAlignedCenter(c, g, x + myLeftIcon.getIconWidth() + myHorizontalStrut, y, myRightIcon); } | paintIcon |
282,977 | void (Component c, Graphics g, int x, int y, @NotNull Icon icon) { int iconHeight = getIconHeight(); icon.paintIcon(c, g, x, y + (iconHeight - icon.getIconHeight()) / 2); } | paintIconAlignedCenter |
282,978 | int () { return myLeftIcon.getIconWidth() + myHorizontalStrut + myRightIcon.getIconWidth(); } | getIconWidth |
282,979 | int () { return Math.max(myLeftIcon.getIconHeight(), myRightIcon.getIconHeight()); } | getIconHeight |
282,980 | void () { super.removeNotify(); if (!ScreenUtil.isStandardAddRemoveNotify(this)) { return; } if (myBusyIcon != null) { remove(myBusyIcon); myBusyIcon.dispose(); myBusyIcon = null; } } | removeNotify |
282,981 | void () { super.doLayout(); if (myBusyIcon != null) { myBusyIcon.updateLocation(this); } } | doLayout |
282,982 | Graphics (Graphics graphics) { return JBSwingUtilities.runGlobalCGTransform(this, super.getComponentGraphics(graphics)); } | getComponentGraphics |
282,983 | void (Graphics g) { super.paint(g); if (myBusyIcon != null) { myBusyIcon.updateLocation(this); } } | paint |
282,984 | void (long tm, int x, int y, int width, int height) { if (width > 0 && height > 0) { ListUI ui = getUI(); // do not paint a line background if the layout orientation is not vertical if (ui instanceof WideSelectionListUI && getLayoutOrientation() == JList.VERTICAL) { x = 0; width = getWidth(); } super.repaint(tm, x, y, ... | repaint |
282,985 | void (ListUI ui) { if (ui != null && Registry.is("ide.wide.selection.list.ui", true)) { Class<? extends ListUI> type = ui.getClass(); if (type == BasicListUI.class) { ui = new WideSelectionListUI(); } } super.setUI(ui); } | setUI |
282,986 | void (boolean paintBusy) { if (myBusy == paintBusy) return; myBusy = paintBusy; updateBusy(); } | setPaintBusy |
282,987 | void () { if (myBusy) { if (myBusyIcon == null) { myBusyIcon = new AsyncProcessIcon(toString()); myBusyIcon.setOpaque(false); myBusyIcon.setPaintPassiveIcon(false); add(myBusyIcon); } } //noinspection DuplicatedCode if (myBusyIcon != null) { if (myBusy) { myBusyIcon.resume(); } else { myBusyIcon.suspend(); SwingUtiliti... | updateBusy |
282,988 | void (int index) { if (index != myDropTargetIndex) { myDropTargetIndex = index; repaint(); } } | setDropTargetIndex |
282,989 | void (@NotNull Function<? super Integer, Integer> offsetFromElementTopForDnD) { this.offsetFromElementTopForDnD = offsetFromElementTopForDnD; } | setOffsetFromElementTopForDnD |
282,990 | void (Graphics g) { super.paintComponent(g); myEmptyText.paint(this, g); if (myDropTargetIndex < 0) { return; } int dropLineY; Rectangle rc; if (myDropTargetIndex == getModel().getSize()) { rc = getCellBounds(myDropTargetIndex-1, myDropTargetIndex-1); dropLineY = (int)rc.getMaxY()-1; } else { rc = getCellBounds(myDropT... | paintComponent |
282,991 | Dimension () { Dimension s = getEmptyText().getPreferredSize(); JBInsets.addTo(s, getInsets()); Dimension size = super.getPreferredSize(); return new Dimension(Math.max(s.width, size.width), Math.max(s.height, size.height)); } | getPreferredSize |
282,992 | Dimension () { return super.getPreferredSize(); } | super_getPreferredSize |
282,993 | void () { setSelectionBackground(UIUtil.getListSelectionBackground(true)); setSelectionForeground(NamedColorUtil.getListSelectionForeground(true)); installDefaultCopyAction(); myEmptyText = new StatusText(this) { @Override protected boolean isStatusVisible() { return JBList.this.isEmpty(); } }; putClientProperty(UIUtil... | init |
282,994 | boolean () { return JBList.this.isEmpty(); } | isStatusVisible |
282,995 | void () { final Action copy = getActionMap().get("copy"); if (copy == null || copy instanceof UIResource) { Action newCopy = new AbstractAction() { @Override public boolean isEnabled() { return getSelectedIndex() != -1; } @Override public void actionPerformed(ActionEvent e) { doCopyToClipboardAction(); } }; getActionMa... | installDefaultCopyAction |
282,996 | boolean () { return getSelectedIndex() != -1; } | isEnabled |
282,997 | void (ActionEvent e) { doCopyToClipboardAction(); } | actionPerformed |
282,998 | void () { ArrayList<String> selected = new ArrayList<>(); for (int index : getSelectedIndices()) { E value = getModel().getElementAt(index); String text = itemToText(index, value); if (text != null) selected.add(text); } if (selected.size() > 0) { String text = StringUtil.join(selected, "\n"); CopyPasteManager.getInsta... | doCopyToClipboardAction |
282,999 | boolean () { return getItemsCount() == 0; } | isEmpty |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.