01: /*
02: * The contents of this file are subject to the terms of the Common
03: * Development
04: The contents of this file are subject to the terms of either the GNU
05: General Public License Version 2 only ("GPL") or the Common
06: Development and Distribution License("CDDL") (collectively, the
07: "License"). You may not use this file except in compliance with the
08: License. You can obtain a copy of the License at
09: http://www.netbeans.org/cddl-gplv2.html
10: or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
11: specific language governing permissions and limitations under the
12: License. When distributing the software, include this License Header
13: Notice in each file and include the License file at
14: nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
15: particular file as subject to the "Classpath" exception as provided
16: by Sun in the GPL Version 2 section of the License file that
17: accompanied this code. If applicable, add the following below the
18: License Header, with the fields enclosed by brackets [] replaced by
19: your own identifying information:
20: "Portions Copyrighted [year] [name of copyright owner]"
21:
22: Contributor(s):
23: *
24: * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
25:
26: If you wish your version of this file to be governed by only the CDDL
27: or only the GPL Version 2, indicate your decision by adding
28: "[Contributor] elects to include this software in this distribution
29: under the [CDDL or GPL Version 2] license." If you do not indicate a
30: single choice of license, a recipient has the option to distribute
31: your version of this file under either the CDDL, the GPL Version 2 or
32: to extend the choice of license to its licensees as provided above.
33: However, if you add GPL Version 2 code and therefore, elected the GPL
34: Version 2 license, then the option applies only if the new code is
35: made subject to such option by the copyright holder.
36: *
37: */
38: package org.netbeans.modules.sql.framework.ui.graph.actions;
39:
40: import java.awt.event.ActionEvent;
41: import java.awt.event.InputEvent;
42: import java.net.URL;
43: import javax.swing.Action;
44: import javax.swing.ImageIcon;
45: import javax.swing.KeyStroke;
46: import net.java.hulp.i18n.Logger;
47: import org.netbeans.modules.etl.logger.Localizer;
48: import org.netbeans.modules.etl.logger.LogUtil;
49: import org.netbeans.modules.etl.ui.DataObjectProvider;
50:
51: import org.netbeans.modules.etl.ui.view.ETLCollaborationTopPanel;
52:
53: /**
54: *
55: * @author karthikeyan s
56: */
57: public class ZoomInAction extends GraphAction {
58:
59: private static final URL zoomInImgUrl = ZoomInAction.class
60: .getResource("/org/netbeans/modules/sql/framework/ui/resources/images/zoom_in_edm.png");
61: private static transient final Logger mLogger = LogUtil
62: .getLogger(ZoomInAction.class.getName());
63: private static transient final Localizer mLoc = Localizer.get();
64:
65: public ZoomInAction() {
66: //action name
67: String nbBundle = mLoc.t("PRSR001: Zoom In...");
68: this .putValue(Action.NAME, Localizer.parse(nbBundle));
69:
70: //action icon
71: this .putValue(Action.SMALL_ICON, new ImageIcon(zoomInImgUrl));
72:
73: //action tooltip
74: String nbBundle1 = mLoc.t("PRSR001: Zoom In (Cntl-Q)");
75: this .putValue(Action.SHORT_DESCRIPTION, Localizer
76: .parse(nbBundle1));
77: // Acceleratot Cntl-Q
78: this .putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(
79: 'Q', InputEvent.CTRL_MASK));
80: }
81:
82: public void actionPerformed(ActionEvent e) {
83: ETLCollaborationTopPanel etlEditor = null;
84: try {
85: etlEditor = DataObjectProvider.getProvider()
86: .getActiveDataObject().getETLEditorTopPanel();
87: } catch (Exception ex) {
88: // ignore
89: }
90: if (etlEditor != null) {
91: etlEditor.setZoomFactor(etlEditor.getZoomFactor() * 1.1);
92: }
93: }
94: }
|