org.openstreetmap.josm.gui.mappaint
Class ElemStyle

java.lang.Object
  extended by org.openstreetmap.josm.gui.mappaint.ElemStyle
All Implemented Interfaces:
StyleKeys
Direct Known Subclasses:
AreaElemStyle, BoxTextElemStyle, LineElemStyle, LinePatternElemStyle, LineTextElemStyle, NodeElemStyle

public abstract class ElemStyle
extends java.lang.Object
implements StyleKeys


Nested Class Summary
private static class ElemStyle.FontDescriptor
           
 
Field Summary
private static java.lang.String DEFAULT_FONT_NAME
           
private static java.lang.Float DEFAULT_FONT_SIZE
           
private static java.util.Map<ElemStyle.FontDescriptor,java.awt.Font> FONT_MAP
           
 boolean isModifier
           
 float major_z_index
           
 float object_z_index
           
 float z_index
           
 
Fields inherited from interface org.openstreetmap.josm.gui.mappaint.StyleKeys
COLOR, DASHES, DASHES_BACKGROUND_COLOR, DASHES_BACKGROUND_OPACITY, DASHES_OFFSET, FILL_COLOR, FILL_IMAGE, FILL_OPACITY, ICON_IMAGE, MODIFIER, OBJECT_Z_INDEX, OFFSET, OPACITY, REAL_WIDTH, TEXT, TEXT_POSITION, WIDTH, Z_INDEX
 
Constructor Summary
protected ElemStyle(Cascade c, float default_major_z_index)
           
  ElemStyle(float major_z_index, float z_index, float object_z_index, boolean isModifier)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
private static java.awt.Font getCachedFont(ElemStyle.FontDescriptor fd)
           
private static java.awt.Font getCachedFont(java.lang.String name, int style, int size)
           
protected static java.awt.Font getFont(Cascade c)
           
protected static java.lang.Float getWidth(Cascade c, java.lang.String key, java.lang.Float relativeTo)
          Get a property value of type Width
 int hashCode()
           
private static void initDefaultFontParameters()
           
 boolean isProperLineStyle()
           
abstract  void paintPrimitive(OsmPrimitive primitive, MapPaintSettings paintSettings, MapPainter painter, boolean selected, boolean member)
          draws a primitive
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

major_z_index

public float major_z_index

z_index

public float z_index

object_z_index

public float object_z_index

isModifier

public boolean isModifier

DEFAULT_FONT_NAME

private static java.lang.String DEFAULT_FONT_NAME

DEFAULT_FONT_SIZE

private static java.lang.Float DEFAULT_FONT_SIZE

FONT_MAP

private static final java.util.Map<ElemStyle.FontDescriptor,java.awt.Font> FONT_MAP
Constructor Detail

ElemStyle

public ElemStyle(float major_z_index,
                 float z_index,
                 float object_z_index,
                 boolean isModifier)

ElemStyle

protected ElemStyle(Cascade c,
                    float default_major_z_index)
Method Detail

paintPrimitive

public abstract void paintPrimitive(OsmPrimitive primitive,
                                    MapPaintSettings paintSettings,
                                    MapPainter painter,
                                    boolean selected,
                                    boolean member)
draws a primitive

Parameters:
primitive -
paintSettings -
painter -
selected - true, if primitive is selected
member - true, if primitive is not selected and member of a selected relation

isProperLineStyle

public boolean isProperLineStyle()

getWidth

protected static java.lang.Float getWidth(Cascade c,
                                          java.lang.String key,
                                          java.lang.Float relativeTo)
Get a property value of type Width

Parameters:
c - the cascade
key - property key for the width value
relativeTo - reference width. Only needed, when relative width syntax is used, e.g. "+4".

initDefaultFontParameters

private static void initDefaultFontParameters()

getCachedFont

private static java.awt.Font getCachedFont(ElemStyle.FontDescriptor fd)

getCachedFont

private static java.awt.Font getCachedFont(java.lang.String name,
                                           int style,
                                           int size)

getFont

protected static java.awt.Font getFont(Cascade c)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


JOSM