Package org.eclipse.gef.editparts

Examples of org.eclipse.gef.editparts.ZoomManager


    viewLocation = getFigureCanvas().getViewport().getViewLocation();

    ret.x += viewLocation.x;
    ret.y += viewLocation.y;
   
    final ZoomManager zoomManager = getZoomManager();

    if( zoomManager != null )
    {
      ret = ret.getScaled( 1 / zoomManager.getZoom() );
    }

    return ret;
  }
View Full Code Here


    if (parentFigure.getLayoutManager() instanceof SapphireSequenceLayout)
    {
      SapphireSequenceLayout sequenceLayout = (SapphireSequenceLayout)parentFigure.getLayoutManager();
      SapphireSequenceLayoutConstraint constraint = (SapphireSequenceLayoutConstraint)sequenceLayout.getConstraint(textFigure);
      CellEditor.LayoutData layoutData = getCellEditor().getLayoutData();
      ZoomManager zoomMgr = (ZoomManager) this.diagramEditor.getGraphicalViewer()
          .getProperty(ZoomManager.class.toString());
      constraint.minWidth = (int)(layoutData.minimumWidth / zoomMgr.getZoom());
    }   
  }
View Full Code Here

        text.setText(initValue);
        internalCommit();
      }
    }
    this.diagramEditor.setDirectEditingActive(false);
    ZoomManager zoomMgr = (ZoomManager) this.diagramEditor.getGraphicalViewer()
        .getProperty(ZoomManager.class.toString());
    if (zoomMgr != null)
      zoomMgr.removeZoomListener(zoomListener);
    if (actionHandler != null) {
      actionHandler.dispose();
      actionHandler = null;
    }
    if (actionBars != null) {
View Full Code Here

    // Shenxue: set text to "" doesn't work since it messes the size calculation in parent's
    // layout manager. It'd shrink the label figure size to 0. Use figure's visibility instead.
    //label.setText("");
    label.setVisible(false);
    // update font
    ZoomManager zoomMgr = (ZoomManager) getEditPart().getViewer()
        .getProperty(ZoomManager.class.toString());
    if (zoomMgr != null) {
      // this will force the font to be set
      cachedZoom = -1.0;
      updateScaledFont(zoomMgr.getZoom());
      zoomMgr.addZoomListener(zoomListener);
    } else
      getCellEditor().getControl().setFont(label.getFont());

    // Hook the cell editor's copy/paste actions to the actionBars so that
    // they can
View Full Code Here

    /**
     * Loads Rete model and initializes zoom manager.
     */
    protected void initializeGraphicalViewer() {
        ZoomManager zoomManager = rootEditPart.getZoomManager();

        //List<String>
        List zoomLevels = new ArrayList( 3 );

        zoomLevels.add( ZoomManager.FIT_ALL );
        zoomLevels.add( ZoomManager.FIT_HEIGHT );
        zoomLevels.add( ZoomManager.FIT_WIDTH );

        zoomManager.setZoomLevelContributions( zoomLevels );

        // Zoom mousewheel - Ctrl+Mousewheel for zoom in/out
        getGraphicalViewer().setProperty( MouseWheelHandler.KeyGenerator.getKey( SWT.MOD1 ),
                                          MouseWheelZoomHandler.SINGLETON );

View Full Code Here

  // We keep grid visibility and enablement in sync
  getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE,
      new Boolean(getLogicDiagram().isGridEnabled()));
 
  // Zoom
  ZoomManager manager = (ZoomManager)getGraphicalViewer()
      .getProperty(ZoomManager.class.toString());
  if (manager != null)
    manager.setZoom(getLogicDiagram().getZoom());
  // Scroll-wheel Zoom
  getGraphicalViewer().setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1),
      MouseWheelZoomHandler.SINGLETON);

}
View Full Code Here

      .getProperty(RulerProvider.PROPERTY_RULER_VISIBILITY)).booleanValue());
  getLogicDiagram().setGridEnabled(((Boolean)getGraphicalViewer()
      .getProperty(SnapToGrid.PROPERTY_GRID_ENABLED)).booleanValue());
  getLogicDiagram().setSnapToGeometry(((Boolean)getGraphicalViewer()
      .getProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED)).booleanValue());
  ZoomManager manager = (ZoomManager)getGraphicalViewer()
      .getProperty(ZoomManager.class.toString());
  if (manager != null)
    getLogicDiagram().setZoom(manager.getZoom());
}
View Full Code Here

/**
* @see org.eclipse.gef.tools.DirectEditManager#bringDown()
*/
protected void bringDown() {
  ZoomManager zoomMgr = (ZoomManager)getEditPart().getViewer()
      .getProperty(ZoomManager.class.toString());
  if (zoomMgr != null)
    zoomMgr.removeZoomListener(zoomListener);

  if (actionHandler != null) {
    actionHandler.dispose();
    actionHandler = null;
  }
View Full Code Here

protected void initCellEditor() {
  // update text
  StickyNoteFigure stickyNote = (StickyNoteFigure)getEditPart().getFigure();
  getCellEditor().setValue(stickyNote.getText());
  // update font
  ZoomManager zoomMgr = (ZoomManager)getEditPart().getViewer()
      .getProperty(ZoomManager.class.toString());
  if (zoomMgr != null) {
    // this will force the font to be set
    cachedZoom = -1.0;
    updateScaledFont(zoomMgr.getZoom());
    zoomMgr.addZoomListener(zoomListener);
  } else
    getCellEditor().getControl().setFont(stickyNote.getFont());

  // Hook the cell editor's copy/paste actions to the actionBars so that they can
  // be invoked via keyboard shortcuts.
View Full Code Here

    /**
     * Loads Rete model and initializes zoom manager.
     */
    protected void initializeGraphicalViewer() {
        ZoomManager zoomManager = rootEditPart.getZoomManager();

        //List<String>
        List<String> zoomLevels = new ArrayList<String>(3);

        zoomLevels.add( ZoomManager.FIT_ALL );
        zoomLevels.add( ZoomManager.FIT_HEIGHT );
        zoomLevels.add( ZoomManager.FIT_WIDTH );

        zoomManager.setZoomLevelContributions( zoomLevels );

        // Zoom mousewheel - Ctrl+Mousewheel for zoom in/out
        getGraphicalViewer().setProperty( MouseWheelHandler.KeyGenerator.getKey( SWT.MOD1 ),
                                          MouseWheelZoomHandler.SINGLETON );

View Full Code Here

TOP

Related Classes of org.eclipse.gef.editparts.ZoomManager

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.