* "Margins" fields should be updated after the orientation is changed.
*/
class OrientationChangeListener implements ChangeListener {
public void stateChanged(ChangeEvent e) {
OrientationRequested now = getOrient();
if ((lastOrient != null) && (now != null) && (!lastOrient.equals(now))) {
/* if orientation was really changed */
String txt = leftTxt.getText();
if ((lastOrient.equals(OrientationRequested.PORTRAIT)
&& now.equals(OrientationRequested.LANDSCAPE))
|| (lastOrient.equals(OrientationRequested.LANDSCAPE)
&& now.equals(OrientationRequested.REVERSE_PORTRAIT))
|| (lastOrient.equals(OrientationRequested.REVERSE_PORTRAIT)
&& now.equals(OrientationRequested.REVERSE_LANDSCAPE))
|| (lastOrient.equals(OrientationRequested.REVERSE_LANDSCAPE)
&& now.equals(OrientationRequested.PORTRAIT))) {
leftTxt.setText(bottomTxt.getText());
bottomTxt.setText(rightTxt.getText());
rightTxt.setText(topTxt.getText());
topTxt.setText(txt);
} else if ((lastOrient.equals(OrientationRequested.PORTRAIT)
&& now.equals(OrientationRequested.REVERSE_PORTRAIT))
|| (lastOrient.equals(OrientationRequested.LANDSCAPE)
&& now.equals(OrientationRequested.REVERSE_LANDSCAPE))
|| (lastOrient.equals(OrientationRequested.REVERSE_PORTRAIT)
&& now.equals(OrientationRequested.PORTRAIT))
|| (lastOrient.equals(OrientationRequested.REVERSE_LANDSCAPE)
&& now.equals(OrientationRequested.LANDSCAPE))) {
leftTxt.setText(rightTxt.getText());
rightTxt.setText(txt);
txt = topTxt.getText();
topTxt.setText(bottomTxt.getText());
bottomTxt.setText(txt);