Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
283,900
void (@NotNull JComponent component) { List<HoverListener> list = ClientProperty.get(component, HOVER_LISTENER_LIST_KEY); if (list == null) { component.putClientProperty(HOVER_LISTENER_LIST_KEY, list = ContainerUtil.createLockFreeCopyOnWriteList()); } list.add(0, this); }
addTo
283,901
void (@NotNull JComponent component) { List<HoverListener> list = ClientProperty.get(component, HOVER_LISTENER_LIST_KEY); if (list != null) { list.remove(this); } }
removeFrom
283,902
List<HoverListener> (@NotNull Component component) { List<HoverListener> list = ClientProperty.get(component, HOVER_LISTENER_LIST_KEY); return list == null ? Collections.emptyList() : list; }
getAll
283,903
void (@NotNull Component component, int x, int y) { mouseMoved(component, x, y); }
mouseEntered
283,904
void (@NotNull Component component, int x, int y) { update(component, tree -> TreeUtil.getRowForLocation(tree, x, y)); }
mouseMoved
283,905
void (@NotNull Component component) { update(component, tree -> -1); }
mouseExited
283,906
void (@NotNull Component component, @NotNull ToIntFunction<? super JTree> rowFunc) { if (component instanceof JTree tree) { int rowNew = rowFunc.applyAsInt(tree); int rowOld = rowHolder.getAndSet(rowNew); if (rowNew != rowOld) onHover(tree, rowNew); } }
update
283,907
void (@NotNull JTree tree, int row) { setHoveredRow(tree, row); // support JBTreeTable and similar views Object property = tree.getClientProperty(RenderingUtil.FOCUSABLE_SIBLING); if (property instanceof JTable) TableHoverListener.setHoveredRow((JTable)property, row); }
onHover
283,908
void (@NotNull JTree tree, int rowNew) { int rowOld = getHoveredRow(tree); if (rowNew == rowOld) return; tree.putClientProperty(HOVERED_ROW_KEY, rowNew < 0 ? null : rowNew); if (RenderingUtil.isHoverPaintingDisabled(tree)) return; TreeUtil.repaintRow(tree, rowOld); TreeUtil.repaintRow(tree, rowNew); }
setHoveredRow
283,909
int (@NotNull JTree tree) { Object property = tree.getClientProperty(HOVERED_ROW_KEY); return property instanceof Integer ? (Integer)property : -1; }
getHoveredRow
283,910
void (@NotNull Component component, int x, int y) { mouseMoved(component, x, y); }
mouseEntered
283,911
void (@NotNull Component component, int x, int y) { update(component, table -> table.rowAtPoint(new Point(x, y)), table -> table.columnAtPoint(new Point(x, y))); }
mouseMoved
283,912
void (@NotNull Component component) { update(component, table -> -1, table -> -1); }
mouseExited
283,913
void (@NotNull Component component, @NotNull ToIntFunction<? super JTable> rowFunc, @NotNull ToIntFunction<? super JTable> columnFunc) { if (component instanceof JTable table) { int rowNew = rowFunc.applyAsInt(table); int rowOld = rowHolder.getAndSet(rowNew); int columnNew = columnFunc.applyAsInt(table); int columnOld = columnHolder.getAndSet(columnNew); if (rowNew != rowOld || columnNew != columnOld) onHover(table, rowNew, columnNew); } }
update
283,914
void (@NotNull JTable table, int row, int column) { setHoveredRow(table, row); // support JBTreeTable and similar views Object property = table.getClientProperty(RenderingUtil.FOCUSABLE_SIBLING); if (property instanceof JTree) TreeHoverListener.setHoveredRow((JTree)property, row); }
onHover
283,915
void (@NotNull JTable table, int rowNew) { int rowOld = getHoveredRow(table); if (rowNew == rowOld) return; table.putClientProperty(HOVERED_ROW_KEY, rowNew < 0 ? null : rowNew); // tables without scroll pane do not repaint rows correctly (BasicTableUI.paint:1868-1872) if (table.getParent() instanceof JViewport) { repaintRow(table, rowOld); repaintRow(table, rowNew); } else { table.repaint(); } }
setHoveredRow
283,916
int (@NotNull JTable table) { Object property = table.getClientProperty(HOVERED_ROW_KEY); return property instanceof Integer ? (Integer)property : -1; }
getHoveredRow
283,917
void (@NotNull JTable table, int row) { Rectangle bounds = row < 0 ? null : table.getCellRect(row, 0, false); if (bounds != null) table.repaint(0, bounds.y, table.getWidth(), bounds.height); }
repaintRow
283,918
void (@NotNull Component component, int x, int y) { mouseMoved(component, x, y); }
mouseEntered
283,919
void (@NotNull Component component, int x, int y) { update(component, list -> list.locationToIndex(new Point(x, y))); }
mouseMoved
283,920
void (@NotNull Component component) { update(component, list -> -1); }
mouseExited
283,921
void (@NotNull Component component, @NotNull ToIntFunction<? super JList<?>> indexFunc) { if (component instanceof JList<?> list) { int indexNew = indexFunc.applyAsInt(list); int indexOld = indexHolder.getAndSet(indexNew); if (indexNew != indexOld) onHover(list, indexNew); } }
update
283,922
void (@NotNull JList<?> list, int index) { setHoveredIndex(list, index); }
onHover
283,923
void (@NotNull JList<?> list, int indexNew) { int indexOld = getHoveredIndex(list); if (indexNew == indexOld) return; list.putClientProperty(HOVERED_INDEX_KEY, indexNew < 0 ? null : indexNew); if (RenderingUtil.isHoverPaintingDisabled(list)) return; repaintIndex(list, indexOld); repaintIndex(list, indexNew); }
setHoveredIndex
283,924
int (@NotNull JList<?> list) { Object property = list.getClientProperty(HOVERED_INDEX_KEY); return property instanceof Integer ? (Integer)property : -1; }
getHoveredIndex
283,925
void (@NotNull JList<?> list, int index) { Rectangle bounds = index < 0 ? null : list.getCellBounds(index, index); if (bounds != null) list.repaint(0, bounds.y, list.getWidth(), bounds.height); }
repaintIndex
283,926
void (Runnable actionDelegate) { this.actionDelegate = actionDelegate; }
setActionDelegate
283,927
void (PropertyChangeEvent e) {}
propertyChange
283,928
void (@NotNull Presentation newPresentation) { if (presentation != null) { presentation.removePropertyChangeListener(this); } newPresentation.addPropertyChangeListener(this); setEnabled(newPresentation.isEnabled()); presentation = newPresentation; }
listenPresentationChanges
283,929
void (@NotNull Menu subMenu, boolean onAppKit) { ensureNativePeer(); subMenu.ensureNativePeer(); nativeSetSubmenu(nativePeer, subMenu.nativePeer, isInHierarchy || subMenu.isInHierarchy); }
setSubmenu
283,930
void (boolean isToggled) { ensureNativePeer(); nativeSetState(nativePeer, isToggled, isInHierarchy); }
setState
283,931
void (boolean isEnabled) { ensureNativePeer(); nativeSetEnabled(nativePeer, isEnabled, isInHierarchy); }
setEnabled
283,932
void (String label, KeyStroke ks) { ensureNativePeer(); // convert (code from native_peer.setLabel) char keyChar = ks == null ? 0 : ks.getKeyChar(); int keyCode = ks == null ? 0 : ks.getKeyCode(); int modifiers = ks == null ? 0 : ks.getModifiers(); if (label == null) { label = ""; } if (keyChar == KeyEvent.CHAR_UNDEFINED) { keyChar = 0; } myTitle = label; nativeSetTitleAndAccelerator(nativePeer, label, keyChar, keyCode, modifiers, isInHierarchy); }
setLabel
283,933
void (String label) { ensureNativePeer(); if (label == null) label = ""; myTitle = label; nativeSetTitle(nativePeer, label, isInHierarchy); }
setLabel
283,934
void (Icon icon) { if (icon == null) return; // todo: the context should belong to the device the icon is displayed on ScaleContext ctx = ScaleContext.create(); // make sure the icon is in JB format icon = MultiResolutionImageProvider.convertFromMRIcon(icon, ctx); int w = icon.getIconWidth(); int h = icon.getIconHeight(); if (w <= 0 || h <= 0) return; BufferedImage image = IconUtil.toBufferedImage(icon, ctx, false); if (image.getType() != BufferedImage.TYPE_INT_ARGB_PRE) { BufferedImage newImage = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_ARGB_PRE); Graphics2D g = newImage.createGraphics(); try { g.setComposite(AlphaComposite.Src); UIUtil.drawImage(g, image, 0, 0, null); } finally { g.dispose(); } image = newImage; } int[] bytes = ((DataBufferInt)image.getRaster().getDataBuffer()).getData(); ensureNativePeer(); nativeSetImage(nativePeer, bytes, w, h, image.getWidth(), image.getHeight(), isInHierarchy); }
setIcon
283,935
void (String acceleratorText) { ensureNativePeer(); nativeSetAcceleratorText(nativePeer, acceleratorText, isInHierarchy); }
setAcceleratorText
283,936
void (WindowEvent e) { refillIfNeeded(); }
windowActivated
283,937
boolean () { for (MenuItem item : myItems) { if (item instanceof Menu && ((Menu)item).myIsOpened) { return true; } } return false; }
isAnyChildOpened
283,938
boolean () { return myIsOpened; }
isOpened
283,939
long () { return myOpenTimeMs; }
getOpenTimeMs
283,940
Menu () { if (ourAppMenu == null) { ourAppMenu = new Menu(); // returns retained pointer long nsMenu = nativeGetAppMenu(); ourAppMenu.nativePeer = ourAppMenu.nativeAttachMenu(nsMenu); ourAppMenu.isInHierarchy = true; } return ourAppMenu; }
getAppMenu
283,941
void (@Nullable DynamicBundle replacements) { if (replacements == null) { return; } Set<String> keySet = replacements.getResourceBundle().keySet(); List<String> replace = new ArrayList<>(keySet.size() * 2); for (String title : keySet) { replace.add(title); replace.add(replacements.getMessage(title)); } //macOS 13.0 Ventura uses Settings instead of Preferences. See IDEA-300314 if (SystemInfo.isMacOSVentura) { replace.add("Prefer.*"); replace.add("Settings..."); } nativeRenameAppMenuItems(ArrayUtilRt.toStringArray(replace)); }
renameAppMenuItems
283,942
void (@NotNull Component component, @NotNull Runnable fillMenuProcedure) { this.myOnOpen = fillMenuProcedure; this.myComponent = component; }
setOnOpen
283,943
void (Component component, Runnable onClose) { this.myOnClose = onClose; this.myComponent = component; }
setOnClose
283,944
void (PropertyChangeEvent e) { @NonNls String propertyName = e.getPropertyName(); if (Presentation.PROP_TEXT.equals(propertyName) || Presentation.PROP_DESCRIPTION.equals(propertyName)) { setTitle(presentation.getText()); } }
propertyChange
283,945
void (String label) { ensureNativePeer(); if (label == null) { label = ""; } myTitle = label; nativeSetTitle(nativePeer, label, isInHierarchy); }
setTitle
283,946
int (String re) { if (re == null || re.isEmpty()) return -1; ensureNativePeer(); return nativeFindIndexByTitle(nativePeer, re); }
findIndexByTitle
283,947
void () { for (MenuItem item : myBuffer) { if (item != null) { Disposer.dispose(item); } } myBuffer.clear(); }
beginFill
283,948
void () { // Called on AppKit when the menu opening myIsOpened = true; if (myOnOpen == null) { return; } myOpenTimeMs = System.currentTimeMillis(); if (USE_STUB) { // NOTE: must add stub item when the menu opens (otherwise AppKit considers it as empty, and we can't fill it later) MenuItem stub = new MenuItem(); myItems.add(stub); stub.isInHierarchy = true; ensureNativePeer(); stub.ensureNativePeer(); nativeAddItem(nativePeer, stub.nativePeer, false/*already on AppKit thread*/); ApplicationManager.getApplication().invokeLater(() -> { beginFill(); myOnOpen.run(); endFill(true); }); } else { beginFill(); invokeWithLWCToolkit(myOnOpen, myComponent, true); endFill(false/*already on AppKit thread*/); } }
menuNeedsUpdate
283,949
void () { // Called on AppKit when a menu opening if (!myIsOpened) { // When a user opens some menu at second time (without focus lost), apple doesn't call menuNeedsUpdate for // this menu (but always calls menuWillOpen) and for all submenus. It causes problems like IDEA-319117. // So detect this case and call menuNeedsUpdate() "manually". // NOTE: unfortunately modifying menu here can cause unstable behavior, see IDEA-315910. getLogger().debug("menuNeedsUpdate wasn't called for '" + myTitle + "', will do it now"); menuNeedsUpdate(); } }
menuWillOpen
283,950
void () { // Called on AppKit when the menu closed myIsOpened = false; // When a user selects item of a system menu (under macOS), // AppKit sometimes generates such sequence: CloseParentMenu -> PerformItemAction // So we can destroy menu-item before item's action performed, and because of that action will not be executed. // Defer clearing to avoid this problem. disposeChildren(CLOSE_DELAY); // NOTE: don't clear native hierarchy here (see IDEA-315910) // It will be done when a menu opens next time. if (myOnClose != null) { invokeWithLWCToolkit(myOnClose, myComponent, false); } }
invokeMenuClosing
283,951
boolean () { if (IS_ENABLED != null) { return IS_ENABLED; } IS_ENABLED = false; if (!SystemInfoRt.isJBSystemMenu) { return false; } if (Boolean.getBoolean("apple.laf.useScreenMenuBar")) { getLogger().info("apple.laf.useScreenMenuBar==true, default screen menu implementation will be used"); return false; } @SuppressWarnings("SpellCheckingInspection") Path lib = PathManager.findBinFile("libmacscreenmenu64.dylib"); try { System.load(Objects.requireNonNull(lib).toString()); nativeInitClass(); // create and dispose a native object (just for to test) Menu test = new Menu("test"); test.ensureNativePeer(); Disposer.dispose(test); } catch (Throwable e) { // default screen menu implementation will be used getLogger().warn("can't load menu library: " + lib + ", exception: " + e.getMessage()); return false; } IS_ENABLED = true; getLogger().info("use new ScreenMenuBar implementation"); return true; }
isJbScreenMenuEnabled
283,952
void (Runnable r, Component invoker, boolean wait) { MethodHandle invokeMethod = getToolkitInvokeMethod(wait); if (invokeMethod == null) { return; } try { if (wait) { invokeMethod.invoke(r, invoker, true, -1); } else { invokeMethod.invoke(r, invoker); } } catch (Throwable e) { // suppress InvocationTargetException as in openjdk implementation (see com.apple.laf.ScreenMenu.java) getLogger().warn("invokeWithLWCToolkit.invokeAndWait: " + e); } }
invokeWithLWCToolkit
283,953
Logger () { return Logger.getInstance(Menu.class); }
getLogger
283,954
boolean () { return myShowText; }
isShowText
283,955
boolean () { return myShowImage; }
isShowImage
283,956
boolean () { return myCrossEsc; }
isCrossEsc
283,957
boolean () { return myPrincipal; }
isPrincipal
283,958
boolean () { return myDefault; }
isDefault
283,959
JComponent () { return myComponent; }
getComponent
283,960
TouchbarActionCustomizations (boolean showText) { myShowText = showText; return this; }
setShowText
283,961
TouchbarActionCustomizations (boolean showImage) { myShowImage = showImage; return this; }
setShowImage
283,962
TouchbarActionCustomizations (boolean crossEsc) { myCrossEsc = crossEsc; return this; }
setCrossEsc
283,963
TouchbarActionCustomizations (boolean principal) { myPrincipal = principal; return this; }
setPrincipal
283,964
TouchbarActionCustomizations (boolean aDefault) { myDefault = aDefault; return this; }
setDefault
283,965
TouchbarActionCustomizations (JComponent component) { myComponent = component; return this; }
setComponent
283,966
TouchbarActionCustomizations (@NotNull AnAction action, boolean showText) { return getClientProperty(action, true).setShowText(showText); }
setShowText
283,967
TouchbarActionCustomizations (@NotNull AnAction action, boolean isDefault) { return getClientProperty(action, true).setDefault(isDefault); }
setDefault
283,968
TouchbarActionCustomizations (@NotNull AnAction action, boolean principal) { return getClientProperty(action, true).setPrincipal(principal); }
setPrincipal
283,969
TouchbarActionCustomizations (@NotNull AnAction action, JComponent contextComponent) { return getClientProperty(action, true).setComponent(contextComponent); }
setComponent
283,970
void (@NotNull JComponent component, @Nullable ActionGroup group) { if (!SystemInfoRt.isMac || !LoadingState.COMPONENTS_REGISTERED.isOccurred() || ApplicationManager.getApplication() == null) { return; } component.putClientProperty(ACTION_GROUP_KEY, group); }
setActions
283,971
void (@NotNull JComponent component, @Nullable AnAction action) { setActions(component, action == null ? null : new DefaultActionGroup(action)); }
setActions
283,972
void (@NotNull JComponent component, @NotNull String actionId) { setActions(component, ActionManager.getInstance().getAction(actionId)); }
setActions
283,973
void (@NotNull JComponent component, @Nullable ActionGroup group) { if (!SystemInfoRt.isMac || !LoadingState.COMPONENTS_REGISTERED.isOccurred() || ApplicationManager.getApplication() == null) { return; } ActionGroup old = ClientProperty.get(component, ACTION_GROUP_KEY); if (old == null) { setActions(component, group); } else if (old instanceof DefaultActionGroup && group != null) { ((DefaultActionGroup)old).addAll(group); } }
addActions
283,974
void (@NotNull JComponent component, Collection<? extends JButton> buttons, Collection<? extends JButton> principal, JButton defaultButton) { setButtonActions(component, buttons, principal, defaultButton, null); }
setButtonActions
283,975
void (@NotNull JComponent component, Collection<? extends JButton> buttons, Collection<? extends JButton> principal, JButton defaultButton, @Nullable ActionGroup extraActions) { if (!SystemInfoRt.isMac || !LoadingState.COMPONENTS_REGISTERED.isOccurred() || ApplicationManager.getApplication() == null) { return; } ActionManagerEx.doWithLazyActionManager(instance -> { DefaultActionGroup result = new DefaultActionGroup(); if (buttons != null) { result.add(buildActionsFromButtons(buttons, defaultButton, false)); } if (extraActions != null) { result.add(extraActions); } if (principal != null) { result.add(buildActionsFromButtons(principal, defaultButton, true)); } setActions(component, result); }); }
setButtonActions
283,976
DefaultActionGroup (Collection<? extends JButton> buttons, JButton defaultButton, boolean isPrincipal) { final DefaultActionGroup result = new DefaultActionGroup(); if (EXPAND_OPTION_BUTTONS) { DefaultActionGroup options = null; for (JButton jb : buttons) { if (jb instanceof JBOptionButton ob) { final Action[] opts = ob.getOptions(); if (opts != null) { for (Action a : opts) { if (a == null) { continue; } AnAction anAct = _createActionFromButton(a, ob, true); if (anAct == null) { continue; } if (options == null) { options = new DefaultActionGroup(); } options.add(anAct); } } } } if (options != null) { result.add(options); } } for (JButton jb : buttons) { final AnAction anAct = _createActionFromButton(jb.getAction(), jb, false); if (anAct != null) { if (jb == defaultButton) { TouchbarActionCustomizations.setDefault(anAct, true); } result.add(anAct); } } if (isPrincipal) { TouchbarActionCustomizations.setPrincipal(result, true); } return result; }
buildActionsFromButtons
283,977
AnAction (@Nullable Action action, @NotNull JButton button, boolean useTextFromAction /*for optional buttons*/) { Object anAct = action == null ? null : action.getValue(OptionAction.AN_ACTION); if (anAct == null) { anAct = new MyAction(useTextFromAction, action, button); } if (!(anAct instanceof AnAction)) { return null; } TouchbarActionCustomizations.setComponent((AnAction)anAct, button).setShowText(true).setShowImage(false); return (AnAction)anAct; }
_createActionFromButton
283,978
Object () { return action == null ? button : action; }
getDelegate
283,979
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
283,980
void (@NotNull AnActionEvent e) { if (action == null) { button.doClick(); return; } // also can be used something like: ApplicationManager.getApplication().invokeLater(() -> jb.doClick(), ms) action.actionPerformed(new ActionEvent(button, ActionEvent.ACTION_PERFORMED, null)); }
actionPerformed
283,981
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(action == null ? button.isEnabled() : action.isEnabled()); if (!useTextFromAction) { e.getPresentation().setText(DialogWrapper.extractMnemonic(button.getText()).second); } }
update
283,982
MouseWheelSmoothScroll () { return create(() -> true); }
create
283,983
MouseWheelSmoothScroll (@NotNull Supplier<Boolean> isScrollEnabled) { return new MouseWheelSmoothScroll(isScrollEnabled); }
create
283,984
void (@NotNull MouseWheelEvent e, @Nullable Consumer<? super MouseWheelEvent> alternative) { JScrollBar bar = !myScrollEnabled.get() ? null : getEventScrollBar(e); if (bar == null) { if (alternative != null) alternative.accept(e); return; } InertialAnimator animator = isHorizontalScroll(e) ? horizontal : vertical; int value = bar.getValue(); int delta = (int)getDelta(bar, e, animator.myTargetValue); if (delta == 0) { return; } animator.start(value, value + delta, bar::setValue, shouldStop(bar), ScrollAnimationSettings.SETTINGS); e.consume(); }
processMouseWheelEvent
283,985
Predicate<Integer> (JScrollBar bar) { return (v) -> { return v - bar.getValue() != 0 || !bar.isShowing(); }; }
shouldStop
283,986
double (@NotNull JScrollBar bar, @NotNull MouseWheelEvent event, double animationTargetValue) { double rotation = event.getPreciseWheelRotation(); int direction = rotation < 0 ? -1 : 1; if (event.getScrollType() == MouseWheelEvent.WHEEL_BLOCK_SCROLL) { return direction * bar.getBlockIncrement(direction); } if (event.getSource() instanceof JScrollPane) { JViewport viewport = ((JScrollPane)event.getSource()).getViewport(); if (viewport.getView() instanceof Scrollable scrollable) { int orientation = bar.getOrientation(); boolean isVertical = orientation == Adjustable.VERTICAL; int scroll = abs(event.getUnitsToScroll()); Rectangle rect = viewport.getViewRect(); int delta = 0; if (!Double.isNaN(animationTargetValue)) { if (isVertical) { rect.y = (int)animationTargetValue; } else { rect.x = (int)animationTargetValue; } } for (int i = 0; i < scroll; i++) { int increment = max(scrollable.getScrollableUnitIncrement(rect, orientation, direction), 0) * direction; if (isVertical) { rect.y += increment; } else { rect.x += increment; } delta += increment; } return delta; } } int increment = bar.getUnitIncrement(direction); int delta = increment * event.getUnitsToScroll(); return delta == 0 ? rotation : delta; }
getDelta
283,987
void (int initValue, int targetValue, @NotNull Consumer<? super Integer> consumer, @Nullable Predicate<? super Integer> shouldStop, @NotNull AnimationSettings settings) { mySettings = settings; double duration = mySettings.getDuration(); if (duration == 0) { consumer.accept(targetValue); stop(); return; } boolean isSameDirection = (myTargetValue - myInitValue) * (targetValue - initValue) > 0; if (isSameDirection && myTimer.isRunning(animationId)) { myTargetValue += (targetValue - initValue); myDuration = (long)duration + max(myLastEventTime - myStartEventTime, 0); myInitValue = myCurrentValue; myStartEventTime = myLastEventTime; } else { myTargetValue = targetValue; myDuration = (long)duration; myInitValue = initValue; myStartEventTime = System.currentTimeMillis(); } myConsumer = Objects.requireNonNull(consumer); myShouldStop = shouldStop == null ? FALSE_PREDICATE : shouldStop; myCurrentValue = initValue; if (!myTimer.isRunning(animationId)) { animationId = myTimer.animate( new Animation(this::run) .setDuration(Integer.MAX_VALUE) // will not end without calling #stop() .setEasing(com.intellij.util.animation.Easing.LINEAR) ); } }
start
283,988
void (double value) { if (value == 1.0) { // should happen only if animator doesn't play animations myConsumer.accept((int) round(myTargetValue)); stop(); return; } if (myShouldStop.test((int)round(myCurrentValue))) { stop(); return; } myLastEventTime = System.currentTimeMillis(); long currentEventTime = min(myLastEventTime, myStartEventTime + myDuration); myCurrentValue = mySettings.getEasing().calc(currentEventTime - myStartEventTime, myInitValue, myTargetValue - myInitValue, myDuration); myConsumer.accept((int) round(myCurrentValue)); if (myLastEventTime >= myStartEventTime + myDuration) { stop(); } }
run
283,989
void () { myTimer.stop(); myDuration = myLastEventTime = myStartEventTime = -1; myInitValue = myCurrentValue = myTargetValue = Double.NaN; myConsumer = BLACK_HOLE; myShouldStop = FALSE_PREDICATE; mySettings = null; }
stop
283,990
double () { return LoadingState.CONFIGURATION_STORE_INITIALIZED.isOccurred() ? UISettings.getShadowInstance().getAnimatedScrollingDuration() : UISettingsStateKt.getDefaultAnimatedScrollingDuration(); }
getDuration
283,991
Easing () { int points = UISettings.getShadowInstance().getAnimatedScrollingCurvePoints(); if (points != curvePoints || ourEasing == null) { double x1 = (points >> 24 & 0xFF) / 200.0; double y1 = (points >> 16 & 0xFF) / 200.0; double x2 = (points >> 8 & 0xFF) / 200.0; double y2 = (points & 0xFF) / 200.0; if (ourEasing == null) { ourEasing = new CubicBezierEasing(x1, y1, x2, y2, 2000); } else { ourEasing.update(x1, y1, x2, y2); } curvePoints = points; } return ourEasing; }
getEasing
283,992
void (double c1x, double c1y, double c2x, double c2y) { delegate.update(c1x, c1y, c2x, c2y); }
update
283,993
int () { return delegate.getSize(); }
getSize
283,994
double (double t, double b, double c, double d) { double x = t / d; return c * delegate.calc(x) + b; }
calc
283,995
TouchScroll () { return create(() -> true); }
create
283,996
TouchScroll (@NotNull Supplier<Boolean> isScrollEnabled) { return new TouchScroll(isScrollEnabled); }
create
283,997
void (@NotNull MouseWheelEvent e, @Nullable Consumer<? super MouseWheelEvent> alternative) { JScrollBar bar = !myScrollEnabled.get() ? null : getEventScrollBar(e); if (bar == null) { if (alternative != null) alternative.accept(e); return; } if (TouchScrollUtil.isBegin(e)) { verticalFling.registerBegin(); horizontalFling.registerBegin(); } else if (TouchScrollUtil.isUpdate(e)) { int value = bar.getValue(); int delta = (int)TouchScrollUtil.getDelta(e); bar.setValue(value + delta); FlingManager fling = isHorizontalScroll(e) ? horizontalFling : verticalFling; fling.registerUpdate(delta); } else if (TouchScrollUtil.isEnd(e)) { verticalFling.start(getEventVerticalScrollBar(e), vertical); horizontalFling.start(getEventHorizontalScrollBar(e), horizontal); } e.consume(); }
processMouseWheelEvent
283,998
Predicate<Integer> (JScrollBar bar) { return (v) -> { return v - bar.getValue() != 0 || !bar.isShowing(); }; }
shouldStop
283,999
void () { beginTime = System.currentTimeMillis(); lastDelta = 0; }
registerBegin