1 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 ; 17 18 import java.awt.event.ActionEvent ; 19 20 23 public class ActualSize extends ActionBase { 24 25 public ActualSize (ProcessEditor pe) { 26 super(pe); 27 } 28 29 public void actionPerformed(ActionEvent e) { 30 double curScale=editor.getGraph().getScale(); 31 try { 32 Dimension prefSize=editor.getGraph().getSize(); 33 prefSize.width=(int)(prefSize.width/curScale); 34 prefSize.height=(int)(prefSize.height/curScale); 35 editor.getGraph().setPreferredSize(prefSize); 36 editor.getGraph().setPreferredSize(editor.getGraph().getWorkflowManager().getGraphsPreferredSize()); 37 } catch (Exception ex) {} 39 editor.setScale(1); 40 if (editor.getGraph().getSelectionCell() != null) { 41 editor.getGraph().scrollCellToVisible(editor.getGraph().getSelectionCell()); 42 } 43 44 } 45 } 46 | Popular Tags |