Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
278,100 | Rectangle () { Rectangle ownerRec = myOwner == null ? new Rectangle(0, 0, 0, 0) : myOwner.getBounds(); Dimension size = getPreferredSize(); int x = (ownerRec.width - size.width) / 2; int y = (ownerRec.height - size.height) / (myShowAboveCenter ? 3 : 2); return new Rectangle(x, y, size.width, size.height); } | getTextComponentBound |
278,101 | Point () { final var textComponentBound = getTextComponentBound(); return new Point(textComponentBound.x, textComponentBound.y + textComponentBound.height); } | getPointBelow |
278,102 | boolean () { return myShowAboveCenter; } | isShowAboveCenter |
278,103 | StatusText (boolean showAboveCenter) { myShowAboveCenter = showAboveCenter; return this; } | setShowAboveCenter |
278,104 | String () { return myText; } | getText |
278,105 | StatusText (@NlsContexts.StatusText String text) { return setText(text, DEFAULT_ATTRIBUTES); } | setText |
278,106 | StatusText (@NlsContexts.StatusText String text, SimpleTextAttributes attrs) { return clear().appendText(text, attrs); } | setText |
278,107 | StatusText () { myText = ""; myPrimaryColumn.fragments.clear(); mySecondaryColumn.fragments.clear(); myHasActiveClickListeners = false; repaintOwner(); return this; } | clear |
278,108 | void () { if (myOwner != null && myOwner.isShowing() && isStatusVisibleInner()) myOwner.repaint(); } | repaintOwner |
278,109 | StatusText (@NlsContexts.StatusText String text) { return appendText(text, DEFAULT_ATTRIBUTES); } | appendText |
278,110 | StatusText (@NlsContexts.StatusText String text, SimpleTextAttributes attrs) { return appendText(text, attrs, null); } | appendText |
278,111 | StatusText (@NlsContexts.StatusText String text, SimpleTextAttributes attrs, ActionListener listener) { if (myIsDefaultText) { clear(); myIsDefaultText = false; } myText += text; return appendText(true, Math.max(0, myPrimaryColumn.fragments.size() - 1), text, attrs, listener); } | appendText |
278,112 | StatusText (boolean isPrimaryColumn, int row, @NlsContexts.StatusText String text, SimpleTextAttributes attrs, ActionListener listener) { return appendText(isPrimaryColumn, row, null, text, attrs, listener); } | appendText |
278,113 | StatusText (boolean isPrimaryColumn, int row, @Nullable Icon icon, @NlsContexts.StatusText String text, SimpleTextAttributes attrs, ActionListener listener) { Fragment fragment = getOrCreateFragment(isPrimaryColumn, row); fragment.myComponent.setIcon(icon); fragment.myComponent.append(text, attrs); fragment.myClickListeners.add(listener); myHasActiveClickListeners |= listener != null; updateBounds(); repaintOwner(); return this; } | appendText |
278,114 | void () { updateBounds(myPrimaryColumn); updateBounds(mySecondaryColumn); } | updateBounds |
278,115 | void (Column column) { Dimension size = new Dimension(); for (int i = 0; i < column.fragments.size(); i++) { Fragment fragment = column.fragments.get(i); Dimension d = fragment.myComponent.getPreferredSize(); fragment.boundsInColumn.setBounds(0, size.height, d.width, d.height); size.height += d.height; if (i > 0) size.height += JBUIScale.scale(Y_GAP); size.width = Math.max(size.width, d.width); } if (myCenterAlignText) { for (int i = 0; i < column.fragments.size(); i++) { Fragment fragment = column.fragments.get(i); fragment.boundsInColumn.x += (size.width - fragment.boundsInColumn.width)/2; } } column.preferredSize.setSize(size); } | updateBounds |
278,116 | Iterable<JComponent> () { return new Iterable<>() { @Override public @NotNull Iterator<JComponent> iterator() { Iterable<JComponent> components = JBIterable.<Fragment>empty() .append(myPrimaryColumn.fragments) .append(mySecondaryColumn.fragments) .map(it -> it.myComponent); return components.iterator(); } }; } | getWrappedFragmentsIterable |
278,117 | Iterator<JComponent> () { Iterable<JComponent> components = JBIterable.<Fragment>empty() .append(myPrimaryColumn.fragments) .append(mySecondaryColumn.fragments) .map(it -> it.myComponent); return components.iterator(); } | iterator |
278,118 | Fragment (boolean isPrimaryColumn, int row) { Column column = isPrimaryColumn ? myPrimaryColumn : mySecondaryColumn; if (column.fragments.size() < row) { throw new IllegalStateException("Cannot add text to row " + row + " as in " + (isPrimaryColumn ? "left" : "right") + " column there are " + column.fragments.size() + " rows only"); } Fragment fragment; if (column.fragments.size() == row) { fragment = new Fragment(); if (myFont != null) { fragment.myComponent.setFont(myFont); } column.fragments.add(fragment); } else { fragment = column.fragments.get(row); } return fragment; } | getOrCreateFragment |
278,119 | StatusText (@NotNull @NlsContexts.StatusText String text, @NotNull SimpleTextAttributes attrs, @Nullable ActionListener listener) { return appendText(true, 1, text, attrs, listener); } | appendSecondaryText |
278,120 | StatusText (@NotNull @NlsContexts.StatusText String text) { return appendLine(text, DEFAULT_ATTRIBUTES, null); } | appendLine |
278,121 | StatusText (@NotNull @NlsContexts.StatusText String text, @NotNull SimpleTextAttributes attrs, @Nullable ActionListener listener) { return appendLine(null, text, attrs, listener); } | appendLine |
278,122 | StatusText (@Nullable Icon icon, @NotNull @NlsContexts.StatusText String text, @NotNull SimpleTextAttributes attrs, @Nullable ActionListener listener) { if (myIsDefaultText) { clear(); myIsDefaultText = false; } return appendText(true, myPrimaryColumn.fragments.size(), icon, text, attrs, listener); } | appendLine |
278,123 | void (Component owner, Graphics g) { if (!isStatusVisibleInner()) { return; } if (owner == myOwner) { doPaintStatusText(g, getTextComponentBound()); } else { paintOnComponentUnderViewport(owner, g); } } | paint |
278,124 | void (Component component, Graphics g) { JBViewport viewport = ObjectUtils.tryCast(myOwner, JBViewport.class); if (viewport == null || viewport.getView() != component || viewport.isPaintingNow()) return; // We're painting a component which has a viewport as it's ancestor. // As the viewport paints status text, we'll erase it, so we need to schedule a repaint for the viewport with status text's bounds. // But it causes flicker, so we paint status text over the component first and then schedule the viewport repaint. Rectangle textBoundsInViewport = getTextComponentBound(); int xInOwner = textBoundsInViewport.x - component.getX(); int yInOwner = textBoundsInViewport.y - component.getY(); Rectangle textBoundsInOwner = new Rectangle(xInOwner, yInOwner, textBoundsInViewport.width, textBoundsInViewport.height); doPaintStatusText(g, textBoundsInOwner); viewport.repaint(textBoundsInViewport); } | paintOnComponentUnderViewport |
278,125 | Point (boolean isPrimary, Rectangle bounds) { if (isPrimary && mySecondaryColumn.fragments.isEmpty()) { return new Point(bounds.x + (bounds.width - myPrimaryColumn.preferredSize.width) / 2, bounds.y); } else if (isPrimary) { return new Point(bounds.x, bounds.y); } else { return new Point(bounds.x + bounds.width - mySecondaryColumn.preferredSize.width, bounds.y); } } | getColumnLocation |
278,126 | void (@NotNull Graphics g, @NotNull Rectangle bounds) { paintColumnInBounds(myPrimaryColumn, g, getColumnLocation(true, bounds), bounds); paintColumnInBounds(mySecondaryColumn, g, getColumnLocation(false, bounds), bounds); } | doPaintStatusText |
278,127 | Rectangle (@NotNull JComponent component, @NotNull Rectangle bounds) { Dimension size = component.getPreferredSize(); int width = Math.min(size.width, bounds.width); int height = Math.min(size.height, bounds.height); if (mySecondaryColumn.fragments.isEmpty()) { return new Rectangle(bounds.x + (bounds.width - width) / 2, bounds.y, width, height); } else { return component == getComponent() ? new Rectangle(bounds.x, bounds.y, width, height) : new Rectangle(bounds.x + bounds.width - width, bounds.y, width, height); } } | adjustComponentBounds |
278,128 | void (Column column, Graphics g, Point location, Rectangle bounds) { for (Fragment fragment : column.fragments) { Rectangle r = getFragmentBounds(column, location, bounds, fragment); paintComponentInBounds(fragment.myComponent, g, r); } } | paintColumnInBounds |
278,129 | Rectangle (Column column, Point columnLocation, Rectangle bounds, Fragment fragment) { Rectangle r = new Rectangle(); r.setBounds(fragment.boundsInColumn); r.x += columnLocation.x; r.y += columnLocation.y; if (column.fragments.size() == 1) { r = adjustComponentBounds(fragment.myComponent, bounds); } return r; } | getFragmentBounds |
278,130 | void (@NotNull SimpleColoredComponent component, @NotNull Graphics g, @NotNull Rectangle bounds) { Graphics2D g2 = (Graphics2D)g.create(bounds.x, bounds.y, bounds.width, bounds.height); try { component.setBounds(0, 0, bounds.width, bounds.height); component.paint(g2); } finally { g2.dispose(); } } | paintComponentInBounds |
278,131 | SimpleColoredComponent () { return getOrCreateFragment(true, 0).myComponent; } | getComponent |
278,132 | SimpleColoredComponent () { return getOrCreateFragment(true, 1).myComponent; } | getSecondaryComponent |
278,133 | Dimension () { return new Dimension(myPrimaryColumn.preferredSize.width + mySecondaryColumn.preferredSize.width, Math.max(myPrimaryColumn.preferredSize.height, mySecondaryColumn.preferredSize.height)); } | getPreferredSize |
278,134 | String () { return getName(); } | toString |
278,135 | boolean () { return getComparator() != null; } | isSortable |
278,136 | boolean (Item item) { return false; } | isCellEditable |
278,137 | void (Item item, Aspect value) { } | setValue |
278,138 | TableCellRenderer (final Item o, TableCellRenderer renderer) { return renderer; } | getCustomizedRenderer |
278,139 | int () { return 0; } | getAdditionalWidth |
278,140 | int (JTable table) { return -1; } | getWidth |
278,141 | void (@ColumnName String s) { myName = s; } | setName |
278,142 | boolean (final Object o) { return this == o || o != null && getClass() == o.getClass() && Objects.equals(myName, ((ColumnInfo<?, ?>)o).myName); } | equals |
278,143 | int () { return myName != null ? myName.hashCode() : 0; } | hashCode |
278,144 | boolean () { return false; } | hasError |
278,145 | boolean (int rowIndex, int columnIndex) { return myColumnInfos[columnIndex].isCellEditable(myItems.get(rowIndex)); } | isCellEditable |
278,146 | ColumnInfo[] () { return myColumnInfos; } | getColumnInfos |
278,147 | String (int column) { return myColumnInfos[column].getName(); } | getColumnName |
278,148 | int () { return myItems.size(); } | getRowCount |
278,149 | Item (int row) { return myItems.get(row); } | getRowValue |
278,150 | int () { return myColumnInfos.length; } | getColumnCount |
278,151 | void (@NotNull List<Item> items) { myItems = items; fireTableDataChanged(); } | setItems |
278,152 | void (int rowIndex, @NotNull Item item) { myItems.set(rowIndex, item); fireTableCellUpdated(rowIndex, TableModelEvent.ALL_COLUMNS); } | setItem |
278,153 | Object (int rowIndex, int columnIndex) { return myColumnInfos[columnIndex].valueOf(getItem(rowIndex)); } | getValueAt |
278,154 | void (Object aValue, int rowIndex, int columnIndex) { setValueAt(aValue, rowIndex, columnIndex, true); } | setValueAt |
278,155 | void (Object aValue, int rowIndex, int columnIndex, boolean notifyListeners) { if (rowIndex < myItems.size()) { //noinspection unchecked setValue(aValue, rowIndex, myColumnInfos[columnIndex]); } if (notifyListeners) fireTableCellUpdated(rowIndex, columnIndex); } | setValueAt |
278,156 | boolean (ColumnInfo[] columnInfos) { if (myColumnInfos != null && Arrays.equals(columnInfos, myColumnInfos)) { return false; } // clear sort by column without resorting mySortByColumn = -1; myColumnInfos = columnInfos; fireTableStructureChanged(); return true; } | setColumnInfos |
278,157 | List<Item> () { return Collections.unmodifiableList(myItems); } | getItems |
278,158 | Object (int aspectIndex, Object item) { return myColumnInfos[aspectIndex].valueOf(item); } | getAspectOf |
278,159 | void (boolean aBoolean) { myIsSortable = aBoolean; } | setSortable |
278,160 | boolean () { return myIsSortable; } | isSortable |
278,161 | int (Item item) { return myItems.indexOf(item); } | indexOf |
278,162 | void () { } | addRow |
278,163 | void (int idx) { myItems.remove(idx); fireTableRowsDeleted(idx, idx); } | removeRow |
278,164 | void (int idx1, int idx2) { Collections.swap(myItems, idx1, idx2); if (idx1 < idx2) { fireTableRowsUpdated(idx1, idx2); } else { fireTableRowsUpdated(idx2, idx1); } } | exchangeRows |
278,165 | boolean (int oldIndex, int newIndex) { return true; } | canExchangeRows |
278,166 | void (Item item) { myItems.add(item); fireTableRowsInserted(myItems.size() - 1, myItems.size() - 1); } | addRow |
278,167 | void (int index, Item item) { myItems.add(index, item); fireTableRowsInserted(index, index); } | insertRow |
278,168 | void (@NotNull Collection<? extends Item> items) { if (items.isEmpty()) return; myItems.addAll(items); fireTableRowsInserted(myItems.size() - items.size(), myItems.size() - 1); } | addRows |
278,169 | Item (final int rowIndex) { return myItems.get(rowIndex); } | getItem |
278,170 | int () { return myLength.getLength(); } | getLength |
278,171 | void (MouseEvent e) { if (myMouseWithin) { return; } myTimeEntered = e.getWhen(); myMouseWithin = true; } | enter |
278,172 | void () { myMouseWithin = false; } | clear |
278,173 | boolean () { long now = System.currentTimeMillis(); return myMouseWithin && now > myTimeEntered && now - myTimeEntered < getLength(); } | isWithin |
278,174 | void (final @NotNull Length deadZone) { myLength = deadZone; } | setLength |
278,175 | int () { return myLength; } | getLength |
278,176 | FormBuilder () { return new FormBuilder(); } | createFormBuilder |
278,177 | FormBuilder (@Nullable JComponent label, @NotNull JComponent component) { return addLabeledComponent(label, component, myVerticalGap, false); } | addLabeledComponent |
278,178 | FormBuilder (@Nullable JComponent label, @NotNull JComponent component, final int topInset) { return addLabeledComponent(label, component, topInset, false); } | addLabeledComponent |
278,179 | FormBuilder (@Nullable JComponent label, @NotNull JComponent component, boolean labelOnTop) { return addLabeledComponent(label, component, myVerticalGap, labelOnTop); } | addLabeledComponent |
278,180 | FormBuilder (@NotNull @NlsContexts.Label String labelText, @NotNull JComponent component) { return addLabeledComponent(labelText, component, myVerticalGap, false); } | addLabeledComponent |
278,181 | FormBuilder (@NotNull @NlsContexts.Label String labelText, @NotNull JComponent component, final int topInset) { return addLabeledComponent(labelText, component, topInset, false); } | addLabeledComponent |
278,182 | FormBuilder (@NotNull @NlsContexts.Label String labelText, @NotNull JComponent component, boolean labelOnTop) { return addLabeledComponent(labelText, component, myVerticalGap, labelOnTop); } | addLabeledComponent |
278,183 | FormBuilder (@NotNull @NlsContexts.Label String labelText, @NotNull JComponent component, final int topInset, boolean labelOnTop) { JLabel label = createLabelForComponent(labelText, component); return addLabeledComponent(label, component, topInset, labelOnTop); } | addLabeledComponent |
278,184 | JLabel (@NotNull @NlsContexts.Label String labelText, @NotNull JComponent component) { JLabel label = new JLabel(UIUtil.replaceMnemonicAmpersand(labelText)); label.setLabelFor(component); return label; } | createLabelForComponent |
278,185 | FormBuilder (@NotNull JComponent component) { return addLabeledComponent((JLabel)null, component, myVerticalGap, false); } | addComponent |
278,186 | FormBuilder (@NotNull JComponent component, final int topInset) { return addLabeledComponent((JLabel)null, component, topInset, false); } | addComponent |
278,187 | FormBuilder (@NotNull JComponent component, int topInset) { return addLabeledComponent(null, component, topInset, false, true); } | addComponentFillVertically |
278,188 | FormBuilder (final int topInset) { return addComponent(new JSeparator(), topInset); } | addSeparator |
278,189 | FormBuilder () { return addSeparator(myVerticalGap); } | addSeparator |
278,190 | FormBuilder (final int height) { if (height == -1) { myPanel.add(new JLabel(), new GridBagConstraints(0, myLineCount++, 2, 1, 0, 1, CENTER, NONE, JBInsets.emptyInsets(), 0, 0)); return this; } return addLabeledComponent((JLabel)null, new Box.Filler(new JBDimension(0, height), new JBDimension(0, height), new JBDimension(Short.MAX_VALUE, height))); } | addVerticalGap |
278,191 | FormBuilder (final @NlsContexts.Label String text) { final JBLabel label = new JBLabel(text, UIUtil.ComponentStyle.SMALL, UIUtil.FontColor.BRIGHTER); label.setBorder(JBUI.Borders.emptyLeft(10)); return addComponentToRightColumn(label, 1); } | addTooltip |
278,192 | FormBuilder (final @NotNull JComponent component) { return addComponentToRightColumn(component, myVerticalGap); } | addComponentToRightColumn |
278,193 | FormBuilder (final @NotNull JComponent component, final int topInset) { return addLabeledComponent(new JLabel(), component, topInset); } | addComponentToRightColumn |
278,194 | FormBuilder (@Nullable JComponent label, @NotNull JComponent component, int topInset, boolean labelOnTop) { boolean fillVertically = component instanceof JScrollPane; return addLabeledComponent(label, component, topInset, labelOnTop, fillVertically); } | addLabeledComponent |
278,195 | FormBuilder (@NotNull @NlsContexts.Label String labelText, @NotNull JComponent component) { JLabel label = createLabelForComponent(labelText, component); return addLabeledComponent(label, component, myVerticalGap, true, true); } | addLabeledComponentFillVertically |
278,196 | FormBuilder (@Nullable JComponent label, @NotNull JComponent component, int topInset, boolean labelOnTop, boolean fillVertically) { GridBagConstraints c = new GridBagConstraints(); topInset = myLineCount > 0 ? topInset : 0; if (myVertical || labelOnTop || label == null) { c.gridwidth = 2; c.gridx = 0; c.gridy = myLineCount; c.weightx = 0; c.weighty = 0; c.fill = NONE; c.anchor = getLabelAnchor(false, fillVertically); c.insets = JBUI.insets(topInset, myFormLeftIndent, DEFAULT_VGAP, 0); if (label != null) myPanel.add(label, c); c.gridx = 0; c.gridy = myLineCount + 1; c.weightx = 1.0; c.weighty = getWeightY(fillVertically); c.fill = getFill(component, fillVertically); c.anchor = WEST; c.insets = JBUI.insets(label == null ? topInset : 0, myFormLeftIndent, 0, 0); myPanel.add(component, c); myLineCount += 2; } else { c.gridwidth = 1; c.gridx = 0; c.gridy = myLineCount; c.weightx = 0; c.weighty = 0; c.fill = NONE; c.anchor = getLabelAnchor(true, fillVertically); c.insets = JBUI.insets(topInset, myFormLeftIndent, 0, myHorizontalGap); myPanel.add(label, c); c.gridx = 1; c.weightx = 1; c.weighty = getWeightY(fillVertically); c.fill = getFill(component, fillVertically); c.anchor = WEST; c.insets = JBUI.insets(topInset, 0, 0, 0); myPanel.add(component, c); myLineCount++; } return this; } | addLabeledComponent |
278,197 | int (boolean honorAlignment, boolean fillVertically) { if (fillVertically) return honorAlignment && myAlignLabelOnRight ? NORTHEAST : NORTHWEST; return honorAlignment && myAlignLabelOnRight ? EAST : WEST; } | getLabelAnchor |
278,198 | int (JComponent component) { if (component instanceof JComboBox || component instanceof JSpinner || component instanceof JButton || component instanceof JTextField && ((JTextField)component).getColumns() != 0) { return NONE; } return HORIZONTAL; } | getFill |
278,199 | int (JComponent component, boolean fillVertically) { if (fillVertically) { return BOTH; } return getFill(component); } | getFill |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.