本文整理汇总了Java中com.intellij.openapi.diff.impl.splitter.DiffDividerPaint类的典型用法代码示例。如果您正苦于以下问题:Java DiffDividerPaint类的具体用法?Java DiffDividerPaint怎么用?Java DiffDividerPaint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DiffDividerPaint类属于com.intellij.openapi.diff.impl.splitter包,在下文中一共展示了DiffDividerPaint类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DiffSplitter
import com.intellij.openapi.diff.impl.splitter.DiffDividerPaint; //导入依赖的package包/类
public DiffSplitter(JComponent component1, JComponent component2, DiffDividerPaint dividerPaint, DiffPanelState data) {
myPaint = dividerPaint;
myData = data;
setDividerWidth(30);
setFirstComponent(component1);
setSecondComponent(component2);
setHonorComponentsMinimumSize(false);
}
示例2: listenEditors
import com.intellij.openapi.diff.impl.splitter.DiffDividerPaint; //导入依赖的package包/类
public void listenEditors(@NotNull EditingSides sides) {
stopListenEditors();
myPaint = new DiffDividerPaint(sides, myLeftSide, MERGE_DIVIDER_POLYGONS_OFFSET);
myEditors[0] = sides.getEditor(FragmentSide.SIDE1);
myEditors[1] = sides.getEditor(FragmentSide.SIDE2);
if (myEditors[0] == null || myEditors[1] == null) {
LOG.error(myEditors[1] + " " + myEditors[1]);
}
for (Editor editor : myEditors) {
editor.getScrollingModel().addVisibleAreaListener(myVisibleAreaListener);
}
}
示例3: DiffSplitter
import com.intellij.openapi.diff.impl.splitter.DiffDividerPaint; //导入依赖的package包/类
public DiffSplitter(JComponent component1, JComponent component2, DiffDividerPaint dividerPaint, DiffPanelState data) {
myPaint = dividerPaint;
myData = data;
setDividerWidth(JBUI.scale(30));
setFirstComponent(component1);
setSecondComponent(component2);
setHonorComponentsMinimumSize(false);
}
示例4: listenEditors
import com.intellij.openapi.diff.impl.splitter.DiffDividerPaint; //导入依赖的package包/类
public void listenEditors(@Nonnull EditingSides sides) {
stopListenEditors();
myPaint = new DiffDividerPaint(sides, myLeftSide, MERGE_DIVIDER_POLYGONS_OFFSET);
myEditors[0] = sides.getEditor(FragmentSide.SIDE1);
myEditors[1] = sides.getEditor(FragmentSide.SIDE2);
if (myEditors[0] == null || myEditors[1] == null) {
LOG.error(myEditors[1] + " " + myEditors[1]);
}
for (Editor editor : myEditors) {
editor.getScrollingModel().addVisibleAreaListener(myVisibleAreaListener);
}
}
示例5: DiffPanelImpl
import com.intellij.openapi.diff.impl.splitter.DiffDividerPaint; //导入依赖的package包/类
public DiffPanelImpl(final Window owner,
@NotNull Project project,
boolean enableToolbar,
boolean horizontal,
int diffDividerPolygonsOffset,
DiffTool parentTool) {
myProject = project;
myIsHorizontal = horizontal;
myParentTool = parentTool;
myOptions = new DiffPanelOptions(this);
myPanel = new DiffPanelOuterComponent(TextDiffType.DIFF_TYPES, null);
myPanel.disableToolbar(!enableToolbar);
if (enableToolbar) myPanel.resetToolbar();
myOwnerWindow = owner;
myIsSyncScroll = true;
final boolean v = !horizontal;
myLeftSide = new DiffSideView(this, new CustomLineBorder(1, 0, v ? 0 : 1, v ? 0 : 1));
myRightSide = new DiffSideView(this, new CustomLineBorder(v ? 0 : 1, v ? 0 : 1, 1, 0));
myLeftSide.becomeMaster();
myDiffUpdater = new Rediffers(this);
myDiffDividerPolygonsOffset = diffDividerPolygonsOffset;
myData = createDiffPanelState(this);
if (horizontal) {
mySplitter = new DiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent(),
new DiffDividerPaint(this, FragmentSide.SIDE1, diffDividerPolygonsOffset), myData);
}
else {
mySplitter = new HorizontalDiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent());
}
myPanel.insertDiffComponent(mySplitter.getComponent(), new MyScrollingPanel());
myDataProvider = new MyGenericDataProvider(this);
myPanel.setDataProvider(myDataProvider);
ComparisonPolicy comparisonPolicy = getComparisonPolicy();
if (comparisonPolicy != DiffManagerImpl.getInstanceEx().getComparisonPolicy()) {
setComparisonPolicy(comparisonPolicy);
}
HighlightMode highlightMode = getHighlightMode();
if (highlightMode != DiffManagerImpl.getInstanceEx().getHighlightMode()) {
setHighlightMode(highlightMode);
}
myVisibleAreaListener = new VisibleAreaListener() {
@Override
public void visibleAreaChanged(VisibleAreaEvent e) {
Editor editor1 = getEditor1();
if (editor1 != null) {
editor1.getComponent().repaint();
}
Editor editor2 = getEditor2();
if (editor2 != null) {
editor2.getComponent().repaint();
}
}
};
registerActions();
}
示例6: getPrimaryBeginnings
import com.intellij.openapi.diff.impl.splitter.DiffDividerPaint; //导入依赖的package包/类
private int[] getPrimaryBeginnings(DiffDividerPaint paint) {
FragmentSide primarySide = paint.getLeftSide();
LOG.assertTrue(getEditor(1) == paint.getSides().getEditor(primarySide));
return paint.getSides().getLineBlocks().getBeginnings(primarySide, true);
}
示例7: getPaint
import com.intellij.openapi.diff.impl.splitter.DiffDividerPaint; //导入依赖的package包/类
public DiffDividerPaint getPaint() {
return myPaint;
}
示例8: DiffPanelImpl
import com.intellij.openapi.diff.impl.splitter.DiffDividerPaint; //导入依赖的package包/类
public DiffPanelImpl(final Window owner,
Project project,
boolean enableToolbar,
boolean horizontal,
int diffDividerPolygonsOffset,
DiffTool parentTool) {
myProject = project;
myIsHorizontal = horizontal;
myParentTool = parentTool;
myOptions = new DiffPanelOptions(this);
myPanel = new DiffPanelOuterComponent(TextDiffType.DIFF_TYPES, null);
myPanel.disableToolbar(!enableToolbar);
if (enableToolbar) myPanel.resetToolbar();
myOwnerWindow = owner;
myIsSyncScroll = true;
final boolean v = !horizontal;
myLeftSide = new DiffSideView(this, new CustomLineBorder(UIUtil.getBorderColor(), 1, 0, v ? 0 : 1, v ? 0 : 1));
myRightSide = new DiffSideView(this, new CustomLineBorder(UIUtil.getBorderColor(), v ? 0 : 1, v ? 0 : 1, 1, 0));
myLeftSide.becomeMaster();
myDiffUpdater = new Rediffers(this);
myData = createDiffPanelState(this);
if (horizontal) {
mySplitter = new DiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent(),
new DiffDividerPaint(this, FragmentSide.SIDE1, diffDividerPolygonsOffset), myData);
}
else {
mySplitter = new HorizontalDiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent());
}
myPanel.insertDiffComponent(mySplitter.getComponent(), new MyScrollingPanel());
myDataProvider = new MyGenericDataProvider(this);
myPanel.setDataProvider(myDataProvider);
final ComparisonPolicy comparisonPolicy = getComparisonPolicy();
final ComparisonPolicy defaultComparisonPolicy = DiffManagerImpl.getInstanceEx().getComparisonPolicy();
if (defaultComparisonPolicy != null && comparisonPolicy != defaultComparisonPolicy) {
setComparisonPolicy(defaultComparisonPolicy);
}
myVisibleAreaListener = new VisibleAreaListener() {
@Override
public void visibleAreaChanged(VisibleAreaEvent e) {
Editor editor1 = getEditor1();
if (editor1 != null) {
editor1.getComponent().repaint();
}
Editor editor2 = getEditor2();
if (editor2 != null) {
editor2.getComponent().repaint();
}
}
};
registerActions();
}
示例9: DiffPanelImpl
import com.intellij.openapi.diff.impl.splitter.DiffDividerPaint; //导入依赖的package包/类
public DiffPanelImpl(final Window owner, @Nonnull Project project, boolean enableToolbar, boolean horizontal, int diffDividerPolygonsOffset, DiffTool parentTool) {
myProject = project;
myIsHorizontal = horizontal;
myParentTool = parentTool;
myOptions = new DiffPanelOptions(this);
myPanel = new DiffPanelOuterComponent(TextDiffType.DIFF_TYPES, null);
myPanel.disableToolbar(!enableToolbar);
if (enableToolbar) myPanel.resetToolbar();
myOwnerWindow = owner;
myIsSyncScroll = true;
final boolean v = !horizontal;
myLeftSide = new DiffSideView(this, new CustomLineBorder(1, 0, v ? 0 : 1, v ? 0 : 1));
myRightSide = new DiffSideView(this, new CustomLineBorder(v ? 0 : 1, v ? 0 : 1, 1, 0));
myLeftSide.becomeMaster();
myDiffUpdater = new Rediffers(this);
myDiffDividerPolygonsOffset = diffDividerPolygonsOffset;
myData = createDiffPanelState(this);
if (horizontal) {
mySplitter = new DiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent(), new DiffDividerPaint(this, FragmentSide.SIDE1, diffDividerPolygonsOffset), myData);
}
else {
mySplitter = new HorizontalDiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent());
}
myPanel.insertDiffComponent(mySplitter.getComponent(), new MyScrollingPanel());
myDataProvider = new MyGenericDataProvider(this);
myPanel.setDataProvider(myDataProvider);
final ComparisonPolicy comparisonPolicy = getComparisonPolicy();
final ComparisonPolicy defaultComparisonPolicy = DiffManagerImpl.getInstanceEx().getComparisonPolicy();
final HighlightMode highlightMode = getHighlightMode();
final HighlightMode defaultHighlightMode = DiffManagerImpl.getInstanceEx().getHighlightMode();
if (defaultComparisonPolicy != null && comparisonPolicy != defaultComparisonPolicy) {
setComparisonPolicy(defaultComparisonPolicy);
}
if (defaultHighlightMode != null && highlightMode != defaultHighlightMode) {
setHighlightMode(defaultHighlightMode);
}
myVisibleAreaListener = new VisibleAreaListener() {
@Override
public void visibleAreaChanged(VisibleAreaEvent e) {
Editor editor1 = getEditor1();
if (editor1 != null) {
editor1.getComponent().repaint();
}
Editor editor2 = getEditor2();
if (editor2 != null) {
editor2.getComponent().repaint();
}
}
};
registerActions();
}