本文整理匯總了Java中com.intellij.openapi.diff.impl.highlighting.FragmentSide.getIndex方法的典型用法代碼示例。如果您正苦於以下問題:Java FragmentSide.getIndex方法的具體用法?Java FragmentSide.getIndex怎麽用?Java FragmentSide.getIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.diff.impl.highlighting.FragmentSide
的用法示例。
在下文中一共展示了FragmentSide.getIndex方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createPolygon
import com.intellij.openapi.diff.impl.highlighting.FragmentSide; //導入方法依賴的package包/類
private static DividerPolygon createPolygon(@NotNull Transformation[] transformations,
@NotNull Trapezium trapezium,
@Nullable Color color,
@NotNull FragmentSide left,
int diffDividerPolygonsOffset, boolean applied) {
Interval base1 = trapezium.getBase(left);
Interval base2 = trapezium.getBase(left.otherSide());
Transformation leftTransform = transformations[left.getIndex()];
Transformation rightTransform = transformations[left.otherSide().getIndex()];
int start1 = leftTransform.transform(base1.getStart());
int end1 = leftTransform.transform(base1.getEnd());
int start2 = rightTransform.transform(base2.getStart());
int end2 = rightTransform.transform(base2.getEnd());
return new DividerPolygon(start1 - diffDividerPolygonsOffset, start2 - diffDividerPolygonsOffset,
end1 - diffDividerPolygonsOffset, end2 - diffDividerPolygonsOffset,
color, applied);
}
示例2: add
import com.intellij.openapi.diff.impl.highlighting.FragmentSide; //導入方法依賴的package包/類
public void add(@NotNull TextRange base, @NotNull TextRange version, @NotNull FragmentSide side) {
int index = side.getIndex();
int otherIndex = side.otherSide().getIndex();
EqualPair pair = new EqualPair(base, version, side);
LOG.assertTrue(myPairs[index] == null || pair.getBaseStart() - myPairs[index].getBaseEnd() >= 0); // '==' can be in case of insertion
LOG.assertTrue(myPairs[otherIndex] == null || pair.getBaseStart() >= myPairs[otherIndex].getBaseStart());
myPairs[index] = pair;
if (myPairs[otherIndex] != null && myPairs[index].getBaseStart() >= myPairs[otherIndex].getBaseEnd()) myPairs[otherIndex] = null;
process();
}
示例3: getDocument
import com.intellij.openapi.diff.impl.highlighting.FragmentSide; //導入方法依賴的package包/類
@NotNull
public Document getDocument(@NotNull FragmentSide side) {
return myDocuments[side.getIndex()];
}
示例4: getStart
import com.intellij.openapi.diff.impl.highlighting.FragmentSide; //導入方法依賴的package包/類
public int getStart(@NotNull FragmentSide side) {
return myStarts[side.getIndex()];
}
示例5: getChangeSide
import com.intellij.openapi.diff.impl.highlighting.FragmentSide; //導入方法依賴的package包/類
@Override
@NotNull
public ChangeSide getChangeSide(@NotNull FragmentSide side) {
return mySides[side.getIndex()];
}