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

📄 ratingscalepanel.java

📁 Java version of ABC/HR comparator v0.5. by schnofler. Runs on Sun JRE 1.5 or later
💻 JAVA
字号:
package abchr.gui.modulecontrols;

import abchr.ProjectModule;
import abchr.RatingScaleModule;

import javax.swing.*;
import java.awt.*;

public class RatingScalePanel extends JPanel implements ModuleControl {
	private JTextArea textArea;

	public RatingScalePanel(RatingScaleModule module) {
		super(new BorderLayout());
		textArea=new JTextArea("");
		textArea.setPreferredSize(new Dimension(110,200));
		textArea.setLineWrap(true);
		textArea.setWrapStyleWord(true);
		textArea.setEditable(false);
		textArea.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
		textArea.setBackground(this.getBackground());
		this.add(textArea,BorderLayout.CENTER);
		setModule(module);
	}

	public RatingScalePanel(){this(null);}

	public void setModule(ProjectModule module) {
		if(module==null) {
			textArea.setText("");
		} else {
			StringBuffer ratingsText=new StringBuffer("Ratings: \n\n\n");
			for(int i=4;i>=0;i--) {
				ratingsText.append(i+1);
				ratingsText.append(".0 = ");
				ratingsText.append(((RatingScaleModule)module).getRatingScaleLabel(i));
				ratingsText.append("\n\n");
			}
			textArea.setText(ratingsText.toString());
			textArea.setPreferredSize(new Dimension(120,200));
			this.setPreferredSize(new Dimension(120,200));
		}
	}
}

⌨️ 快捷键说明

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