diff --git a/src/demo/share/jfc/Font2DTest/Font2DTest.html b/src/demo/share/jfc/Font2DTest/Font2DTest.html deleted file mode 100644 index 4c94fc02b70c..000000000000 --- a/src/demo/share/jfc/Font2DTest/Font2DTest.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - -Font2DTest Demo - - - - - -
-
- -

-Font2DTest -

- -An encompassing font/glyph demo application. -Source code is in
-Font2DTest.java,
-Font2DTestApplet.java,
-RangeMenu.java and
-FontPanel.java.
-You can run this program either as an applet or as an application.
-Detailed information about the program can be found in -README.txt
- -

To run it as an application, -execute the Font2DTest class. -For example: - -

-
-% java -jar Font2DTest.jar
-
-
- -

-Note: If AWTPermission's showWindowWithoutWarningBanner permission is not given,
-the zoom feature will not look as good, as characters may be hidden by the warning banner.
- - - - -


- - - - diff --git a/src/demo/share/jfc/Font2DTest/Font2DTest.java b/src/demo/share/jfc/Font2DTest/Font2DTest.java index 0fb8251b7189..4c698344c340 100644 --- a/src/demo/share/jfc/Font2DTest/Font2DTest.java +++ b/src/demo/share/jfc/Font2DTest/Font2DTest.java @@ -133,7 +133,7 @@ public final class Font2DTest extends JPanel private static boolean canDisplayCheck = true; /// Initialize GUI variables and its layouts - public Font2DTest( JFrame f, boolean isApplet ) { + public Font2DTest( JFrame f) { parent = f; rm = new RangeMenu( this, parent ); @@ -165,8 +165,8 @@ public Font2DTest( JFrame f, boolean isApplet ) { contrastSlider.setPaintLabels(true); contrastSlider.addChangeListener(this); setupPanel(); - setupMenu( isApplet ); - setupDialog( isApplet ); + setupMenu(); + setupDialog(); if(canDisplayCheck) { fireRangeChanged(); @@ -256,7 +256,7 @@ private void addLabeledComponentToGBL( String name, } /// Sets up menu entries - private void setupMenu( boolean isApplet ) { + private void setupMenu() { JMenu fileMenu = new JMenu( "File" ); JMenu optionMenu = new JMenu( "Option" ); @@ -268,11 +268,7 @@ private void setupMenu( boolean isApplet ) { fileMenu.add( new MenuItemV2( "Page Setup...", this )); fileMenu.add( new MenuItemV2( "Print...", this )); fileMenu.addSeparator(); - if ( !isApplet ) - fileMenu.add( new MenuItemV2( "Exit", this )); - else - fileMenu.add( new MenuItemV2( "Close", this )); - + fileMenu.add( new MenuItemV2( "Exit", this )); displayGridCBMI = new CheckboxMenuItemV2( "Display Grid", true, this ); force16ColsCBMI = new CheckboxMenuItemV2( "Force 16 Columns", false, this ); showFontInfoCBMI = new CheckboxMenuItemV2( "Display Font Info", false, this ); @@ -326,11 +322,8 @@ private void setupMenu( boolean isApplet ) { } /// Sets up the all dialogs used in Font2DTest... - private void setupDialog( boolean isApplet ) { - if (!isApplet) - filePromptDialog = new JFileChooser( ); - else - filePromptDialog = null; + private void setupDialog() { + filePromptDialog = new JFileChooser(); /// Prepare user text dialog... userTextDialog = new JDialog( parent, "User Text", false ); @@ -432,8 +425,6 @@ public void fireRangeChanged() { /// Changes the message on the status bar public void fireChangeStatus( String message, boolean error ) { - /// If this is not ran as an applet, use own status bar, - /// Otherwise, use the appletviewer/browser's status bar statusBar.setText( message ); if ( error ) fp.showingError = true; @@ -1030,7 +1021,7 @@ public static void main(String[] argv) { UIManager.put("swing.boldMetal", Boolean.FALSE); final JFrame f = new JFrame( "Font2DTest" ); - final Font2DTest f2dt = new Font2DTest( f, false ); + final Font2DTest f2dt = new Font2DTest( f); f.addWindowListener( new WindowAdapter() { public void windowOpening( WindowEvent e ) { f2dt.repaint(); } public void windowClosing( WindowEvent e ) { System.exit(0); } diff --git a/src/demo/share/jfc/Font2DTest/README.txt b/src/demo/share/jfc/Font2DTest/README.txt index 1eb959d79ed1..60f8c013aabd 100644 --- a/src/demo/share/jfc/Font2DTest/README.txt +++ b/src/demo/share/jfc/Font2DTest/README.txt @@ -4,35 +4,17 @@ Font2DTest To run Font2DTest: % java -jar Font2DTest.jar - or -% appletviewer Font2DTest.html -These instructions assume that the 1.7 versions of the java -and appletviewer commands are in your path. If they aren't, -then you should either specify the complete path to the commands +These instructions assume that the java command is in your path. +If they aren't, then you should either specify the complete path to the commands or update your PATH environment variable as described in the installation instructions for the Java(TM) SE Development Kit. -To view Font2DTest within a web browser with Java Plugin, -load Font2DTest.html. - If you wish to modify any of the source code, you may want to extract the contents of the Font2DTest.jar file by executing this command: % jar -xvf Font2DTest.jar -NOTE: - -When Font2DTest is ran as an applet, the browser plugin/viewer needs -following permissions given in order to run properly: - -AWTPermission "showWindowWithoutWarningBanner" -RuntimePermission "queuePrintJob" - -The program will run without these properties set, -but some of its features will be limited. -To enable all features, please add these permissions. - ----------------------------------------------------------------------- Introduction ----------------------------------------------------------------------- @@ -129,23 +111,3 @@ that are within the selected range. Third option, "Print all text..." is similar, and it will print all lines of text that user has put in. ==================================================================== - -Known Problems: - -- When a PostScript font is used, the characters may extend beyond the -enclosing grid or zoom rectangle. This is due to the problem with -FontMetrics.getMaxAscent() and getMaxDescent() functions; the functions -do not always return the right values for PostScript fonts. - -- There are still some bugs around the error handling. -Most of these problems will usually get fixed when some parameters -are changed, or the screen is refreshed. - -- Many fonts on Solaris fails to retrieve outlines properly, -and as the result, they do not align within the grid properly. -These are mainly F3 and fonts that was returned by X server. - -- When showWindowWithoutWarningBanner AWTPermission is not given, -the "zoom" window will look really bad because of the -Applet warning label tacked at the bottom of the zoom window. -To remove this, follow the "NOTE:" instruction at the top.