Tabnine Logo
IntMap.put
Code IndexAdd Tabnine to your IDE (free)

How to use
put
method
in
com.jme3.util.IntMap

Best Java code snippets using com.jme3.util.IntMap.put (Showing top 20 results out of 315)

origin: jMonkeyEngine/jmonkeyengine

public void addKerning(int second, int amount){
  kerning.put(second, amount);
}
origin: jMonkeyEngine/jmonkeyengine

protected void findVertexIndex(Vertex vert){
  Integer index = vertIndexMap.get(vert);
  if (index != null){
    vert.index = index.intValue();
  }else{
    vert.index = curIndex++;
    vertIndexMap.put(vert, vert.index);
    indexVertMap.put(vert.index, vert);
  }
}
origin: jMonkeyEngine/jmonkeyengine

private IntMap<Savable> intSavableMapFromKV(int[] keys, Savable[] values) {
  if(keys == null || values == null) {
    return null;
  }
  IntMap<Savable> map = new IntMap<Savable>(keys.length);
  for (int x = 0; x < keys.length; x++)
    map.put(keys[x], values[x]);
  return map;
}
origin: jMonkeyEngine/jmonkeyengine

private static void noEnumArgs(String method, int... argSlots) {
  IntMap<Void> argSlotsMap = new IntMap<Void>();
  for (int argSlot : argSlots) {
    argSlotsMap.put(argSlot, (Void) null);
  }
  nonEnumArgMap.put(method, argSlotsMap);
}

origin: jMonkeyEngine/jmonkeyengine

private static IntMap<String> generateConstantMap(Class<?> ... classes) {
  IntMap<String> constMap = new IntMap<String>();
  for (Class<?> clazz : classes) {
    for (Field field : clazz.getFields()) {
      if (field.getType() == int.class) {
        try {
          int val = field.getInt(null);
          String name = field.getName();
          constMap.put(val, name);
        } catch (IllegalArgumentException ex) {
        } catch (IllegalAccessException ex) {
        }
      }
    }
  }
  // GL_ONE is more common than GL_TRUE (which is a boolean anyway..)
  constMap.put(1, "GL_ONE");
  return constMap;
}

origin: jMonkeyEngine/jmonkeyengine

public void addCharacter(int index, BitmapCharacter ch){
  getCharacterSet(0).put(index, ch);
}
origin: jMonkeyEngine/jmonkeyengine

private IntMap<BitmapCharacter> readCharset(InputCapsule ic, int style) throws IOException {
  IntMap<BitmapCharacter> charset = new IntMap<BitmapCharacter>();
  short[] indexes = ic.readShortArray("indexes"+style, null);
  Savable[] chars = ic.readSavableArray("chars"+style, null);
  for (int i = 0; i < indexes.length; i++){
    int index = indexes[i] & 0xFFFF;
    BitmapCharacter chr = (BitmapCharacter) chars[i];
    charset.put(index, chr);
  }
  return charset;
}
origin: jMonkeyEngine/jmonkeyengine

private SkinBuffers getSkinBuffers(String bufferType) {
  int bufIndex = getIndex(bufferType);
  SkinBuffers buffs = skinBuffers.get(bufIndex);
  if (buffs == null) {
    buffs = new SkinBuffers();
    skinBuffers.put(bufIndex, buffs);
  }
  return buffs;
}
origin: jMonkeyEngine/jmonkeyengine

private IntMap<BitmapCharacter> getCharacterSet(int style) {
  if (characters.size() == 0) {
    characters.put(style, new IntMap<BitmapCharacter>());
  }
  return characters.get(style);
}
origin: jMonkeyEngine/jmonkeyengine

public void setStyle(int style) {
  if (characters.size() > 1) {
    throw new RuntimeException("Applicable only for single style font");
  }
  Entry<IntMap<BitmapCharacter>> entry = characters.iterator().next();
  IntMap<BitmapCharacter> charset = entry.getValue();
  characters.remove(entry.getKey());
  characters.put(style, charset);
}
origin: jMonkeyEngine/jmonkeyengine

private SensorData initSensor(int sensorType) {
  boolean success = false;
  SensorData sensorData = sensors.get(sensorType);
  if (sensorData != null) {
    unRegisterListener(sensorType);
  } else {
    sensorData = new SensorData(sensorType, null);
    sensors.put(sensorType, sensorData);
  }
  sensorData.androidSensorType = sensorType;
  sensorData.sensor = sensorManager.getDefaultSensor(sensorType);
  if (sensorData.sensor != null) {
    logger.log(Level.FINE, "Sensor Type {0} found.", sensorType);
    success = registerListener(sensorType);
  } else {
    logger.log(Level.FINE, "Sensor Type {0} not found.", sensorType);
  }
  if (success) {
    return sensorData;
  } else {
    return null;
  }
}
origin: jMonkeyEngine/jmonkeyengine

private void invokeTimedActions(int hash, long time, boolean pressed) {
  if (!bindings.containsKey(hash)) {
    return;
  }
  if (pressed) {
    pressedButtons.put(hash, time);
  } else {
    Long pressTimeObj = pressedButtons.remove(hash);
    if (pressTimeObj == null) {
      return; // under certain circumstances it can be null, ignore
    }                        // the event then.
    long pressTime = pressTimeObj;
    long lastUpdate = lastLastUpdateTime;
    long releaseTime = time;
    long timeDelta = releaseTime - Math.max(pressTime, lastUpdate);
    if (timeDelta > 0) {
      invokeAnalogs(hash, computeAnalogValue(timeDelta), false);
    }
  }
}
origin: jMonkeyEngine/jmonkeyengine

public Attribute getAttribute(VertexBuffer.Type attribType){
  int ordinal = attribType.ordinal();
  Attribute attrib = attribs.get(ordinal);
  if (attrib == null){
    attrib = new Attribute();
    attrib.name = attribType.name();
    attribs.put(ordinal, attrib);
  }
  return attrib;
}
origin: jMonkeyEngine/jmonkeyengine

private void startLodFaceList(String submeshindex, String numfaces) {
  int index = Integer.parseInt(submeshindex);
  mesh = geoms.get(index).getMesh();
  int faceCount = Integer.parseInt(numfaces);
  VertexBuffer originalIndexBuffer = mesh.getBuffer(Type.Index);
  vb = new VertexBuffer(VertexBuffer.Type.Index);
  if (originalIndexBuffer.getFormat() == Format.UnsignedInt) {
    // LOD buffer should also be integer
    ib = BufferUtils.createIntBuffer(faceCount * 3);
    sb = null;
    vb.setupData(Usage.Static, 3, Format.UnsignedInt, ib);
  } else {
    sb = BufferUtils.createShortBuffer(faceCount * 3);
    ib = null;
    vb.setupData(Usage.Static, 3, Format.UnsignedShort, sb);
  }
  List<VertexBuffer> levels = lodLevels.get(index);
  if (levels == null) {
    // Create the LOD levels list
    levels = new ArrayList<VertexBuffer>();
    // Add the first LOD level (always the original index buffer)
    levels.add(originalIndexBuffer);
    lodLevels.put(index, levels);
  }
  levels.add(vb);
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Called by the Renderer when a texture has been set.
 * 
 * @param image The image that was set
 * @param wasSwitched If true, the texture has required a state switch
 */
public void onTextureUse(Image image, boolean wasSwitched){
  assert image.getId() >= 1;
  if( !enabled )
    return;
    
  if (!texturesUsed.containsKey(image.getId()))
    texturesUsed.put(image.getId(), null);
  if (wasSwitched)
    numTextureBinds ++;
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Called by the Renderer when a framebuffer has been set.
 * 
 * @param fb The framebuffer that was set
 * @param wasSwitched If true, the framebuffer required a state switch
 */
public void onFrameBufferUse(FrameBuffer fb, boolean wasSwitched){
  if( !enabled )
    return;
    
  if (fb != null){
    assert fb.getId() >= 1;
    if (!fbosUsed.containsKey(fb.getId()))
      fbosUsed.put(fb.getId(), null);
  }
  if (wasSwitched)
    numFboSwitches ++;
}

origin: jMonkeyEngine/jmonkeyengine

/**
 * Sets the {@link VertexBuffer} on the mesh.
 * This will update the vertex/triangle counts if needed.
 *
 * @param vb The buffer to set
 * @throws IllegalArgumentException If the buffer type is already set
 */
public void setBuffer(VertexBuffer vb){
  if (buffers.containsKey(vb.getBufferType().ordinal())) {
    throw new IllegalArgumentException("Buffer type already set: " + vb.getBufferType());
  }
  buffers.put(vb.getBufferType().ordinal(), vb);
  buffersList.add(vb);
  updateCounts();
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Called by the Renderer when a shader has been utilized.
 * 
 * @param shader The shader that was used
 * @param wasSwitched If true, the shader has required a state switch
 */
public void onShaderUse(Shader shader, boolean wasSwitched){
  assert shader.getId() >= 1;
  if( !enabled )
    return;
  
  // Reduces unnecessary hashmap lookups if
  // we already considered this shader.
  if (lastShader != shader.getId()) {
    lastShader = shader.getId();
    if (!shadersUsed.containsKey(shader.getId())) {
      shadersUsed.put(shader.getId(), null);
    }
  }
  if (wasSwitched)
    numShaderSwitches++;
}
origin: jMonkeyEngine/jmonkeyengine

@Override
public void read(JmeImporter im) throws IOException {
  InputCapsule ic = im.getCapsule(this);
  lineHeight = ic.readInt("lineHeight", 0);
  base = ic.readInt("base", 0);
  renderedSize = ic.readInt("renderedSize", 0);
  width = ic.readInt("width", 0);
  height = ic.readInt("height", 0);
  pageSize = ic.readInt("pageSize", 0);
  int[] styles = ic.readIntArray("styles", null);
  for (int style : styles) {
    characters.put(style, readCharset(ic, style));
  }
}
origin: jMonkeyEngine/jmonkeyengine

  public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    c = (char) ic.readInt("c", 0);
    x = ic.readInt("x", 0);
    y = ic.readInt("y", 0);
    width = ic.readInt("width", 0);
    height = ic.readInt("height", 0);
    xOffset = ic.readInt("xOffset", 0);
    yOffset = ic.readInt("yOffset", 0);
    xAdvance = ic.readInt("xAdvance", 0);

    int[] seconds = ic.readIntArray("seconds", null);
    int[] amounts = ic.readIntArray("amounts", null);

    for (int i = 0; i < seconds.length; i++){
      kerning.put(seconds[i], amounts[i]);
    }
  }
}
com.jme3.utilIntMapput

Popular methods of IntMap

  • get
  • clear
  • size
  • <init>
  • remove
  • containsKey
  • iterator
  • clone

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (Timer)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Notification (javax.management)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now