Java 类com.badlogic.gdx.utils.Sort 实例源码

项目:skin-composer    文件:DialogDrawables.java   
/**
 * Sorts by modified date with oldest first.
 */
private void sortDrawablesOldest() {
    Sort.instance().sort(drawables, (DrawableData o1, DrawableData o2) -> {
        if (o1.file.lastModified() < o2.file.lastModified()) {
            return -1;
        } else if (o1.file.lastModified() > o2.file.lastModified()) {
            return 1;
        } else {
            return 0;
        }
    });
    refreshDrawableDisplay();
}
项目:skin-composer    文件:DialogDrawables.java   
/**
 * Sorts by modified date with newest first.
 */
private void sortDrawablesNewest() {
    Sort.instance().sort(drawables, (DrawableData o1, DrawableData o2) -> {
        if (o1.file.lastModified() < o2.file.lastModified()) {
            return 1;
        } else if (o1.file.lastModified() > o2.file.lastModified()) {
            return -1;
        } else {
            return 0;
        }
    });
    refreshDrawableDisplay();
}
项目:skin-composer    文件:DialogFonts.java   
private void sortFontsOldest() {
    Sort.instance().sort(fonts, (FontData o1, FontData o2) -> {
        if (o1.file.lastModified() < o2.file.lastModified()) {
            return -1;
        } else if (o1.file.lastModified() > o2.file.lastModified()) {
            return 1;
        } else {
            return 0;
        }
    });

    refreshTable();
}
项目:skin-composer    文件:DialogFonts.java   
private void sortFontsNewest() {
    Sort.instance().sort(fonts, (FontData o1, FontData o2) -> {
        if (o1.file.lastModified() < o2.file.lastModified()) {
            return 1;
        } else if (o1.file.lastModified() > o2.file.lastModified()) {
            return -1;
        } else {
            return 0;
        }
    });
    refreshTable();
}
项目:skin-composer    文件:DialogColors.java   
private void sortFontsAZ() {
    Sort.instance().sort(colors, new Comparator<ColorData>() {
        @Override
        public int compare(ColorData o1, ColorData o2) {
            return o1.toString().compareToIgnoreCase(o2.toString());
        }
    });
    refreshTable();
}
项目:skin-composer    文件:DialogColors.java   
private void sortFontsZA() {
    Sort.instance().sort(colors, new Comparator<ColorData>() {
        @Override
        public int compare(ColorData o1, ColorData o2) {
            return o1.toString().compareToIgnoreCase(o2.toString()) * -1;
        }
    });
    refreshTable();
}
项目:libgdxcn    文件:SimpleOrthoGroupStrategy.java   
@Override
public void beforeGroup (int group, Array<Decal> contents) {
    if (group == GROUP_BLEND) {
        Sort.instance().sort(contents, comparator);
        Gdx.gl.glEnable(GL20.GL_BLEND);
        // no need for writing into the z buffer if transparent decals are the last thing to be rendered
        // and they are rendered back to front
        Gdx.gl.glDepthMask(false);
    } else {
        // FIXME sort by material
    }
}
项目:ingress-indonesia-dev    文件:SimpleOrthoGroupStrategy.java   
public void beforeGroup(int paramInt, Array<Decal> paramArray)
{
  if (paramInt == 1)
  {
    Sort.instance().sort(paramArray, this.comparator);
    Gdx.gl10.glEnable(3042);
    Gdx.gl10.glDepthMask(false);
  }
}
项目:skin-composer    文件:DialogDrawables.java   
/**
 * Sorts alphabetically from A to Z.
 */
private void sortDrawablesAZ() {
    Sort.instance().sort(drawables, (DrawableData o1, DrawableData o2) -> o1.toString().compareToIgnoreCase(o2.toString()));
    refreshDrawableDisplay();
}
项目:skin-composer    文件:DialogDrawables.java   
/**
 * Sorts alphabetically from Z to A.
 */
private void sortDrawablesZA() {
    Sort.instance().sort(drawables, (DrawableData o1, DrawableData o2) -> o1.toString().compareToIgnoreCase(o2.toString()) * -1);
    refreshDrawableDisplay();
}
项目:skin-composer    文件:DialogFonts.java   
private void sortFontsAZ() {
    Sort.instance().sort(fonts, (FontData o1, FontData o2) -> o1.toString().compareToIgnoreCase(o2.toString()));
    refreshTable();
}
项目:skin-composer    文件:DialogFonts.java   
private void sortFontsZA() {
    Sort.instance().sort(fonts, (FontData o1, FontData o2) -> o1.toString().compareToIgnoreCase(o2.toString()) * -1);
    refreshTable();
}
项目:nvlist    文件:DrawBuffer.java   
/**
 * Returns a sorted list of render commands stored in this buffer.
 */
public List<? extends BaseRenderCommand> getCommands() {
    Sort.instance().sort(contents.items, 0, contents.size);
    return Arrays.asList(contents.items).subList(0, contents.size);
}
项目:ModularArmour    文件:Array.java   
/**
 * Sorts this array. The array elements must implement {@link Comparable}.
 * This method is not thread safe (uses {@link Sort#instance()}).
 */
public void sort() {
    Sort.instance().sort(items, 0, size);
}
项目:ModularArmour    文件:Array.java   
/**
 * Sorts the array. This method is not thread safe (uses
 * {@link Sort#instance()}).
 */
public void sort(Comparator<? super T> comparator) {
    Sort.instance().sort(items, comparator, 0, size);
}