当前位置: 首页>>代码示例>>Java>>正文


Java DiffDividerPaint类代码示例

本文整理汇总了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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:DiffSplitter.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:DiffDivider.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:DiffSplitter.java

示例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);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:DiffDivider.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:63,代码来源:DiffPanelImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:MergePanel2.java

示例7: getPaint

import com.intellij.openapi.diff.impl.splitter.DiffDividerPaint; //导入依赖的package包/类
public DiffDividerPaint getPaint() {
  return myPaint;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:DiffDivider.java

示例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();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:57,代码来源:DiffPanelImpl.java

示例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();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:58,代码来源:DiffPanelImpl.java


注:本文中的com.intellij.openapi.diff.impl.splitter.DiffDividerPaint类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。