public class RulerComposite extends Composite
graphical
viewer
. The rulers will be shown based on whether or not
horizontal ruler
and
vertical
ruler
properties are set on the given viewer, and the value of the
visibility
property.Constructor and Description |
---|
RulerComposite(Composite parent,
int style)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static Rectangle |
calculateEditorTrim(Canvas canvas)
Calculates the proper trim.
|
static Rectangle |
calculateRulerTrim(Canvas canvas)
Calculates the proper trim for the ruler.
|
void |
doLayout()
Perform the ruler layout.
|
protected FigureCanvas |
getEditor()
Retrieve the editor figure canvas.
|
protected GraphicalViewer |
getLeft()
Retrieve the left ruler graphical viewer.
|
protected GraphicalViewer |
getTop()
Retrieve the top ruler graphical viewer.
|
void |
layout(boolean change) |
void |
setGraphicalViewer(ScrollingGraphicalViewer primaryViewer)
Creates rulers for the given graphical viewer.
|
changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
public RulerComposite(Composite parent, int style)
parent
- a widget which will be the parent of the new instance (cannot
be null)style
- the style of widget to constructComposite.Composite(org.eclipse.swt.widgets.Composite, int)
public static Rectangle calculateEditorTrim(Canvas canvas)
canvas
- The canvas.public static Rectangle calculateRulerTrim(Canvas canvas)
canvas
- The canvas.public void doLayout()
public void layout(boolean change)
layout
in class Composite
Composite.layout(boolean)
public void setGraphicalViewer(ScrollingGraphicalViewer primaryViewer)
The primaryViewer or its Control cannot be null
. The
primaryViewer's Control should be a FigureCanvas and a child of this
Composite. This method should only be invoked once.
To create ruler(s), simply add the RulerProvider(s) (with the right key: RulerProvider.PROPERTY_HORIZONTAL_RULER or RulerProvider.PROPERTY_VERTICAL_RULER) as a property on the given viewer. It can be done after this method is invoked. RulerProvider.PROPERTY_RULER_VISIBILITY can be used to show/hide the rulers.
primaryViewer
- The graphical viewer for which the rulers have to be createdprotected GraphicalViewer getLeft()
protected GraphicalViewer getTop()
protected FigureCanvas getEditor()
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.