Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
284,700 | void (SingleRowPassInfo data) { if (data.requiredLength > data.toFitLength) { data.moreRect = getStrategy().getMoreRect(data); } } | layoutMoreButton |
284,701 | boolean (SingleRowPassInfo data, TabLabel label, int length) { if (data.requiredLength > data.toFitLength && !(label.isPinned() && TabLayout.showPinnedTabsSeparately())) { length = getStrategy().getLengthIncrement(label.getPreferredSize()); int moreRectSize = getMoreRectAxisSize(); if (data.entryPointAxisSize == 0) { Insets insets = myTabs.getActionsInsets(); moreRectSize += insets.left + insets.right; } if (data.position + length > data.toFitLength - moreRectSize) { if (getStrategy().drawPartialOverflowTabs()) { int clippedLength = ExperimentalUI.isNewUI() && myTabs.getTabsPosition().isSide() ? length : data.toFitLength - data.position - moreRectSize; final Rectangle rec = getStrategy().getLayoutRect(data, data.position, clippedLength); myTabs.layout(label, rec); } label.setAlignmentToCenter(false); return false; } } return super.applyTabLayout(data, label, length); } | applyTabLayout |
284,702 | boolean (@NotNull TabInfo info) { TabLabel label = myTabs.getInfoToLabel().get(info); Rectangle bounds = label.getBounds(); int deadzone = JBUI.scale(DEADZONE_FOR_DECLARE_TAB_HIDDEN); return getStrategy().getMinPosition(bounds) < -deadzone || bounds.width < label.getPreferredSize().width - deadzone || bounds.height < label.getPreferredSize().height - deadzone; } | isTabHidden |
284,703 | int () { if (ExperimentalUI.isNewUI() && myTabs.getPosition().isSide()) { return 0; } return getStrategy().getMoreRectAxisSize(); } | getMoreRectAxisSize |
284,704 | boolean () { return true; } | isScrollable |
284,705 | boolean () { return myWithScrollBar; } | isWithScrollBar |
284,706 | void (SingleRowPassInfo data) { data.requiredLength = myTabs.getWidth(); data.toLayout.addAll(data.myVisibleInfos); } | recomputeToLayout |
284,707 | boolean (SingleRowPassInfo data, TabLabel label, int length) { int tabCount = data.toLayout.size(); if (tabCount > 0) { Rectangle bounds = getStrategy().getLayoutRect(data, data.position, length); int tabsWidth = myTabs.getWidth(); bounds.width = tabsWidth / tabCount; if (myTabs.getIndexOf(label.getInfo()) == myTabs.getTabCount() - 1) { int fullWidth = bounds.width * tabCount; if (fullWidth < tabsWidth) { bounds.width += tabsWidth - fullWidth; } } myTabs.layout(label, bounds); label.setAlignmentToCenter(true); return true; } return super.applyTabLayout(data, label, length); } | applyTabLayout |
284,708 | int (Point point) { Component component = myTabs.getComponentAt(point); if (component instanceof TabLabel label && lastSingRowLayout != null) { return lastSingRowLayout.myVisibleInfos.indexOf(label.getInfo()); } return -1; } | getDropIndexFor |
284,709 | int (@NotNull Point point) { return -1; } | getDropSideFor |
284,710 | boolean (@NotNull TabLabel tabLabel, int deltaX, int deltaY) { Rectangle bounds = tabLabel.getBounds(); if (bounds.x + bounds.width + deltaX < 0 || bounds.x + bounds.width > tabLabel.getParent().getWidth()) return true; return Math.abs(deltaY) > tabLabel.getHeight(); } | isDragOut |
284,711 | Rectangle (final SingleRowPassInfo data, final int position, final int length) { return getLayoutRec(data, position, getFixedPosition(data), length, getFixedFitLength(data)); } | getLayoutRect |
284,712 | boolean () { return false; } | isSideComponentOnTabs |
284,713 | boolean () { return true; } | isToCenterTextWhenStretched |
284,714 | boolean (TabLabel tabLabel, int deltaX, int deltaY) { Rectangle bounds = tabLabel.getBounds(); if (bounds.x + bounds.width + deltaX < 0 || bounds.x + bounds.width > tabLabel.getParent().getWidth()) return true; return Math.abs(deltaY) > tabLabel.getHeight() * TabLayout.getDragOutMultiplier(); } | isDragOut |
284,715 | int () { return myTabs.getMoreToolbarPreferredSize().width; } | getMoreRectAxisSize |
284,716 | int () { return myTabs.getEntryPointPreferredSize().width; } | getEntryPointAxisSize |
284,717 | int (final SingleRowPassInfo data) { JComponent hToolbar = data.hToolbar.get(); int length; if (hToolbar != null) { length = myTabs.getWidth() - data.insets.left - data.insets.right - hToolbar.getMinimumSize().width; } else { length = myTabs.getWidth() - data.insets.left - data.insets.right; } length += getStartPosition(data); int entryPointWidth = myTabs.getEntryPointPreferredSize().width; Insets toolbarInsets = myTabs.getActionsInsets(); int insets = toolbarInsets.left + toolbarInsets.right; length -= (entryPointWidth + insets * Math.signum(entryPointWidth)); return length; } | getToFitLength |
284,718 | int (final Dimension labelPrefSize) { return myTabs.isEditorTabs() ? Math.max(labelPrefSize.width, MIN_TAB_WIDTH) : labelPrefSize.width; } | getLengthIncrement |
284,719 | int () { return 0; } | getAdditionalLength |
284,720 | int (Rectangle bounds) { return (int)bounds.getX(); } | getMinPosition |
284,721 | int (final Rectangle bounds) { return (int)bounds.getMaxX(); } | getMaxPosition |
284,722 | int (final SingleRowPassInfo data) { return myTabs.getHeaderFitSize().height; } | getFixedFitLength |
284,723 | Rectangle (final SingleRowPassInfo data, final int position, final int fixedPos, final int length, final int fixedFitLength) { return new Rectangle(position, fixedPos, length, fixedFitLength); } | getLayoutRec |
284,724 | int (final SingleRowPassInfo data) { return data.insets.left; } | getStartPosition |
284,725 | boolean () { return true; } | drawPartialOverflowTabs |
284,726 | boolean () { return !myTabs.isSideComponentVertical() && myTabs.isSideComponentOnTabs(); } | isSideComponentOnTabs |
284,727 | ShapeTransform (Rectangle labelRec) { return new ShapeTransform.Top(labelRec); } | createShapeTransform |
284,728 | int (final SingleRowPassInfo data) { return data.insets.top; } | getFixedPosition |
284,729 | Rectangle (SingleRowPassInfo data) { int x; if (myTabs.isEditorTabs()) { x = data.layoutSize.width - myTabs.getActionsInsets().right - data.entryPointAxisSize; } else { x = data.position; } return new Rectangle(x, 1, data.entryPointAxisSize, myTabs.getHeaderFitSize().height); } | getEntryPointRect |
284,730 | Rectangle (final SingleRowPassInfo data) { int x; if (myTabs.isEditorTabs()) { x = data.layoutSize.width - myTabs.getActionsInsets().right - data.moreRectAxisSize; } else { x = data.position; } x -= data.entryPointAxisSize; return new Rectangle(x, 1, data.moreRectAxisSize, myTabs.getHeaderFitSize().height); } | getMoreRect |
284,731 | Rectangle (SingleRowPassInfo data) { return new Rectangle(0, 0, myTabs.getTitleWrapper().getPreferredSize().width, myTabs.getHeaderFitSize().height); } | getTitleRect |
284,732 | void (SingleRowPassInfo data) { if (myTabs.isHideTabs()) { myTabs.layoutComp(data, 0, 0, 0, 0); } else { JComponent vToolbar = data.vToolbar.get(); final int vToolbarWidth = vToolbar != null ? vToolbar.getPreferredSize().width : 0; final int vSeparatorWidth = vToolbarWidth > 0 ? myTabs.separatorWidth : 0; final int x = vToolbarWidth > 0 ? vToolbarWidth + vSeparatorWidth : 0; JComponent hToolbar = data.hToolbar.get(); final int hToolbarHeight = !myTabs.isSideComponentOnTabs() && hToolbar != null ? hToolbar.getPreferredSize().height : 0; final int y = myTabs.getHeaderFitSize().height + (Math.max(hToolbarHeight, 0)); JComponent comp = data.component.get(); if (hToolbar != null) { final Rectangle compBounds = myTabs.layoutComp(x, y, comp, 0, 0); if (myTabs.isSideComponentOnTabs()) { int toolbarX = (!data.moreRect.isEmpty() ? (int)data.moreRect.getMaxX() : data.position) + myTabs.getToolbarInset(); final Rectangle rec = new Rectangle(toolbarX, data.insets.top, myTabs.getSize().width - data.insets.left - toolbarX, // reduce toolbar height by 1 pixel to properly paint the border between tabs and the content myTabs.getHeaderFitSize().height - JBUI.scale(1)); myTabs.layout(hToolbar, rec); } else { final int toolbarHeight = hToolbar.getPreferredSize().height; myTabs.layout(hToolbar, compBounds.x, compBounds.y - toolbarHeight, compBounds.width, toolbarHeight); } } else if (vToolbar != null) { if (myTabs.isSideComponentBefore()) { final Rectangle compBounds = myTabs.layoutComp(x, y, comp, 0, 0); myTabs.layout(vToolbar, compBounds.x - vToolbarWidth - vSeparatorWidth, compBounds.y, vToolbarWidth, compBounds.height); } else { int width = vToolbarWidth > 0 ? myTabs.getWidth() - vToolbarWidth - vSeparatorWidth : myTabs.getWidth(); final Rectangle compBounds = myTabs.layoutComp(new Rectangle(0, y, width, myTabs.getHeight()), comp, 0, 0); myTabs.layout(vToolbar, compBounds.x + compBounds.width + vSeparatorWidth, compBounds.y, vToolbarWidth, compBounds.height); } } else { myTabs.layoutComp(x, y, comp, 0, 0); } } } | layoutComp |
284,733 | void (SingleRowPassInfo data) { if (myTabs.isHideTabs()) { myTabs.layoutComp(data, 0, 0, 0, 0); } else { myTabs.layoutComp(data, 0, 0, 0, -(myTabs.getHeaderFitSize().height)); } } | layoutComp |
284,734 | int (final SingleRowPassInfo data) { return myTabs.getSize().height - data.insets.bottom - myTabs.getHeaderFitSize().height; } | getFixedPosition |
284,735 | Rectangle (SingleRowPassInfo data) { int x; if (myTabs.isEditorTabs()) { x = data.layoutSize.width - myTabs.getActionsInsets().right - data.entryPointAxisSize; } else { x = data.position; } return new Rectangle(x, getFixedPosition(data), data.entryPointAxisSize, myTabs.getHeaderFitSize().height); } | getEntryPointRect |
284,736 | Rectangle (final SingleRowPassInfo data) { int x; if (myTabs.isEditorTabs()) { x = data.layoutSize.width - myTabs.getActionsInsets().right - data.moreRectAxisSize; } else { x = data.position; } x -= data.entryPointAxisSize; return new Rectangle(x, getFixedPosition(data), data.moreRectAxisSize, myTabs.getHeaderFitSize().height); } | getMoreRect |
284,737 | Rectangle (SingleRowPassInfo data) { return new Rectangle(0, getFixedPosition(data), myTabs.getTitleWrapper().getPreferredSize().width, myTabs.getHeaderFitSize().height); } | getTitleRect |
284,738 | ShapeTransform (Rectangle labelRec) { return new ShapeTransform.Bottom(labelRec); } | createShapeTransform |
284,739 | boolean (TabLabel tabLabel, int deltaX, int deltaY) { Rectangle bounds = tabLabel.getBounds(); if (bounds.y + bounds.height + deltaX < 0 || bounds.y + bounds.height > tabLabel.getParent().getHeight()) return true; return Math.abs(deltaX) > tabLabel.getWidth() * TabLayout.getDragOutMultiplier(); } | isDragOut |
284,740 | boolean () { return false; } | isToCenterTextWhenStretched |
284,741 | int (final SingleRowPassInfo data) { return data.insets.top; } | getStartPosition |
284,742 | int (final SingleRowPassInfo data) { int length = myTabs.getHeight() - data.insets.top - data.insets.bottom; if (!ExperimentalUI.isNewUI()) { int entryPointHeight = data.entryPointAxisSize; Insets toolbarInsets = myTabs.getActionsInsets(); int insets = toolbarInsets.top + toolbarInsets.bottom; length -= (entryPointHeight + insets * Math.signum(entryPointHeight)); } return length; } | getToFitLength |
284,743 | int (final Dimension labelPrefSize) { return labelPrefSize.height; } | getLengthIncrement |
284,744 | int () { return ExperimentalUI.isNewUI() ? JBUI.scale(32) : 0; } | getAdditionalLength |
284,745 | int (Rectangle bounds) { return (int) bounds.getMinY(); } | getMinPosition |
284,746 | int (final Rectangle bounds) { return (int)bounds.getMaxY(); } | getMaxPosition |
284,747 | int (final SingleRowPassInfo data) { return myTabs.getHeaderFitSize().width; } | getFixedFitLength |
284,748 | Rectangle (final SingleRowPassInfo data, final int position, final int fixedPos, final int length, final int fixedFitLength) { Rectangle baseRect = new Rectangle(fixedPos, position, fixedFitLength, length); if (!ExperimentalUI.isNewUI()) { return baseRect; } Rectangle rect = myTabs.getMoreToolbar().getComponent().isVisible() && !data.moreRect.isEmpty() ? data.moreRect : data.entryPointRect; Rectangle leftmostButtonRect = new Rectangle(rect.x - myTabs.getActionsInsets().left, rect.y, rect.width, rect.height); Rectangle intersection = baseRect.intersection(leftmostButtonRect); if (intersection.height > length * 0.4) { return new Rectangle(baseRect.x, baseRect.y, leftmostButtonRect.x - baseRect.x, baseRect.height); } return baseRect; } | getLayoutRec |
284,749 | boolean () { return ExperimentalUI.isNewUI(); } | drawPartialOverflowTabs |
284,750 | void (SingleRowPassInfo data) { if (myTabs.isHideTabs()) { myTabs.layoutComp(data, 0, 0, 0, 0); } else { myTabs.layoutComp(data, myTabs.getHeaderFitSize().width, 0, 0, 0); } } | layoutComp |
284,751 | ShapeTransform (Rectangle labelRec) { return new ShapeTransform.Left(labelRec); } | createShapeTransform |
284,752 | Rectangle (SingleRowPassInfo data) { return new Rectangle(0, 0, myTabs.getHeaderFitSize().width, myTabs.getTitleWrapper().getPreferredSize().height); } | getTitleRect |
284,753 | int (final SingleRowPassInfo data) { return data.insets.left; } | getFixedPosition |
284,754 | Rectangle (SingleRowPassInfo data) { Insets insets = myTabs.getActionsInsets(); Dimension entryPointSize = myTabs.getEntryPointPreferredSize(); if (ExperimentalUI.isNewUI()) { return new Rectangle(myTabs.getHeaderFitSize().width - entryPointSize.width - data.insets.right - insets.right - 1, myTabs.getHeight() - entryPointSize.height - data.insets.bottom - insets.bottom, entryPointSize.width, entryPointSize.height); } else { return new Rectangle(data.insets.left + JBTabsImpl.getSelectionTabVShift(), myTabs.getHeight() - entryPointSize.height - data.insets.bottom - insets.bottom, myTabs.getHeaderFitSize().width, entryPointSize.height); } } | getEntryPointRect |
284,755 | Rectangle (final SingleRowPassInfo data) { Dimension entryPointSize = myTabs.getEntryPointPreferredSize(); Dimension moreToolbarSize = myTabs.getMoreToolbarPreferredSize(); Insets insets = myTabs.getActionsInsets(); if (ExperimentalUI.isNewUI()) { return new Rectangle(myTabs.getHeaderFitSize().width - entryPointSize.width - moreToolbarSize.width - data.insets.right - insets.right - 1, myTabs.getHeight() - moreToolbarSize.height - data.insets.bottom - insets.bottom, moreToolbarSize.width, moreToolbarSize.height); } else { return new Rectangle(data.insets.left + JBTabsImpl.getSelectionTabVShift(), myTabs.getHeight() - moreToolbarSize.height - entryPointSize.height - data.insets.bottom - insets.bottom - insets.top, myTabs.getHeaderFitSize().width, moreToolbarSize.height); } } | getMoreRect |
284,756 | void (SingleRowPassInfo data) { if (myTabs.isHideTabs()) { myTabs.layoutComp(data, 0, 0, 0, 0); } else { myTabs.layoutComp(data, 0, 0, -(myTabs.getHeaderFitSize().width), 0); } } | layoutComp |
284,757 | ShapeTransform (Rectangle labelRec) { return new ShapeTransform.Right(labelRec); } | createShapeTransform |
284,758 | int (SingleRowPassInfo data) { return data.layoutSize.width - myTabs.getHeaderFitSize().width - data.insets.right; } | getFixedPosition |
284,759 | Rectangle (SingleRowPassInfo data) { Dimension entryPointSize = myTabs.getEntryPointPreferredSize(); Insets insets = myTabs.getActionsInsets(); if (ExperimentalUI.isNewUI()) { return new Rectangle(data.layoutSize.width - entryPointSize.width - insets.right, myTabs.getHeight() - entryPointSize.height - data.insets.bottom - insets.bottom, entryPointSize.width, entryPointSize.height); } else { return new Rectangle(data.layoutSize.width - myTabs.getHeaderFitSize().width, myTabs.getHeight() - entryPointSize.height - data.insets.bottom - insets.bottom, myTabs.getHeaderFitSize().width, entryPointSize.height); } } | getEntryPointRect |
284,760 | Rectangle (SingleRowPassInfo data) { Dimension entryPointSize = myTabs.getEntryPointPreferredSize(); Dimension moreToolbarSize = myTabs.getMoreToolbarPreferredSize(); Insets insets = myTabs.getActionsInsets(); if (ExperimentalUI.isNewUI()) { return new Rectangle(data.layoutSize.width - moreToolbarSize.width - entryPointSize.width - insets.right, myTabs.getHeight() - moreToolbarSize.height - data.insets.bottom - insets.bottom, moreToolbarSize.width, moreToolbarSize.height); } else { return new Rectangle(data.layoutSize.width - myTabs.getHeaderFitSize().width, myTabs.getHeight() - moreToolbarSize.height - entryPointSize.height - data.insets.bottom - insets.bottom, myTabs.getHeaderFitSize().width, moreToolbarSize.height); } } | getMoreRect |
284,761 | Rectangle (SingleRowPassInfo data) { return new Rectangle(data.layoutSize.width - myTabs.getHeaderFitSize().width, 0, myTabs.getHeaderFitSize().width, myTabs.getTitleWrapper().getPreferredSize().height); } | getTitleRect |
284,762 | ActionUpdateThread () { return ActionUpdateThread.BGT; } | getActionUpdateThread |
284,763 | void (@NotNull AnActionEvent e) { QuickActionProvider quickActionProvider = e.getData(QuickActionProvider.KEY); if (quickActionProvider == null) { e.getPresentation().setEnabled(false); return; } List<AnAction> actions = quickActionProvider.getActions(true); e.getPresentation().setEnabled(!actions.isEmpty()); } | update |
284,764 | void (@NotNull AnActionEvent e) { QuickActionProvider provider = e.getRequiredData(QuickActionProvider.KEY); List<AnAction> actions = provider.getActions(true); DefaultActionGroup group = new DefaultActionGroup(actions); group.addSeparator(); JComponent component = provider.getComponent(); if (component != null && !provider.isCycleRoot()) { Component eachParent = component.getParent(); while (eachParent != null) { QuickActionProvider parentProvider = ObjectUtils.tryCast(eachParent, QuickActionProvider.class); if (parentProvider != null && provider != parentProvider) { List<AnAction> parentActions = parentProvider.getActions(false); if (!parentActions.isEmpty()) { String name = StringUtil.notNullize(parentProvider.getName()); DefaultActionGroup parentGroup = new DefaultActionGroup(name, parentActions); if (!StringUtil.isEmpty(name)) { parentGroup.setPopup(true); } else { group.add(Separator.getInstance()); } group.add(parentGroup); } if (parentProvider.isCycleRoot()) break; } eachParent = eachParent.getParent(); } } JBPopupFactory.getInstance() .createActionGroupPopup(null, group, e.getDataContext(), ALPHA_NUMBERING, true) .showInBestPositionFor(e.getDataContext()); } | actionPerformed |
284,765 | void (@NotNull Graphics2D g, int x, int y, int width, int height, Font font) { EffectPainter2D.LINE_UNDERSCORE.paint(g, x, y, width, height, font); } | paint |
284,766 | void (@NotNull Graphics2D g, int x, int y, int width, int height, Font font) { EffectPainter2D.BOLD_LINE_UNDERSCORE.paint(g, x, y, width, height, font); } | paint |
284,767 | void (@NotNull Graphics2D g, int x, int y, int width, int height, Font font) { EffectPainter2D.BOLD_DOTTED_UNDERSCORE.paint(g, x, y, width, height, font); } | paint |
284,768 | void (@NotNull Graphics2D g, int x, int y, int width, int height, Font font) { EffectPainter2D.WAVE_UNDERSCORE.paint(g, x, y, width, height, font); } | paint |
284,769 | void (@NotNull Graphics2D g, int x, int y, int width, int height, Font font) { EffectPainter2D.STRIKE_THROUGH.paint(g, x, y, width, height, font); } | paint |
284,770 | void (@NotNull Graphics2D g, double x, double y, double width, double height, Font font) { if (!Registry.is("ide.text.effect.new")) { LinePainter2D.paint(g, x, y + 1, x + width, y + 1); } else { paintUnderline(g, x, y, width, height, font, 1, this); } } | paint |
284,771 | void (@NotNull Graphics2D g, double x, double y, double width, double height, Font font) { if (!Registry.is("ide.text.effect.new")) { int h = JBUIScale.scale(Registry.intValue("editor.bold.underline.height", 2)); RectanglePainter2D.FILL.paint(g, x, y, width, h); } else { paintUnderline(g, x, y, width, height, font, 2, this); } } | paint |
284,772 | void (@NotNull Graphics2D g, double x, double y, double width, double height, Font font) { paintUnderline(g, x, y, width, height, font, 2, this); } | paint |
284,773 | void (@NotNull Graphics2D g, double x, double y, double width, double height, Font font) { if (!Registry.is("ide.text.effect.new")) { WavePainter2D.forColor(g.getColor()).paint(g, x, x + width, y + height); } else if (Registry.is("ide.text.effect.new.metrics")) { paintUnderline(g, x, y, width, height, font, 3, this); } else if (width > 0 && height > 0) { Cached.WAVE_UNDERSCORE.paint(g, x, y, width, height, null); } } | paint |
284,774 | void (@NotNull Graphics2D g, double x, double y, double width, double height, Font font) { if (width > 0 && height > 0) { if (!Registry.is("ide.text.effect.new.metrics")) { drawLineCentered(g, x, y - height, width, height, 1, this); } else { if (font == null) font = g.getFont(); LineMetrics metrics = font.getLineMetrics("", g.getFontRenderContext()); double offset = PaintUtil.alignToInt(-metrics.getStrikethroughOffset(), g, RoundingMode.FLOOR); float strikeThroughThickness = metrics.getStrikethroughThickness(); double thickness = PaintUtil.alignToInt(maybeScaleFontMetricsThickness(strikeThroughThickness, font), g, RoundingMode.FLOOR); if (strikeThroughThickness > 0 && thickness <= 0) { thickness = PaintUtil.devPixel(g); } drawLine(g, x, y - offset, width, thickness, this); } } } | paint |
284,775 | double (double height) { return height > 7 && Registry.is("ide.text.effect.new.scale") ? height / 2 : 3; } | getMaxHeight |
284,776 | void (Graphics2D g, double x, double y, double width, double height, Font font, double thickness, EffectPainter2D painter) { if (width > 0 && height > 0) { if (Registry.is("ide.text.effect.new.metrics")) { if (font == null) font = g.getFont(); RoundingMode roundingMode = !JreHiDpiUtil.isJreHiDPIEnabled() || painter != WAVE_UNDERSCORE || font.getSize2D() / UISettings.getDefFontSize() > 1 ? RoundingMode.FLOOR : RoundingMode.CEIL; LineMetrics metrics = font.getLineMetrics("", g.getFontRenderContext()); double devPixel = PaintUtil.devPixel(g); double underlineThickness = maybeScaleFontMetricsThickness(metrics.getUnderlineThickness(), font); double underlineOffset = Math.max(devPixel, metrics.getUnderlineOffset()); boolean positive = thickness * underlineThickness > 0; thickness = PaintUtil.alignToInt(thickness * underlineThickness, g, roundingMode); if (positive && thickness <= 0) { thickness = devPixel; } double offset = Math.min(height - thickness, underlineOffset); if (offset < devPixel) { offset = height > 3 * devPixel ? devPixel : 0; thickness = PaintUtil.alignToInt(Math.min(thickness, height - offset), g, roundingMode); } else { offset = PaintUtil.alignToInt(offset, g, roundingMode); } drawLine(g, x, y + offset, width, thickness, painter); } else { if (height > 3) { double max = getMaxHeight(height); y += height - max; height = max; if (thickness > 1 && height > 3) { thickness = JBUIScale.scale((float)thickness); } } drawLineCentered(g, x, y, width, height, thickness, painter); } } } | paintUnderline |
284,777 | double (double fontMetricsThickness, @NotNull Font font) { return maybeScaleFontMetricsThickness(fontMetricsThickness, font); } | maybeScaleFontMetricsThickness_TestOnly |
284,778 | double (double fontMetricsThickness, @NotNull Font font) { float fontScale = JBUIScale.getFontScale(font.getSize2D()); float normalizedFontScale = font.getSize2D() / UISettings.getDefFontSize(); if (normalizedFontScale > 1) { // k==1.0 with normalizedFontScale==1.0, k->0.5 fast enough with normalizedFontScale increasing double k = 1 / (Math.pow(normalizedFontScale, 2) + 1) + 0.5; fontScale *= k; } if (!JreHiDpiUtil.isJreHiDPIEnabled()) fontScale = Math.max(1, Math.round(fontScale)); return Math.max(fontMetricsThickness, fontScale); } | maybeScaleFontMetricsThickness |
284,779 | void (Graphics2D g, double x, double y, double width, double height, double thickness, EffectPainter2D painter) { double offset = height - thickness; if (offset > 0) { y += offset / 2; height = thickness; } drawLine(g, x, y, width, height, painter); } | drawLineCentered |
284,780 | void (Graphics2D g, double x, double y, double width, double height, EffectPainter2D painter) { if (painter == BOLD_DOTTED_UNDERSCORE) { double dx = (x % height + height) % height; double w = width + dx; double dw = (w % height + height) % height; Cached.BOLD_DOTTED_UNDERSCORE.paint(g, x - dx, y, dw == 0 ? w : w - dw + height, height, null); } else if (painter == WAVE_UNDERSCORE) { Cached.WAVE_UNDERSCORE.paint(g, x, y, width, height, null); } else { RectanglePainter2D.FILL.paint(g, x, y, width, height); } } | drawLine |
284,781 | void (@NotNull Graphics2D g, double x, double y, double width, double height, Paint paint) { if (paint == null) paint = g.getPaint(); g = (Graphics2D)g.create(); g.translate(x, y); g.clip(new Rectangle2D.Double(0, 0, width, height)); g.setComposite(AlphaComposite.SrcOver); BufferedImage image = paint instanceof Color ? getImage(g, (Color)paint, height) : createImage(g, paint, height); if (image == null) return; double period = ImageUtil.getRealWidth(image) / ImageUtil.getImageScale(image); double offset = (x % period + period) % period; // normalize g.translate(-offset, 0); for (double dx = -offset; dx < width; dx += period) { StartupUiUtil.drawImage(g, image, 0, 0, null); g.translate(period, 0); } g.dispose(); } | paint |
284,782 | PopupState<JBPopup> () { return new JBPopupState(); } | forPopup |
284,783 | PopupState<JPopupMenu> () { return new JPopupMenuState(); } | forPopupMenu |
284,784 | PopupState<Balloon> () { return new BalloonState(); } | forBalloon |
284,785 | void (@NotNull Popup popup) { hidePopup(); addListener(popup); reference = new WeakReference<>(popup); } | prepareToShow |
284,786 | boolean () { if (hiddenLongEnough) return false; hiddenLongEnough = true; return (System.currentTimeMillis() - timeHiddenAt) < intValue("ide.popup.hide.show.threshold", 200); } | isRecentlyHidden |
284,787 | boolean () { return !isShowing(); } | isHidden |
284,788 | boolean () { Popup popup = getPopup(); return popup != null && isShowing(popup); } | isShowing |
284,789 | void () { Popup popup = getPopup(); if (popup != null) hide(popup); reference = null; } | hidePopup |
284,790 | void (@NotNull LightweightWindowEvent event) { onHide(); } | onClosed |
284,791 | void (PopupMenuEvent event) { } | popupMenuWillBecomeVisible |
284,792 | void (PopupMenuEvent event) { onHide(); } | popupMenuWillBecomeInvisible |
284,793 | void (PopupMenuEvent event) { } | popupMenuCanceled |
284,794 | void (@NotNull LightweightWindowEvent event) { onHide(); } | onClosed |
284,795 | void (@NotNull JComponent component) { HintUpdateSupply supply = getSupply(component); if (supply != null) supply.hideHint(); } | hideHint |
284,796 | void (@NotNull JComponent component) { installHintUpdateSupply(component, o -> o instanceof PsiElement ? (PsiElement)o : null); } | installSimpleHintUpdateSupply |
284,797 | void (@NotNull JComponent component) { installHintUpdateSupply(component, o -> o instanceof PsiElement ? (PsiElement)o : CommonDataKeys.PSI_ELEMENT.getData(DataManager.getInstance().getDataContext(component))); } | installDataContextHintUpdateSupply |
284,798 | void (final @NotNull JComponent component, final Function<Object, ? extends PsiElement> provider) { HintUpdateSupply supply = new HintUpdateSupply(component) { @Override protected @Nullable PsiElement getPsiElementForHint(@Nullable Object selectedValue) { return provider.fun(selectedValue); } }; if (component instanceof JList) supply.installListListener((JList)component); if (component instanceof JTree) supply.installTreeListener((JTree)component); if (component instanceof JTable) supply.installTableListener((JTable)component); } | installHintUpdateSupply |
284,799 | void (final @NotNull JTable table) { ListSelectionListener listener = new ListSelectionListener() { @Override public void valueChanged(final ListSelectionEvent e) { if (!shouldUpdateHint()) return; int selected = ((ListSelectionModel)e.getSource()).getLeadSelectionIndex(); int rowCount = table.getRowCount(); if (selected == -1 || rowCount == 0) return; PsiElement element = getPsiElementForHint(table.getValueAt(Math.min(selected, rowCount - 1), 0)); if (element != null && element.isValid()) { updateHint(element); } } }; table.getSelectionModel().addListSelectionListener(listener); table.getColumnModel().getSelectionModel().addListSelectionListener(listener); } | installTableListener |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.