Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
286,700
void () { end = System.nanoTime(); StartUpMeasurer.addActivity(this); }
end
286,701
void (@NotNull String value) { description = value; }
setDescription
286,702
ActivityImpl (@NotNull String name) { end = System.nanoTime(); StartUpMeasurer.addActivity(this); return new ActivityImpl(name, /* start = */end, parent, /* pluginId = */ pluginId, category); }
endAndStart
286,703
String () { StringBuilder builder = new StringBuilder(); builder.append("ActivityImpl(name=").append(name).append(", start="); nanoToString(start, builder); builder.append(", end="); nanoToString(end, builder); builder.append(", category=").append(category).append(")"); return builder.toString(); }
toString
286,704
void (long start, @NotNull StringBuilder builder) { //noinspection NonAsciiCharacters builder .append(TimeUnit.NANOSECONDS.toMillis(start - StartUpMeasurer.getStartTime())).append("ms (") .append(TimeUnit.NANOSECONDS.toMicros(start - StartUpMeasurer.getStartTime())).append("μs)"); }
nanoToString
286,705
String () { return jsonName; }
getJsonName
286,706
void () { measuringPluginStartupCosts = false; }
stopPluginCostMeasurement
286,707
long () { return startTime; }
getStartTime
286,708
long () { return startTimeUnixNanoDiff; }
getStartTimeUnixNanoDiff
286,709
boolean () { return isEnabled; }
isEnabled
286,710
void () { isEnabled = false; }
disable
286,711
long () { return System.nanoTime(); }
getCurrentTime
286,712
long () { return isEnabled ? System.nanoTime() : -1; }
getCurrentTimeIfEnabled
286,713
void (@NonNls @NotNull String name) { if (!isEnabled) { return; } ActivityImpl activity = new ActivityImpl(name, System.nanoTime(), null, null); activity.setEnd(-1); items.add(activity); }
addInstantEvent
286,714
Activity (@NonNls @NotNull String name, @NotNull ActivityCategory category) { return new ActivityImpl(name, System.nanoTime(), /* parent = */ null, /* pluginId = */ null, category); }
startActivity
286,715
Activity (@NonNls @NotNull String name) { return new ActivityImpl(name, System.nanoTime(), /* parent = */ null, /* pluginId = */ null, ActivityCategory.DEFAULT); }
startActivity
286,716
Activity (@NonNls @NotNull String name, @Nullable Activity parent) { return new ActivityImpl(name, System.nanoTime(), /* parent = */ (ActivityImpl)parent, /* pluginId = */ null, ActivityCategory.DEFAULT); }
startActivity
286,717
long (long start, @NotNull Class<?> clazz, @NotNull ActivityCategory category, @Nullable String pluginId) { return addCompletedActivity(start, clazz, category, pluginId, -1); }
addCompletedActivity
286,718
void (long start, @NonNls @NotNull String name, @Nullable Activity parent) { if (!isEnabled) { return; } long end = System.nanoTime(); long duration = end - start; if (duration <= MEASURE_THRESHOLD) { return; } ActivityImpl item = new ActivityImpl(name, start, /* parent = */ (ActivityImpl)parent, null, ActivityCategory.DEFAULT); item.setEnd(end); items.add(item); }
addCompletedActivity
286,719
long (long start, @NotNull Class<?> clazz, @NotNull ActivityCategory category, @Nullable String pluginId, long threshold) { if (!isEnabled) { return -1; } long end = System.nanoTime(); long duration = end - start; if (duration <= threshold) { return duration; } addCompletedActivity(start, end, clazz.getName(), category, pluginId); return duration; }
addCompletedActivity
286,720
long (long start, @NonNls @NotNull String name, @NotNull ActivityCategory category, String pluginId) { long end = System.nanoTime(); long duration = end - start; if (duration <= MEASURE_THRESHOLD) { return duration; } addCompletedActivity(start, end, name, category, pluginId); return duration; }
addCompletedActivity
286,721
void (long start, long end, @NonNls @NotNull String name, @NotNull ActivityCategory category, String pluginId) { if (!isEnabled) { return; } ActivityImpl item = new ActivityImpl(name, start, /* parent = */ null, pluginId, category); item.setEnd(end); items.add(item); }
addCompletedActivity
286,722
void (boolean isContinueToCollect, @NotNull Consumer<? super ActivityImpl> consumer) { isEnabled = isContinueToCollect; while (true) { ActivityImpl item = items.poll(); if (item == null) { break; } consumer.accept(item); } }
processAndClear
286,723
void (@NotNull ActivityImpl activity) { if (isEnabled) { items.add(activity); } }
addActivity
286,724
void (List<Object> timings, String parentName, long startTimeUnixNano) { if (!items.isEmpty()) { throw new IllegalStateException("addTimings must be not called if some events were already added using API"); } if (timings.isEmpty()) { return; } ActivityImpl parent = new ActivityImpl(parentName, (long)timings.get(1), null, null); parent.setEnd(System.nanoTime()); for (int i = 0; i < timings.size(); i += 2) { long start = (long)timings.get(i + 1); if (start < startTime) { startTime = start; startTimeUnixNanoDiff = startTimeUnixNano - start; } ActivityImpl activity = new ActivityImpl((String)timings.get(i), start, parent, null); activity.setEnd(i == timings.size() - 2 ? parent.getEnd() : (long)timings.get(i + 3)); items.add(activity); } items.add(parent); }
addTimings
286,725
void (@NonNls @NotNull String pluginId, @NonNls @NotNull String phase, long time) { if (isMeasuringPluginStartupCosts()) { doAddPluginCost(pluginId, phase, time, pluginCostMap); } }
addPluginCost
286,726
boolean () { return measuringPluginStartupCosts; }
isMeasuringPluginStartupCosts
286,727
void (@NonNls @NotNull String pluginId, @NonNls @NotNull String phase, long time, @NotNull Map<String, Object2LongOpenHashMap<String>> pluginCostMap) { Object2LongMap<String> costPerPhaseMap = pluginCostMap.computeIfAbsent(pluginId, __ -> new Object2LongOpenHashMap<>()); synchronized (costPerPhaseMap) { costPerPhaseMap.mergeLong(phase, time, Math::addExact); } }
doAddPluginCost
286,728
PluginDescriptor () { return myPluginDescriptor; }
getPluginDescriptor
286,729
void (@NotNull PluginDescriptor pluginDescriptor) { myPluginDescriptor = pluginDescriptor; }
setPluginDescriptor
286,730
void (@NotNull ChannelHandlerContext context, @NotNull ByteBuf input) { ByteBuf buffer = getBufferIfSufficient(input, 5, context); if (buffer != null) { decode(context, buffer); } }
messageReceived
286,731
void (@NotNull ChannelHandlerContext context, @NotNull ByteBuf buffer) { ChannelPipeline pipeline = context.pipeline(); if (detectSsl && SslHandler.isEncrypted(buffer)) { SSLEngine engine = SSL_SERVER_CONTEXT.get().newEngine(context.alloc()); engine.setUseClientMode(false); pipeline.addLast(new SslHandler(engine), new ChunkedWriteHandler(), new PortUnificationServerHandler(delegatingHttpRequestHandler, false, detectGzip)); } else { int magic1 = buffer.getUnsignedByte(buffer.readerIndex()); int magic2 = buffer.getUnsignedByte(buffer.readerIndex() + 1); if (detectGzip && magic1 == 31 && magic2 == 139) { pipeline.addLast(ZlibCodecFactory.newZlibEncoder(ZlibWrapper.GZIP), ZlibCodecFactory.newZlibDecoder(ZlibWrapper.GZIP), new PortUnificationServerHandler(delegatingHttpRequestHandler, detectSsl, false)); } else if (isHttp(magic1, magic2)) { NettyUtil.addHttpServerCodec(pipeline); pipeline.addLast("delegatingHttpHandler", delegatingHttpRequestHandler); Logger logger = Logger.getInstance(BuiltInServer.class); if (logger.isDebugEnabled()) { pipeline.addLast(new ChannelOutboundHandlerAdapter() { @Override public void write(ChannelHandlerContext context, Object message, ChannelPromise promise) throws Exception { if (message instanceof HttpResponse response) { logger.debug("OUT HTTP: " + response); } super.write(context, message, promise); } }); } } else if (magic1 == 'C' && magic2 == 'H') { buffer.skipBytes(2); pipeline.addLast(new CustomHandlerDelegator()); } else { Logger.getInstance(BuiltInServer.class).warn("unknown request, first two bytes " + magic1 + " " + magic2); context.close(); } } // must be after new channels handlers addition (netty bug?) pipeline.remove(this); // Buffer will be automatically released after messageReceived, but we pass it to next handler, and next handler will also release, so, we must retain. // We can introduce Decoder.isAutoRelease, but in this case, if error will be thrown while we are executing, buffer will not be released. // So, it is robust solution just always release (Decoder does) and just retain (we - client) if autorelease behavior is not suitable. buffer.retain(); // we must fire channel read - new added handler must read buffer context.fireChannelRead(buffer); }
decode
286,732
void (ChannelHandlerContext context, Throwable cause) { NettyUtil.logAndClose(cause, Logger.getInstance(BuiltInServer.class), context.channel()); }
exceptionCaught
286,733
boolean (int magic1, int magic2) { return magic1 == 'G' && magic2 == 'E' || // GET magic1 == 'P' && magic2 == 'O' || // POST magic1 == 'P' && magic2 == 'U' || // PUT magic1 == 'H' && magic2 == 'E' || // HEAD magic1 == 'O' && magic2 == 'P' || // OPTIONS magic1 == 'P' && magic2 == 'A' || // PATCH magic1 == 'D' && magic2 == 'E' || // DELETE magic1 == 'T' && magic2 == 'R' || // TRACE magic1 == 'C' && magic2 == 'O'; // CONNECT }
isHttp
286,734
void (@NotNull ChannelHandlerContext context, @NotNull ByteBuf input) { ByteBuf buffer = getBufferIfSufficient(input, UUID_LENGTH, context); if (buffer == null) { return; } UUID uuid = new UUID(buffer.readLong(), buffer.readLong()); for (BinaryRequestHandler customHandler : BinaryRequestHandler.EP_NAME.getExtensionList()) { if (uuid.equals(customHandler.getId())) { ChannelPipeline pipeline = context.pipeline(); pipeline.addLast(customHandler.getInboundHandler(context)); pipeline.addLast(ChannelExceptionHandler.getInstance()); pipeline.remove(this); context.fireChannelRead(buffer); break; } } }
messageReceived
286,735
void (ChannelHandlerContext context, Throwable cause) { NettyUtil.logAndClose(cause, Logger.getInstance(BuiltInServer.class), context.channel()); }
exceptionCaught
286,736
int () { return parseInt(builder, 0, false, 10); }
parseContentLength
286,737
boolean (char what, @NotNull ByteBuf buffer, @NotNull StringBuilder builder) { int i = buffer.readerIndex(); for (int n = buffer.writerIndex(); i < n; i++) { char c = (char)buffer.getByte(i); if (c == what) { buffer.readerIndex(i + 1); return true; } else { builder.append(c); } } buffer.readerIndex(i); return false; }
readUntil
286,738
void (@NotNull ByteBuf buffer) { int i = buffer.readerIndex(); int n = buffer.writerIndex(); for (; i < n; i++) { char c = (char)buffer.getByte(i); if (c != ' ') { buffer.readerIndex(i); return; } } buffer.readerIndex(n); }
skipWhitespace
286,739
int (@NotNull CharSequence value, int start, boolean isNegative, int radix) { final int end = value.length(); int result = 0; // Accumulates negatively (avoid MIN_VALUE overflow). int i = start; for (; i < end; i++) { char c = value.charAt(i); int digit = (c <= '9') ? c - '0' : ((c <= 'Z') && (c >= 'A')) ? c - 'A' + 10 : ((c <= 'z') && (c >= 'a')) ? c - 'a' + 10 : -1; if ((digit >= 0) && (digit < radix)) { int newResult = result * radix - digit; if (newResult > result) { throw new NumberFormatException("Overflow parsing " + value.subSequence(start, end)); } result = newResult; } else { break; } } // Requires one valid digit character and checks for opposite overflow. if ((result == 0) && ((end == 0) || (value.charAt(i - 1) != '0'))) { throw new NumberFormatException("Invalid integer representation for " + value.subSequence(start, end)); } if ((result == Integer.MIN_VALUE) && !isNegative) { throw new NumberFormatException("Overflow parsing " + value.subSequence(start, end)); } return isNegative ? result : -result; }
parseInt
286,740
ByteBuf (@NotNull ByteBuf input, int requiredLength, @NotNull ChannelHandlerContext context) { if (!input.isReadable()) { return null; } if (cumulation == null) { if (input.readableBytes() < requiredLength) { cumulation = input; input.retain(); input.touch(); return null; } else { return input; } } else { int currentAccumulatedByteCount = cumulation.readableBytes(); if ((currentAccumulatedByteCount + input.readableBytes()) < requiredLength) { CompositeByteBuf compositeByteBuf; if ((cumulation instanceof CompositeByteBuf)) { compositeByteBuf = (CompositeByteBuf)cumulation; } else { compositeByteBuf = context.alloc().compositeBuffer(DEFAULT_MAX_COMPOSITE_BUFFER_COMPONENTS); compositeByteBuf.addComponent(true, cumulation); cumulation = compositeByteBuf; } compositeByteBuf.addComponent(true, input); input.retain(); input.touch(); return null; } else { CompositeByteBuf buffer; if (cumulation instanceof CompositeByteBuf) { buffer = (CompositeByteBuf)cumulation; buffer.addComponent(input); } else { // may be it will be used by client to cumulate something - don't set artificial restriction (2) buffer = context.alloc().compositeBuffer(DEFAULT_MAX_COMPOSITE_BUFFER_COMPONENTS); buffer.addComponents(cumulation, input); } // we don't set writerIndex on addComponent, it is clear to set it to requiredLength here buffer.writerIndex(requiredLength); input.skipBytes(requiredLength - currentAccumulatedByteCount); input.retain(); input.touch(); cumulation = null; return buffer; } } }
getBufferIfSufficient
286,741
ChannelHandler () { return INSTANCE; }
getInstance
286,742
boolean () { return serverChannel.get() == null && clientChannels.isEmpty(); }
isEmpty
286,743
void (@NotNull Channel channel, boolean isOwnEventLoopGroup) { boolean isSet = serverChannel.compareAndSet(null, (ServerChannel)channel); LOG.assertTrue(isSet); this.isEventLoopGroupOwner = isOwnEventLoopGroup; }
setServerChannel
286,744
void () { close(isEventLoopGroupOwner); }
close
286,745
void (boolean shutdownEventLoopGroup) { ServerChannel serverChannel = this.serverChannel.get(); if (serverChannel == null) { LOG.assertTrue(clientChannels.isEmpty()); return; } else if (!this.serverChannel.compareAndSet(serverChannel, null)) { return; } EventLoopGroup eventLoopGroup = shutdownEventLoopGroup ? serverChannel.eventLoop().parent() : null; try { long start = System.currentTimeMillis(); Channel[] clientChannels = this.clientChannels.toArray(new Channel[]{}); this.clientChannels.clear(); final CountDownLatch countDown = new CountDownLatch(clientChannels.length + 1); GenericFutureListener<ChannelFuture> listener = new GenericFutureListener<>() { @Override public void operationComplete(@NotNull ChannelFuture future) { try { Throwable cause = future.cause(); if (cause != null) { LOG.warn(cause); } } finally { countDown.countDown(); } } }; addCloseListener(serverChannel, countDown, listener); for (Channel channel : clientChannels) { addCloseListener(channel, countDown, listener); } try { countDown.await(5, TimeUnit.SECONDS); } catch (InterruptedException e) { LOG.warn("Cannot close all channels for 10 seconds, channels: " + Arrays.toString(clientChannels)); } long duration = System.currentTimeMillis() - start; if (duration > 1000) { LOG.info("Close all channels took " + duration + " ms: " + (duration / 60000) + " min " + ((duration % 60000) / 1000) + "sec"); } } finally { if (eventLoopGroup != null) { eventLoopGroup.shutdownGracefully(1, 2, TimeUnit.NANOSECONDS); } } }
close
286,746
void (@NotNull ChannelFuture future) { try { Throwable cause = future.cause(); if (cause != null) { LOG.warn(cause); } } finally { countDown.countDown(); } }
operationComplete
286,747
void (@NotNull Channel serverChannel, @NotNull CountDownLatch countDown, @NotNull GenericFutureListener<ChannelFuture> listener) { ChannelFuture close = serverChannel.close(); if (close.isDone()) { countDown.countDown(); } else { close.addListener(listener); } }
addCloseListener
286,748
void (@NotNull Throwable error, @NotNull Logger log, @NotNull Channel channel) { // don't report about errors while connecting // WEB-7727 try { if (error instanceof ConnectException) { log.debug(error); } else { log(error, log); } } finally { log.info("Channel will be closed due to error"); channel.close(); } }
logAndClose
286,749
void (@NotNull Throwable throwable, @NotNull Logger log) { String message = throwable.getMessage(); if (message == null) { log.error(throwable); return; } if (message.startsWith("Connection reset")) {//NON-NLS return; } if (isAsWarning(message, throwable)) { log.warn(throwable); } else { log.error(throwable); } }
log
286,750
boolean (@NlsSafe @NotNull String message, @NotNull Throwable throwable) { if (message.equals("Operation timed out") || message.equals("Connection timed out")) { return true; } if (throwable instanceof IOException) { return throwable instanceof BindException || message.equals("An established connection was aborted by the software in your host machine") || message.equals("An existing connection was forcibly closed by the remote host") || message.equals("\u0423\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0445\u043e\u0441\u0442 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0440\u0432\u0430\u043b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435"); } return (throwable instanceof ChannelException && message.startsWith("Failed to bind to: ")); }
isAsWarning
286,751
Bootstrap (@NotNull EventLoopGroup eventLoopGroup) { Bootstrap bootstrap = new Bootstrap().group(eventLoopGroup).channel(NioSocketChannel.class); bootstrap.option(ChannelOption.TCP_NODELAY, true).option(ChannelOption.SO_KEEPALIVE, true); return bootstrap; }
nioClientBootstrap
286,752
void (@NotNull ChannelPipeline pipeline) { pipeline.addLast("httpRequestEncoder", new HttpResponseEncoder()); // https://jetbrains.zendesk.com/agent/tickets/68315 pipeline.addLast("httpRequestDecoder", new HttpRequestDecoder(16 * 1024, 16 * 1024, 8192)); pipeline.addLast("httpObjectAggregator", new HttpObjectAggregator(MAX_CONTENT_LENGTH)); // could be added earlier if HTTPS if (pipeline.get(ChunkedWriteHandler.class) == null) { pipeline.addLast("chunkedWriteHandler", new ChunkedWriteHandler()); } pipeline.addLast("corsHandler", new CorsHandler(CorsConfigBuilder .forAnyOrigin() .shortCircuit() .allowCredentials() .allowNullOrigin() .allowedRequestMethods(HttpMethod.GET, HttpMethod.POST, HttpMethod.PUT, HttpMethod.DELETE, HttpMethod.HEAD, HttpMethod.PATCH) .allowedRequestHeaders("origin", "accept", "authorization", "content-type", "x-ijt", "x-requested-with") //NON-NLS .build())); }
addHttpServerCodec
286,753
FullHttpRequest (@NotNull FullHttpRequest httpRequest) { try { URI uri = new URI(httpRequest.uri()); if (uri.getHost() != null) { URI patchedRequestURI = new URI(null, null, null, -1, uri.getPath(), uri.getQuery(), uri.getFragment()); FullHttpRequest httpRequestCopy = httpRequest.copy(); httpRequestCopy.setUri(patchedRequestURI.toString()); return httpRequestCopy; } } catch (URISyntaxException ignored) { } return httpRequest; }
ensureRequestUriIsRelative
286,754
void (long timeout, @NotNull TimeUnit unit) { try { @NotNull GlobalEventExecutor executor = GlobalEventExecutor.INSTANCE; executor.awaitInactivity(timeout, unit); } catch (InterruptedException ignored) { } catch (IllegalStateException ignored) { // thread did not start } }
awaitQuiescenceOfGlobalEventExecutor
286,755
int () { return myLayoutState.getComponentCount(); }
getComponentCount
286,756
Component (final int componentIndex) { return myLayoutState.getComponent(componentIndex); }
getComponent
286,757
GridConstraints (int componentIndex) { return myLayoutState.getConstraints(componentIndex); }
getConstraints
286,758
int (final int componentIndex) { return myCell[componentIndex]; }
getCell
286,759
int (final int componentIndex) { return mySpan[componentIndex]; }
getSpan
286,760
int (final int cellIndex) { return myStretches[cellIndex]; }
getStretch
286,761
int () { return myGap; }
getGap
286,762
boolean (final int componentIndex, final int cellIndex) { final int componentStartCell = getCell(componentIndex); final int span = getSpan(componentIndex); return componentStartCell <= cellIndex && cellIndex < componentStartCell + span; }
componentBelongsCell
286,763
int (final int cellIndex) { return myCellSizePolicies[cellIndex]; }
getCellSizePolicy
286,764
int (final int cellIndex, final ArrayList<Integer> eliminatedCells) { int policyFromChild = getCellSizePolicyFromInheriting(cellIndex); if (policyFromChild != -1) { return policyFromChild; } for (int i = eliminatedCells.size() - 1; i >= 0; i--) { if (cellIndex == eliminatedCells.get(i).intValue()) { return GridConstraints.SIZEPOLICY_CAN_SHRINK; } } return calcCellSizePolicy(cellIndex); }
getCellSizePolicyImpl
286,765
int (final int cellIndex) { boolean canShrink = true; boolean canGrow = false; boolean wantGrow = false; boolean weakCanGrow = true; boolean weakWantGrow = true; int countOfBelongingComponents = 0; for (int i = 0; i < getComponentCount(); i++) { if (!componentBelongsCell(i, cellIndex)){ continue; } countOfBelongingComponents++; final int p = getSizePolicy(i); final boolean thisCanShrink = (p & GridConstraints.SIZEPOLICY_CAN_SHRINK) != 0; final boolean thisCanGrow = (p & GridConstraints.SIZEPOLICY_CAN_GROW) != 0; final boolean thisWantGrow = (p & GridConstraints.SIZEPOLICY_WANT_GROW) != 0; if (getCell(i) == cellIndex && mySpansAfterElimination[i] == 1) { canShrink &= thisCanShrink; canGrow |= thisCanGrow; wantGrow |= thisWantGrow; } if (!thisCanGrow) { weakCanGrow = false; } if (!thisWantGrow) { weakWantGrow = false; } } return (canShrink ? GridConstraints.SIZEPOLICY_CAN_SHRINK : 0) | (canGrow || (countOfBelongingComponents > 0 && weakCanGrow) ? GridConstraints.SIZEPOLICY_CAN_GROW : 0) | (wantGrow || (countOfBelongingComponents > 0 && weakWantGrow) ? GridConstraints.SIZEPOLICY_WANT_GROW : 0); }
calcCellSizePolicy
286,766
int (final int cellIndex) { int nonInheritingComponentsInCell = 0; int policyFromInheriting = -1; for(int i=getComponentCount() - 1; i >= 0; i--) { if (!componentBelongsCell(i, cellIndex)) { continue; } Component child = getComponent(i); GridConstraints c = getConstraints(i); Container container = findAlignedChild(child, c); if (container != null) { GridLayoutManager grid = (GridLayoutManager) container.getLayout(); grid.validateInfos(container); DimensionInfo info = getDimensionInfo(grid); final int policy = info.calcCellSizePolicy(cellIndex - getOriginalCell(c)); if (policyFromInheriting == -1) { policyFromInheriting = policy; } else { policyFromInheriting |= policy; } } else if (getOriginalCell(c) == cellIndex && getOriginalSpan(c) == 1 && !(child instanceof Spacer)) { nonInheritingComponentsInCell++; } } if (nonInheritingComponentsInCell > 0) { return -1; } return policyFromInheriting; }
getCellSizePolicyFromInheriting
286,767
Container (final Component child, final GridConstraints c) { if (c.isUseParentLayout() && child instanceof Container) { Container container = (Container) child; if (container.getLayout() instanceof GridLayoutManager) { return container; } else if (container.getComponentCount() == 1 && container.getComponent(0) instanceof Container) { // "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 childContainer = (Container) container.getComponent(0); if (childContainer.getLayout() instanceof GridLayoutManager) { return childContainer; } } } return null; }
findAlignedChild
286,768
Dimension (final int componentIndex) { Dimension size = myLayoutState.myPreferredSizes[componentIndex]; if (size == null) { size = Util.getPreferredSize(myLayoutState.getComponent(componentIndex), myLayoutState.getConstraints(componentIndex), true); myLayoutState.myPreferredSizes[componentIndex] = size; } return size; }
getPreferredSize
286,769
Dimension (final int componentIndex) { Dimension size = myLayoutState.myMinimumSizes[componentIndex]; if (size == null) { size = Util.getMinimumSize(myLayoutState.getComponent(componentIndex), myLayoutState.getConstraints(componentIndex), true); myLayoutState.myMinimumSizes[componentIndex] = size; } return size; }
getMinimumSize
286,770
int (final GridConstraints constraints) { return constraints.getRow(); }
getOriginalCell
286,771
int (final GridConstraints constraints) { return constraints.getRowSpan(); }
getOriginalSpan
286,772
int (final int componentIndex) { return getMinimumSize(componentIndex).height; }
getMinimumWidth
286,773
DimensionInfo (GridLayoutManager grid) { return grid.myVerticalInfo; }
getDimensionInfo
286,774
int () { return myLayoutState.getRowCount(); }
getCellCount
286,775
int (final int componentIndex) { return getPreferredSize(componentIndex).height; }
getPreferredWidth
286,776
int (final GridConstraints constraints) { return constraints.getColumn(); }
getOriginalCell
286,777
int (final GridConstraints constraints) { return constraints.getColSpan(); }
getOriginalSpan
286,778
int (final int componentIndex) { return getMinimumSize(componentIndex).width; }
getMinimumWidth
286,779
DimensionInfo (GridLayoutManager grid) { return grid.myHorizontalInfo; }
getDimensionInfo
286,780
int () { return myLayoutState.getColumnCount(); }
getCellCount
286,781
int (final int componentIndex) { return getPreferredSize(componentIndex).width; }
getPreferredWidth
286,782
Dimension () { return new Dimension(0, 0); }
getMinimumSize
286,783
Dimension () { return getMinimumSize(); }
getPreferredSize
286,784
Object () { return new GridConstraints( myRow, myColumn, myRowSpan, myColSpan, myAnchor, myFill, myHSizePolicy, myVSizePolicy, new Dimension(myMinimumSize), new Dimension(myPreferredSize), new Dimension(myMaximumSize), myIndent, myUseParentLayout); }
clone
286,785
int () { return myColumn; }
getColumn
286,786
void (final int column) { if (column < 0) { throw new IllegalArgumentException("wrong column: " + column); } myColumn = column; }
setColumn
286,787
int () { return myRow; }
getRow
286,788
void (final int row) { if(row<0){ throw new IllegalArgumentException("wrong row: "+row); } myRow = row; }
setRow
286,789
int () { return myRowSpan; }
getRowSpan
286,790
void (final int rowSpan) { if (rowSpan <= 0) { throw new IllegalArgumentException("wrong rowSpan: " + rowSpan); } myRowSpan = rowSpan; }
setRowSpan
286,791
int () { return myColSpan; }
getColSpan
286,792
void (final int colSpan) { if (colSpan <= 0) { throw new IllegalArgumentException("wrong colSpan: " + colSpan); } myColSpan = colSpan; }
setColSpan
286,793
int () { return myHSizePolicy; }
getHSizePolicy
286,794
void (final int sizePolicy) { if (sizePolicy < 0 || sizePolicy > 7) { throw new IllegalArgumentException("invalid sizePolicy: " + sizePolicy); } myHSizePolicy = sizePolicy; }
setHSizePolicy
286,795
int () { return myVSizePolicy; }
getVSizePolicy
286,796
void (final int sizePolicy) { if (sizePolicy < 0 || sizePolicy > 7) { throw new IllegalArgumentException("invalid sizePolicy: " + sizePolicy); } myVSizePolicy = sizePolicy; }
setVSizePolicy
286,797
int () { return myAnchor; }
getAnchor
286,798
void (final int anchor) { if (anchor < 0 || anchor > 15){ throw new IllegalArgumentException("invalid anchor: " + anchor); } myAnchor = anchor; }
setAnchor
286,799
int () { return myFill; }
getFill