// Path: DBMetadata-swing/src/main/java/com/github/abel533/Code.java
// public class Code {
//     public static Font TEXT_MSG = new Font("Monospaced", Font.PLAIN, 10);
//     public static Font TEXT_FONT = new Font(I18n.key("tools.text.font"), Font.PLAIN, 14);
//     public static Font TEXT_TABLE = new Font(I18n.key("tools.text.font"), Font.PLAIN, 12);
//     public static Font TEXT_BUTTON = new Font(I18n.key("tools.text.font"), Font.BOLD, 14);
// }
// 
// Path: DBMetadata-swing/src/main/java/com/github/abel533/component/JTextF.java
// public class JTextF extends JTextField {
// 
//     private static final long serialVersionUID = 1L;
//     private BufferedImage buffer = null;
// 
//     public JTextF() {
//         super();
//         setFont(Code.TEXT_FONT);
//     }
// 
//     @Override
//     public void paintComponent(Graphics g) {
//         Component window = this.getTopLevelAncestor();
//         if (window instanceof Window && !((Window) window).isOpaque()) {
//             // This is a translucent window, so we need to draw to a buffer
//             // first to work around a bug in the DirectDraw rendering in Swing.
//             int w = this.getWidth();
//             int h = this.getHeight();
//             if (buffer == null || buffer.getWidth() != w || buffer.getHeight() != h) {
//                 // Create a new buffer based on the current size.
//                 GraphicsConfiguration gc = this.getGraphicsConfiguration();
//                 buffer = gc.createCompatibleImage(w, h, BufferedImage.TRANSLUCENT);
//             }
// 
//             // Use the super class's paintComponent implementation to draw to
//             // the buffer, then write that buffer to the original Graphics object.
//             Graphics bufferGraphics = buffer.createGraphics();
//             try {
//                 super.paintComponent(bufferGraphics);
//             } finally {
//                 bufferGraphics.dispose();
//             }
//             g.drawImage(buffer, 0, 0, w, h, 0, 0, w, h, null);
//         } else {
//             // This is not a translucent window, so we can call the super class
//             // implementation directly.
//             super.paintComponent(g);
//         }
//     }
// }
// 
// Path: DBMetadata-swing/src/main/java/com/github/abel533/utils/I18n.java
// public class I18n {
//     private static final String SUFFIX = ".properties";
//     private static ResourceBundle[] resourceBundles;
//     private static Set<String> baseNameList;
// 
//     static {
//         init(null);
//     }
// 
//     private static void initBaseNameList() {
//         File[] files = new File(Path.LANGUAGE).listFiles(new FilenameFilter() {
//             @Override
//             public boolean accept(File dir, String name) {
//                 if (name.endsWith(SUFFIX)) {
//                     return true;
//                 }
//                 return false;
//             }
//         });
//         baseNameList = new HashSet<String>();
//         for (int i = 0; i < files.length; i++) {
//             String fileName = files[i].getName();
//             int index = fileName.indexOf('_');
//             if (index == -1) {
//                 baseNameList.add("language/" + fileName.substring(0, fileName.lastIndexOf('.')));
//             } else {
//                 baseNameList.add("language/" + fileName.substring(0, index));
//             }
//         }
//     }
// 
//     /**
//      * 初始化 - 可以设置语言
//      *
//      * @param locale
//      */
//     public static void init(Locale locale) {
//         if (locale != null) {
//             Locale.setDefault(locale);
//         }
//         if (baseNameList == null || baseNameList.size() == 0) {
//             initBaseNameList();
//         }
//         resourceBundles = new ResourceBundle[baseNameList.size()];
//         int i = 0;
//         for (String baseName : baseNameList) {
//             resourceBundles[i] = ResourceBundle.getBundle(baseName);
//             i++;
//         }
//     }
// 
//     public static String key(String key) {
//         for (int i = 0; i < resourceBundles.length; i++) {
//             if (resourceBundles[i].containsKey(key)) {
//                 return resourceBundles[i].getString(key);
//             }
//         }
//         throw new RuntimeException("key:" + key + " not exists!");
//     }
// 
//     /**
//      * 可配参数，如：查找{0}字段
//      *
//      * @param key
//      * @param args
//      * @return
//      */
//     public static String key(String key, Object... args) {
//         return MessageFormat.format(key(key), args);
//     }
// }


import com.github.abel533.Code;
import com.github.abel533.component.JTextF;
import com.github.abel533.utils.I18n;
import org.jb2011.lnf.beautyeye.ch3_button.BEButtonUI;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
package com.github.abel533.view.panel;



/**
 * 主界面 - 查询
 *
 * @author liuzh
 * @since 2015-03-20
 */
public class SearchPanel extends JPanel {
    private static final long serialVersionUID = 1L;

    private JTextF textSearchName;
    private JTextF textSearchComment;
    private JTextF textChoose;

    private JRadioButton radioTypeTable;
    private JRadioButton radioTypeField;

    private JCheckBox checkBoxQuickSearch;
    private JCheckBox checkBoxCaseSensitive;

    private JRadioButton radioMatchEquals;
    private JRadioButton radioMatchContains;

    private JButton btnSearch;
    private JButton btnCancel;

    /**
     * Create the this.
     */
    public SearchPanel() {
        this.setPreferredSize(new Dimension(811, 114));
        this.setLayout(new BorderLayout(0, 0));

        JPanel panel_2 = new JPanel();
        panel_2.setPreferredSize(new Dimension(250, 10));
        this.add(panel_2, BorderLayout.EAST);
        panel_2.setLayout(null);

// Path: DBMetadata-swing/src/main/java/com/github/abel533/Code.java
// public class Code {
//     public static Font TEXT_MSG = new Font("Monospaced", Font.PLAIN, 10);
//     public static Font TEXT_FONT = new Font(I18n.key("tools.text.font"), Font.PLAIN, 14);
//     public static Font TEXT_TABLE = new Font(I18n.key("tools.text.font"), Font.PLAIN, 12);
//     public static Font TEXT_BUTTON = new Font(I18n.key("tools.text.font"), Font.BOLD, 14);
// }
// 
// Path: DBMetadata-swing/src/main/java/com/github/abel533/component/JTextF.java
// public class JTextF extends JTextField {
// 
//     private static final long serialVersionUID = 1L;
//     private BufferedImage buffer = null;
// 
//     public JTextF() {
//         super();
//         setFont(Code.TEXT_FONT);
//     }
// 
//     @Override
//     public void paintComponent(Graphics g) {
//         Component window = this.getTopLevelAncestor();
//         if (window instanceof Window && !((Window) window).isOpaque()) {
//             // This is a translucent window, so we need to draw to a buffer
//             // first to work around a bug in the DirectDraw rendering in Swing.
//             int w = this.getWidth();
//             int h = this.getHeight();
//             if (buffer == null || buffer.getWidth() != w || buffer.getHeight() != h) {
//                 // Create a new buffer based on the current size.
//                 GraphicsConfiguration gc = this.getGraphicsConfiguration();
//                 buffer = gc.createCompatibleImage(w, h, BufferedImage.TRANSLUCENT);
//             }
// 
//             // Use the super class's paintComponent implementation to draw to
//             // the buffer, then write that buffer to the original Graphics object.
//             Graphics bufferGraphics = buffer.createGraphics();
//             try {
//                 super.paintComponent(bufferGraphics);
//             } finally {
//                 bufferGraphics.dispose();
//             }
//             g.drawImage(buffer, 0, 0, w, h, 0, 0, w, h, null);
//         } else {
//             // This is not a translucent window, so we can call the super class
//             // implementation directly.
//             super.paintComponent(g);
//         }
//     }
// }
// 
// Path: DBMetadata-swing/src/main/java/com/github/abel533/utils/I18n.java
// public class I18n {
//     private static final String SUFFIX = ".properties";
//     private static ResourceBundle[] resourceBundles;
//     private static Set<String> baseNameList;
// 
//     static {
//         init(null);
//     }
// 
//     private static void initBaseNameList() {
//         File[] files = new File(Path.LANGUAGE).listFiles(new FilenameFilter() {
//             @Override
//             public boolean accept(File dir, String name) {
//                 if (name.endsWith(SUFFIX)) {
//                     return true;
//                 }
//                 return false;
//             }
//         });
//         baseNameList = new HashSet<String>();
//         for (int i = 0; i < files.length; i++) {
//             String fileName = files[i].getName();
//             int index = fileName.indexOf('_');
//             if (index == -1) {
//                 baseNameList.add("language/" + fileName.substring(0, fileName.lastIndexOf('.')));
//             } else {
//                 baseNameList.add("language/" + fileName.substring(0, index));
//             }
//         }
//     }
// 
//     /**
//      * 初始化 - 可以设置语言
//      *
//      * @param locale
//      */
//     public static void init(Locale locale) {
//         if (locale != null) {
//             Locale.setDefault(locale);
//         }
//         if (baseNameList == null || baseNameList.size() == 0) {
//             initBaseNameList();
//         }
//         resourceBundles = new ResourceBundle[baseNameList.size()];
//         int i = 0;
//         for (String baseName : baseNameList) {
//             resourceBundles[i] = ResourceBundle.getBundle(baseName);
//             i++;
//         }
//     }
// 
//     public static String key(String key) {
//         for (int i = 0; i < resourceBundles.length; i++) {
//             if (resourceBundles[i].containsKey(key)) {
//                 return resourceBundles[i].getString(key);
//             }
//         }
//         throw new RuntimeException("key:" + key + " not exists!");
//     }
// 
//     /**
//      * 可配参数，如：查找{0}字段
//      *
//      * @param key
//      * @param args
//      * @return
//      */
//     public static String key(String key, Object... args) {
//         return MessageFormat.format(key(key), args);
//     }
// }


// Path: DBMetadata-swing/src/main/java/com/github/abel533/view/panel/SearchPanel.java
import com.github.abel533.Code;
import com.github.abel533.component.JTextF;
import com.github.abel533.utils.I18n;
import org.jb2011.lnf.beautyeye.ch3_button.BEButtonUI;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;

package com.github.abel533.view.panel;



/**
 * 主界面 - 查询
 *
 * @author liuzh
 * @since 2015-03-20
 */
public class SearchPanel extends JPanel {
    private static final long serialVersionUID = 1L;

    private JTextF textSearchName;
    private JTextF textSearchComment;
    private JTextF textChoose;

    private JRadioButton radioTypeTable;
    private JRadioButton radioTypeField;

    private JCheckBox checkBoxQuickSearch;
    private JCheckBox checkBoxCaseSensitive;

    private JRadioButton radioMatchEquals;
    private JRadioButton radioMatchContains;

    private JButton btnSearch;
    private JButton btnCancel;

    /**
     * Create the this.
     */
    public SearchPanel() {
        this.setPreferredSize(new Dimension(811, 114));
        this.setLayout(new BorderLayout(0, 0));

        JPanel panel_2 = new JPanel();
        panel_2.setPreferredSize(new Dimension(250, 10));
        this.add(panel_2, BorderLayout.EAST);
        panel_2.setLayout(null);

        btnSearch = new JButton(I18n.key("tools.main.btn.search"));