Package org.jamesii.gui.model.editor.ca.cellrenderer.valuemapper

Examples of org.jamesii.gui.model.editor.ca.cellrenderer.valuemapper.ValueMapper


    // only two states usually indicate a simple dead/alive state
    // model
    // black and white are a safe bet for colors in that case
    if (cellRenderer instanceof ColorCellRenderer) {
      List<String> states = modelInfo.getStates();
      ValueMapper vm = new ValueMapper(Color.class);
      if (states.size() == 2) {
        vm.setMappingFor(0, Color.BLACK);
        vm.setMappingFor(1, Color.WHITE);
      } else {
        Random r = new Random();
        for (int i = 0; i < states.size(); i++) {
          vm.setMappingFor(i, new Color(r.nextInt()));
        }
      }
      cellRenderer.setMapper(0, vm);
    }
View Full Code Here

TOP

Related Classes of org.jamesii.gui.model.editor.ca.cellrenderer.valuemapper.ValueMapper

Copyright © 2018 www.massapicom. 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.