本文整理匯總了Java中org.oscim.backend.canvas.Paint.Cap類的典型用法代碼示例。如果您正苦於以下問題:Java Cap類的具體用法?Java Cap怎麽用?Java Cap使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Cap類屬於org.oscim.backend.canvas.Paint包,在下文中一共展示了Cap類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: LineStyle
import org.oscim.backend.canvas.Paint.Cap; //導入依賴的package包/類
public LineStyle(int level, String style, int color, float width,
Cap cap, boolean fixed,
int stipple, int stippleColor, float stippleWidth,
int fadeScale, float blur, boolean isOutline) {
this.level = level;
this.style = style;
this.outline = isOutline;
this.cap = cap;
this.color = color;
this.width = width;
this.fixed = fixed;
this.stipple = stipple;
this.stippleColor = stippleColor;
this.stippleWidth = stippleWidth;
this.blur = blur;
this.fadeScale = fadeScale;
}
示例2: reset
import org.oscim.backend.canvas.Paint.Cap; //導入依賴的package包/類
public T reset() {
level = -1;
style = null;
fillColor = Color.BLACK;
cap = Cap.ROUND;
strokeWidth = 1;
fixed = false;
fadeScale = -1;
blur = 0;
stipple = 0;
stippleWidth = 1;
stippleColor = Color.BLACK;
return self();
}
示例3: MyTheme
import org.oscim.backend.canvas.Paint.Cap; //導入依賴的package包/類
public MyTheme() {
rules(
matchKeyValue("natural", "water")
.style(area(Color.BLUE)),
matchKeyValue("landuse", "forest")
.style(area(Color.GREEN)),
matchKeyValue("landuse", "residential")
.style(area(Color.LTGRAY)),
matchKey("highway")
.rules(matchValue("residential")
.style(line(Color.DKGRAY, 1.2f),
line(Color.WHITE, 1.1f)
.cap(Cap.ROUND)))
.style(line(Color.BLACK, 1)
.blur(0.5f)));
}
示例4: TrackLayer
import org.oscim.backend.canvas.Paint.Cap; //導入依賴的package包/類
public TrackLayer(Map map, Track track) {
super(map);
mWorker = new Worker(map);
mLineStyle = new LineStyle(track.style.color, track.style.width, Cap.BUTT);
mRenderer = new RenderPath();
mTrack = track;
updatePoints();
}
示例5: GridRendererMT
import org.oscim.backend.canvas.Paint.Cap; //導入依賴的package包/類
public GridRendererMT(final float scale) {
this(
1,
new LineStyle(Color.GRAY, 1.2f * scale, Cap.BUTT),
TextStyle
.builder()
.fontSize(26 * scale)
.fontStyle(Paint.FontStyle.NORMAL)
.color(Color.RED)
.build());
}
示例6: GridRenderer
import org.oscim.backend.canvas.Paint.Cap; //導入依賴的package包/類
public GridRenderer() {
this(1, new LineStyle(Color.LTGRAY, 1.2f, Cap.BUTT),
TextStyle.builder()
.fontSize(22)
.color(Color.RED)
.build());
}
示例7: PathLayer
import org.oscim.backend.canvas.Paint.Cap; //導入依賴的package包/類
public PathLayer(Map map, int lineColor, float lineWidth) {
super(map);
mWorker = new Worker(map);
mLineStyle = new LineStyle(lineColor, lineWidth, Cap.BUTT);
mRenderer = new RenderPath();
mPoints = new ArrayList<GeoPoint>();
}
示例8: createLineStyle
import org.oscim.backend.canvas.Paint.Cap; //導入依賴的package包/類
private LineStyle createLineStyle() {
final Map25TrackConfig trackConfig = Map25ConfigManager.getActiveTourTrackConfig();
return LineStyle
.builder()//
.strokeWidth(trackConfig.outlineWidth)
.color(ColorUtil.getARGB(trackConfig.outlineColor, 0xff))
.cap(Cap.BUTT)
// this is not yet working
// .isOutline(true)
.build();
}
示例9: TileGridLayer
import org.oscim.backend.canvas.Paint.Cap; //導入依賴的package包/類
public TileGridLayer(Map map, int color, float width, int repeat) {
super(map, new GridRenderer(repeat, new LineStyle(color, width, Cap.BUTT), null));
}
示例10: createLine
import org.oscim.backend.canvas.Paint.Cap; //導入依賴的package包/類
/**
* @param line
* optional: line style defaults
* @param level
* the drawing level of this instruction.
* @param isOutline
* is outline layer
* @return a new Line with the given rendering attributes.
*/
private LineStyle createLine(LineStyle line, String elementName, Attributes attributes,
int level, boolean isOutline) {
LineBuilder<?> b = mLineBuilder.set(line);
b.isOutline(isOutline);
b.level(level);
for (int i = 0; i < attributes.getLength(); i++) {
String name = attributes.getLocalName(i);
String value = attributes.getValue(i);
if ("id".equals(name))
b.style = value;
else if ("src".equals(name))
;// src = value;
else if ("use".equals(name))
;// ignore
else if ("outline".equals(name))
;// ignore
else if ("stroke".equals(name))
b.color(value);
else if ("width".equals(name) || "stroke-width".equals(name)) {
b.strokeWidth = parseFloat(value);
if (line == null) {
if (!isOutline)
validateNonNegative("width", b.strokeWidth);
} else {
/* use stroke width relative to 'line' */
b.strokeWidth += line.width;
if (b.strokeWidth <= 0)
b.strokeWidth = 1;
}
}
else if ("cap".equals(name) || "stroke-linecap".equals(name))
b.cap = Cap.valueOf(value.toUpperCase());
else if ("fix".equals(name))
b.fixed = parseBoolean(value);
else if ("stipple".equals(name))
b.stipple = parseInt(value);
else if ("stipple-stroke".equals(name))
b.stippleColor(value);
else if ("stipple-width".equals(name))
b.stippleWidth = parseFloat(value);
else if ("fade".equals(name))
b.fadeScale = Integer.parseInt(value);
else if ("min".equals(name))
; //min = Float.parseFloat(value);
else if ("blur".equals(name))
b.blur = parseFloat(value);
else if ("style".equals(name))
; // ignore
else if ("dasharray".equals(name))
; // TBD
else
logUnknownAttribute(elementName, name, value, i);
}
return b.build();
}