1 package cve.osservatori.servizioOACesecSemantic; 2 3 import cve.core.elementEEL.*; 4 5 import cve.osservatori.*; 6 import interactionHandler.*; 7 import interactionGraphics.*; 8 9 import java.awt.*; 10 import java.util.*; 11 12 import javax.swing.text.*; 14 import javax.swing.*; 15 import javax.swing.event.*; 16 17 import org.apache.log4j.Logger; 18 import cve.staticLayout.*; 19 20 32 public class ControllerOACesecSemantic extends Controller { 33 35 private IJCanvas canvas; 37 private OACesecSemantic oac; 39 private IStateEvent currentState; 41 44 private StateInteraction dState; 46 47 50 public ControllerOACesecSemantic(OACesecSemantic oac){ 51 Cve.errLog.debug(""); 52 this.oac=oac; 53 dState = new StateInteraction(this); 55 currentState = dState; 56 } 57 58 61 public void registerCanvas(IJCanvas p){ 62 Cve.errLog.debug(""); 63 canvas = p; 64 } 65 66 69 public void setEventManager(IStateEvent stateEvent){ 70 Cve.errLog.debug(""); 71 currentState = stateEvent; 72 System.out.println(" #O ControllerCanvans: setEventManager "); 73 canvas.setPointClick((boolean)currentState.getInteractionStyle()); 74 } 75 76 79 public IStateEvent getEventManager(){ 80 Cve.errLog.debug(""); 81 return currentState; 82 } 83 84 91 public void clickButtonAlf(String idTipo){ 92 Cve.errLog.debug(""); 93 System.out.println(" #O ControllerCanvans: clickButtonAlf idTipo: " + idTipo); 94 oac.trigger(idTipo); 95 } 96 97 101 public void clickElementCanvas(String idTipo,String idIstanza,boolean selected){ 102 Cve.errLog.debug(""); 103 System.out.println(" #O ControllerCanvans: clickElementCanvas idTipo: " + idTipo + " idIstanza: "+ idIstanza + " selected: " + selected); 104 105 108 oac.inputSelected(idTipo,idIstanza,selected); 110 } 111 112 115 public void setDefault(){ 116 Cve.errLog.debug(""); 117 currentState = dState; 118 } 119 120 126 public void leftClickCanvas( String idTipo,String idIstanza,boolean select){ 127 Cve.errLog.debug(""); 128 System.out.println(" #O ControllerCanvans: leftClickCanvas idTipo: " + idTipo + " idIstanza: "+ idIstanza + " select: " + select); 129 currentState.leftClickCanvas(idTipo, idIstanza,select); 130 } 131 132 138 public void shiftClickCanvas( String idTipo,String idIstanza,boolean select){ 139 Cve.errLog.debug(""); 140 System.out.println(" #O ControllerCanvans: leftClickCanvas idTipo: " + idTipo + " idIstanza: "+ idIstanza + " select: " + select); 141 currentState.shiftClickCanvas(idTipo, idIstanza,select); 142 } 143 144 150 public void altClickCanvas( String idTipo,String idIstanza,boolean select){ 151 Cve.errLog.debug(""); 152 System.out.println(" #O ControllerCanvans: altClickCanvas idTipo: " + idTipo + " idIstanza: "+ idIstanza + " select: " + select); 153 currentState.altClickCanvas(idTipo, idIstanza,select); 154 } 155 156 162 public void rightClickCanvas(String idTipo,String idIstanza,boolean select){ 163 Cve.errLog.debug(""); 164 System.out.println(" #O ControllerCanvans: rightClickCanvas idTipo: " + idTipo + " idIstanza: "+ idIstanza + " select: " + select); 165 currentState.rightClickCanvas(idTipo, idIstanza,select); 166 } 167 168 174 public void selectElement(String idTipo,String idIstanza,boolean select){ 175 Cve.errLog.debug(""); 176 System.out.println(" #O ControllerCanvans: selectElement idTipo: " + idTipo + " idIstanza: "+ idIstanza + " select: " + select); 177 oac.inputSelected(idTipo,idIstanza,select); 178 } 179 180 186 public void queryElement(String idTipo,String idIstanza){ 187 Cve.errLog.debug(""); 188 System.out.println(" #O ControllerCanvans: queryElement idTipo: " + idTipo + " idIstanza: "+ idIstanza); 189 oac.query(idTipo,idIstanza); 190 } 191 192 198 public void configElement(String idTipo,String idIstanza){ 199 Cve.errLog.debug(""); 200 System.out.println(" #O ControllerCanvans: configElement idTipo: " + idTipo + " idIstanza: "+ idIstanza); 201 oac.configElement(idTipo,idIstanza); 202 } 203 204 210 public void setInteractionStyle(boolean interaction){ 211 Cve.errLog.debug(""); 212 System.out.println(" #O ControllerCanvans: setInteractionStyle: " + interaction); 213 canvas.setPointClick(interaction); 214 } 215 216 221 224 private void repaint(){ 225 Cve.errLog.debug(""); 226 canvas.repaint(); 227 } 228 } | Popular Tags |