Hi
I'm trying to customize the editor tollbar for OMDistance's so that the
graphics attributes part, i.e., line width etc is not shown. I have
managed to get the GUI to work as I want it to but the modifications
breaks the editor functionallity, i.e., dragging a node only works until
the first time the distance label is updated. My code goes like this:
public class RouteDrawingEditorTool extends DrawingEditorTool {
public RouteDrawingEditorTool(EditorLayer layer) {
super(layer);
drawingTool = new OMDrawingTool() {
public Component getGUI() {
if (!resetGUIWhenDeactivated)
return this;
removeAll();
Component eomgc = null;
graphicAttributes.setLineMenuAdditions(null);
if (currentEditable != null) {
// GUI specific to a particular EditableOMGraphic type.
eomgc = currentEditable.getGUI(graphicAttributes);
if (eomgc != null) {
add(eomgc);
}
}
// do not show the graphicAttributes part of the GUI
// Basic, generic GUI if eomgc wasn't set.
// if (eomgc == null) {
// add(graphicAttributes.getGUI());
// }
revalidate();
return this;
}
};
drawingTool.setUseAsTool(true); // prevents popup menu use.
drawingTool.getMouseMode().setVisible(false);
ga = drawingTool.getAttributes();
ga.setRenderType(OMGraphic.RENDERTYPE_LATLON);
ga.setLineType(OMGraphic.LINETYPE_GREATCIRCLE);
layer.setDrawingTool(drawingTool);
System.out.println("RouteDrawingEditorTool created!");
}
}
Any hints?
regards
/carsten
--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon Jan 09 2006 - 10:14:26 EST