private void drawTileIDs(DrawContext dc, ArrayList<MercatorTextureTile> tiles) { java.awt.Rectangle viewport = dc.getView().getViewport(); if (this.textRenderer == null) { this.textRenderer = new TextRenderer(java.awt.Font.decode("Arial-Plain-13"), true, true); this.textRenderer.setUseVertexArrays(false); } dc.getGL().glDisable(GL.GL_DEPTH_TEST); dc.getGL().glDisable(GL.GL_BLEND); dc.getGL().glDisable(GL.GL_TEXTURE_2D); this.textRenderer.setColor(java.awt.Color.YELLOW); this.textRenderer.beginRendering(viewport.width, viewport.height); for (MercatorTextureTile tile : tiles) { String tileLabel = tile.getLabel(); if (tile.getFallbackTile() != null) tileLabel += "/" + tile.getFallbackTile().getLabel(); LatLon ll = tile.getSector().getCentroid(); Vec4 pt = dc.getGlobe() .computePointFromPosition( ll.getLatitude(), ll.getLongitude(), dc.getGlobe().getElevation(ll.getLatitude(), ll.getLongitude())); pt = dc.getView().project(pt); this.textRenderer.draw(tileLabel, (int) pt.x, (int) pt.y); } this.textRenderer.endRendering(); }
public int compare(MercatorTextureTile ta, MercatorTextureTile tb) { int la = ta.getFallbackTile() == null ? ta.getLevelNumber() : ta.getFallbackTile().getLevelNumber(); int lb = tb.getFallbackTile() == null ? tb.getLevelNumber() : tb.getFallbackTile().getLevelNumber(); return la < lb ? -1 : la == lb ? 0 : 1; }