⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 customizerdialog.java

📁 openmap java写的开源数字地图程序. 用applet实现,可以像google map 那样放大缩小地图.
💻 JAVA
字号:
/* ********************************************************************** *  *    Use, duplication, or disclosure by the Government is subject to *           restricted rights as set forth in the DFARS. *   *                         BBNT Solutions LLC *                             A Part of  *                  Verizon       *                          10 Moulton Street *                         Cambridge, MA 02138 *                          (617) 873-3000 * *    Copyright (C) 2002 by BBNT Solutions, LLC *                 All Rights Reserved. * ********************************************************************** */package com.bbn.openmap.tools.beanbox;import java.awt.*;import java.awt.event.*;import java.beans.*;/** * Utility class that takes a generic component editor and wraps it in * a Dialog box. This includes adding the Frame and the "ok" and * "cancel" buttons. This class is used by the * {@link com.bbn.openmap.tools.beanbox.GenericPropertySheet}to show * a bean customizer. */public class CustomizerDialog extends Dialog implements ActionListener {    private Component body;    private Button doneButton;    private static int vPad = 5;    private static int hPad = 4;    /**     * Constructor taking the parent frame, the customizer component     * and the target bean as arguments.     */    public CustomizerDialog(Frame frame, Customizer customizer, Object target) {        super(frame, customizer.getClass().getName(), true);        setLayout(null);        body = (Component) customizer;        add(body);        doneButton = new Button("Done");        doneButton.addActionListener(this);        add(doneButton);        int x = frame.getLocation().x + 30;        int y = frame.getLocation().y + 100;        setLocation(x, y);        show();    }    public void doLayout() {        Insets ins = getInsets();        Dimension bodySize = body.getPreferredSize();        Dimension buttonSize = doneButton.getPreferredSize();        int width = ins.left + 2 * hPad + ins.right + bodySize.width;        int height = ins.top + 3 * vPad + ins.bottom + bodySize.height                + buttonSize.height;        body.setBounds(ins.left + hPad,                ins.top + vPad,                bodySize.width,                bodySize.height);        doneButton.setBounds((width - buttonSize.width) / 2,                ins.top + (2 * hPad) + bodySize.height,                buttonSize.width,                buttonSize.height);        setSize(width, height);    }    /**     * Disposes this dialog.     */    public void actionPerformed(ActionEvent evt) {        // Our "done" button got pushed.        dispose();    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -