本文整理汇总了Java中org.oscim.renderer.bucket.TextBucket类的典型用法代码示例。如果您正苦于以下问题:Java TextBucket类的具体用法?Java TextBucket怎么用?Java TextBucket使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextBucket类属于org.oscim.renderer.bucket包,在下文中一共展示了TextBucket类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addLabels
import org.oscim.renderer.bucket.TextBucket; //导入依赖的package包/类
private void addLabels(int x, int y, int z) {
int s = Tile.SIZE;
TextBucket tl = mTextBucket;
tl.clear();
StringBuilder sb = mStringBuffer;
for (int yy = -2; yy < 2; yy++) {
for (int xx = -2; xx < 2; xx++) {
sb.setLength(0);
sb.append(x + xx)
.append(" / ")
.append(y + yy)
.append(" / ")
.append(z);
TextItem ti = TextItem.pool.get();
ti.set(s * xx + s / 2, s * yy + s / 2, sb.toString(), mText);
tl.addText(ti);
}
}
}
示例2: GridRendererMT
import org.oscim.renderer.bucket.TextBucket; //导入依赖的package包/类
public GridRendererMT(final int numLines, final LineStyle lineStyle, final TextStyle textStyle) {
final int size = Tile.SIZE;
/* not needed to set but we know: 16 lines 'a' two points */
mLines = new GeometryBuffer(2 * 16, 16);
final float pos = -size * 4;
/* 8 vertical lines */
for (int i = 0; i < 8 * numLines; i++) {
final float x = pos + i * size / numLines;
mLines.startLine();
mLines.addPoint(x, pos);
mLines.addPoint(x, pos + size * 8);
}
/* 8 horizontal lines */
for (int j = 0; j < 8 * numLines; j++) {
final float y = pos + j * size / numLines;
mLines.startLine();
mLines.addPoint(pos, y);
mLines.addPoint(pos + size * 8, y);
}
_textStyle = textStyle;
mLineBucket = new LineBucket(0);
mLineBucket.line = lineStyle;
if (_textStyle != null) {
mTextBucket = new TextBucket();
mTextBucket.next = mLineBucket;
} else {
mTextBucket = null;
mLineBucket.addLine(mLines);
buckets.set(mLineBucket);
}
}
示例3: LabelTask
import org.oscim.renderer.bucket.TextBucket; //导入依赖的package包/类
LabelTask() {
pos = new MapPosition();
symbolLayer = new SymbolBucket();
textLayer = new TextBucket();
layers = symbolLayer;
symbolLayer.next = textLayer;
}
示例4: GridRenderer
import org.oscim.renderer.bucket.TextBucket; //导入依赖的package包/类
public GridRenderer(int numLines, LineStyle lineStyle, TextStyle textStyle) {
int size = Tile.SIZE;
/* not needed to set but we know: 16 lines 'a' two points */
mLines = new GeometryBuffer(2 * 16, 16);
float pos = -size * 4;
/* 8 vertical lines */
for (int i = 0; i < 8 * numLines; i++) {
float x = pos + i * size / numLines;
mLines.startLine();
mLines.addPoint(x, pos);
mLines.addPoint(x, pos + size * 8);
}
/* 8 horizontal lines */
for (int j = 0; j < 8 * numLines; j++) {
float y = pos + j * size / numLines;
mLines.startLine();
mLines.addPoint(pos, y);
mLines.addPoint(pos + size * 8, y);
}
mText = textStyle;
mLineBucket = new LineBucket(0);
mLineBucket.line = lineStyle;
if (mText != null) {
mTextBucket = new TextBucket();
mTextBucket.next = mLineBucket;
} else {
mTextBucket = null;
mLineBucket.addLine(mLines);
buckets.set(mLineBucket);
}
mStringBuffer = new StringBuilder(32);
}
示例5: LabelTask
import org.oscim.renderer.bucket.TextBucket; //导入依赖的package包/类
LabelTask() {
pos = new MapPosition();
symbolLayer = new SymbolBucket();
textLayer = new TextBucket();
layers = symbolLayer;
symbolLayer.next = textLayer;
}
示例6: processFeatures
import org.oscim.renderer.bucket.TextBucket; //导入依赖的package包/类
@Override
protected void processFeatures(Task t, Envelope b) {
mTextLayer = new TextBucket();
t.buckets.set(mTextLayer);
super.processFeatures(t, b);
//render TextItems to a bitmap and prepare vertex buffer data.
mTextLayer.prepare();
mTextLayer.clearLabels();
}
示例7: MapObjectRenderer
import org.oscim.renderer.bucket.TextBucket; //导入依赖的package包/类
MapObjectRenderer(float scale) {
mSymbolBucket = new SymbolBucket();
mTextBucket = new TextBucket();
mSymbolBucket.next = mTextBucket;
mScale = scale;
}
示例8: addLabels
import org.oscim.renderer.bucket.TextBucket; //导入依赖的package包/类
private void addLabels(final int x, final int y, final int z, final MapPosition mapPosition) {
final int s = Tile.SIZE;
final int tileZ = 1 << z;
final float lineHeight = _textStyle.fontSize + 1;
final TextBucket textBucket = mTextBucket;
textBucket.clear();
for (int yy = -2; yy < 2; yy++) {
for (int xx = -2; xx < 2; xx++) {
final int tileX = x + xx;
final int tileY = y + yy;
final double latitude = MercatorProjection.toLatitude((double) tileY / tileZ);
final double longitude = MercatorProjection.toLongitude((double) tileX / tileZ);
final String labelTile = String.format("%d / %d / %d", z, tileX, tileY); //$NON-NLS-1$
final String labelLat = String.format("lat %.4f", latitude); //$NON-NLS-1$
final String labelLon = String.format("lon %.4f", longitude); //$NON-NLS-1$
final int textX = s * xx + s / 2;
final int textY = s * yy + s / 2;
TextItem textItem = TextItem.pool.get();
textItem.set(textX, textY, labelTile, _textStyle);
textBucket.addText(textItem);
/*
* Lat/Lon
*/
textItem = TextItem.pool.get();
textItem.set(textX, textY + lineHeight, labelLat, _textStyle);
textBucket.addText(textItem);
textItem = TextItem.pool.get();
textItem.set(textX, textY + lineHeight * 2, labelLon, _textStyle);
textBucket.addText(textItem);
}
}
}