📄 errorlistdialog.java
字号:
/*====================================================================*\ErrorListDialog.javaFile error dialog box class.------------------------------------------------------------------------This file is part of FuncPlotter, a combined Java application and appletfor plotting explicit functions in one variable.Copyright 2005-2007 Andy Morgan-Richards.FuncPlotter is free software: you can redistribute it and/or modify itunder the terms of the GNU General Public License as published by theFree Software Foundation, either version 3 of the License, or (at youroption) any later version.This program is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public License alongwith this program. If not, see <http://www.gnu.org/licenses/>.\*====================================================================*/// IMPORTSimport gui.NonEditableTextAreaDialog;import java.awt.Window;import java.util.List;//----------------------------------------------------------------------// ERROR LIST DIALOG BOX CLASSclass ErrorListDialog extends NonEditableTextAreaDialog{////////////////////////////////////////////////////////////////////////// Constants//////////////////////////////////////////////////////////////////////// private static final int MAX_NUM_ERRORS = FunctionDocument.MAX_NUM_FUNCTIONS; private static final int NUM_COLUMNS = 64; private static final int NUM_ROWS = MAX_NUM_ERRORS + 1; private static final String FIRST_ERRORS_STR = " : First " + MAX_NUM_ERRORS + " errors";////////////////////////////////////////////////////////////////////////// Constructors//////////////////////////////////////////////////////////////////////// private ErrorListDialog( Window owner, String titleStr, String text ) { super( owner, titleStr, NUM_COLUMNS, NUM_ROWS, text ); } //------------------------------------------------------------------////////////////////////////////////////////////////////////////////////// Class methods//////////////////////////////////////////////////////////////////////// public static ErrorListDialog showDialog( Window owner, String titleStr, String pathname, List<String> errorStrs ) { if ( errorStrs.size( ) > MAX_NUM_ERRORS ) titleStr += FIRST_ERRORS_STR; int numErrors = Math.min( errorStrs.size( ), MAX_NUM_ERRORS ); StringBuilder buffer = new StringBuilder( numErrors * 64 ); buffer.append( pathname ); for ( int i = 0; i < numErrors; ++i ) { buffer.append( '\n' ); buffer.append( errorStrs.get( i ) ); } return new ErrorListDialog( owner, titleStr, buffer.toString( ) ); } //------------------------------------------------------------------////////////////////////////////////////////////////////////////////////// Instance methods : overriding methods//////////////////////////////////////////////////////////////////////// protected void applyOrientation( ) { App.applyOrientationByLocale( this ); } //------------------------------------------------------------------}//----------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -