Fix rendering rules
This commit is contained in:
parent
b4e3e20dfd
commit
8d540d66ac
3 changed files with 24 additions and 2 deletions
|
@ -24,21 +24,25 @@ public class RenderingRuleStorageProperties {
|
||||||
public static final String SHADOW_RADIUS = "shadowRadius";
|
public static final String SHADOW_RADIUS = "shadowRadius";
|
||||||
public static final String SHADOW_COLOR = "shadowColor";
|
public static final String SHADOW_COLOR = "shadowColor";
|
||||||
public static final String SHADER = "shader";
|
public static final String SHADER = "shader";
|
||||||
|
public static final String CAP_4 = "cap_4";
|
||||||
public static final String CAP_3 = "cap_3";
|
public static final String CAP_3 = "cap_3";
|
||||||
public static final String CAP_2 = "cap_2";
|
public static final String CAP_2 = "cap_2";
|
||||||
public static final String CAP = "cap";
|
public static final String CAP = "cap";
|
||||||
public static final String CAP_0 = "cap_0";
|
public static final String CAP_0 = "cap_0";
|
||||||
public static final String CAP__1 = "cap__1";
|
public static final String CAP__1 = "cap__1";
|
||||||
|
public static final String PATH_EFFECT_4 = "pathEffect_4";
|
||||||
public static final String PATH_EFFECT_3 = "pathEffect_3";
|
public static final String PATH_EFFECT_3 = "pathEffect_3";
|
||||||
public static final String PATH_EFFECT_2 = "pathEffect_2";
|
public static final String PATH_EFFECT_2 = "pathEffect_2";
|
||||||
public static final String PATH_EFFECT = "pathEffect";
|
public static final String PATH_EFFECT = "pathEffect";
|
||||||
public static final String PATH_EFFECT_0 = "pathEffect_0";
|
public static final String PATH_EFFECT_0 = "pathEffect_0";
|
||||||
public static final String PATH_EFFECT__1 = "pathEffect__1";
|
public static final String PATH_EFFECT__1 = "pathEffect__1";
|
||||||
|
public static final String STROKE_WIDTH_4 = "strokeWidth_4";
|
||||||
public static final String STROKE_WIDTH_3 = "strokeWidth_3";
|
public static final String STROKE_WIDTH_3 = "strokeWidth_3";
|
||||||
public static final String STROKE_WIDTH_2 = "strokeWidth_2";
|
public static final String STROKE_WIDTH_2 = "strokeWidth_2";
|
||||||
public static final String STROKE_WIDTH = "strokeWidth";
|
public static final String STROKE_WIDTH = "strokeWidth";
|
||||||
public static final String STROKE_WIDTH_0 = "strokeWidth_0";
|
public static final String STROKE_WIDTH_0 = "strokeWidth_0";
|
||||||
public static final String STROKE_WIDTH__1 = "strokeWidth__1";
|
public static final String STROKE_WIDTH__1 = "strokeWidth__1";
|
||||||
|
public static final String COLOR_4 = "color_4";
|
||||||
public static final String COLOR_3 = "color_3";
|
public static final String COLOR_3 = "color_3";
|
||||||
public static final String COLOR = "color";
|
public static final String COLOR = "color";
|
||||||
public static final String COLOR_2 = "color_2";
|
public static final String COLOR_2 = "color_2";
|
||||||
|
@ -86,21 +90,25 @@ public class RenderingRuleStorageProperties {
|
||||||
public RenderingRuleProperty R_SHADOW_RADIUS;
|
public RenderingRuleProperty R_SHADOW_RADIUS;
|
||||||
public RenderingRuleProperty R_SHADOW_COLOR;
|
public RenderingRuleProperty R_SHADOW_COLOR;
|
||||||
public RenderingRuleProperty R_SHADER;
|
public RenderingRuleProperty R_SHADER;
|
||||||
|
public RenderingRuleProperty R_CAP_4;
|
||||||
public RenderingRuleProperty R_CAP_3;
|
public RenderingRuleProperty R_CAP_3;
|
||||||
public RenderingRuleProperty R_CAP_2;
|
public RenderingRuleProperty R_CAP_2;
|
||||||
public RenderingRuleProperty R_CAP;
|
public RenderingRuleProperty R_CAP;
|
||||||
public RenderingRuleProperty R_CAP_0;
|
public RenderingRuleProperty R_CAP_0;
|
||||||
public RenderingRuleProperty R_CAP__1;
|
public RenderingRuleProperty R_CAP__1;
|
||||||
|
public RenderingRuleProperty R_PATH_EFFECT_4;
|
||||||
public RenderingRuleProperty R_PATH_EFFECT_3;
|
public RenderingRuleProperty R_PATH_EFFECT_3;
|
||||||
public RenderingRuleProperty R_PATH_EFFECT_2;
|
public RenderingRuleProperty R_PATH_EFFECT_2;
|
||||||
public RenderingRuleProperty R_PATH_EFFECT;
|
public RenderingRuleProperty R_PATH_EFFECT;
|
||||||
public RenderingRuleProperty R_PATH_EFFECT_0;
|
public RenderingRuleProperty R_PATH_EFFECT_0;
|
||||||
public RenderingRuleProperty R_PATH_EFFECT__1;
|
public RenderingRuleProperty R_PATH_EFFECT__1;
|
||||||
|
public RenderingRuleProperty R_STROKE_WIDTH_4;
|
||||||
public RenderingRuleProperty R_STROKE_WIDTH_3;
|
public RenderingRuleProperty R_STROKE_WIDTH_3;
|
||||||
public RenderingRuleProperty R_STROKE_WIDTH_2;
|
public RenderingRuleProperty R_STROKE_WIDTH_2;
|
||||||
public RenderingRuleProperty R_STROKE_WIDTH;
|
public RenderingRuleProperty R_STROKE_WIDTH;
|
||||||
public RenderingRuleProperty R_STROKE_WIDTH_0;
|
public RenderingRuleProperty R_STROKE_WIDTH_0;
|
||||||
public RenderingRuleProperty R_STROKE_WIDTH__1;
|
public RenderingRuleProperty R_STROKE_WIDTH__1;
|
||||||
|
public RenderingRuleProperty R_COLOR_4;
|
||||||
public RenderingRuleProperty R_COLOR_3;
|
public RenderingRuleProperty R_COLOR_3;
|
||||||
public RenderingRuleProperty R_COLOR;
|
public RenderingRuleProperty R_COLOR;
|
||||||
public RenderingRuleProperty R_COLOR_2;
|
public RenderingRuleProperty R_COLOR_2;
|
||||||
|
@ -207,22 +215,26 @@ public class RenderingRuleStorageProperties {
|
||||||
R_COLOR = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR));
|
R_COLOR = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR));
|
||||||
R_COLOR_2 = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR_2));
|
R_COLOR_2 = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR_2));
|
||||||
R_COLOR_3 = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR_3));
|
R_COLOR_3 = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR_3));
|
||||||
|
R_COLOR_4 = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR_4));
|
||||||
R_COLOR_0 = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR_0));
|
R_COLOR_0 = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR_0));
|
||||||
R_COLOR__1 = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR__1));
|
R_COLOR__1 = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR__1));
|
||||||
R_STROKE_WIDTH = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH));
|
R_STROKE_WIDTH = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH));
|
||||||
R_STROKE_WIDTH_2 = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH_2));
|
R_STROKE_WIDTH_2 = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH_2));
|
||||||
R_STROKE_WIDTH_3 = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH_3));
|
R_STROKE_WIDTH_3 = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH_3));
|
||||||
|
R_STROKE_WIDTH_4 = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH_4));
|
||||||
R_STROKE_WIDTH_0 = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH_0));
|
R_STROKE_WIDTH_0 = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH_0));
|
||||||
R_STROKE_WIDTH__1 = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH__1));
|
R_STROKE_WIDTH__1 = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH__1));
|
||||||
|
|
||||||
R_PATH_EFFECT = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT));
|
R_PATH_EFFECT = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT));
|
||||||
R_PATH_EFFECT_2 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT_2));
|
R_PATH_EFFECT_2 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT_2));
|
||||||
R_PATH_EFFECT_3 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT_3));
|
R_PATH_EFFECT_3 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT_3));
|
||||||
|
R_PATH_EFFECT_4 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT_4));
|
||||||
R_PATH_EFFECT_0 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT_0));
|
R_PATH_EFFECT_0 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT_0));
|
||||||
R_PATH_EFFECT__1 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT__1));
|
R_PATH_EFFECT__1 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT__1));
|
||||||
R_CAP = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP));
|
R_CAP = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP));
|
||||||
R_CAP_2 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP_2));
|
R_CAP_2 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP_2));
|
||||||
R_CAP_3 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP_3));
|
R_CAP_3 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP_3));
|
||||||
|
R_CAP_4 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP_4));
|
||||||
R_CAP_0 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP_0));
|
R_CAP_0 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP_0));
|
||||||
R_CAP__1 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP__1));
|
R_CAP__1 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP__1));
|
||||||
R_SHADER = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(SHADER));
|
R_SHADER = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(SHADER));
|
||||||
|
|
|
@ -302,7 +302,6 @@ public class RenderingRulesStorage {
|
||||||
stateChanged = true;
|
stateChanged = true;
|
||||||
} else if("renderingAttribute".equals(name)){ //$NON-NLS-1$
|
} else if("renderingAttribute".equals(name)){ //$NON-NLS-1$
|
||||||
String attr = parser.getAttributeValue("", "name");
|
String attr = parser.getAttributeValue("", "name");
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
RenderingRule root = new RenderingRule(new HashMap<String, String>( ), RenderingRulesStorage.this);
|
RenderingRule root = new RenderingRule(new HashMap<String, String>( ), RenderingRulesStorage.this);
|
||||||
renderingAttributes.put(attr, root);
|
renderingAttributes.put(attr, root);
|
||||||
stack.push(root);
|
stack.push(root);
|
||||||
|
|
|
@ -652,11 +652,22 @@ public class OsmandRenderer {
|
||||||
rStrokeW = req.ALL.R_STROKE_WIDTH__1;
|
rStrokeW = req.ALL.R_STROKE_WIDTH__1;
|
||||||
rCap = req.ALL.R_CAP__1;
|
rCap = req.ALL.R_CAP__1;
|
||||||
rPathEff = req.ALL.R_PATH_EFFECT__1;
|
rPathEff = req.ALL.R_PATH_EFFECT__1;
|
||||||
} else {
|
|
||||||
|
} else if(ind == 2){
|
||||||
rColor = req.ALL.R_COLOR_3;
|
rColor = req.ALL.R_COLOR_3;
|
||||||
rStrokeW = req.ALL.R_STROKE_WIDTH_3;
|
rStrokeW = req.ALL.R_STROKE_WIDTH_3;
|
||||||
rCap = req.ALL.R_CAP_3;
|
rCap = req.ALL.R_CAP_3;
|
||||||
rPathEff = req.ALL.R_PATH_EFFECT_3;
|
rPathEff = req.ALL.R_PATH_EFFECT_3;
|
||||||
|
} else if(ind == 3){
|
||||||
|
rColor = req.ALL.R_COLOR_4;
|
||||||
|
rStrokeW = req.ALL.R_STROKE_WIDTH_4;
|
||||||
|
rCap = req.ALL.R_CAP_4;
|
||||||
|
rPathEff = req.ALL.R_PATH_EFFECT_4;
|
||||||
|
} else {
|
||||||
|
rColor = req.ALL.R_COLOR_4;
|
||||||
|
rStrokeW = req.ALL.R_STROKE_WIDTH_4;
|
||||||
|
rCap = req.ALL.R_CAP_4;
|
||||||
|
rPathEff = req.ALL.R_PATH_EFFECT_4;
|
||||||
}
|
}
|
||||||
if(area){
|
if(area){
|
||||||
if(!req.isSpecified(rColor) && !req.isSpecified(req.ALL.R_SHADER)){
|
if(!req.isSpecified(rColor) && !req.isSpecified(req.ALL.R_SHADER)){
|
||||||
|
|
Loading…
Reference in a new issue