01: /*
02: * Copyright 2006 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
07: * BI Platform. The Initial Developer is Pentaho Corporation.
08: *
09: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11: * the license for the specific language governing your rights and limitations.
12: *
13: * @created Feb 01, 2006
14: * @author Michael D'Amour
15: */
16: package org.pentaho.jfreereport.wizard.ui;
17:
18: import org.eclipse.swt.events.MouseEvent;
19: import org.eclipse.swt.widgets.Composite;
20: import org.pentaho.jfreereport.wizard.ReportWizard;
21: import org.pentaho.jfreereport.wizard.ui.swt.SWTImageMap;
22:
23: public class NavigationPanel extends SWTImageMap {
24: ReportWizard reportWizard;
25:
26: /**
27: *
28: */
29: public NavigationPanel(Composite parent, int style,
30: ReportWizard wizard) {
31: super (parent, style, "NavigationPanel.properties"); //$NON-NLS-1$
32: reportWizard = wizard;
33: }
34:
35: /*
36: * (non-Javadoc)
37: *
38: * @see org.eclipse.swt.events.MouseListener#mouseUp(org.eclipse.swt.events.MouseEvent)
39: */
40: public void mouseUp(MouseEvent e) {
41: switch (getHotspotIndex(e.x, e.y)) {
42: case 0: {
43: reportWizard.handleTabSelection(ReportWizard.TAB_TEMPLATE,
44: true);
45: break;
46: }
47: case 1: {
48: reportWizard.handleTabSelection(ReportWizard.TAB_QUERY,
49: true);
50: break;
51: }
52: case 2: {
53: reportWizard.handleTabSelection(ReportWizard.TAB_LAYOUT,
54: true);
55: break;
56: }
57: case 3: {
58: reportWizard.handleTabSelection(ReportWizard.TAB_FORMAT,
59: true);
60: break;
61: }
62: case 4: {
63: reportWizard
64: .handleTabSelection(ReportWizard.TAB_PAGE, true);
65: break;
66: }
67: case 5: {
68: reportWizard.handleTabSelection(ReportWizard.TAB_REPORT,
69: true);
70: break;
71: }
72: }
73: }
74: }
|