📄 processbox.java,v
字号:
head 1.3;access;symbols;locks; strict;comment @# @;1.3date 2005.05.24.16.01.03; author rirwin; state Exp;branches;next 1.2;1.2date 2005.03.11.23.39.13; author patil; state Exp;branches;next 1.1;1.1date 2004.12.28.00.04.32; author patil; state Exp;branches;next ;desc@@1.3log@fixed javadoc errors.@text@/** * file: ProcessBox.java * * last editted: Ryan Irwin */// import necessary java libraries//import java.awt.*;import javax.swing.*;import javax.swing.border.*;//These imports are not needed - Phil T. 6-23-03//import java.awt.event.*;/** * ProcessBox inplements the text area to the right of the applet that * acts as a process description for the various algorithms being used * * hierarchy: JPanel->SubPanel->ProcessBox * */class ProcessBox extends SubPanel { // ********************************************************************* // // declare global variables and components // // ********************************************************************* // declare components // JTextArea textArea; // text area for user information JScrollPane scrollPane; // scroll pane for the text area ProgressBar progress; // progress bar indicator String title1; // title for process discription Font currentFont = getFont(); // fonts for the buttons Font newFont = new Font(currentFont.getName(), currentFont.getStyle(), 12); // ********************************************************************* // // declare class constructors // // ********************************************************************* /** * Constructor initializes the text area and scroll bar objects * */ ProcessBox() { // initialize the progress bar // progress = new ProgressBar(); progress.add_components(); // initialize the titles of the objects // title1 = new String("Process Description:"); // initialize the text area // textArea = new JTextArea(); textArea.setEditable(false); // make the text area scrollable // scrollPane = new JScrollPane(textArea); // set the border for the panel // Border titleBorder = BorderFactory.createTitledBorder( BorderFactory.createLineBorder(Color.black), title1, TitledBorder.LEFT, TitledBorder.ABOVE_TOP, newFont, Color.black); scrollPane.setBorder(titleBorder); } // ********************************************************************* // // declare class methods // // ********************************************************************* /** * Adds components to the input panel * */ public void add_components() { constrain(this, scrollPane, 0, 0, GridBagConstraints.REMAINDER, 1, GridBagConstraints.BOTH, GridBagConstraints.NORTHWEST, 1, 1, 0, 0, 0, 0); constrain(this, progress, 0, 1, GridBagConstraints.REMAINDER, 1, GridBagConstraints.BOTH, GridBagConstraints.NORTHWEST, 1, 0.01, 0, 0, 0, 0); } /** * Appends a message to the text area * * @@param text_a String message to be appended */ public void appendMessage(String text_a) { textArea.append(text_a + "\n"); } /** * Appends messages to the text area * * @@param text_a String messages to be appended */ public void appendMessages(String text_a) { textArea.append(text_a); } /** * method: appendMessage * * @@param none * @@return none * * appendMessage to the text area * */ // public void appendMessages1(String text_a) { // textArea.append(text_a); // } /** * Clears all messages * */ public void clearMessage() { // clear all message // textArea.setText(""); } /** * Sets the progress minimum value * * @@param min_a Sets progressBar to this minimum value */ public void setProgressMin(int min_a) { // clear all message // progress.progressBar.setMinimum(min_a); } /** * Sets the progress maximum value * * @@param max_a Sets progress to this maximum value */ public void setProgressMax(int max_a) { // clear all message // progress.progressBar.setMaximum(max_a); } /** * Sets the progress current value * * @@param curr_a Sets the progress to this current value */ public void setProgressCurr(int curr_a) { // clear all message // progress.progressBar.setValue(curr_a); progress.repaint(); }}@1.2log@comments changed to suit the Java Documentation.@text@d4 1a15 2 * class: ProcessBox *d50 1a50 6 * method: ProcessBox * * @@param none * @@return none * * constructor initializes the text area and scroll bar objectsd93 1a93 6 * method: add_components * * @@param none * @@return none * * add components to the input paneld130 1a130 6 * method: appendMessage * * @@param none * @@return none * * appendMessage to the text aread132 1d141 1a141 6 * method: appendMessage * * @@param none * @@return none * * appendMessage to the text aread143 1d165 1a165 6 * method: appendMessage * * @@param none * @@return none * * appendMessage to the text aread177 1a177 6 * method: setProcessMin * * @@param none * @@return none * * set the prgress minimumd179 1d190 1a190 6 * method: setProcessMax * * @@param none * @@return none * * appendMessage to the text aread192 1d203 1a203 6 * method: setProcessCurr * * @@param none * @@return none * * appendMessage to the text aread205 1@1.1log@Initial revision@text@d1 4a4 3// file: ProcessBox.java//d14 11a24 8// class: ProcessBox//// ProcessBox inplements the text area to the right of the applet that // acts as a process description for the various algorithms being used//// hierarchy: JPanel->SubPanel->ProcessBox//class ProcessBox extends SubPanel {d49 12a60 9 // method: ProcessBox // // arguments: none // returns : none // // constructor initializes the text area and scroll bar objects // ProcessBox() {a96 17 // method: add_components // // arguments: none // return : none // // add components to the input panel // public void add_components() { constrain(this, scrollPane, 0, 0, GridBagConstraints.REMAINDER, 1, GridBagConstraints.BOTH, GridBagConstraints.NORTHWEST, 1, 1, 0, 0, 0, 0); constrain(this, progress, 0, 1, GridBagConstraints.REMAINDER, 1, GridBagConstraints.BOTH, GridBagConstraints.NORTHWEST, 1, 0.01, 0, 0, 0, 0); }d98 53a150 8 // method: appendMessage // // arguments: none // return : none // // appendMessage to the text area // public void appendMessage(String text_a) {d155 11a165 9 // method: appendMessage // // arguments: none // return : none // // appendMessage to the text area // public void appendMessages(String text_a) { d168 11a178 8 // method: appendMessage // // arguments: none // return : none // // appendMessage to the text area // // public void appendMessages1(String text_a) {d182 12a193 8 // method: appendMessage // // arguments: none // return : none // // appendMessage to the text area // public void clearMessage() {d199 12a210 9 // method: setProcessMin // // arguments: none // return : none // // set the prgress minimum // public void setProgressMin(int min_a) {d216 12a227 9 // method: setProcessMax // // arguments: none // return : none // // appendMessage to the text area // public void setProgressMax(int max_a) {d234 11a244 8 // method: setProcessCurr // // arguments: none // return : none // // appendMessage to the text area // public void setProgressCurr(int curr_a) {a250 1a251 4//// end of file@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -