add StyleBuilder interface
This commit is contained in:
parent
f5645cf292
commit
4f254bde75
@ -104,7 +104,7 @@ public class AreaStyle extends RenderStyle {
|
|||||||
renderCallback.renderWay(outline, level + 1);
|
renderCallback.renderWay(outline, level + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class AreaBuilder {
|
public static class AreaBuilder implements StyleBuilder {
|
||||||
public int level;
|
public int level;
|
||||||
public String style;
|
public String style;
|
||||||
public LineStyle outline;
|
public LineStyle outline;
|
||||||
|
|||||||
@ -98,7 +98,7 @@ public final class LineStyle extends RenderStyle {
|
|||||||
return (LineStyle) mCurrent;
|
return (LineStyle) mCurrent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static class LineBuilder {
|
public final static class LineBuilder implements StyleBuilder {
|
||||||
public int level;
|
public int level;
|
||||||
|
|
||||||
public String style;
|
public String style;
|
||||||
@ -203,5 +203,10 @@ public final class LineStyle extends RenderStyle {
|
|||||||
public LineStyle build() {
|
public LineStyle build() {
|
||||||
return new LineStyle(this);
|
return new LineStyle(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LineBuilder cap(Cap cap) {
|
||||||
|
this.cap = cap;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,12 @@ import org.oscim.theme.IRenderTheme.Callback;
|
|||||||
*/
|
*/
|
||||||
public abstract class RenderStyle {
|
public abstract class RenderStyle {
|
||||||
|
|
||||||
|
public interface StyleBuilder {
|
||||||
|
RenderStyle build();
|
||||||
|
|
||||||
|
StyleBuilder level(int level);
|
||||||
|
}
|
||||||
|
|
||||||
RenderStyle mCurrent = this;
|
RenderStyle mCurrent = this;
|
||||||
RenderStyle mNext;
|
RenderStyle mNext;
|
||||||
boolean update;
|
boolean update;
|
||||||
|
|||||||
@ -27,7 +27,7 @@ import org.oscim.theme.IRenderTheme.Callback;
|
|||||||
|
|
||||||
public final class TextStyle extends RenderStyle {
|
public final class TextStyle extends RenderStyle {
|
||||||
|
|
||||||
public static class TextBuilder {
|
public static class TextBuilder implements StyleBuilder {
|
||||||
|
|
||||||
public String style;
|
public String style;
|
||||||
public float fontSize;
|
public float fontSize;
|
||||||
@ -134,6 +134,11 @@ public final class TextStyle extends RenderStyle {
|
|||||||
this.strokeWidth = strokeWidth;
|
this.strokeWidth = strokeWidth;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TextBuilder level(int level) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TextStyle(TextBuilder tb) {
|
TextStyle(TextBuilder tb) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user