Ignore:
Timestamp:
2016-01-03T15:50:53+01:00 (8 years ago)
Author:
bastiK
Message:

move ElemStyle classes to new package, rename to (Style)Element

Location:
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/TextLabel.java

    r9275 r9278  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.gui.mappaint;
     2package org.openstreetmap.josm.gui.mappaint.styleelement;
    33
    44import java.awt.Color;
     
    77
    88import org.openstreetmap.josm.data.osm.OsmPrimitive;
    9 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy;
    10 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.StaticLabelCompositionStrategy;
    11 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.TagLookupCompositionStrategy;
     9import org.openstreetmap.josm.gui.mappaint.Cascade;
     10import org.openstreetmap.josm.gui.mappaint.Environment;
     11import org.openstreetmap.josm.gui.mappaint.Keyword;
    1212import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.TagKeyReference;
     13import org.openstreetmap.josm.gui.mappaint.StyleKeys;
     14import org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy;
     15import org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy.StaticLabelCompositionStrategy;
     16import org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy.TagLookupCompositionStrategy;
    1317import org.openstreetmap.josm.tools.CheckParameterUtil;
    1418import org.openstreetmap.josm.tools.Utils;
     
    1822 * @since 3880
    1923 */
    20 public class TextElement implements StyleKeys {
     24public class TextLabel implements StyleKeys {
    2125    public static final LabelCompositionStrategy AUTO_LABEL_COMPOSITION_STRATEGY = new DeriveLabelFromNameTagsCompositionStrategy();
    2226
     
    4549     * @param haloColor halo color
    4650     */
    47     public TextElement(LabelCompositionStrategy strategy, Font font, int xOffset, int yOffset, Color color, Float haloRadius, Color haloColor) {
     51    public TextLabel(LabelCompositionStrategy strategy, Font font, int xOffset, int yOffset, Color color, Float haloRadius, Color haloColor) {
    4852        CheckParameterUtil.ensureParameterNotNull(font);
    4953        CheckParameterUtil.ensureParameterNotNull(color);
     
    6266     * @param other the other element.
    6367     */
    64     public TextElement(TextElement other) {
     68    public TextLabel(TextLabel other) {
    6569        this.labelCompositionStrategy = other.labelCompositionStrategy;
    6670        this.font = other.font;
     
    116120     * @throws IllegalArgumentException if {@code defaultTextColor} is null
    117121     */
    118     public static TextElement create(Environment env, Color defaultTextColor, boolean defaultAnnotate) {
     122    public static TextLabel create(Environment env, Color defaultTextColor, boolean defaultAnnotate) {
    119123        CheckParameterUtil.ensureParameterNotNull(defaultTextColor);
    120124        Cascade c = env.mc.getCascade(env.layer);
     
    124128        String s = strategy.compose(env.osm);
    125129        if (s == null) return null;
    126         Font font = ElemStyle.getFont(c, s);
     130        Font font = StyleElement.getFont(c, s);
    127131
    128132        float xOffset = 0;
     
    157161        }
    158162
    159         return new TextElement(strategy, font, (int) xOffset, -(int) yOffset, color, haloRadius, haloColor);
     163        return new TextLabel(strategy, font, (int) xOffset, -(int) yOffset, color, haloRadius, haloColor);
    160164    }
    161165
     
    212216        if (obj == null || getClass() != obj.getClass())
    213217            return false;
    214         final TextElement other = (TextElement) obj;
     218        final TextLabel other = (TextLabel) obj;
    215219        return Objects.equals(labelCompositionStrategy, other.labelCompositionStrategy) &&
    216220        Objects.equals(font, other.font) &&
Note: See TracChangeset for help on using the changeset viewer.