KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jawe > actions > ZoomOut


1 /*
2  * Authors:
3  * Stefanovic Nenad chupo@iis.ns.ac.yu
4  * Bojanic Sasa sasaboy@neobee.net
5  * Puskas Vladimir vpuskas@eunet.yu
6  * Pilipovic Goran zboniek@uns.ac.yu
7  *
8  */

9
10 package org.enhydra.jawe.actions;
11
12 import org.enhydra.jawe.*;
13 import org.enhydra.jawe.xml.*;
14 import org.enhydra.jawe.xml.elements.*;
15 import org.enhydra.jawe.xml.panels.*;
16 import java.awt.Dimension JavaDoc;
17
18 import java.awt.event.ActionEvent JavaDoc;
19
20 /**
21  * Zoom out (for 15%)
22  */

23 public class ZoomOut extends ActionBase {
24
25    public ZoomOut (ProcessEditor pe) {
26       super(pe);
27    }
28
29    public void actionPerformed(ActionEvent JavaDoc e) {
30       //setResizeAction(null);
31
editor.setScale(editor.getGraph().getScale()/1.15);
32       try {
33          Dimension JavaDoc prefSize=editor.getGraph().getSize();
34          prefSize.width=(int)(prefSize.width/1.15);
35          prefSize.height=(int)(prefSize.height/1.15);
36          editor.getGraph().setPreferredSize(prefSize);
37       } catch (Exception JavaDoc ex) {}
38
39       // With JGraph3.4.1 this causes problems
40
/*if (editor.getGraph().getSelectionCell() != null) {
41          editor.getGraph().scrollCellToVisible(editor.getGraph().getSelectionCell());
42        }*/

43    }
44 }
45
Popular Tags