// ********************************************************************** // ********************************************************************** // ********************************************************************** package com.obrctm.openmap.editor; import com.bbn.openmap.omGraphics.*; import com.bbn.openmap.tools.drawing.*; /** * Loader that knows how to create/edit OMIcon objects. */ public class OMIconLoader extends AbstractToolLoader implements EditToolLoader { protected String iconClassName = "com.obrctm.openmap.editor.OMRasterName"; public OMIconLoader() { init(); } public void init() { EditClassWrapper ecw = new EditClassWrapper(iconClassName, "com.obrctm.openmap.editor..EditableOMIcon", "editableicon.gif", "Symbol"); addEditClassWrapper(ecw); } /** * Give the classname of a graphic to create, returning an * EditableOMGraphic for that graphic. The GraphicAttributes * object lets you set some of the initial parameters of the text, * like font and size. */ public EditableOMGraphic getEditableGraphic(String classname, GraphicAttributes ga) { if (classname.intern() == iconClassName) { return new EditableOMIcon(ga); } return null; } /** * Give an OMGraphic to the EditToolLoader, which will create an * EditableOMGraphic for it. */ public EditableOMGraphic getEditableGraphic(OMGraphic graphic) { if (graphic instanceof OMNamedRaster) { return new EditableOMIcon((OMNamedRaster)graphic); } return null; } }