Enable style categories (#430)

This commit is contained in:
Andrey Novikov
2017-10-24 12:44:57 +03:00
committed by Emux
parent e2a4ad8a97
commit df5bcd583f
6 changed files with 22 additions and 0 deletions

View File

@@ -108,6 +108,7 @@ public class AreaStyle extends RenderStyle<AreaStyle> {
} }
public AreaStyle(AreaBuilder<?> b) { public AreaStyle(AreaBuilder<?> b) {
this.cat = b.cat;
this.level = b.level; this.level = b.level;
this.style = b.style; this.style = b.style;
this.fadeScale = b.fadeScale; this.fadeScale = b.fadeScale;
@@ -195,6 +196,7 @@ public class AreaStyle extends RenderStyle<AreaStyle> {
if (area == null) if (area == null)
return reset(); return reset();
this.cat = area.cat;
this.level = area.level; this.level = area.level;
this.style = area.style; this.style = area.style;
this.fadeScale = area.fadeScale; this.fadeScale = area.fadeScale;
@@ -266,6 +268,7 @@ public class AreaStyle extends RenderStyle<AreaStyle> {
} }
public T reset() { public T reset() {
cat = null;
level = -1; level = -1;
fillColor = Color.WHITE; fillColor = Color.WHITE;
strokeColor = Color.BLACK; strokeColor = Color.BLACK;

View File

@@ -43,6 +43,7 @@ public final class CircleStyle extends RenderStyle<CircleStyle> {
} }
public CircleStyle(CircleBuilder<?> b) { public CircleStyle(CircleBuilder<?> b) {
this.cat = b.cat;
this.radius = b.radius; this.radius = b.radius;
this.scaleRadius = b.scaleRadius; this.scaleRadius = b.scaleRadius;
this.fillColor = b.themeCallback != null ? b.themeCallback.getColor(b.fillColor) : b.fillColor; this.fillColor = b.themeCallback != null ? b.themeCallback.getColor(b.fillColor) : b.fillColor;
@@ -78,6 +79,7 @@ public final class CircleStyle extends RenderStyle<CircleStyle> {
this.fillColor = themeCallback != null ? themeCallback.getColor(circle.fillColor) : circle.fillColor; this.fillColor = themeCallback != null ? themeCallback.getColor(circle.fillColor) : circle.fillColor;
this.strokeColor = themeCallback != null ? themeCallback.getColor(circle.strokeColor) : circle.strokeColor; this.strokeColor = themeCallback != null ? themeCallback.getColor(circle.strokeColor) : circle.strokeColor;
this.strokeWidth = circle.strokeWidth; this.strokeWidth = circle.strokeWidth;
this.cat = circle.cat;
this.level = circle.level; this.level = circle.level;
return self(); return self();
@@ -94,6 +96,7 @@ public final class CircleStyle extends RenderStyle<CircleStyle> {
} }
public T reset() { public T reset() {
cat = null;
level = -1; level = -1;
radius = 0; radius = 0;
scaleRadius = false; scaleRadius = false;

View File

@@ -44,6 +44,7 @@ public class ExtrusionStyle extends RenderStyle<ExtrusionStyle> {
} }
public ExtrusionStyle(ExtrusionBuilder<?> b) { public ExtrusionStyle(ExtrusionBuilder<?> b) {
this.cat = b.cat;
this.level = b.level; this.level = b.level;
this.colorSide = b.themeCallback != null ? b.themeCallback.getColor(b.colorSide) : b.colorSide; this.colorSide = b.themeCallback != null ? b.themeCallback.getColor(b.colorSide) : b.colorSide;
@@ -105,6 +106,7 @@ public class ExtrusionStyle extends RenderStyle<ExtrusionStyle> {
if (extrusion == null) if (extrusion == null)
return reset(); return reset();
this.cat = extrusion.cat;
this.level = extrusion.level; this.level = extrusion.level;
this.colorSide = themeCallback != null ? themeCallback.getColor(extrusion.colorSide) : extrusion.colorSide; this.colorSide = themeCallback != null ? themeCallback.getColor(extrusion.colorSide) : extrusion.colorSide;
this.colorTop = themeCallback != null ? themeCallback.getColor(extrusion.colorTop) : extrusion.colorTop; this.colorTop = themeCallback != null ? themeCallback.getColor(extrusion.colorTop) : extrusion.colorTop;
@@ -150,6 +152,7 @@ public class ExtrusionStyle extends RenderStyle<ExtrusionStyle> {
} }
public T reset() { public T reset() {
cat = null;
level = -1; level = -1;
colorSide = Color.TRANSPARENT; colorSide = Color.TRANSPARENT;
colorTop = Color.TRANSPARENT; colorTop = Color.TRANSPARENT;

View File

@@ -104,6 +104,7 @@ public final class LineStyle extends RenderStyle<LineStyle> {
} }
private LineStyle(LineBuilder<?> b) { private LineStyle(LineBuilder<?> b) {
this.cat = b.cat;
this.level = b.level; this.level = b.level;
this.style = b.style; this.style = b.style;
this.width = b.strokeWidth; this.width = b.strokeWidth;
@@ -171,6 +172,7 @@ public final class LineStyle extends RenderStyle<LineStyle> {
if (line == null) if (line == null)
return reset(); return reset();
this.cat = line.cat;
this.level = line.level; this.level = line.level;
this.style = line.style; this.style = line.style;
this.strokeWidth = line.width; this.strokeWidth = line.width;
@@ -290,6 +292,7 @@ public final class LineStyle extends RenderStyle<LineStyle> {
} }
public T reset() { public T reset() {
cat = null;
level = -1; level = -1;
style = null; style = null;
fillColor = Color.BLACK; fillColor = Color.BLACK;

View File

@@ -58,6 +58,8 @@ public final class SymbolStyle extends RenderStyle<SymbolStyle> {
} }
public SymbolStyle(SymbolBuilder<?> b) { public SymbolStyle(SymbolBuilder<?> b) {
this.cat = b.cat;
this.bitmap = b.bitmap; this.bitmap = b.bitmap;
this.texture = b.texture; this.texture = b.texture;
this.hash = b.hash; this.hash = b.hash;
@@ -105,6 +107,8 @@ public final class SymbolStyle extends RenderStyle<SymbolStyle> {
if (symbol == null) if (symbol == null)
return reset(); return reset();
this.cat = symbol.cat;
this.bitmap = symbol.bitmap; this.bitmap = symbol.bitmap;
this.texture = symbol.texture; this.texture = symbol.texture;
this.hash = symbol.hash; this.hash = symbol.hash;
@@ -147,6 +151,8 @@ public final class SymbolStyle extends RenderStyle<SymbolStyle> {
} }
public T reset() { public T reset() {
cat = null;
bitmap = null; bitmap = null;
texture = null; texture = null;
hash = 0; hash = 0;

View File

@@ -47,6 +47,7 @@ public final class TextStyle extends RenderStyle<TextStyle> {
public int symbolPercent; public int symbolPercent;
public T reset() { public T reset() {
cat = null;
fontFamily = FontFamily.DEFAULT; fontFamily = FontFamily.DEFAULT;
fontStyle = FontStyle.NORMAL; fontStyle = FontStyle.NORMAL;
style = null; style = null;
@@ -150,6 +151,7 @@ public final class TextStyle extends RenderStyle<TextStyle> {
} }
public T from(TextBuilder<?> other) { public T from(TextBuilder<?> other) {
cat = other.cat;
fontFamily = other.fontFamily; fontFamily = other.fontFamily;
fontStyle = other.fontStyle; fontStyle = other.fontStyle;
style = other.style; style = other.style;
@@ -176,6 +178,7 @@ public final class TextStyle extends RenderStyle<TextStyle> {
if (text == null) if (text == null)
return reset(); return reset();
this.cat = text.cat;
this.style = text.style; this.style = text.style;
this.textKey = text.textKey; this.textKey = text.textKey;
this.caption = text.caption; this.caption = text.caption;
@@ -202,6 +205,7 @@ public final class TextStyle extends RenderStyle<TextStyle> {
} }
TextStyle(TextBuilder<?> b) { TextStyle(TextBuilder<?> b) {
this.cat = b.cat;
this.style = b.style; this.style = b.style;
this.textKey = b.textKey; this.textKey = b.textKey;
this.caption = b.caption; this.caption = b.caption;