Changeset 21169 in osm


Ignore:
Timestamp:
2010-05-07T22:37:50+02:00 (15 years ago)
Author:
lambertus
Message:

'Fix the message text (and remove the now redundant message popup)'

Location:
applications/editors/josm/plugins/terracer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/terracer/build.xml

    r21166 r21169  
    3232
    3333
    34     <property name="commit.message" value="Remember the interpolation setting between restarts" />
     34    <property name="commit.message" value="Fix the message text (and remove the now redundant message popup)" />
    3535    <property name="plugin.main.version" value="3210" />
    3636
  • applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputDialog.java

    r21166 r21169  
    1717import java.awt.Frame;
    1818import java.awt.GridBagLayout;
     19import java.awt.GridBagConstraints;
    1920import java.awt.GridLayout;
    2021import java.awt.event.ActionEvent;
     
    105106        setupDialog();
    106107        setVisible(true);
     108        lo.requestFocus();
    107109    }
    108110
     
    126128    private Container getJContentPane() {
    127129        if (jContentPane == null) {
    128        
    129             messageLabel = new JTextArea();
     130            jContentPane = this.getContentPane();
     131            jContentPane.setLayout(new BoxLayout(jContentPane, BoxLayout.Y_AXIS));
     132            jContentPane.add(getInputPanel(), jContentPane);
     133        }
     134        return jContentPane;
     135    }
     136
     137    /**
     138     * This method initializes inputPanel
     139     *
     140     * @return javax.swing.JPanel
     141     */
     142    private JPanel getInputPanel() {
     143        if (inputPanel == null) {
     144
     145                GridBagConstraints c = new GridBagConstraints();
     146
     147                messageLabel = new JTextArea();
    130148            messageLabel.setText(DEFAULT_MESSAGE);
    131149            messageLabel.setAutoscrolls(true);
     
    135153            messageLabel.setBackground(new Color(238, 238, 238));
    136154            messageLabel.setEditable(false);
     155            messageLabel.setFocusable(false); // Needed so that lowest number can have focus immediately
    137156           
    138             jContentPane = this.getContentPane();
    139             jContentPane.setLayout(new BoxLayout(jContentPane, BoxLayout.Y_AXIS));
    140             jContentPane.add(messageLabel, jContentPane);
    141             jContentPane.add(getInputPanel(), jContentPane);
    142         }
    143         return jContentPane;
    144     }
    145 
    146     /**
    147      * This method initializes inputPanel
    148      *
    149      * @return javax.swing.JPanel
    150      */
    151     private JPanel getInputPanel() {
    152         if (inputPanel == null) {
    153157            interpolationLabel = new JLabel();
    154158            interpolationLabel.setText(tr("Interpolation"));
     
    170174            inputPanel = new JPanel();
    171175            inputPanel.setLayout(new GridBagLayout());
     176            c.fill = GridBagConstraints.HORIZONTAL;
     177                        c.gridwidth = GridBagConstraints.REMAINDER;
     178            inputPanel.add(messageLabel, c);
     179           
    172180            inputPanel.add(loLabel, GBC.std().insets(3,3,0,0));
    173181            inputPanel.add(getLo(), GBC.eol().fill(GBC.HORIZONTAL).insets(5,3,0,0));
     
    207215            lo = new JTextField();
    208216            lo.setText("");
    209             lo.requestFocus();
    210217        }
    211218        return lo;
  • applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputHandler.java

    r21166 r21169  
    138138                dialog.messageLabel.setForeground(Color.red);
    139139                dialog.messageLabel.setText(message.toString());
    140                 JOptionPane.showMessageDialog(null, message.toString(), tr("Error"), JOptionPane.ERROR_MESSAGE);
     140                //JOptionPane.showMessageDialog(null, message.toString(), tr("Error"), JOptionPane.ERROR_MESSAGE);
    141141
    142142            return false;
Note: See TracChangeset for help on using the changeset viewer.