// ********************************************************************** // ********************************************************************** // ********************************************************************** package com.obrctm.openmap.editor; import com.bbn.openmap.omGraphics.*; import com.bbn.openmap.tools.drawing.*; /** * Loader that knows how to create/edit OMText objects. */ public class OMTextLoader extends AbstractToolLoader implements EditToolLoader { protected String textClassName = "com.bbn.openmap.omGraphics.OMText"; public OMTextLoader() { init(); } public void init() { EditClassWrapper ecw = new EditClassWrapper(textClassName, "com.obrctm.mrcc.graphiceditor.EditableOMText", "editabletext.gif", "Text"); 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() == textClassName) { return new EditableOMText(ga); } return null; } /** * Give an OMGraphic to the EditToolLoader, which will create an * EditableOMGraphic for it. */ public EditableOMGraphic getEditableGraphic(OMGraphic graphic) { if (graphic instanceof OMText) { return new EditableOMText((OMText)graphic); } return null; } }