Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
283,200 | JComponent () { if (getComponentCount() == 1) { return (JComponent) getComponent(0); } else { return this; } } | getTargetComponent |
283,201 | Wrapper (JComponent verticalSizeReferent) { myVerticalSizeReferent = verticalSizeReferent; return this; } | setVerticalSizeReferent |
283,202 | Wrapper (JComponent horizontalSizeReferent) { myHorizontalSizeReferent = horizontalSizeReferent; return this; } | setHorizontalSizeReferent |
283,203 | Dimension () { Dimension size = super.getPreferredSize(); if (myHorizontalSizeReferent != null && myHorizontalSizeReferent.isShowing()) { size.width = Math.max(size.width, myHorizontalSizeReferent.getPreferredSize().width); } if (myVerticalSizeReferent != null && myVerticalSizeReferent.isShowing()) { size.height = Math.max(size.height, myVerticalSizeReferent.getPreferredSize().height); } return size; } | getPreferredSize |
283,204 | void (Component component, Object constraints) { if ((constraints == null) || (constraints instanceof String)) { addLayoutComponent((String)constraints, component); } else { throw new IllegalArgumentException("unsupported constraints: " + constraints); } } | addLayoutComponent |
283,205 | Dimension (Container target) { return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE); } | maximumLayoutSize |
283,206 | float (Container target) { return .5f; } | getLayoutAlignmentX |
283,207 | float (Container target) { return .5f; } | getLayoutAlignmentY |
283,208 | void (Container target) { } | invalidateLayout |
283,209 | void (String name, Component component) { synchronized (component.getTreeLock()) { if (name == null || TOP.equalsIgnoreCase(name)) { myTop.add(component); } else if (CENTER.equalsIgnoreCase(name)) { myCenter.add(component); } else if (BOTTOM.equalsIgnoreCase(name)) { myBottom.add(component); } else { throw new IllegalArgumentException("unsupported name: " + name); } } } | addLayoutComponent |
283,210 | void (Component component) { myTop.remove(component); myBottom.remove(component); myCenter.remove(component); } | removeLayoutComponent |
283,211 | Dimension (Container container) { return getPreferredSize(container, true); } | preferredLayoutSize |
283,212 | Dimension (Container container) { return getPreferredSize(container, false); } | minimumLayoutSize |
283,213 | void (Container container) { int gap = myGap.get(); synchronized (container.getTreeLock()) { Dimension top = getPreferredSize(myTop); Dimension bottom = getPreferredSize(myBottom); Dimension center = getPreferredSize(myCenter); Insets insets = container.getInsets(); int width = container.getWidth() - insets.left - insets.right; int height = container.getHeight() - insets.top - insets.bottom; int topY = 0; if (top != null) { topY = gap + layout(myTop, 0, width, insets); } int bottomY = height; if (bottom != null) { bottomY -= bottom.height; } if (bottomY < topY) { bottomY = topY; } if (center != null) { int centerY = (height - center.height) / 2; if (centerY > topY) { int centerBottomY = centerY + center.height + gap + gap; if (centerBottomY > bottomY) { centerY = bottomY - center.height - gap - gap; } } if (centerY < topY) { centerY = topY; } centerY = gap + layout(myCenter, centerY, width, insets); if (bottomY < centerY) { bottomY = centerY; } } if (bottom != null) { layout(myBottom, bottomY, width, insets); } } } | layoutContainer |
283,214 | int (List<? extends Component> list, int y, int width, Insets insets) { int gap = myGap.get(); for (Component component : list) { if (component.isVisible()) { Dimension size = LayoutUtil.getPreferredSize(component); int x = 0; if (myAlignment == FILL) { size.width = width; } else if (myAlignment != SwingConstants.LEFT) { x = width - size.width; if (myAlignment == SwingConstants.CENTER) { x /= 2; } } component.setBounds(x + insets.left, y + insets.top, size.width, size.height); y += size.height + gap; } } return y; } | layout |
283,215 | Dimension (Dimension result, int gap, Dimension size) { if (size == null) { return result; } if (result == null) { return new Dimension(size); } result.height += gap + size.height; if (result.width < size.width) { result.width = size.width; } return result; } | join |
283,216 | Dimension (List<? extends Component> list) { int gap = myGap.get(); Dimension result = null; for (Component component : list) { if (component.isVisible()) { result = join(result, gap, LayoutUtil.getPreferredSize(component)); } } return result; } | getPreferredSize |
283,217 | Dimension (Container container, boolean aligned) { int gap2 = 2 * myGap.get(); synchronized (container.getTreeLock()) { Dimension top = getPreferredSize(myTop); Dimension bottom = getPreferredSize(myBottom); Dimension center = getPreferredSize(myCenter); Dimension result = join(join(join(null, gap2, top), gap2, center), gap2, bottom); if (result == null) { result = new Dimension(); } else if (aligned && center != null) { int topHeight = top == null ? 0 : top.height; int bottomHeight = bottom == null ? 0 : bottom.height; result.height += Math.abs(topHeight - bottomHeight); } JBInsets.addTo(result, container.getInsets()); return result; } } | getPreferredSize |
283,218 | void (boolean isOpaque) { super.setOpaque(isOpaque); setDoubleBuffered(false); } | setOpaque |
283,219 | void (JComponent c) { c.setOpaque(false); } | setTransparent |
283,220 | void (Graphics g) { Color bg = getBackground(); g.setColor(bg); Dimension size = getSize(); g.fillRect(0, 0, size.width, size.height); } | paintComponent |
283,221 | void () { myErrorLabel = createErrorLabel(); myMainComponent = createMainComponent(); add(myMainComponent, BorderLayout.CENTER); add(myErrorLabel, BorderLayout.SOUTH); } | doInitialize |
283,222 | void (@NlsContexts.Label String errorText) { if ("".equals(errorText) || errorText == null) { errorText = " "; } myErrorLabel.setText(errorText); } | setErrorText |
283,223 | JLabel () { return myErrorLabel; } | getErrorLabel |
283,224 | T () { return myMainComponent; } | getMainComponent |
283,225 | String () { final String text = myErrorLabel.getText(); return " ".equals(text) ? "" : text; } | getErrorText |
283,226 | void (JLabel label) { myLabel = label; myLabel.setLabelFor(myMainComponent); add(label, BorderLayout.WEST); } | setLabel |
283,227 | JLabel () { final JLabel label = new JLabel(" "); label.setForeground(JBColor.red); label.setFont(ERROR_FONT); return label; } | createErrorLabel |
283,228 | void () { super.doLayout(); if (myLabel != null) { myErrorLabel.setBorder(BorderFactory.createEmptyBorder(0, myLabel.getSize().width, 0, 0)); } } | doLayout |
283,229 | Dimension (@NotNull Component component) { Dimension size = component.getPreferredSize(); if (size == null) return new Dimension(); // rare if (component.isMaximumSizeSet()) { Dimension max = component.getMaximumSize(); if (max != null) { if (size.width > max.width) size.width = max.width; if (size.height > max.height) size.height = max.height; } } return size; } | getPreferredSize |
283,230 | JPanel (Component component) { JPanel panel = new JPanel(INSTANCE); if (component != null) panel.add(component); panel.setOpaque(false); return panel; } | wrap |
283,231 | void (Component visible) { if (visible != null && !visible.isVisible()) { Container container = visible.getParent(); if (container != null) { synchronized (container.getTreeLock()) { for (Component component : container.getComponents()) { component.setVisible(component == visible); } } } } } | show |
283,232 | Component (Container container) { synchronized (container.getTreeLock()) { for (Component component : container.getComponents()) { if (component.isVisible()) return component; } } return null; } | getComponent |
283,233 | Dimension (Container container, Dimension size) { Insets insets = container.getInsets(); if (insets != null) { int width = size.width + insets.left + insets.right; if (size.width < width) size.width = width; int height = size.height + insets.top + insets.bottom; if (size.height < height) size.height = height; } return size; } | getSize |
283,234 | void (String name, Component component) { addLayoutComponent(component, name); } | addLayoutComponent |
283,235 | void (Component component, Object constraints) { if (constraints != null) throw new IllegalArgumentException("unsupported constraints: " + constraints); Container container = component.getParent(); component.setVisible(container != null && 0 < container.getComponentCount()); } | addLayoutComponent |
283,236 | void (Component component) { } | removeLayoutComponent |
283,237 | void (Container container) { } | invalidateLayout |
283,238 | float (Container container) { Component component = getComponent(container); return component != null ? component.getAlignmentX() : Component.CENTER_ALIGNMENT; } | getLayoutAlignmentX |
283,239 | float (Container container) { Component component = getComponent(container); return component != null ? component.getAlignmentY() : Component.CENTER_ALIGNMENT; } | getLayoutAlignmentY |
283,240 | Dimension (Container container) { Component component = getComponent(container); return getSize(container, component != null ? component.getPreferredSize() : new Dimension()); } | preferredLayoutSize |
283,241 | Dimension (Container container) { Component component = getComponent(container); return getSize(container, component != null ? component.getMinimumSize() : new Dimension()); } | minimumLayoutSize |
283,242 | Dimension (Container container) { Component component = getComponent(container); return getSize(container, component != null ? component.getMaximumSize() : new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE)); } | maximumLayoutSize |
283,243 | void (Container container) { synchronized (container.getTreeLock()) { boolean logged = false; boolean updated = false; for (Component component : container.getComponents()) { if (component.isVisible()) { if (!updated) { updated = true; Dimension min = component.getMinimumSize(); Dimension max = component.getMaximumSize(); if (max.height < min.height) max.height = min.height; Rectangle bounds = new Rectangle(container.getWidth(), container.getHeight()); JBInsets.removeFrom(bounds, container.getInsets()); if (max.width < min.width) max.width = min.width; if (bounds.width > max.width) { bounds.x += (int)(.5f + (bounds.width - max.width) * component.getAlignmentX()); bounds.width = max.width; } else if (bounds.width < min.width) { bounds.x += (int)(.5f + (bounds.width - min.width) * component.getAlignmentX()); bounds.width = min.width; } if (max.height < min.height) max.height = min.height; if (bounds.height > max.height) { bounds.y += (int)(.5f + (bounds.height - max.height) * component.getAlignmentY()); bounds.height = max.height; } else if (bounds.height < min.height) { bounds.y += (int)(.5f + (bounds.height - min.height) * component.getAlignmentY()); bounds.height = min.height; } component.setBounds(bounds); } else { component.setVisible(false); if (!logged) { logged = true; Logger.getInstance(StatelessCardLayout.class).warn("too many visible components"); } } } } } } | layoutContainer |
283,244 | Component (Component comp) { ((JComponent) comp).setAlignmentX(0f); return super.add(comp); } | add |
283,245 | Component (Component comp) { ((JComponent) comp).setAlignmentY(0f); return super.add(comp); } | add |
283,246 | Component (Component aComponent) { return myBox.add(aComponent); } | add |
283,247 | void (Component aComponent) { myBox.remove(aComponent); } | remove |
283,248 | void () { myBox.removeAll(); } | removeAll |
283,249 | void (BiConsumer<? super Crumb, ? super InputEvent> consumer) { hover = hover.andThen(consumer); } | onHover |
283,250 | void (BiConsumer<? super Crumb, ? super InputEvent> consumer) { select = select.andThen(consumer); } | onSelect |
283,251 | boolean (Crumb crumb) { return hovered == crumb; } | isHovered |
283,252 | boolean (Crumb crumb) { return selected == crumb; } | isSelected |
283,253 | boolean (Crumb crumb) { for (CrumbView view : views) { if (view.crumb != null) { if (view.crumb == crumb) return false; if (isSelected(view.crumb)) break; } } return true; } | isAfterSelected |
283,254 | Crumb (int x, int y) { for (CrumbView view : views) { if (view.contains(x, y)) return view.crumb; } return null; } | getCrumbAt |
283,255 | Iterable<Crumb> () { return views.stream().map(view -> view.crumb).filter(crumb -> crumb != null).collect(toList()); } | getCrumbs |
283,256 | void (@NotNull Iterable<? extends Crumb> crumbs) { CrumbView view = null; int index = 0; for (Crumb crumb : crumbs) { if (crumb != null) { if (index < views.size()) { view = views.get(index++); view.initialize(crumb); } else { view = new CrumbView(view, crumb); views.add(view); index++; } } } while (index < views.size()) { views.get(index++).initialize(null); } if (hovered != null) hover.accept(null, null); if (selected != null) select.accept(null, null); revalidate(); repaint(); } | setCrumbs |
283,257 | int (int width, int height) { return views.isEmpty() ? -1 : views.get(0).getBaseline(); } | getBaseline |
283,258 | void (Graphics g) { // this custom component does not have a corresponding UI, // so we should care of painting its background if (isOpaque()) { g.setColor(getBackground()); g.fillRect(0, 0, getWidth(), getHeight()); } if (g instanceof Graphics2D g2d) { g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, getKeyForCurrentScope(!Registry.is("editor.breadcrumbs.system.font"))); for (CrumbView view : views) { if (view.crumb != null) view.paint(g2d); } } } | paintComponent |
283,259 | void (Graphics2D g, int x, int y, int width, int height, Crumb crumb, int thickness) { if (thickness > 0) { Color foreground = getMarkerForeground(crumb); if (foreground != null) { g.setColor(foreground); g.fillRect(x, y + height - thickness, width, thickness); } } } | paintMarker |
283,260 | Color (Crumb crumb) { if (!Registry.is("editor.breadcrumbs.marker")) return null; CrumbView found = getCrumbView(view -> view.crumb == crumb); Color foreground = found == null ? null : found.foreground; if (foreground == null) return null; double alpha = Registry.doubleValue("editor.breadcrumbs.marker.alpha"); return ColorUtil.toAlpha(foreground, (int)(alpha * foreground.getAlpha())); } | getMarkerForeground |
283,261 | Font (Crumb crumb) { Font font = getFont(); if (font == null) return null; int old = font.getStyle(); if (font != cache[old]) { for (int i = 0; i < cache.length; i++) { cache[i] = i == old ? font : null; } } int style = getFontStyle(crumb); if (style == old) return font; Font cached = cache[style]; if (cached != null) return cached; font = font.deriveFont(style); cache[style] = font; return font; } | getFont |
283,262 | Font () { Font font = super.getFont(); return font != null ? RelativeFont.NORMAL.fromResource("Breadcrumbs.fontSizeOffset", 0).derive(font) : null; } | getFont |
283,263 | int (Crumb crumb) { TextAttributes attributes = getAttributes(crumb); return attributes == null ? Font.PLAIN : attributes.getFontType(); } | getFontStyle |
283,264 | Color (Crumb crumb) { TextAttributes attributes = getAttributes(crumb); Color foreground = attributes == null ? null : attributes.getForegroundColor(); return foreground != null ? foreground : getForeground(); } | getForeground |
283,265 | Color (Crumb crumb) { TextAttributes attributes = getAttributes(crumb); return attributes == null ? null : attributes.getBackgroundColor(); } | getBackground |
283,266 | Color (Crumb crumb) { TextAttributes attributes = getAttributes(crumb); return attributes == null ? null : attributes.getEffectColor(); } | getEffectColor |
283,267 | EffectType (Crumb crumb) { TextAttributes attributes = getAttributes(crumb); return attributes == null ? null : attributes.getEffectType(); } | getEffectType |
283,268 | EffectPainter (EffectType type) { if (type == EffectType.STRIKEOUT) return EffectPainter.STRIKE_THROUGH; if (type == EffectType.WAVE_UNDERSCORE) return EffectPainter.WAVE_UNDERSCORE; if (type == EffectType.LINE_UNDERSCORE) return EffectPainter.LINE_UNDERSCORE; if (type == EffectType.BOLD_LINE_UNDERSCORE) return EffectPainter.BOLD_LINE_UNDERSCORE; if (type == EffectType.BOLD_DOTTED_LINE) return EffectPainter.BOLD_DOTTED_UNDERSCORE; return null; } | getEffectPainter |
283,269 | TextAttributes (Crumb crumb) { return null; } | getAttributes |
283,270 | CrumbView (Predicate<? super CrumbView> predicate) { for (CrumbView view : views) if (view.crumb != null && predicate.test(view)) return view; return null; } | getCrumbView |
283,271 | void (Dimension size, int scale) { for (CrumbView view : views) { if (view.crumb != null) { if (view.font == null) view.update(); size.width += view.preferred.width; if (size.height < view.preferred.height) { size.height = view.preferred.height; } } } if (size.height == 0) { Font font = getFont(); if (font != null) { FontMetrics fm = getFontMetrics(font); size.height = scale * (TOP_BOTTOM + TOP_BOTTOM) + (fm != null ? fm.getHeight() : font.getSize()); } } } | updatePreferredSize |
283,272 | int () { Font font = getFont(); if (font != null) { int size = font.getSize(); if (size > 10) return size / 10; } return 1; } | getScale |
283,273 | float (Font font) { return font == null ? JBUIScale.DEF_SYSTEM_FONT_SIZE : font.getSize2D(); } | getFontSize |
283,274 | Dimension (Container container) { Dimension size = new Dimension(); if (container instanceof Breadcrumbs breadcrumbs) { breadcrumbs.updatePreferredSize(size, breadcrumbs.getScale()); } JBInsets.addTo(size, container.getInsets()); return size; } | preferredLayoutSize |
283,275 | void (Container container) { if (container instanceof Breadcrumbs breadcrumbs) { Rectangle bounds = new Rectangle(breadcrumbs.getWidth(), breadcrumbs.getHeight()); JBInsets.removeFrom(bounds, breadcrumbs.getInsets()); int scale = breadcrumbs.getScale(); for (CrumbView view : breadcrumbs.views) { if (view.crumb != null) { view.update(); view.setBounds(bounds.x, bounds.y, view.preferred.width, bounds.height, scale); bounds.x += view.preferred.width; } } } } | layoutContainer |
283,276 | void (MouseEvent event) { if (!event.isConsumed()) { Crumb crumb = null; BiConsumer<Crumb, InputEvent> consumer = null; switch (event.getID()) { case MouseEvent.MOUSE_MOVED: case MouseEvent.MOUSE_ENTERED: crumb = getCrumbAt(event.getX(), event.getY()); case MouseEvent.MOUSE_EXITED: if (!isHovered(crumb)) consumer = hover; break; case MouseEvent.MOUSE_PRESSED: case MouseEvent.MOUSE_RELEASED: if (event.isPopupTrigger()) { crumb = getCrumbAt(event.getX(), event.getY()); if (crumb == null) break; // crumb is not found Collection<? extends Action> actions = crumb.getContextActions(); if (actions.isEmpty()) break; // nothing to show DefaultActionGroup group = new DefaultActionGroup(); for (Action action : actions) { if (action != null) { group.add(ActionUtil.createActionFromSwingAction(action)); } else { group.addSeparator(); } } JPopupMenu popup = ActionManager.getInstance().createActionPopupMenu("crumbs", group).getComponent(); Component invoker = event.getComponent(); popup.show(invoker, event.getX(), invoker.getHeight()); event.consume(); } else if (isLeftMouseButton(event)) { crumb = getCrumbAt(event.getX(), event.getY()); if (crumb != null) consumer = select; } break; } if (consumer != null) { consumer.accept(crumb, event); event.consume(); revalidate(); repaint(); } } } | handle |
283,277 | void () { icon = crumb.getIcon(); if (icon != null) { crumbIconWidth = icon.getIconWidth(); crumbIconHeight = icon.getIconHeight(); } else { crumbIconWidth = 0; crumbIconHeight = 0; } text = crumb.getText(); font = getFont(crumb); foreground = getForeground(crumb); background = getBackground(crumb); effectType = getEffectType(crumb); effectColor = getEffectColor(crumb); // use shared foreground and font if not set if (foreground == null) foreground = getForeground(); if (font == null) font = getFont(); // scale loaded icon by font if (icon != null) icon = IconUtil.scaleByFont(icon, Breadcrumbs.this, getFontSize(font)); // calculate preferred size int scale = getScale(); preferred.width = scale * (LEFT_RIGHT + LEFT_RIGHT + getLeftGap() + getRightGap()); preferred.height = scale * (TOP_BOTTOM + TOP_BOTTOM); if (font != null && !StringUtil.isEmpty(text)) { FontMetrics fm = getFontMetrics(font); Rectangle iconR = new Rectangle(); Rectangle textR = new Rectangle(); layout(fm, iconR, textR, new Rectangle(Short.MAX_VALUE, Short.MAX_VALUE)); preferred.width += Math.max(iconR.x + iconR.width, textR.x + textR.width) - Math.min(iconR.x, textR.x); preferred.height += Math.max(iconR.y + iconR.height, textR.y + textR.height) - Math.min(iconR.y, textR.y); } else if (icon != null) { preferred.width += icon.getIconWidth(); preferred.height += icon.getIconHeight(); } } | update |
283,278 | String (FontMetrics fm, Rectangle iconR, Rectangle textR, Rectangle viewR) { int gap = icon == null ? 0 : Math.min(icon.getIconHeight(), icon.getIconWidth()) / 4; // an icon can have two or more images: [][] return layoutCompoundLabel(fm, text, icon, CENTER, LEFT, CENTER, RIGHT, viewR, iconR, textR, gap); } | layout |
283,279 | Rectangle (int dx, int dy) { return new Rectangle(bounds.x + dx, bounds.y + dy, bounds.width - dx - dx, bounds.height - dy - dy); } | getBounds |
283,280 | void (int x, int y, int width, int height, int scale) { int left = scale * getLeftGap(); int right = scale * getRightGap(); bounds.setBounds(x + left, y, width - left - right, height); path = Registry.is("editor.breadcrumbs.marker") ? null : createPath(scale, true); } | setBounds |
283,281 | boolean (int x, int y) { return crumb != null && (path != null ? path.contains(x, y) : bounds.contains(x, y)); } | contains |
283,282 | int () { if (crumb == null) { return -1; } if (font == null) { update(); } FontMetrics fm = getFontMetrics(font); if (fm != null) { Rectangle textR = new Rectangle(); int scale = getScale(); String text = layout(fm, new Rectangle(), textR, getBounds(scale * LEFT_RIGHT, scale * TOP_BOTTOM)); if (!StringUtil.isEmpty(text)) { return textR.y + fm.getAscent(); } } return -1; } | getBaseline |
283,283 | void (Graphics2D g) { final Icon crumbIcon = crumb.getIcon(); if (crumbIcon != null && (crumbIcon.getIconWidth() != crumbIconWidth || crumbIcon.getIconHeight() != crumbIconHeight)) { // process size change for IconDeferrer (lazy calculated on pool thread) Breadcrumbs.this.revalidate(); Breadcrumbs.this.repaint(); return; } int scale = getScale(); if (path != null) { if (background != null) { g.setColor(background); g.fill(path); } if (parent != null && parent.background == background && !Registry.is("editor.breadcrumbs.marker")) { Graphics2D g2 = (Graphics2D)g.create(); float stroke = JBUIScale.getFontScale(getFontSize(getFont())); // calculate a visible width of separator (30% of a whole path) int delta = (int)(scale * (.3 * getRightGap() + getLeftGap())); g2.clipRect(bounds.x - delta, bounds.y, Short.MAX_VALUE, bounds.height); g2.setPaint(getForeground()); if (stroke > 1) g2.setStroke(new BasicStroke(stroke)); g2.draw(createPath(scale, false)); g2.dispose(); } } if (effectType == EffectType.ROUNDED_BOX && effectColor != null) { Rectangle bounds = getBounds(scale, scale); RectanglePainter.paint(g, bounds.x, bounds.y, bounds.width, bounds.height, bounds.height / 2, background, effectColor); } else if (effectType == EffectType.BOXED && effectColor != null) { Rectangle bounds = getBounds(scale, scale); RectanglePainter.paint(g, bounds.x, bounds.y, bounds.width, bounds.height, 0, background, effectColor); } else if (background != null) { g.setColor(background); g.fillRect(bounds.x, bounds.y, bounds.width, bounds.height); if (isSelected(crumb)) { paintMarker(g, bounds.x, bounds.y, bounds.width, bounds.height, crumb, scale * 2); } } else if (isSelected(crumb)) { paintMarker(g, bounds.x, bounds.y, bounds.width, bounds.height, crumb, scale * 2); } else if (isHovered(crumb)) { paintMarker(g, bounds.x, bounds.y, bounds.width, bounds.height, crumb, scale); } if (font != null && foreground != null) { g.setFont(font); FontMetrics fm = getFontMetrics(font); if (fm != null) { Rectangle iconR = new Rectangle(); Rectangle textR = new Rectangle(); Rectangle viewR = getBounds(scale * LEFT_RIGHT, scale * TOP_BOTTOM); String text = layout(fm, iconR, textR, viewR); if (!StringUtil.isEmpty(text)) { g.setColor(foreground); g.drawString(text, textR.x, textR.y += fm.getAscent()); if (effectColor != null && effectType != null) { EffectPainter painter = getEffectPainter(effectType); if (painter != null) { g.setColor(effectColor); textR.height = painter == EffectPainter.STRIKE_THROUGH ? fm.getAscent() : fm.getDescent(); painter.paint(g, textR.x, textR.y, textR.width, textR.height, font); } } } if (icon != null) { icon.paintIcon(Breadcrumbs.this, g, iconR.x, iconR.y); } } } } | paint |
283,284 | int () { return !Registry.is("editor.breadcrumbs.marker") ? Registry.intValue("editor.breadcrumbs.gap.left", 5) : parent != null ? 10 : 0; } | getLeftGap |
283,285 | int () { return !Registry.is("editor.breadcrumbs.marker") ? Registry.intValue("editor.breadcrumbs.gap.right", 9) : 0; } | getRightGap |
283,286 | Path2D (int scale, boolean closed) { Path2D path = new Path2D.Double(); int left = scale * getLeftGap(); int right = scale * getRightGap(); if (parent != null) { left += right; path.moveTo(bounds.x - left, bounds.y); path.lineTo(bounds.x - left + right, bounds.y + bounds.height * 0.5); } else { path.moveTo(bounds.x - left, bounds.y); } path.lineTo(bounds.x - left, bounds.y + bounds.height); if (closed) { path.lineTo(bounds.x + bounds.width, bounds.y + bounds.height); path.lineTo(bounds.x + bounds.width + right, bounds.y + bounds.height * 0.5); path.lineTo(bounds.x + bounds.width, bounds.y); path.closePath(); } return path; } | createPath |
283,287 | AccessibleContext () { if (accessibleContext == null) { accessibleContext = new AccessibleBreadcrumbs(); } return accessibleContext; } | getAccessibleContext |
283,288 | int () { return views.size(); } | getAccessibleChildrenCount |
283,289 | Accessible (int i) { if (i < views.size()) { return new AccessibleCrumb(i, views.get(i).text); } return null; } | getAccessibleChild |
283,290 | Accessible (Point p) { Crumb crumb = getCrumbAt(p.x, p.y); if (crumb != null) { int index = -1; for (int i = 0; i < views.size(); i++) { CrumbView view = views.get(i); if (view.crumb == crumb) { index = i; break; } } if (index != -1) { return new AccessibleCrumb(index, crumb.getText()); } } return null; } | getAccessibleAt |
283,291 | AccessibleContext () { return this; } | getAccessibleContext |
283,292 | AccessibleRole () { return AccessibleRole.PUSH_BUTTON; } | getAccessibleRole |
283,293 | AccessibleStateSet () { return AccessibleBreadcrumbs.this.getAccessibleStateSet(); } | getAccessibleStateSet |
283,294 | int () { return myIndex; } | getAccessibleIndexInParent |
283,295 | int () { return 0; } | getAccessibleChildrenCount |
283,296 | Accessible (int i) { return null; } | getAccessibleChild |
283,297 | Icon () { return icon; } | getIcon |
283,298 | String () { return tooltip; } | getTooltip |
283,299 | String () { return getText(); } | toString |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.