[OpenMap Users] EditableOMText

From: Kevin Grunenberg <KGrunenberg_at_asascience.com>
Date: Fri, 16 Sep 2011 16:14:51 -0400

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 Fri Sep 16 2011 - 16:20:37 EDT

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