EditorActions.java 文件源码

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

项目:Tarski 作者:
/**
 * 
 */
public void actionPerformed(ActionEvent e)
{
    if (e.getSource() instanceof mxGraphComponent)
    {
        mxGraphComponent graphComponent = (mxGraphComponent) e
                .getSource();
        double scale = this.scale;

        if (scale == 0)
        {
            String value = (String) JOptionPane.showInputDialog(
                    graphComponent, mxResources.get("value"),
                    mxResources.get("scale") + " (%)",
                    JOptionPane.PLAIN_MESSAGE, null, null, "");

            if (value != null)
            {
                scale = Double.parseDouble(value.replace("%", "")) / 100;
            }
        }

        if (scale > 0)
        {
            graphComponent.zoomTo(scale, graphComponent.isCenterZoom());
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号