use of org.eclipse.gef.editparts.ZoomManager in project knime-core by knime.
the class WorkflowRootEditPart method createToolTipHelper.
/**
* @param underlyingShell underlying shell
*/
public void createToolTipHelper(final Shell underlyingShell) {
// create a tooltip helper for all child figures
ZoomManager zoomManager = (ZoomManager) (getRoot().getViewer().getProperty(ZoomManager.class.toString()));
m_toolTipHelper = new ProgressToolTipHelper(getViewer().getControl(), zoomManager);
getFigure().setProgressToolTipHelper(m_toolTipHelper);
}
use of org.eclipse.gef.editparts.ZoomManager in project knime-core by knime.
the class ConnectionBendpointEditPolicy method getCreateBendpointCommand.
/**
* {@inheritDoc}
*/
protected Command getCreateBendpointCommand(final BendpointRequest req) {
int index = req.getIndex();
Point loc = req.getLocation();
ConnectionContainerEditPart editPart = (ConnectionContainerEditPart) getHost();
ZoomManager zoomManager = (ZoomManager) getHost().getRoot().getViewer().getProperty(ZoomManager.class.toString());
return new NewBendpointCreateCommand(editPart, getWorkflowManager(), index, loc, zoomManager);
}
use of org.eclipse.gef.editparts.ZoomManager in project knime-core by knime.
the class ConnectionBendpointEditPolicy method getMoveBendpointCommand.
/**
* {@inheritDoc}
*/
protected Command getMoveBendpointCommand(final BendpointRequest request) {
// index of the bendpoint to move
int index = request.getIndex();
Point loc = request.getLocation();
ConnectionContainerEditPart edit = (ConnectionContainerEditPart) getHost();
ZoomManager zoomManager = (ZoomManager) getHost().getRoot().getViewer().getProperty(ZoomManager.class.toString());
WorkflowManager m = getWorkflowManager();
return new NewBendpointMoveCommand(edit, m, index, loc, zoomManager);
}
use of org.eclipse.gef.editparts.ZoomManager in project knime-core by knime.
the class SnapIconToGrid method getIconOffset.
private Point getIconOffset(final NodeContainerFigure nodeFigure) {
Point iconOffset = getGridRefPointOffset(nodeFigure);
double zoomFactor = ((ZoomManager) (m_container.getViewer().getProperty(ZoomManager.class.toString()))).getZoom();
iconOffset = iconOffset.getScaled(zoomFactor);
return iconOffset;
}
use of org.eclipse.gef.editparts.ZoomManager in project yamcs-studio by yamcs.
the class OPIEditor method getDisplayCenterPosition.
/**
* Returns the Point, which is the center of the Display.
*
* @return Point The Point, which is the center of the Display
*/
public Point getDisplayCenterPosition() {
ScalableFreeformRootEditPart root = (ScalableFreeformRootEditPart) getGraphicalViewer().getRootEditPart();
ZoomManager m = root.getZoomManager();
Point center = m.getViewport().getBounds().getCenter();
Rectangle x = new Rectangle(center.x, center.y, 10, 10);
x.translate(m.getViewport().getViewLocation());
m.getScalableFigure().translateFromParent(x);
Point result = x.getLocation();
return result;
}
Aggregations