Changeset 8087 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java
- Timestamp:
- 2015-02-19T15:22:49+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java
r8085 r8087 14 14 public abstract class ElemStyle implements StyleKeys { 15 15 16 protected static final String[] ICON_KEYS = {"icon-image", "icon-width", "icon-height", "icon-opacity", "icon-offset-x", "icon-offset-y"}; 17 protected static final String[] REPEAT_IMAGE_KEYS = {"repeat-image", "repeat-image-width", "repeat-image-height", "repeat-image-opacity", null, null}; 16 protected static final int ICON_IMAGE_IDX = 0; 17 protected static final int ICON_WIDTH_IDX = 1; 18 protected static final int ICON_HEIGHT_IDX = 2; 19 protected static final int ICON_OPACITY_IDX = 3; 20 protected static final int ICON_OFFSET_X_IDX = 4; 21 protected static final int ICON_OFFSET_Y_IDX = 5; 22 public static final String[] ICON_KEYS = {ICON_IMAGE, ICON_WIDTH, ICON_HEIGHT, ICON_OPACITY, ICON_OFFSET_X, ICON_OFFSET_Y}; 23 public static final String[] REPEAT_IMAGE_KEYS = {REPEAT_IMAGE, REPEAT_IMAGE_WIDTH, REPEAT_IMAGE_HEIGHT, REPEAT_IMAGE_OPACITY, null, null}; 18 24 19 25 public float major_z_index; … … 31 37 32 38 protected ElemStyle(Cascade c, float default_major_z_index) { 33 major_z_index = c.get( "major-z-index", default_major_z_index, Float.class);39 major_z_index = c.get(MAJOR_Z_INDEX, default_major_z_index, Float.class); 34 40 z_index = c.get(Z_INDEX, 0f, Float.class); 35 41 object_z_index = c.get(OBJECT_Z_INDEX, 0f, Float.class); … … 177 183 178 184 protected static Font getFont(Cascade c, String s) { 179 String name = c.get( "font-family", getDefaultFontName(), String.class);180 float size = c.get( "font-size", getDefaultFontSize(), Float.class);185 String name = c.get(FONT_FAMILY, getDefaultFontName(), String.class); 186 float size = c.get(FONT_SIZE, getDefaultFontSize(), Float.class); 181 187 int weight = Font.PLAIN; 182 if ("bold".equalsIgnoreCase(c.get( "font-weight", null, String.class))) {188 if ("bold".equalsIgnoreCase(c.get(FONT_WEIGHT, null, String.class))) { 183 189 weight = Font.BOLD; 184 190 } 185 191 int style = Font.PLAIN; 186 if ("italic".equalsIgnoreCase(c.get( "font-style", null, String.class))) {192 if ("italic".equalsIgnoreCase(c.get(FONT_STYLE, null, String.class))) { 187 193 style = Font.ITALIC; 188 194 }
Note:
See TracChangeset
for help on using the changeset viewer.