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

📄 text.java

📁 用java 实现屏幕取词技术
💻 JAVA
字号:
/*
 * Text.java
 *
 * Created on 2007年4月3日, 上午12:30
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package dyno.swing.beans;

public class Text {

    private int x;
    private int y;
    private int width;
    private int height;

    private String text;
    private boolean visible;

    public boolean isVisible() {
        return visible;
    }

    public void setVisible(boolean visible) {
        this.visible = visible;
    }

    public Text(String text) {
        this.text = text;
    }

    public void setBounds(int x, int y, int width, int height) {
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public int getWidth() {
        return width;
    }

    public int getHeight() {
        return height;
    }

    public String getText() {
        return text;
    }

    public String getTranslation() {
        if (text != null) {
            String translation = Dictionary.getInstance().get(text.toLowerCase());
            if (translation != null) {
                return "<html><body><p>" + text + "<p>&nbsp;&nbsp;&nbsp;&nbsp;" + translation + "</body></html>";
            } else {
                return "<html><body><p>" + text + "<p>&nbsp;&nbsp;&nbsp;&nbsp;查找不到该单词</body></html>";
            }
        } else {
            return null;
        }
    }
}

⌨️ 快捷键说明

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