1 9 10 package org.enhydra.jawe.actions; 11 12 import org.enhydra.jawe.*; 13 14 import java.awt.event.ActionEvent ; 15 16 public class FocusNearestCell extends ActionBase { 17 public static final int FOCUS_UP=0; 18 public static final int FOCUS_DOWN=1; 19 public static final int FOCUS_LEFT=2; 20 public static final int FOCUS_RIGHT=3; 21 22 private int direction=0; 23 24 public FocusNearestCell (AbstractEditor editor,int direction) { 25 super(editor); 26 this.direction=direction; 27 } 28 29 public void actionPerformed(ActionEvent e) { 30 Object cell=editor.getGraph().getSelectionCell(); 32 Object nearestCell=editor.getGraph().getWorkflowManager(). 33 findNearestCell(cell,direction); 34 if (nearestCell!=null) { 35 editor.getGraph().setSelectionCell(nearestCell); 36 } 37 } 38 } 39 | Popular Tags |