Package org.eclipse.gef.ui.parts

Examples of org.eclipse.gef.ui.parts.ScrollingGraphicalViewer


    createTrayViewer(trayComposite);
    trayComposite.setTrayControl(trayViewer.getControl());
  }
 
  protected void createTrayViewer(Composite parent) {
    trayViewer = new ScrollingGraphicalViewer();
    trayViewer.createControl(parent);
    final FigureCanvas canvas = (FigureCanvas) trayViewer.getControl();
    canvas.setScrollBarVisibility(FigureCanvas.NEVER);
   
    // We need to modify the viewport layout so that it adjusts the
View Full Code Here


            Composite composite = new Composite(folder, SWT.NONE);
            composite.setLayout(new FillLayout());
            tabItem.setControl(composite);
           
            graphicalViewer = new ScrollingGraphicalViewer();
            graphicalViewer.createControl(composite);
            graphicalViewer.getControl().setBackground(ColorConstants.listBackground);
            graphicalViewer.setRootEditPart(new ScalableRootEditPart());
            IJavaProject javaProject = getJavaProject(projectName);
           
View Full Code Here

* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
public void run(IAction action) {
  int style = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getStyle();
  Shell shell = new Shell((style & SWT.MIRRORED) != 0 ? SWT.RIGHT_TO_LEFT : SWT.NONE);
  GraphicalViewer viewer = new ScrollingGraphicalViewer();
  viewer.createControl(shell);
  viewer.setEditDomain(new DefaultEditDomain(null));
  viewer.setRootEditPart(new ScalableFreeformRootEditPart());
  viewer.setEditPartFactory(new GraphicalPartFactory());
  viewer.setContents(getContents());
  viewer.flush();
 
  int printMode = new PrintModeDialog(shell).open();
  if (printMode == -1)
    return;
  PrintDialog dialog = new PrintDialog(shell, SWT.NULL);
View Full Code Here

  super.commandStackChanged(event);
}

protected void configureGraphicalViewer() {
  super.configureGraphicalViewer();
  ScrollingGraphicalViewer viewer = (ScrollingGraphicalViewer)getGraphicalViewer();

  ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();

  List zoomLevels = new ArrayList(3);
  zoomLevels.add(ZoomManager.FIT_ALL);
  zoomLevels.add(ZoomManager.FIT_WIDTH);
  zoomLevels.add(ZoomManager.FIT_HEIGHT);
  root.getZoomManager().setZoomLevelContributions(zoomLevels);

  IAction zoomIn = new ZoomInAction(root.getZoomManager());
  IAction zoomOut = new ZoomOutAction(root.getZoomManager());
  getActionRegistry().registerAction(zoomIn);
  getActionRegistry().registerAction(zoomOut);
  getSite().getKeyBindingService().registerAction(zoomIn);
  getSite().getKeyBindingService().registerAction(zoomOut);

  viewer.setRootEditPart(root);

  viewer.setEditPartFactory(new GraphicalPartFactory());
  ContextMenuProvider provider = new LogicContextMenuProvider(viewer, getActionRegistry());
  viewer.setContextMenu(provider);
  getSite().registerContextMenu("org.eclipse.gef.examples.logic.editor.contextmenu", //$NON-NLS-1$
      provider, viewer);
  viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer)
      .setParent(getCommonKeyHandler()));
 
  loadProperties();

  // Actions
View Full Code Here

  /**
   * Creates the GraphicalViewer on the specified <code>Composite</code>.
   * @param parent the parent composite
   */
  protected void createGraphicalViewer(Composite parent) {
    GraphicalViewer viewer = new ScrollingGraphicalViewer();
    viewer.createControl(parent);
    getSite().setSelectionProvider(viewer);
    setGraphicalViewer(viewer);
    configureGraphicalViewer();
    initializeGraphicalViewer();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.gef.ui.parts.ScrollingGraphicalViewer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.