## org.eclipse.emf.compare.ui.viewer.content.part
Class AbstractCenterPart

    java.lang.Object
      org.eclipse.swt.widgets.Widget
          org.eclipse.swt.widgets.Control
              org.eclipse.swt.widgets.Scrollable
                  org.eclipse.swt.widgets.Composite
                      org.eclipse.swt.widgets.Canvas
                          org.eclipse.emf.compare.ui.viewer.content.part.AbstractCenterPart

All Implemented Interfaces:
  org.eclipse.swt.graphics.Drawable

    public abstract class AbstractCenterPart

extends org.eclipse.swt.widgets.Canvas

We want to avoid flickering as much as possible for our draw operations on the center part, yet we can't use double buffering to draw on it. We will then draw on a `Canvas` moved above that center part.

Field Summary
`protected org.eclipse.swt.graphics.Image` `buffer` Buffer used by this `Canvas` to smoothly paint its content.

Fields inherited from class org.eclipse.swt.widgets.Composite
`embeddedHandle`

Fields inherited from class org.eclipse.swt.widgets.Widget
`handle`

Constructor Summary
`AbstractCenterPart(org.eclipse.swt.widgets.Composite parent)` Default constructor, instantiates the canvas given its parent.

Method Summary
`void` `dispose()`
`abstract void` `doPaint(org.eclipse.swt.graphics.GC gc)` Clients should implement this method for the actual drawing.
`protected void` `drawLine(org.eclipse.swt.graphics.GC gc, ModelContentMergeTabItem leftItem, ModelContentMergeTabItem rightItem)` Draws a line connecting the given right and left items.
`protected java.util.List<DiffElement>` `retainVisibleDiffs(java.util.List<ModelContentMergeTabItem> leftVisible, java.util.List<ModelContentMergeTabItem> rightVisible)` This will retain the visible differences in the given list.

Methods inherited from class org.eclipse.swt.widgets.Canvas
`drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME`

Methods inherited from class org.eclipse.swt.widgets.Composite
`changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList`

Methods inherited from class org.eclipse.swt.widgets.Scrollable
`computeTrim, getBorderWidth, getHorizontalBar, getVerticalBar`

Methods inherited from class org.eclipse.swt.widgets.Control

`addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update`

Methods inherited from class org.eclipse.swt.widgets.Widget
`addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### buffer

    protected org.eclipse.swt.graphics.Image buffer

  Buffer used by this `Canvas` to smoothly paint its content.

Constructor Detail

### AbstractCenterPart

    public AbstractCenterPart(org.eclipse.swt.widgets.Composite parent)

  Default constructor, instantiates the canvas given its parent.

  Parameters:
    `parent` - Parent of the canvas.

Method Detail

### dispose

    public void dispose()

  Overrides:
    `dispose` in class `org.eclipse.swt.widgets.Widget`
  See Also:
    `Widget.dispose()`

### doPaint

    public abstract void doPaint(org.eclipse.swt.graphics.GC gc)

  Clients should implement this method for the actual drawing.

  Parameters:
    `gc` - `GC` used for the painting.

### drawLine

    protected void drawLine(org.eclipse.swt.graphics.GC gc,
                            ModelContentMergeTabItem leftItem,
                            ModelContentMergeTabItem rightItem)

  Draws a line connecting the given right and left items.

  Parameters:
    `gc` - `graphics configuration` on which to actually draw.
    `leftItem` - Left of the two items to connect.
    `rightItem` - Right of the items to connect.

### retainVisibleDiffs

    protected java.util.List<DiffElement> retainVisibleDiffs(java.util.List<ModelContentMergeTabItem> leftVisible,
                                                             java.util.List<ModelContentMergeTabItem> rightVisible)

  This will retain the visible differences in the given list.

  Parameters:
    `leftVisible` - Items visible on the left part.
    `rightVisible` - Items visible on the right part.
  Returns:
    Filtered list of DiffElements.

Copyright 2006 IBM Corporation and others. All Rights Reserved.