Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
286,800
void (final int fill) { if ( fill != FILL_NONE && fill != FILL_HORIZONTAL && fill != FILL_VERTICAL && fill != FILL_BOTH ){ throw new IllegalArgumentException("invalid fill: " + fill); } myFill = fill; }
setFill
286,801
int () { return myIndent; }
getIndent
286,802
void (final int indent) { myIndent = indent; }
setIndent
286,803
boolean () { return myUseParentLayout; }
isUseParentLayout
286,804
void (final boolean useParentLayout) { myUseParentLayout = useParentLayout; }
setUseParentLayout
286,805
GridConstraints () { final GridConstraints copy = new GridConstraints(); copy.setRow(myRow); copy.setColumn(myColumn); copy.setColSpan(myColSpan); copy.setRowSpan(myRowSpan); copy.setVSizePolicy(myVSizePolicy); copy.setHSizePolicy(myHSizePolicy); copy.setFill(myFill); copy.setAnchor(myAnchor); copy.setIndent(myIndent);...
store
286,806
void (final GridConstraints constraints) { myRow = constraints.myRow; myColumn = constraints.myColumn; myRowSpan = constraints.myRowSpan; myColSpan = constraints.myColSpan; myHSizePolicy = constraints.myHSizePolicy; myVSizePolicy = constraints.myVSizePolicy; myFill = constraints.myFill; myAnchor = constraints.myAnchor;...
restore
286,807
boolean (Object o) { if (this == o) return true; if (!(o instanceof GridConstraints)) return false; final GridConstraints gridConstraints = (GridConstraints)o; if (myAnchor != gridConstraints.myAnchor) return false; if (myColSpan != gridConstraints.myColSpan) return false; if (myColumn != gridConstraints.myColumn) retu...
equals
286,808
int () { int result; result = myRow; result = 29 * result + myColumn; result = 29 * result + myRowSpan; result = 29 * result + myColSpan; result = 29 * result + myVSizePolicy; result = 29 * result + myHSizePolicy; result = 29 * result + myFill; result = 29 * result + myAnchor; result = 29 * result + (myMinimumSize != n...
hashCode
286,809
int (final boolean isRow) { return isRow ? getRow() : getColumn(); }
getCell
286,810
void (final boolean isRow, final int value) { if (isRow) { setRow(value); } else { setColumn(value); } }
setCell
286,811
int (final boolean isRow) { return isRow ? getRowSpan() : getColSpan(); }
getSpan
286,812
void (final boolean isRow, final int value) { if (isRow) { setRowSpan(value); } else { setColSpan(value); } }
setSpan
286,813
boolean (final boolean isRow, final int cell) { if (isRow) { return cell >= myRow && cell < myRow + myRowSpan; } return cell >= myColumn && cell < myColumn + myColSpan; }
contains
286,814
String () { //noinspection HardCodedStringLiteral return "GridConstraints (row=" + myRow + ", col=" + myColumn + ", rowspan=" + myRowSpan + ", colspan=" + myColSpan + ")"; }
toString
286,815
void (final Component comp, final Object constraints) { final GridConstraints c = (GridConstraints)constraints; final int row = c.getRow(); final int rowSpan = c.getRowSpan(); final int rowCount = getRowCount(); if (row < 0 || row >= rowCount) { throw new IllegalArgumentException("wrong row: " + row); } if (row + rowSp...
addLayoutComponent
286,816
int () { return myRowStretches.length; }
getRowCount
286,817
int () { return myColumnStretches.length; }
getColumnCount
286,818
int (final int rowIndex) { return myRowStretches[rowIndex]; }
getRowStretch
286,819
void (final int rowIndex, final int stretch) { if (stretch < 1) { throw new IllegalArgumentException("wrong stretch: " + stretch); } myRowStretches[rowIndex] = stretch; }
setRowStretch
286,820
int (final int columnIndex) { return myColumnStretches[columnIndex]; }
getColumnStretch
286,821
void (final int columnIndex, final int stretch) { if (stretch < 1) { throw new IllegalArgumentException("wrong stretch: " + stretch); } myColumnStretches[columnIndex] = stretch; }
setColumnStretch
286,822
Dimension (final Container target) { return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE); }
maximumLayoutSize
286,823
Dimension (final Container container) { validateInfos(container); // IMPORTANT!!! DO NOT INLINE!!! final DimensionInfo horizontalInfo = myHorizontalInfo; final DimensionInfo verticalInfo = myVerticalInfo; final Dimension result = getTotalGap(container, horizontalInfo, verticalInfo); final int[] widths = getMinSizes(hor...
minimumLayoutSize
286,824
void (int[] widths) { int max = widths[0]; for (int width : widths) { max = Math.max(width, max); } Arrays.fill(widths, max); }
makeSameSizes
286,825
int[] (DimensionInfo info, int totalWidth) { int[] widths = new int[info.getCellCount()]; int average = totalWidth / widths.length; int rest = totalWidth % widths.length; for (int i = 0; i < widths.length; i++) { widths[i] = average; if (rest > 0) { widths[i]++; rest--; } } return widths; }
getSameSizes
286,826
Dimension (final Container container) { validateInfos(container); // IMPORTANT!!! DO NOT INLINE!!! final DimensionInfo horizontalInfo = myHorizontalInfo; final DimensionInfo verticalInfo = myVerticalInfo; final Dimension result = getTotalGap(container, horizontalInfo, verticalInfo); final int[] widths = getPrefSizes(ho...
preferredLayoutSize
286,827
int (final int[] ints) { int result = 0; for (int i = ints.length - 1; i >= 0; i--) { result += ints[i]; } return result; }
sum
286,828
Dimension (final Container container, final DimensionInfo hInfo, final DimensionInfo vInfo) { final Insets insets = getInsets(container); return new Dimension( insets.left + insets.right + countGap(hInfo, 0, hInfo.getCellCount()) + myMargin.left + myMargin.right, insets.top + insets.bottom + countGap(vInfo, 0, vInfo.ge...
getTotalGap
286,829
int (Container container) { while(container != null) { if (container instanceof JComponent) { Integer designTimeInsets = (Integer)((JComponent) container).getClientProperty(DESIGN_TIME_INSETS); if (designTimeInsets != null) { return designTimeInsets.intValue(); } } container = container.getParent(); } return 0; }
getDesignTimeInsets
286,830
Insets (Container container) { final Insets insets = container.getInsets(); int insetsValue = getDesignTimeInsets(container); if (insetsValue != 0) { return new Insets(insets.top+insetsValue, insets.left+insetsValue, insets.bottom+insetsValue, insets.right+insetsValue); } return insets; }
getInsets
286,831
int (final DimensionInfo info, final int startCell, final int cellCount) { int counter = 0; for (int cellIndex = startCell + cellCount - 2 /*gap after last cell should not be counted*/; cellIndex >= startCell; cellIndex--) { if (shouldAddGapAfterCell(info, cellIndex)) { counter++; } } return counter * info.getGap(); }
countGap
286,832
boolean (final DimensionInfo info, final int cellIndex) { if (cellIndex < 0 || cellIndex >= info.getCellCount()) { throw new IllegalArgumentException("wrong cellIndex: " + cellIndex + "; cellCount=" + info.getCellCount()); } boolean endsInThis = false; boolean startsInNext = false; int indexOfNextNotEmpty = -1; for (in...
shouldAddGapAfterCell
286,833
boolean (final DimensionInfo info, final int cellIndex) { if (cellIndex < 0 || cellIndex >= info.getCellCount()) { throw new IllegalArgumentException("wrong cellIndex: " + cellIndex + "; cellCount=" + info.getCellCount()); } for (int i = 0; i < info.getComponentCount(); i++) { final Component component = info.getCompon...
isCellEmpty
286,834
void (final Container container) { validateInfos(container); // IMPORTANT!!! DO NOT INLINE!!! final LayoutState layoutState = myLayoutState; final DimensionInfo horizontalInfo = myHorizontalInfo; final DimensionInfo verticalInfo = myVerticalInfo; Insets insets = getInsets(container); int skipLayout = checkSetSizesFromP...
layoutContainer
286,835
int (final Container container, final Insets insets) { int skipLayout = 0; GridLayoutManager parentGridLayout = null; GridConstraints parentGridConstraints = null; // "use parent layout" also needs to work in cases where a grid is the only control in a non-grid panel // which is contained in a grid Container parent = c...
checkSetSizesFromParent
286,836
void (final Container container) { myLayoutState = null; myHorizontalInfo = null; myVerticalInfo = null; }
invalidateLayout
286,837
int[] () { return myXs; }
getXs
286,838
int[] () { return myWidths; }
getWidths
286,839
int[] () { return myYs; }
getYs
286,840
int[] () { return myHeights; }
getHeights
286,841
int[] (boolean isRow) { return isRow ? myYs : myXs; }
getCoords
286,842
int[] (boolean isRow) { return isRow ? myHeights : myWidths; }
getSizes
286,843
int[] (final DimensionInfo info) { return getMinOrPrefSizes(info, true); }
getMinSizes
286,844
int[] (final DimensionInfo info) { return getMinOrPrefSizes(info, false); }
getPrefSizes
286,845
int[] (final DimensionInfo info, final boolean min) { final int[] widths = new int[info.getCellCount()]; Arrays.fill(widths, myMinCellSize); // single spaned components for (int i = info.getComponentCount() - 1; i >= 0; i--) { if (info.getSpan(i) != 1) { continue; } int size = min ? getMin2(info, i) : Math.max(info.get...
getMinOrPrefSizes
286,846
void (final DimensionInfo info, final boolean min, final int[] widths) { for(int i=info.getComponentCount() - 1; i >= 0; i--) { Component child = info.getComponent(i); GridConstraints c = info.getConstraints(i); if (c.isUseParentLayout() && child instanceof Container) { Container container = (Container) child; if (cont...
updateSizesFromChildren
286,847
void (final DimensionInfo info, final boolean min, final int[] widths, final Container container, final int childIndex) { GridLayoutManager childLayout = (GridLayoutManager) container.getLayout(); if (info.getSpan(childIndex) == info.getChildLayoutCellCount(childLayout)) { childLayout.validateInfos(container); Dimensio...
updateSizesFromChild
286,848
int (final DimensionInfo info, final int componentIndex) { final int s; if ((info.getSizePolicy(componentIndex) & GridConstraints.SIZEPOLICY_CAN_SHRINK) != 0) { s = info.getMinimumWidth(componentIndex); } else { // it might be possible that minSize > prefSize (for example, only min is set in constraints to 100 and // J...
getMin2
286,849
void (final int[] widths, final int cell, final int span, final int minWidth, final DimensionInfo info, final boolean checkPrefs) { int toDistribute = minWidth; for (int i = cell; i < cell + span; i++) { toDistribute -= widths[i]; } if (toDistribute <= 0) { return; } final boolean[] allowedCells = new boolean[info.getC...
new_doIt
286,850
void (final boolean[] higherPriorityCells, final DimensionInfo info, int toDistribute, final int[] widths) { int stretches = 0; for (int i = 0; i < info.getCellCount(); i++) { if (higherPriorityCells[i]) { stretches += info.getStretch(i); } } { final int toDistributeFrozen = toDistribute; for (int i = 0; i < info.getCe...
distribute
286,851
void ( final DimensionInfo info, final boolean[] allowedCells, final boolean[] higherPriorityCells, final boolean checkPrefs, final int[] widths ) { Arrays.fill(higherPriorityCells, false); int foundCells = 0; if (checkPrefs) { // less that preferred size final int[] prefs = getMinOrPrefSizes(info, false); for (int cel...
getCellsWithHigherPriorities
286,852
boolean () { return mySameSizeHorizontally; }
isSameSizeHorizontally
286,853
boolean () { return mySameSizeVertically; }
isSameSizeVertically
286,854
void (boolean sameSizeHorizontally) { mySameSizeHorizontally = sameSizeHorizontally; }
setSameSizeHorizontally
286,855
void (boolean sameSizeVertically) { mySameSizeVertically = sameSizeVertically; }
setSameSizeVertically
286,856
int[] () { return getGridLines(myYs, myHeights); }
getHorizontalGridLines
286,857
int[] () { return getGridLines(myXs, myWidths); }
getVerticalGridLines
286,858
int[] (int[] pos, int[] heights) { int[] result = new int [pos.length + 1]; result [0] = pos[0]; for(int i = 0; i < pos.length - 1; i++) { result [i+1] = (pos[i] + heights[i] + pos[i + 1]) / 2; } result [pos.length] = pos[pos.length - 1] + heights[pos.length - 1]; return result; }
getGridLines
286,859
int (final boolean isRow) { return isRow ? getRowCount() : getColumnCount(); }
getCellCount
286,860
int (final boolean isRow, final int cellIndex) { DimensionInfo info = isRow ? myVerticalInfo : myHorizontalInfo; if (info == null) { // not laid out yet return 0; } return info.getCellSizePolicy(cellIndex); }
getCellSizePolicy
286,861
TextWithMnemonic (String textWithMnemonic) { if (textWithMnemonic == null) { throw new IllegalArgumentException("textWithMnemonic cannot be null"); } // Parsing is copied from Presentation.setText(String, boolean) int index = -1; final StringBuilder plainText = new StringBuilder(); for (int i = 0; i < textWithMnemonic....
parseText
286,862
char () { if (myMnemonicIndex == -1) { throw new IllegalStateException("text doesn't contain mnemonic"); } return Character.toUpperCase(myText.charAt(myMnemonicIndex)); }
getMnemonicChar
286,863
void (JComponent component, int index) { try { Method method = component.getClass().getMethod("setDisplayedMnemonicIndex", int.class); method.setAccessible(true); method.invoke(component, Integer.valueOf(index)); } catch (Exception e) { // JDK earlier than 1.4 - do nothing } }
setDisplayedMnemonicIndex
286,864
Dimension (final Component component, final GridConstraints constraints, final boolean addIndent) { try { final Dimension size = getSize(constraints.myMinimumSize, component.getMinimumSize()); if (addIndent) { size.width += DEFAULT_INDENT * constraints.getIndent(); } return size; } catch (NullPointerException npe) { //...
getMinimumSize
286,865
Dimension (final GridConstraints constraints, final boolean addIndent) { try { //[anton] we use only our property for maximum size. // JButton reports that its max size = pref size, so it is impossible to make a column of same sized buttons. // Probably there are other bad cases... final Dimension size = getSize(constr...
getMaximumSize
286,866
Dimension (final Component component, final GridConstraints constraints, final boolean addIndent) { try { final Dimension size = getSize(constraints.myPreferredSize, component.getPreferredSize()); if (addIndent) { size.width += DEFAULT_INDENT * constraints.getIndent(); } return size; } catch (NullPointerException e) {/...
getPreferredSize
286,867
Dimension (final Dimension overridenSize, final Dimension ownSize) { final int overridenWidth = overridenSize.width >= 0 ? overridenSize.width : ownSize.width; final int overridenHeight = overridenSize.height >= 0 ? overridenSize.height : ownSize.height; return new Dimension(overridenWidth, overridenHeight); }
getSize
286,868
void (final Component component, final GridConstraints constraints, final Dimension size) { final Dimension minimumSize = getMinimumSize(component, constraints, false); final Dimension maximumSize = getMaximumSize(constraints, false); size.width = Math.max(size.width, minimumSize.width); size.height = Math.max(size.hei...
adjustSize
286,869
int (final int[] cellIndices, final int[] spans, final ArrayList eliminated) { final int size = cellIndices.length; if (size != spans.length) { throw new IllegalArgumentException("size mismatch: " + size + ", " + spans.length); } if (eliminated != null && eliminated.size() != 0) { throw new IllegalArgumentException("el...
eliminate
286,870
Insets () { return (Insets)myMargin.clone(); }
getMargin
286,871
int () { return myHGap; }
getHGap
286,872
int (Container container) { if(container==null){ throw new IllegalArgumentException("container cannot be null"); } while(container!=null){ if(container.getLayout() instanceof AbstractLayout){ final AbstractLayout layout=(AbstractLayout)container.getLayout(); if(layout.getHGap()!=-1){ return layout.getHGap(); } } contai...
getHGapImpl
286,873
void (final int hGap) { if(hGap<-1){ throw new IllegalArgumentException("wrong hGap: "+hGap); } myHGap=hGap; }
setHGap
286,874
int () { return myVGap; }
getVGap
286,875
int (Container container) { if(container==null){ throw new IllegalArgumentException("container cannot be null"); } while(container!=null){ if(container.getLayout() instanceof AbstractLayout){ final AbstractLayout layout=(AbstractLayout)container.getLayout(); if(layout.getVGap() !=-1){ return layout.getVGap(); } } conta...
getVGapImpl
286,876
void (final int vGap) { if(vGap<-1){ throw new IllegalArgumentException("wrong vGap: "+vGap); } myVGap=vGap; }
setVGap
286,877
void (final Insets margin) { if (margin == null) { throw new IllegalArgumentException("margin cannot be null"); } myMargin = (Insets)margin.clone(); }
setMargin
286,878
int () { return myComponents.length; }
getComponentCount
286,879
Component (final int index) { return myComponents[index]; }
getComponent
286,880
GridConstraints (final int index) { return myConstraints[index]; }
getConstraints
286,881
void (final Component comp, final Object constraints) { if (!(constraints instanceof GridConstraints)) { throw new IllegalArgumentException("constraints: " + constraints); } final Component[] newComponents = new Component[myComponents.length + 1]; System.arraycopy(myComponents, 0, newComponents, 0, myComponents.length)...
addLayoutComponent
286,882
void (final String name, final Component comp) { throw new UnsupportedOperationException(); }
addLayoutComponent
286,883
void (final Component comp) { final int i = getComponentIndex(comp); if (i == -1) { throw new IllegalArgumentException("component was not added: " + comp); } if (myComponents.length == 1) { myComponents = COMPONENT_EMPTY_ARRAY; } else { final Component[] newComponents = new Component[myComponents.length - 1]; System.ar...
removeLayoutComponent
286,884
GridConstraints (Component comp) { final int i = getComponentIndex(comp); if (i == -1) { throw new IllegalArgumentException("component was not added: " + comp); } return myConstraints[i]; }
getConstraintsForComponent
286,885
int (final Component comp) { for (int i = 0; i < myComponents.length; i++) { final Component component = myComponents[i]; if (component == comp) { return i; } } return -1; }
getComponentIndex
286,886
float (final Container container) { return 0.5f; }
getLayoutAlignmentX
286,887
float (final Container container) { return 0.5f; }
getLayoutAlignmentY
286,888
int () { return myComponents.length; }
getComponentCount
286,889
Component (final int index) { return myComponents[index]; }
getComponent
286,890
GridConstraints (final int index) { return myConstraints[index]; }
getConstraints
286,891
int () { return myColumnCount; }
getColumnCount
286,892
int () { return myRowCount; }
getRowCount
286,893
void (@NlsContexts.TabTitle String tabText) { myTabText = tabText; }
setTabText
286,894
String () { return myScopeText; }
getScopeText
286,895
void (@NotNull @NlsSafe String scopeText) { myScopeText = scopeText; }
setScopeText
286,896
boolean () { return myShowReadOnlyStatusAsRed; }
isShowReadOnlyStatusAsRed
286,897
void (boolean showReadOnlyStatusAsRed) { myShowReadOnlyStatusAsRed = showReadOnlyStatusAsRed; }
setShowReadOnlyStatusAsRed
286,898
void (@Nls String usagesString) { myUsagesString = usagesString; }
setUsagesString
286,899
String () { return myTargetsNodeText; }
getTargetsNodeText