Class PiccoloViewerUI
java.lang.Object
de.cau.cs.kieler.klighd.viewers.AbstractViewer
de.cau.cs.kieler.klighd.piccolo.viewer.PiccoloViewer
de.cau.cs.kieler.klighd.ui.viewers.PiccoloViewerUI
- All Implemented Interfaces:
IDiagramOutlinePage.Provider,ILayoutRecorder,IViewer
UI stuff such as the text input mechanism and registry of actions are extracted from the
PiccoloViewer to this class to optimize dependencies. PiccoloViewerUi instance will be generated
by the PiccoloViewerProvider.
- Author:
- chsch, ckru
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSWT eventListenerimplementation that is dedicated to the creation and propagation ofKlighdTextSelectionsafter corresponding mouse and key events notified to the employed label text widget.
Note: This class may be subclassed.static classThe required corresponding provider class. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPiccoloViewerUI(ContextViewer parentViewer, org.eclipse.swt.widgets.Composite parent) Creates a Piccolo2D viewer with default style.PiccoloViewerUI(ContextViewer parentViewer, org.eclipse.swt.widgets.Composite parent, int style) Creates a Piccolo2D viewer with given style. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddLabelTextWidget(ContextViewer parentViewer) Adds a text widget to the viewer that can be used to select and edit texts.protected voidattachLabelTextWidgetEventListener(org.eclipse.swt.custom.StyledText textLabelWidget) Extension hook method registering an SWT eventListeneron the employedtextLabelWidget.protected PiccoloOutlinePageprotected org.eclipse.swt.custom.StyledTextGetter providing the employedStyledTextSWT widget, e.g.protected voidupdateSelection(IKlighdSelection selection) Asynchronously executes the super method#updateSelection(IKlighdSelection)in order to let the calling method terminate quickly and do not block any display modifications.Methods inherited from class de.cau.cs.kieler.klighd.piccolo.viewer.PiccoloViewer
centerOn, clip, clip, collapse, expand, getClip, getContextViewer, getControl, getDiagramOutlinePage, getRepresentation, getScale, getViewContext, getZoomLevel, hide, installEventHanders, installToolTip, isDisplayed, isExpanded, isMagnificationLensVisible, isVisible, notifyViewChangeListeners, panDiagramToTopLeftCorner, panToTopLeftCorner, reveal, scale, setModel, show, startRecording, stopRecording, stopRecording, stopRecording, toggleExpansion, zoom, zoomToFocus, zoomToLevelMethods inherited from class de.cau.cs.kieler.klighd.viewers.AbstractViewer
addViewChangeListener, addViewChangeListener, centerOn, clip, clip, collapse, expand, getDiagramSelection, getScale, getSelection, getViewChangeListeners, getVisibleDiagramElements, getVisibleDiagramNodes, hide, isDisplayed, isExpanded, isVisible, notifyViewChangeListeners, panToTopLeftCorner, removeViewChangeListener, resetSelectionTo, resetSelectionTo, resetSelectionTo, resetSelectionToDiagramElements, resetSelectionToSemanticElements, reveal, scale, setModel, setModel, show, toggleExpansion, toggleSelectionOf, toggleSelectionOf, toggleSelectionOf, toggleSelectionOfDiagramElements, toggleSelectionOfSemanticElements, zoomToFocusMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.cau.cs.kieler.klighd.IViewer
addViewChangedListener, removeViewChangedEventListener
-
Field Details
-
ID
The identifier of this viewer type as specified in the extension.- See Also:
-
-
Constructor Details
-
PiccoloViewerUI
Creates a Piccolo2D viewer with default style.- Parameters:
parentViewer- the parentContextViewerparent- the parent composite
-
PiccoloViewerUI
public PiccoloViewerUI(ContextViewer parentViewer, org.eclipse.swt.widgets.Composite parent, int style) Creates a Piccolo2D viewer with given style.- Parameters:
parentViewer- the parentContextViewerparent- the parent compositestyle- the style attributes
-
-
Method Details
-
getLabelTextWidget
protected org.eclipse.swt.custom.StyledText getLabelTextWidget()Getter providing the employedStyledTextSWT widget, e.g. for installing additional eventListeners.- Returns:
- the employed
StyledTextwidget.
-
addLabelTextWidget
Adds a text widget to the viewer that can be used to select and edit texts.- Parameters:
parentViewer- the viewer to which to add the text widget
-
attachLabelTextWidgetEventListener
protected void attachLabelTextWidgetEventListener(org.eclipse.swt.custom.StyledText textLabelWidget) Extension hook method registering an SWT eventListeneron the employedtextLabelWidget.- Parameters:
textLabelWidget- the employed instance ofStyledText
-
updateSelection
Asynchronously executes the super method#updateSelection(IKlighdSelection)in order to let the calling method terminate quickly and do not block any display modifications.- Overrides:
updateSelectionin classAbstractViewer- Parameters:
selection- the newIKlighdSelectionto be propagated to the selection service.
-
createDiagramOutlinePage
- Overrides:
createDiagramOutlinePagein classPiccoloViewer
-