コード例 #1
0
  /* (non-Javadoc)
   * @see com.geopista.style.sld.controller.Action#doExecute(com.geopista.style.sld.controller.Request)
   */
  public ActionForward doExecute(Request request) {

    /*Recuperamos las instancias del FrontController y de la Session*/
    FrontController frontController = FrontControllerImpl.getInstance();
    Session session = SessionImpl.getInstance();
    String styleName = (String) request.getAttribute("StyleName");
    session.setAttribute("StyleName", styleName);
    String symbolizerType = (String) request.getAttribute("SymbolizerType");
    List inserts = (List) session.getAttribute("Insert");
    inserts.add(2, new Integer(1));
    session.setAttribute("Insert", inserts);
    session.setAttribute("SymbolizerType", symbolizerType);
    /*Actualizamos el parámetro PagesVisited en la Session*/
    List pagesVisited = (List) session.getAttribute("PagesVisited");
    pagesVisited.add("InsertUpdateCustomStyle");
    session.setAttribute("PagesVisited", pagesVisited);
    /*Redirigimos a otra acción del controlador*/
    Action action = frontController.getAction("GetFeatureAttributes");
    Request newRequest = FrontControllerFactory.createRequest();
    String layerName = (String) session.getAttribute("LayerName");
    newRequest.setAttribute("LayerName", layerName);
    action.doExecute(newRequest);
    ActionForward forward = null;
    if ((symbolizerType.toLowerCase()).equals("point")) {
      forward = frontController.getForward("InsertUpdateThematicPointRule");
    } else if ((symbolizerType.toLowerCase()).equals("line")) {
      forward = frontController.getForward("InsertUpdateThematicLineRule");
    } else if ((symbolizerType.toLowerCase()).equals("polygon")) {
      forward = frontController.getForward("InsertUpdateThematicPolygonRule");
    } else if ((symbolizerType.toLowerCase()).equals("text")) {
      forward = frontController.getForward("InsertUpdateThematicTextRule");
    }
    return forward;
  }
コード例 #2
0
 public boolean windowClosing() {
   Request theRequest = FrontControllerFactory.createRequest();
   FrontController fc = FrontControllerFactory.getFrontController();
   Action theAction = fc.getAction("GetBack");
   ActionForward theActionForward = theAction.doExecute(theRequest);
   _container.forward(theActionForward, theRequest);
   return false;
 }
コード例 #3
0
 private void cancelBtnActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_cancelBtnActionPerformed
   Request theRequest = FrontControllerFactory.createRequest();
   FrontController fc = FrontControllerFactory.getFrontController();
   Action theAction = fc.getAction("GetBack");
   ActionForward theActionForward = theAction.doExecute(theRequest);
   _container.forward(theActionForward, theRequest);
 } // GEN-LAST:event_cancelBtnActionPerformed
コード例 #4
0
 private void okBtnActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_okBtnActionPerformed
   if (importar.equals("true") && !new File(fileTxt.getText()).exists())
     JOptionPane.showMessageDialog(null, aplicacion.getI18nString("SLDStyle.FicheroNoExiste"));
   else {
     Request theRequest = FrontControllerFactory.createRequest();
     theRequest.setAttribute("FileExport", fileTxt.getText());
     theRequest.setAttribute("selectedStyles", selectedStyles);
     theRequest.setAttribute("SLDStyle", sldStyle);
     theRequest.setAttribute("Layer", layer);
     theRequest.setAttribute("LayerName", layerName);
     FrontController fc = FrontControllerFactory.getFrontController();
     Action theAction;
     if (importar.equals("true")) theAction = fc.getAction("ImportCustomUserStyle");
     else theAction = fc.getAction("ExportCustomUserStyle");
     ActionForward theActionForward = theAction.doExecute(theRequest);
     _container.forward(theActionForward, theRequest);
   }
 } // GEN-LAST:event_okBtnActionPerformed