Ignore:
Timestamp:
2013-03-21T07:28:34+01:00 (12 years ago)
Author:
zverik
Message:

updated alpha of iodb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagery_offset_db/src/iodb/OffsetDialogButton.java

    r29379 r29380  
    2424    public OffsetDialogButton( ImageryOffsetBase offset ) {
    2525        super();
     26        this.offset = offset;
    2627        setMinimumSize(new Dimension(500, 10));
    2728        setMaximumSize(new Dimension(500, 150));
    28         setText("<html>"
    29                 + Math.round(offset.getPosition().greatCircleDistance(ImageryOffsetTools.getMapCenter())) + " m: "
    30                 + offset.getDescription() + "</html>");
     29        setRelevantText();
    3130        setIcon(new OffsetIcon(offset));
    32         this.offset = offset;
    3331
    3432        offsetLength = offset instanceof ImageryOffset ? getLengthAndDirection((ImageryOffset)offset)[0] : 0.0;
    3533        // todo: layout, info, map distance and direction
     34    }
     35
     36    /**
     37     * Update text on the button. This method is to be deleted by release.
     38     */
     39    public void setRelevantText() {
     40        setText("<html>"
     41                + ImageryOffsetTools.formatDistance(offset.getPosition().greatCircleDistance(ImageryOffsetTools.getMapCenter()))
     42                + ": " + offset.getDescription() + "</html>");
    3643    }
    3744
     
    4653        size.height = 70;
    4754        return size;
     55    }
     56
     57    /**
     58     * Update arrow for the offset location.
     59     */
     60    public void updateLocation() {
     61        // map was moved, update arrow.
     62        setRelevantText();
    4863    }
    4964
Note: See TracChangeset for help on using the changeset viewer.