--- old/src/demo/share/jfc/Font2DTest/Font2DTest.java 2020-01-22 16:03:16.000000000 -0800 +++ new/src/demo/share/jfc/Font2DTest/Font2DTest.java 2020-01-22 16:03:16.000000000 -0800 @@ -67,7 +67,6 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; -import java.util.EnumSet; import java.util.StringTokenizer; import java.util.BitSet; import javax.swing.*; @@ -101,8 +100,8 @@ private final ChoiceV2 transformMenu; private final ChoiceV2 transformMenuG2; private final ChoiceV2 methodsMenu; - private final JComboBox antiAliasMenu; - private final JComboBox fracMetricsMenu; + private final JComboBox antiAliasMenu; + private final JComboBox fracMetricsMenu; private final JSlider contrastSlider; @@ -151,10 +150,10 @@ methodsMenu = new ChoiceV2( this ); antiAliasMenu = - new JComboBox(EnumSet.allOf(FontPanel.AAValues.class).toArray()); + new JComboBox<>(FontPanel.AAValues.values()); antiAliasMenu.addActionListener(this); fracMetricsMenu = - new JComboBox(EnumSet.allOf(FontPanel.FMValues.class).toArray()); + new JComboBox<>(FontPanel.FMValues.values()); fracMetricsMenu.addActionListener(this); contrastSlider = new JSlider(JSlider.HORIZONTAL, 100, 250, @@ -359,7 +358,7 @@ userTextDialog.pack(); userTextDialog.addWindowListener( new WindowAdapter() { public void windowClosing( WindowEvent e ) { - userTextDialog.hide(); + userTextDialog.setVisible(false); } }); @@ -385,7 +384,7 @@ printDialog.setResizable( false ); printDialog.addWindowListener( new WindowAdapter() { public void windowClosing( WindowEvent e ) { - printDialog.hide(); + printDialog.setVisible(false); } }); printDialog.getContentPane().setLayout( new GridLayout( printModeCBs.length + 2, 1 )); @@ -402,7 +401,7 @@ fontInfoDialog.setResizable( false ); fontInfoDialog.addWindowListener( new WindowAdapter() { public void windowClosing( WindowEvent e ) { - fontInfoDialog.hide(); + fontInfoDialog.setVisible(false); showFontInfoCBMI.setState( false ); } }); @@ -467,7 +466,7 @@ int style = fontStyles[styleMenu.getSelectedIndex()]; Font f; for (int i = 0; i < listCount; i++) { - String fontName = (String)fontMenu.getItemAt(i); + String fontName = fontMenu.getItemAt(i); f = new Font(fontName, style, size); if ((rm.getSelectedIndex() != RangeMenu.SURROGATES_AREA_INDEX) && canDisplayRange(f, rangeStart, rangeEnd)) { @@ -673,9 +672,9 @@ /// Set the visibility of User Text dialog if ( selectedText == fp.USER_TEXT ) - userTextDialog.show(); + userTextDialog.setVisible(true); else - userTextDialog.hide(); + userTextDialog.setVisible(false); /// Change the visibility/status/availability of Print JDialog buttons printModeCBs[ fp.ONE_PAGE ].setSelected( true ); if ( selectedText == fp.FILE_TEXT || selectedText == fp.USER_TEXT ) { @@ -793,10 +792,10 @@ lcdContrast, userTextOpt ); if ( showFontInfoOpt ) { fireUpdateFontInfo(); - fontInfoDialog.show(); + fontInfoDialog.setVisible(true); } else - fontInfoDialog.hide(); + fontInfoDialog.setVisible(false); } catch ( Exception ex ) { fireChangeStatus( "ERROR: Failed to Load Options File; See Stack Trace", true ); @@ -819,7 +818,7 @@ } }); f.pack(); - f.show(); + f.setVisible(true); } catch ( Exception ex ) { fireChangeStatus( "ERROR: Failed to Load PNG File; See Stack Trace", true ); @@ -861,7 +860,7 @@ else if ( itemName.equals( "Page Setup..." )) fp.doPageSetup(); else if ( itemName.equals( "Print..." )) - printDialog.show(); + printDialog.setVisible(true); else if ( itemName.equals( "Close" )) parent.dispose(); else if ( itemName.equals( "Exit" )) @@ -893,19 +892,19 @@ if ( itemName.equals( "Print" )) { for ( int i = 0; i < printModeCBs.length; i++ ) if ( printModeCBs[i].isSelected() ) { - printDialog.hide(); + printDialog.setVisible(false); fp.doPrint( i ); } } else if ( itemName.equals( "Cancel" )) - printDialog.hide(); + printDialog.setVisible(false); /// Update button from Usert Text JDialog... else if ( itemName.equals( "Update" )) fp.setTextToDraw( fp.USER_TEXT, null, parseUserText( userTextArea.getText() ), null ); } else if ( source instanceof JComboBox ) { - JComboBox c = (JComboBox) source; + JComboBox c = (JComboBox) source; /// RangeMenu handles actions by itself and then calls fireRangeChanged, /// so it is not listed or handled here @@ -996,10 +995,10 @@ else if ( cbmi == showFontInfoCBMI ) { if ( showFontInfoCBMI.getState() ) { fireUpdateFontInfo(); - fontInfoDialog.show(); + fontInfoDialog.setVisible(true); } else - fontInfoDialog.hide(); + fontInfoDialog.setVisible(false); } } } @@ -1039,7 +1038,7 @@ f.getContentPane().add( f2dt ); f.pack(); - f.show(); + f.setVisible(true); } /// Inner class definitions... @@ -1070,7 +1069,7 @@ } } - private final class ChoiceV2 extends JComboBox { + private final class ChoiceV2 extends JComboBox { private BitSet bitSet = null; @@ -1141,7 +1140,7 @@ this.choice = choice; } - public Component getListCellRendererComponent(JList list, + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,