uDIG
  1. uDIG
  2. UDIG-1530

first geom after layer change not persistant

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: UDIG 1.2.M2, UDIG 1.2.M3, UDIG 1.2.M4, UDIG 1.2.M5
    • Fix Version/s: UDIG 1.4.1
    • Labels:
      None
    • Environment:
      XP, jre1.6.0_07

      Description

      The first geometry I draw after selecting a layer in the layer view is not created. The shape is drawn on the screen but when another action is made, the shape disappears. Every subsequent geom drawn behaves normally.

      If I select another layer, the same happens: first geom gives error, subsequent geoms work correctly. Similarly, if I click back to the original layer, the same issue occurs.

      AcceptChangesBehaviour uses isCreatingNewFeature(handler)

      The issue is that isCreatingNewFeature() Returns false when creating the first geom after selecting a layer (meaning that the EditManager still has an edit feature that hasn't been cleared).

      If we put something like:
      ((EditManager)handler.getContext().getEditManager()).setEditFeature(null, null);
      into a listener for the layers panel, it would solve the problem.

        Activity

        Hide
        Luke Temby added a comment -
        Fix suggestion:

        CLASS: net.refractions.udig.project.ui.internal.MapEditor
        FIX: insert at line 980:
            ((EditManager)getMap().getEditManager()).setEditFeature(null, null);

        This clears the editfeature when a new layer is selected.

        In other words, replace:
            if( layer.getMap()==getMap()
                && getMap().getEditManager().getSelectedLayer() != layer){
              SelectLayerCommand selectLayerCommand = new SelectLayerCommand(layer);

        with:
            if( layer.getMap()==getMap()
                && getMap().getEditManager().getSelectedLayer() != layer){

              ((EditManager)getMap().getEditManager()).setEditFeature(null, null);
                          
              SelectLayerCommand selectLayerCommand = new SelectLayerCommand(layer);

        Luke.
        Show
        Luke Temby added a comment - Fix suggestion: CLASS: net.refractions.udig.project.ui.internal.MapEditor FIX: insert at line 980:     ((EditManager)getMap().getEditManager()).setEditFeature(null, null); This clears the editfeature when a new layer is selected. In other words, replace:     if( layer.getMap()==getMap()         && getMap().getEditManager().getSelectedLayer() != layer){       SelectLayerCommand selectLayerCommand = new SelectLayerCommand(layer); with:     if( layer.getMap()==getMap()         && getMap().getEditManager().getSelectedLayer() != layer){       ((EditManager)getMap().getEditManager()).setEditFeature(null, null);                          SelectLayerCommand selectLayerCommand = new SelectLayerCommand(layer); Luke.
        Hide
        Luke Temby added a comment -
        Suggested fix @ line 982
        Show
        Luke Temby added a comment - Suggested fix @ line 982

          People

          • Assignee:
            Unassigned
            Reporter:
            Luke Temby
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: