Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
275,600 | Font () { return FontUtil.getCommitMetadataFont(); } | getLabelsFont |
275,601 | Dimension () { return new Dimension(super.getMaximumSize().width, super.getPreferredSize().height); } | getMaximumSize |
275,602 | Color () { return getCommitDetailsBackground(); } | getBackground |
275,603 | float (int x1, int y1, int x2, int y2) { return (float)Math.hypot(x1 - x2, y1 - y2); } | distance |
275,604 | boolean (int upPosition, int downPosition, int x, int y, int rowHeight, int nodeWidth, float lineThickness) { int x1 = nodeWidth * downPosition + nodeWidth / 2; int y1 = rowHeight / 2; int x2 = nodeWidth * upPosition + nodeWidth / 2; int y2 = -rowHeight / 2; //return true; return (distance(x1, y1, x, y) + distance(x2, y2, x, y) < distance(x1, y1, x2, y2) + lineThickness); } | overUpEdge |
275,605 | boolean (int upPosition, int downPosition, int x, int y, int rowHeight, int nodeWidth, float lineThickness) { int x1 = nodeWidth * upPosition + nodeWidth / 2; int y1 = rowHeight / 2; int x2 = nodeWidth * downPosition + nodeWidth / 2; int y2 = rowHeight + rowHeight / 2; return distance(x1, y1, x, y) + distance(x2, y2, x, y) < distance(x1, y1, x2, y2) + lineThickness; } | overDownEdge |
275,606 | boolean (int position, int x, int y, int rowHeight, int nodeWidth, int circleRadius) { int x0 = nodeWidth * position + nodeWidth / 2; int y0 = rowHeight / 2; return distance(x0, y0, x, y) <= circleRadius; } | overNode |
275,607 | int (@NotNull Point point, int rowHeight) { return point.y - getRowIndex(point, rowHeight) * rowHeight; } | getYInsideRow |
275,608 | int (@NotNull Point point, int rowHeight) { return point.y / rowHeight; } | getRowIndex |
275,609 | int () { return PaintParameters.ROW_HEIGHT; } | getRowHeight |
275,610 | float[] (double edgeLength) { // If the edge is vertical, then edgeLength is equal to rowHeight. Exactly one dash and one space fits on the edge, // so spaceLength + dashLength is also equal to rowHeight. // When the edge is not vertical, spaceLength is kept the same, but dashLength is chosen to be slightly greater // so that the whole number of dashes would fit on the edge. int rowHeight = getRowHeight(); int dashCount = Math.max(1, (int)Math.floor(edgeLength / rowHeight)); float spaceLength = rowHeight / 2.0f - 2; float dashLength = (float)(edgeLength / dashCount - spaceLength); return new float[]{dashLength, spaceLength}; } | getDashLength |
275,611 | BasicStroke () { return new BasicStroke(PaintParameters.getLineThickness(getRowHeight()), BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL); } | getOrdinaryStroke |
275,612 | BasicStroke () { return new BasicStroke(PaintParameters.getSelectedLineThickness(getRowHeight()), BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL); } | getSelectedStroke |
275,613 | Stroke (float[] dash) { return new BasicStroke(PaintParameters.getLineThickness(getRowHeight()), BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL, 0, dash, dash[0] / 2); } | getDashedStroke |
275,614 | Stroke (float[] dash) { return new BasicStroke(PaintParameters.getSelectedLineThickness(getRowHeight()), BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL, 0, dash, dash[0] / 2); } | getSelectedDashedStroke |
275,615 | void (@NotNull Graphics2D g2, @NotNull Color color, int from, int to, boolean hasArrow, boolean isUsual, boolean isSelected, boolean isTerminal) { // paint vertical lines normal size // paint non-vertical lines twice the size to make them dock with each other well int nodeWidth = PaintParameters.getNodeWidth(getRowHeight()); if (from == to) { int x = nodeWidth * from + nodeWidth / 2; int y1 = getRowHeight() / 2 - 1; int y2 = isTerminal ? PaintParameters.getCircleRadius(getRowHeight()) / 2 + 1 : 0; paintLine(g2, color, hasArrow, x, y1, x, y2, x, y2, isUsual, isSelected); } else { assert !isTerminal; int x1 = nodeWidth * from + nodeWidth / 2; int y1 = getRowHeight() / 2; int x2 = nodeWidth * to + nodeWidth / 2; int y2 = -getRowHeight() / 2; paintLine(g2, color, hasArrow, x1, y1, x2, y2, (x1 + x2) / 2, (y1 + y2) / 2, isUsual, isSelected); } } | paintUpLine |
275,616 | void (@NotNull Graphics2D g2, @NotNull Color color, int from, int to, boolean hasArrow, boolean isUsual, boolean isSelected, boolean isTerminal) { int nodeWidth = PaintParameters.getNodeWidth(getRowHeight()); if (from == to) { int y2 = getRowHeight() - (isTerminal ? PaintParameters.getCircleRadius(getRowHeight()) / 2 + 1 : 0); int y1 = getRowHeight() / 2; int x = nodeWidth * from + nodeWidth / 2; paintLine(g2, color, hasArrow, x, y1, x, y2, x, y2, isUsual, isSelected); } else { assert !isTerminal; int x1 = nodeWidth * from + nodeWidth / 2; int y1 = getRowHeight() / 2; int x2 = nodeWidth * to + nodeWidth / 2; int y2 = getRowHeight() + getRowHeight() / 2; paintLine(g2, color, hasArrow, x1, y1, x2, y2, (x1 + x2) / 2, (y1 + y2) / 2, isUsual, isSelected); } } | paintDownLine |
275,617 | void (@NotNull Graphics2D g2, @NotNull Color color, boolean hasArrow, int x1, int y1, int x2, int y2, int startArrowX, int startArrowY, boolean isUsual, boolean isSelected) { g2.setColor(color); if (isUsual || hasArrow) { setUsualStroke(g2, isSelected); } else { setDashedStroke(g2, isSelected, (x1 == x2) ? getRowHeight() : Math.hypot(x1 - x2, y1 - y2)); } g2.drawLine(x1, y1, x2, y2); if (hasArrow) { Pair<Integer, Integer> rotate1 = rotate(x1, y1, startArrowX, startArrowY, Math.sqrt(ARROW_ANGLE_COS2), Math.sqrt(1 - ARROW_ANGLE_COS2), ARROW_LENGTH * getRowHeight()); Pair<Integer, Integer> rotate2 = rotate(x1, y1, startArrowX, startArrowY, Math.sqrt(ARROW_ANGLE_COS2), -Math.sqrt(1 - ARROW_ANGLE_COS2), ARROW_LENGTH * getRowHeight()); g2.drawLine(startArrowX, startArrowY, rotate1.first, rotate1.second); g2.drawLine(startArrowX, startArrowY, rotate2.first, rotate2.second); } } | paintLine |
275,618 | void (@NotNull Graphics2D g2, int position, @NotNull Color color, boolean select) { int nodeWidth = PaintParameters.getNodeWidth(getRowHeight()); int circleRadius = PaintParameters.getCircleRadius(getRowHeight()); int selectedCircleRadius = PaintParameters.getSelectedCircleRadius(getRowHeight()); int x0 = nodeWidth * position + nodeWidth / 2; int y0 = getRowHeight() / 2; int r = circleRadius; if (select) { r = selectedCircleRadius; } Ellipse2D.Double circle = new Ellipse2D.Double(x0 - r + 0.5, y0 - r + 0.5, 2 * r, 2 * r); g2.setColor(color); g2.fill(circle); } | paintCircle |
275,619 | void (@NotNull Graphics2D g2, boolean select) { g2.setStroke(select ? getSelectedStroke() : getOrdinaryStroke()); } | setUsualStroke |
275,620 | void (@NotNull Graphics2D g2, boolean select, double edgeLength) { float[] length = getDashLength(edgeLength); g2.setStroke(select ? getSelectedDashedStroke(length) : getDashedStroke(length)); } | setDashedStroke |
275,621 | Color (@NotNull PrintElement printElement) { return myColorGenerator.getColor(printElement.getColorId()); } | getColor |
275,622 | boolean (@NotNull PrintElement printElement) { if (!(printElement instanceof EdgePrintElement)) return true; EdgePrintElement.LineStyle lineStyle = ((EdgePrintElement)printElement).getLineStyle(); return lineStyle == EdgePrintElement.LineStyle.SOLID; } | isUsual |
275,623 | void (@NotNull Graphics2D g2, @NotNull Collection<? extends PrintElement> printElements) { g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); List<PrintElement> selected = new SmartList<>(); for (PrintElement printElement : printElements) { if (printElement.isSelected()) { selected.add(printElement); // to draw later } else { drawElement(g2, printElement, false); } } // draw selected elements for (PrintElement printElement : selected) { drawElement(g2, printElement, true); } for (PrintElement printElement : selected) { drawElement(g2, printElement, false); } } | draw |
275,624 | void (@NotNull Graphics2D g2, @NotNull PrintElement printElement, boolean isSelected) { if (printElement instanceof EdgePrintElement) { if (isSelected) { printEdge(g2, MARK_COLOR, true, (EdgePrintElement)printElement); } else { printEdge(g2, getColor(printElement), false, (EdgePrintElement)printElement); } } if (printElement instanceof NodePrintElement) { int position = printElement.getPositionInCurrentRow(); if (isSelected) { paintCircle(g2, position, MARK_COLOR, true); } else { paintCircle(g2, position, getColor(printElement), false); } } } | drawElement |
275,625 | void (@NotNull Graphics2D g2, @NotNull Color color, boolean isSelected, @NotNull EdgePrintElement edgePrintElement) { int from = edgePrintElement.getPositionInCurrentRow(); int to = edgePrintElement.getPositionInOtherRow(); boolean isUsual = isUsual(edgePrintElement); if (edgePrintElement.getType() == EdgePrintElement.Type.DOWN) { paintDownLine(g2, color, from, to, edgePrintElement.hasArrow(), isUsual, isSelected, edgePrintElement instanceof TerminalEdgePrintElement); } else { paintUpLine(g2, color, from, to, edgePrintElement.hasArrow(), isUsual, isSelected, edgePrintElement instanceof TerminalEdgePrintElement); } } | printEdge |
275,626 | int (int rowHeight) { return WIDTH_NODE * rowHeight / ROW_HEIGHT; } | getNodeWidth |
275,627 | float (int rowHeight) { return THICK_LINE * rowHeight / ROW_HEIGHT; } | getLineThickness |
275,628 | float (int rowHeight) { return SELECT_THICK_LINE * rowHeight / ROW_HEIGHT; } | getSelectedLineThickness |
275,629 | int (int rowHeight) { return SELECT_CIRCLE_RADIUS * rowHeight / ROW_HEIGHT; } | getSelectedCircleRadius |
275,630 | int (int rowHeight) { return CIRCLE_RADIUS * rowHeight / ROW_HEIGHT; } | getCircleRadius |
275,631 | List<CommitId> () { return myUi.getTable().getSelection().getCommits(); } | getSelectedCommits |
275,632 | List<VcsCommitMetadata> () { return myUi.getTable().getSelection().getCachedMetadata(); } | getSelectedShortDetails |
275,633 | List<VcsFullCommitDetails> () { return myUi.getTable().getSelection().getCachedFullDetails(); } | getSelectedDetails |
275,634 | void (@NotNull Consumer<? super List<? extends VcsFullCommitDetails>> consumer) { getTable().getSelection().requestFullDetails(consumer::consume); } | requestSelectedDetails |
275,635 | ListenableFuture<Boolean> (@NotNull String reference, boolean focus) { return VcsLogNavigationUtil.jumpToRefOrHash(myUi, reference, false, focus); } | jumpToReference |
275,636 | ListenableFuture<Boolean> (@NotNull Hash commitHash, @NotNull VirtualFile root, boolean focus) { return VcsLogNavigationUtil.jumpToCommit(myUi, commitHash, root, false, focus); } | jumpToCommit |
275,637 | VcsLogGraphTable () { return myUi.getTable(); } | getTable |
275,638 | void () { boolean isEmpty = true; if (Files.exists(PersistentUtil.LOG_CACHE)) { try (DirectoryStream<Path> stream = Files.newDirectoryStream(PersistentUtil.LOG_CACHE)) { if (stream.iterator().hasNext()) { isEmpty = false; } } catch (IOException ignored) { } } if (!isEmpty) { try { Files.createFile(NioFiles.createParentDirectories(PersistentUtil.getCorruptionMarkerFile())); } catch (Exception e) { LOG.error(e); } } } | invalidateCaches |
275,639 | String () { return VcsLogBundle.message("vcs.log.clear.caches.checkbox.description"); } | getDescription |
275,640 | Boolean () { return Boolean.FALSE; } | optionalCheckboxDefaultValue |
275,641 | VcsLogCachesInvalidator () { return EP_NAME.findExtensionOrFail(VcsLogCachesInvalidator.class); } | getInstance |
275,642 | LogDataImpl () { return EMPTY; } | empty |
275,643 | List<VcsCommitMetadata> () { return myCommits; } | getCommits |
275,644 | Set<VcsRef> () { return myRefs; } | getRefs |
275,645 | Set<VcsUser> () { return myUsers; } | getUsers |
275,646 | Collection<Change> () { return myChanges.get().getMergedChanges(); } | getChanges |
275,647 | Collection<Change> (int parent) { return myChanges.get().getChanges(parent); } | getChanges |
275,648 | int () { return myChanges.get().size(); } | size |
275,649 | Changes () { return myChanges.get(); } | getChangesObject |
275,650 | Collection<Change> () { return ContainerUtil.emptyList(); } | getMergedChanges |
275,651 | Collection<Change> (int parent) { return ContainerUtil.emptyList(); } | getChanges |
275,652 | int () { return 0; } | size |
275,653 | ParsedChanges () { List<Change> mergedChanges = parseMergedChanges(); List<Collection<Change>> changes = computeChanges(mergedChanges); ParsedChanges parsedChanges = new ParsedChanges(mergedChanges, changes); myChanges.compareAndSet(this, parsedChanges); return parsedChanges; } | parseChanges |
275,654 | List<Change> () { List<MergedStatusInfo<VcsFileStatusInfo>> statuses = getMergedStatusInfo(); List<Change> changes = myParser.apply(ContainerUtil.map(statuses, MergedStatusInfo::getStatusInfo), 0); if (changes.size() != statuses.size()) { LOG.error("Incorrectly parsed statuses " + statuses + " to changes " + changes); } if (getParents().size() <= 1) return changes; // each merge change knows about all changes to parents List<Change> wrappedChanges = new ArrayList<>(statuses.size()); for (int i = 0; i < statuses.size(); i++) { wrappedChanges.add(new MyMergedChange(changes.get(i), statuses.get(i), myParser)); } return wrappedChanges; } | parseMergedChanges |
275,655 | Collection<Change> () { return parseChanges().getMergedChanges(); } | getMergedChanges |
275,656 | Collection<Change> (int parent) { return parseChanges().getChanges(parent); } | getChanges |
275,657 | int () { int size = 0; for (List<VcsFileStatusInfo> changesToParent : myChangesOutput) { size += changesToParent.size(); } return size; } | size |
275,658 | List<Collection<Change>> (@NotNull Collection<Change> mergedChanges) { if (myChangesOutput.size() == 1) { return Collections.singletonList(mergedChanges); } else { List<Collection<Change>> changes = new ArrayList<>(myChangesOutput.size()); for (int i = 0; i < myChangesOutput.size(); i++) { ProgressManager.checkCanceled(); changes.add(myParser.apply(myChangesOutput.get(i), i)); } return changes; } } | computeChanges |
275,659 | List<MergedStatusInfo<VcsFileStatusInfo>> () { return myStatusMerger.merge(myChangesOutput); } | getMergedStatusInfo |
275,660 | Collection<VcsFileStatusInfo> () { Collection<VcsFileStatusInfo> result = new HashSet<>(); for (MergedStatusInfo<VcsFileStatusInfo> mergedStatusInfo : getMergedStatusInfo()) { result.add(mergedStatusInfo.getStatusInfo()); } return result; } | getMergedStatuses |
275,661 | List<Change> () { return mySourceChanges.get(); } | getSourceChanges |
275,662 | Collection<Change> () { return myMergedChanges; } | getMergedChanges |
275,663 | Collection<Change> (int parent) { return myChanges.get(parent); } | getChanges |
275,664 | int () { int size = 0; for (Collection<Change> changesToParent : myChanges) { size += changesToParent.size(); } return size; } | size |
275,665 | Hash (@NotNull String inputStr) { byte[] data = buildData(inputStr); assert data.length > 0 : "Can not build hash for string " + inputStr; return new HashImpl(data); } | build |
275,666 | int (@NotNull String inputString, int index) { int k = Character.digit(inputString.charAt(index), BASE); if (k < 0) { throw new IllegalArgumentException("bad hash string: " + inputString); } return k; } | parseChar |
275,667 | String () { assert myData.length > 0 : "bad length Hash.data"; byte even = myData[0]; StringBuilder sb = new StringBuilder(); for (int i = 1; i < myData.length; i++) { int k1 = (myData[i] + 128) / 16; int k2 = (myData[i] + 128) % 16; char c1 = Character.forDigit(k1, 16); char c2 = Character.forDigit(k2, 16); if (i == myData.length - 1 && even == 1) { sb.append(c2); } else { sb.append(c1).append(c2); } } return sb.toString(); } | asString |
275,668 | boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; HashImpl that = (HashImpl)o; return myHashCode == that.myHashCode && Arrays.equals(myData, that.myData); } | equals |
275,669 | int () { return myHashCode; } | hashCode |
275,670 | String () { return asString(); } | toString |
275,671 | String () { return VcsLogUtil.getShortHash(asString()); } | toShortString |
275,672 | int (@NotNull VcsRef ref1, @NotNull VcsRef ref2) { VcsLogProvider provider1 = myProviders.get(ref1.getRoot()); VcsLogProvider provider2 = myProviders.get(ref2.getRoot()); if (provider1 == null) return provider2 == null ? ref1.getName().compareTo(ref2.getName()) : 1; if (provider2 == null) return -1; if (provider1 == provider2) { return provider1.getReferenceManager().getLabelsOrderComparator().compare(ref1, ref2); } return provider1.getSupportedVcs().getName().compareTo(provider2.getSupportedVcs().getName()); } | compare |
275,673 | Hash () { return myHash; } | getId |
275,674 | List<Hash> () { return myParents; } | getParents |
275,675 | boolean (Object obj) { if (this == obj) { return true; } if (!(obj instanceof TimedVcsCommitImpl)) { return false; } return myHash.equals(((TimedVcsCommitImpl)obj).myHash); } | equals |
275,676 | int () { return myHash.hashCode(); } | hashCode |
275,677 | String () { return myHash.toShortString() + "|-" + StringUtil.join(ContainerUtil.map(myParents, hash -> hash.toShortString()), ",") + ":" + myTime; } | toString |
275,678 | long () { return myTime; } | getTimestamp |
275,679 | int () { return myCommitCount; } | getCommitCount |
275,680 | boolean () { return myRefresh; } | isRefresh |
275,681 | Collection<VcsRef> () { return myPreviousRefs; } | getPreviousRefs |
275,682 | Hash (@NotNull String stringHash) { return HashImpl.build(stringHash); } | createHash |
275,683 | TimedVcsCommit (@NotNull Hash hash, @NotNull List<Hash> parents, long timeStamp) { return new TimedVcsCommitImpl(hash, parents, timeStamp); } | createTimedCommit |
275,684 | VcsShortCommitDetails (@NotNull Hash hash, @NotNull List<Hash> parents, long commitTime, @NotNull VirtualFile root, @NotNull String subject, @NotNull String authorName, String authorEmail, @NotNull String committerName, @NotNull String committerEmail, long authorTime) { VcsUser author = createUser(authorName, authorEmail); VcsUser committer = createUser(committerName, committerEmail); return new VcsShortCommitDetailsImpl(hash, parents, commitTime, root, subject, author, committer, authorTime); } | createShortDetails |
275,685 | VcsCommitMetadata (@NotNull Hash hash, @NotNull List<Hash> parents, long commitTime, @NotNull VirtualFile root, @NotNull String subject, @NotNull String authorName, @NotNull String authorEmail, @NotNull String message, @NotNull String committerName, @NotNull String committerEmail, long authorTime) { VcsUser author = createUser(authorName, authorEmail); VcsUser committer = createUser(committerName, committerEmail); return new VcsCommitMetadataImpl(hash, parents, commitTime, root, subject, author, message, committer, authorTime); } | createCommitMetadata |
275,686 | VcsUser (@NotNull String name, @NotNull String email) { return myUserRegistry.createUser(name, email); } | createUser |
275,687 | VcsRef (@NotNull Hash commitHash, @NotNull String name, @NotNull VcsRefType type, @NotNull VirtualFile root) { return new VcsRefImpl(commitHash, name, type, root); } | createRef |
275,688 | Disposable (@NotNull VcsLogWindow window) { String windowId = window.getId(); if (ContainerUtil.exists(myLogWindows, w -> w.getId().equals(windowId))) { throw new CannotAddVcsLogWindowException("Log window with id '" + windowId + "' was already added. " + "Existing windows:\n" + getLogWindowsInformation(), myCreationTraces.get(windowId)); } myLogWindows.add(window); myCreationTraces.put(windowId, new Throwable("Creation trace for " + window)); refresherActivated(window.getRefresher(), true); return () -> { LOG.debug("Removing disposed log window " + window); myLogWindows.remove(window); myCreationTraces.remove(windowId); }; } | addLogWindow |
275,689 | boolean () { return Registry.is("vcs.log.keep.up.to.date") && !PowerSaveMode.isEnabled(); } | keepUpToDate |
275,690 | boolean () { if (keepUpToDate()) return true; return isLogVisible(); } | canRefreshNow |
275,691 | boolean () { for (VcsLogWindow window : myLogWindows) { if (window.isVisible()) return true; } return false; } | isLogVisible |
275,692 | void (@NotNull VisiblePackRefresher refresher, boolean firstTime) { myLogData.initialize(); if (!myRootsToRefresh.isEmpty()) { refreshPostponedRoots(); } else { refresher.setValid(true, firstTime); } } | refresherActivated |
275,693 | void (@NotNull VisiblePackRefresher refresher, boolean visible) { refresher.setValid(visible, true); } | dataPackArrived |
275,694 | void (@NotNull VirtualFile root) { if (canRefreshNow()) { myLogData.refresh(Collections.singleton(root)); } else { LOG.debug("Postponed refresh for " + root); myRootsToRefresh.add(root); } } | refresh |
275,695 | boolean () { return !myRootsToRefresh.isEmpty(); } | hasPostponedRoots |
275,696 | void () { Set<VirtualFile> toRefresh = new HashSet<>(myRootsToRefresh); myRootsToRefresh.removeAll(toRefresh); // clear the set, but keep roots which could possibly arrive after collecting them in the var. myLogData.refresh(toRefresh); } | refreshPostponedRoots |
275,697 | Set<VcsLogWindow> () { return myLogWindows; } | getLogWindows |
275,698 | String () { return StringUtil.join(myLogWindows, window -> { String isVisible = window.isVisible() ? " (visible)" : ""; String isDisposed = Disposer.isDisposed(window.getRefresher()) ? " (disposed)" : ""; return window + isVisible + isDisposed; }, "\n"); } | getLogWindowsInformation |
275,699 | VcsLogUiEx () { return myUi; } | getUi |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.