Package hec.gfx2d
Class G2dGlyphFactory
java.lang.Object
hec.gfx2d.G2dGlyphFactory
Makes the Glyphs for the Maps.. And sets the Glyph Characteristics through the
GlyphDataRecord in the MapObject (if it has one).
To add a new Glyph to the factory, use
addMapping(Class, Class)
. It is recommended to call addMapping
in a static { ... }
block at the top of your Data object class. Example:
public class MyG2dObject implements G2dObject { static { G2dGlyphFactory.addMapping(MyG2dObject.class.getName(), MyG2dObjectGlyph.class); } public MyG2dObject() { // ... } // ... }This ensures that when the Data Object is created for the first time, it will add the mapping to the G2dGlyphFactory. This avoids the need to directly reference the classes in the Glyph Factory, and the static{} block ensures that it is only added once per classloader.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addMapping
(Class<?> g2dGlyphDataClass, Class<? extends G2dGlyph> g2dGlyphClass) add a Plot object to G2dGlyph mapping.static void
addMapping
(String g2dGlyphDataClass, String g2dGlyphClass) Deprecated.static G2dGlyph
newG2dGlyph
(Viewport view, G2dObject obj, Scale scl)
-
Field Details
-
g2dGlyphMapping
-
-
Constructor Details
-
G2dGlyphFactory
public G2dGlyphFactory()
-
-
Method Details
-
addMapping
Deprecated.add a MapObjectInterface to MapGlyph mapping.- Parameters:
g2dGlyphDataClass
- the classname of the MapObjectInterfaceg2dGlyphClass
- the classname of the MapGlyph- See Also:
-
addMapping
add a Plot object to G2dGlyph mapping.- Parameters:
g2dGlyphDataClass
- the class of the Plot objectg2dGlyphClass
- the class of the G2dGlyph
-
newG2dGlyph
-