[OpenMap Users] Re: EditableOMText

From: Don Dietrick <dfdietrick_at_gmail.com>
Date: Sat, 17 Sep 2011 01:56:50 -0400

Hi Kevin,

I appreciate you sending these in, I've updated the code for checkin.

Thanks again for the fixes,

Don

On Fri, Sep 16, 2011 at 4:14 PM, Kevin Grunenberg
<KGrunenberg_at_asascience.com> wrote:
> Don,
> Just wanted to share a problem I found and what I did to fix it.
> The DrawingToolLayer appeared to have a problem rotating text. After looking
> into it the problem was in the EditableOMText class. It was taking the input
> and converting it to Degrees when it was expecting Radians. Then when it
> would display the value for edit it would convert it again (expecting it was
> stored in radians)
> package com.bbn.openmap.omGraphics;
> EditableOMText.java
> ************************
> Change: actionPerformed
> ************************
> text.setRotationAngle(Math.toDegrees(rotation.intValue() % 360));
> To:
> text.setRotationAngle(Math.toRadians(rotation.intValue()));
>
>
> Also there was some funk with the display (if the value was –45 it would
> show –140 ????) that appears to be fixed with the following change
> ************************
> Change: getTextGUI
> ************************
> textField = new JTextField(Integer.toString((int) Math.toDegrees(text
>                 .getRotationAngle()), 5));
> To:
> textField = new JTextField(String.valueOf((int) Math.toDegrees(text
>                 .getRotationAngle())), 5);
>
> -- Kevin Grunenberg

--
[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 Sat Sep 17 2011 - 01:59:04 EDT

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