sysperfana/memspyext/com.nokia.s60tools.swmtanalyser/src/com/nokia/s60tools/swmtanalyser/ui/graphs/ZoomableGraph.java
author Jussi Ryoma <ext-jussi.s.ryoma@nokia.com>
Tue, 24 Aug 2010 14:01:48 +0300
changeset 16 72f198be1c1d
parent 7 8e12a575a9b5
permissions -rw-r--r--
Crash Analyser Carbide Extension 1.4.0

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/


package com.nokia.s60tools.swmtanalyser.ui.graphs;

import org.eclipse.jface.action.IAction;

/**
 * Common abstract base class for graphs that support zoom operations.
 */
public abstract class ZoomableGraph {
	
	
	/**
	 * Context menu title for action: Zoom In
	 */
	protected static final String ZOOM_IN_CONTEXT_MENU_TITLE = "Zoom In";

	/**
	 * Context menu title for action: Zoom Out
	 */
	protected static final String ZOOM_OUT_CONTEXT_MENU_TITLE = "Zoom Out";

	/**
	 * Copy -action
	 */
	protected IAction copy;
	
	
	/**
	 * Zoom In -action
	 */
	protected IAction zoomIn;

	/**
	 * Zoom Out -action
	 */
	protected IAction zoomOut;
	
	/**
	 * This method zooms in the graph area.
	 */
	protected abstract void zoomIn();
	
	/**
	 * This method zooms out the graph area.
	 */
	protected abstract void zoomOut();

	/**
	 * Sets given enable state for an action if it is non <code>null</code>.
	 * @param action Action to set enable status for.
	 * @param enableStatus <code>true</code> if enabled, otherwise <code>false</code>.
	 */
	protected void setEnableState(IAction action, boolean enableStatus) {
		if(action != null){
			action.setEnabled(enableStatus);			
		}
	}
}