1 package cve.osservatori.servizioOACesec; 2 3 import cve.osservatori.*; 4 import interactionHandler.*; 5 import interactionGraphics.*; 6 7 import cve.core.elementEEL.*; 9 import cve.osservatori.*; 10 11 import java.awt.*; 12 import java.util.*; 13 import javax.swing.text.*; 15 import javax.swing.*; 16 import javax.swing.event.*; 17 18 import cve.staticLayout.*; 19 import org.apache.log4j.Logger; 20 21 33 public class ControllerOACesec extends Controller { 34 36 private IJCanvas canvas; 38 private OACesec oac; 40 private IStateEvent currentState; 42 private StateInteraction dState; 44 45 48 public ControllerOACesec(OACesec oac){ 49 Cve.errLog.debug(""); 50 this.oac=oac; 51 dState = new StateInteraction(this); 52 currentState = dState; 53 } 54 55 58 public void registerCanvas(IJCanvas p){ 59 Cve.errLog.debug(""); 60 canvas = p; 61 } 62 63 66 public void setEventManager(IStateEvent stateEvent){ 67 Cve.errLog.debug(""); 68 currentState = stateEvent; 69 System.out.println(" #O ControllerCanvans: setEventManager "); 70 canvas.setPointClick((boolean)currentState.getInteractionStyle()); 71 } 72 73 76 public IStateEvent getEventManager(){ 77 Cve.errLog.debug(""); 78 return currentState; 79 } 80 81 88 public void clickButtonAlf(String idTipo){ 89 Cve.errLog.debug(""); 90 System.out.println(" #O ControllerCanvans: clickButtonAlf idTipo: " + idTipo); 91 oac.trigger(idTipo); 92 } 93 94 98 public void clickElementCanvas(String idTipo,String idIstanza,boolean selected){ 99 Cve.errLog.debug(""); 100 System.out.println(" #O ControllerCanvans: clickElementCanvas idTipo: " + idTipo + " idIstanza: "+ idIstanza + " selected: " + selected); 101 102 105 oac.inputSelected(idTipo,idIstanza,selected); 107 } 108 109 112 public void setDefault(){ 113 Cve.errLog.debug(""); 114 currentState = dState; 115 } 116 117 123 public void leftClickCanvas( String idTipo,String idIstanza,boolean select){ 124 System.out.println(" #O ControllerCanvans: leftClickCanvas idTipo: " + idTipo + " idIstanza: "+ idIstanza + " select: " + select); 125 currentState.leftClickCanvas(idTipo, idIstanza,select); 126 } 127 128 134 public void shiftClickCanvas( String idTipo,String idIstanza,boolean select){ 135 Cve.errLog.debug(""); 136 System.out.println(" #O ControllerCanvans: leftClickCanvas idTipo: " + idTipo + " idIstanza: "+ idIstanza + " select: " + select); 137 currentState.shiftClickCanvas(idTipo, idIstanza,select); 138 } 139 140 146 public void altClickCanvas( String idTipo,String idIstanza,boolean select){ 147 Cve.errLog.debug(""); 148 System.out.println(" #O ControllerCanvans: altClickCanvas idTipo: " + idTipo + " idIstanza: "+ idIstanza + " select: " + select); 149 currentState.altClickCanvas(idTipo, idIstanza,select); 150 } 151 152 158 public void rightClickCanvas(String idTipo,String idIstanza,boolean select){ 159 Cve.errLog.debug(""); 160 System.out.println(" #O ControllerCanvans: rightClickCanvas idTipo: " + idTipo + " idIstanza: "+ idIstanza + " select: " + select); 161 currentState.rightClickCanvas(idTipo, idIstanza,select); 162 } 163 164 170 public void selectElement(String idTipo,String idIstanza,boolean select){ 171 Cve.errLog.debug(""); 172 System.out.println(" #O ControllerCanvans: selectElement idTipo: " + idTipo + " idIstanza: "+ idIstanza + " select: " + select); 173 oac.inputSelected(idTipo,idIstanza,select); 174 } 175 176 182 public void queryElement(String idTipo,String idIstanza){ 183 Cve.errLog.debug(""); 184 System.out.println(" #O ControllerCanvans: queryElement idTipo: " + idTipo + " idIstanza: "+ idIstanza); 185 oac.query(idTipo,idIstanza); 186 } 187 188 194 public void configElement(String idTipo,String idIstanza){ 195 Cve.errLog.debug(""); 196 System.out.println(" #O ControllerCanvans: configElement idTipo: " + idTipo + " idIstanza: "+ idIstanza); 197 } 199 200 206 public void setInteractionStyle(boolean interaction){ 207 Cve.errLog.debug(""); 208 System.out.println(" #O ControllerCanvans: setInteractionStyle: " + interaction); 209 canvas.setPointClick(interaction); 210 } 211 212 215 private void repaint(){ 216 Cve.errLog.debug(""); 217 canvas.repaint(); 218 } 219 } | Popular Tags |