Display.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:TrakEM2 作者:
@Override
      public void textValueChanged(final TextEvent e) {
    try {
        final TextField source = (TextField) e.getSource();
        if (scale == source && (scale.isFocusOwner() || bar.isFocusOwner())) {
            final double sc = Double.parseDouble(scale.getText()) / 100;
            // update both
            width.setText(Integer.toString((int) (sc * initial_width + 0.5)));
            height.setText(Integer.toString((int) (sc * initial_height + 0.5)));
        } else if (width == source && width.isFocusOwner()) {
            /*
            final int width = Integer.toString((int) (width.getText() + 0.5));
            final double sc = width / (double)initial_width;
            scale.setText(Integer.toString((int)(sc * 100 + 0.5)));
            height.setText(Integer.toString((int)(sc * initial_height + 0.5)));
            */
            set(width, height, initial_width, initial_height);
        } else if (height == source && height.isFocusOwner()) {
            set(height, width, initial_height, initial_width);
        }
    } catch (final NumberFormatException nfe) {
        Utils.logAll("Unparsable number: " + nfe.getMessage());
    } catch (final Exception ee) {
        IJError.print(ee);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号