Re: [OpenMap Users] Customizing editor toolbar?

From: Don Dietrick <dietrick_at_bbn.com>
Date: Mon, 9 Jan 2006 16:42:53 -0500

OK, if you want some attributes to show up, you should keep that
property set to true. I'd override the EditableOMGraphics.getGUI()
methods to return what you want. It sounds like you want the
EditableOMRoute.getGUI() to just return the getPolyGUI() JToolBar
instead of adding that JToolBar to the GraphicAttributes GUI. For
all those EditableOMGraphics.getGUI() methods, returning null is safe
if you don't want anything to display.

- Don

On Jan 9, 2006, at 3:45 PM, Carsten . Madsen wrote:

> I tried that but I want the poly add/remove node icons to appear in
> the toolbar. I have tweaked my Editable class to do:
>
> public class EditableOMRoute extends EditableOMDistance {
> public JToolBar getPolyGUI() {
> return getPolyGUI(false, true, true);
> }
> ...
> }
>
> But if I run with showAttributes=false the getPolyGUI code is never
> called?
>
> regards
> /carsten
>
>
> Don Dietrick wrote:
>
>> Hi Carsten,
>>
>> You can set the .showAttributes property to false, and those
>> controls won't be shown. The 'Distance Layer' in the
>> openmap.properties file has that setting.
>>
>> Regards,
>>
>> Don
>>
>>
>> On Jan 9, 2006, at 9:44 AM, Carsten . Madsen wrote:
>>
>>> 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"]
>>
>>
>>
>
> --
> [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"]

--
[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 - 16:44:10 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:07 EDT