Examples of GridState


Examples of com.sencha.gxt.state.client.GridStateHandler.GridState

  @SuppressWarnings({"rawtypes", "unchecked"})
  @Override
  public void applyState() {
    if (getObject().isStateful()) {
      GridState state = getState();
      Set<String> hidden = state.getHidden();
      if (hidden != null) {
        for (String path : hidden) {
          ColumnConfig<M, ?> column = getObject().getColumnModel().findColumnConfig(path);
          if (column != null) {
            column.setHidden(true);
          }
        }
      }

      Map<String, Integer> widths = state.getWidths();
      if (widths != null) {
        for (String path : widths.keySet()) {
          ColumnConfig<M, ?> column = getObject().getColumnModel().findColumnConfig(path);
          if (column != null) {
            column.setWidth(widths.get(path));
          }
        }
      }

      if (state.getSortField() != null) {

        ValueProvider<? super M, Comparable> vp = (ValueProvider) getObject().getColumnModel().findColumnConfig(
            state.getSortField()).getValueProvider();

        if (vp != null) {
          getObject().getStore().clearSortInfo();
          getObject().getStore().addSortInfo(new StoreSortInfo<M>(vp, state.getSortDir()));
        }

      }
    }
  }
View Full Code Here

Examples of com.sencha.gxt.state.client.GridStateHandler.GridState

    }
  }

  protected void handleColumnHiddenChange(ColumnHiddenChangeEvent event) {
    if (getObject().isStateful()) {
      GridState state = getState();
      Set<String> hidden = state.getHidden();
      if (hidden == null) {
        hidden = new HashSet<String>();
        state.setHidden(hidden);
      }

      if (event.getColumnConfig().isHidden()) {
        hidden.add(event.getColumnConfig().getPath());
      } else {
View Full Code Here

Examples of com.sencha.gxt.state.client.GridStateHandler.GridState

    }
  }

  protected void handleColumnWidthChange(ColumnWidthChangeEvent event) {
    if (getObject().isStateful()) {
      GridState state = getState();
      Map<String, Integer> widths = state.getWidths();
      if (widths == null) {
        widths = new HashMap<String, Integer>();
        state.setWidths(widths);
      }
      widths.put(event.getColumnConfig().getPath(), event.getColumnConfig().getWidth());

      saveState();
    }
View Full Code Here

Examples of com.sencha.gxt.state.client.GridStateHandler.GridState

    }
  }

  protected void handleSortChange(SortChangeEvent event) {
    if (getObject().isStateful()) {
      GridState state = getState();

      state.setSortField(event.getSortInfo().getSortField());
      state.setSortDir(event.getSortInfo().getSortDir());

      saveState();
    }
  }
View Full Code Here

Examples of com.sencha.gxt.state.client.GridStateHandler.GridState

  @SuppressWarnings({"rawtypes", "unchecked"})
  @Override
  public void applyState() {
    if (getObject().isStateful()) {
      GridState state = getState();
      Set<String> hidden = state.getHidden();
      if (hidden != null) {
        for (String path : hidden) {
          ColumnConfig<M, ?> column = getObject().getColumnModel().findColumnConfig(path);
          if (column != null) {
            column.setHidden(true);
          }
        }
      }

      Map<String, Integer> widths = state.getWidths();
      if (widths != null) {
        for (String path : widths.keySet()) {
          ColumnConfig<M, ?> column = getObject().getColumnModel().findColumnConfig(path);
          if (column != null) {
            column.setWidth(widths.get(path));
          }
        }
      }

      if (state.getSortField() != null) {

        ValueProvider<? super M, Comparable> vp = (ValueProvider) getObject().getColumnModel().findColumnConfig(
            state.getSortField()).getValueProvider();

        if (vp != null) {
          getObject().getStore().clearSortInfo();
          getObject().getStore().addSortInfo(new StoreSortInfo<M>(vp, state.getSortDir()));
        }

      }
    }
  }
View Full Code Here

Examples of com.sencha.gxt.state.client.GridStateHandler.GridState

    }
  }

  protected void handleColumnHiddenChange(ColumnHiddenChangeEvent event) {
    if (getObject().isStateful()) {
      GridState state = getState();
      Set<String> hidden = state.getHidden();
      if (hidden == null) {
        hidden = new HashSet<String>();
        state.setHidden(hidden);
      }

      if (event.getColumnConfig().isHidden()) {
        hidden.add(event.getColumnConfig().getPath());
      } else {
View Full Code Here

Examples of com.sencha.gxt.state.client.GridStateHandler.GridState

    }
  }

  protected void handleColumnWidthChange(ColumnWidthChangeEvent event) {
    if (getObject().isStateful()) {
      GridState state = getState();
      Map<String, Integer> widths = state.getWidths();
      if (widths == null) {
        widths = new HashMap<String, Integer>();
        state.setWidths(widths);
      }
      widths.put(event.getColumnConfig().getPath(), event.getColumnConfig().getWidth());

      saveState();
    }
View Full Code Here

Examples of com.sencha.gxt.state.client.GridStateHandler.GridState

    }
  }

  protected void handleSortChange(SortChangeEvent event) {
    if (getObject().isStateful()) {
      GridState state = getState();

      state.setSortField(event.getSortInfo().getSortField());
      state.setSortDir(event.getSortInfo().getSortDir());

      saveState();
    }
  }
View Full Code Here

Examples of org.encog.ml.world.grid.GridState

    if (!(resultState instanceof GridState)
        || !(previousState instanceof GridState)) {
      throw new WorldError("Must be instance of GridState");
    }

    GridState gridResultState = (GridState) resultState;
    GridState gridPreviousState = (GridState) previousState;

    Action resultingAction = determineResultingAction(gridPreviousState,
        gridResultState);
    GridState desiredState = determineActionState(gridPreviousState,
        desiredAction);

    // are we trying to move nowhere
    if (gridResultState == gridPreviousState) {
      if (GridWorld.isStateBlocked(desiredState))
View Full Code Here

Examples of org.encog.ml.world.grid.GridState

    return null;
  }
 
  public GridState determineActionState(GridState currentState, Action action) {
   
    GridState result = null;
   
    if( action==GridWorld.ACTION_NORTH) {
      result = this.world.getState(currentState.getRow()-1, currentState.getColumn());
    } else if( action==GridWorld.ACTION_SOUTH) {
      result = this.world.getState(currentState.getRow()+1, currentState.getColumn());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.