diff options
| author | Stefano Marchetti <[email protected]> | 2025-08-17 15:21:33 +0200 | 
|---|---|---|
| committer | Stefano Marchetti <[email protected]> | 2025-08-17 15:21:33 +0200 | 
| commit | b35dd9fd117afe540e630c033c46f65d396410fc (patch) | |
| tree | a2ee0df89c417ac20dc56ce53550eaaf61f84ac6 /MyFntSel.java | |
| parent | b4bc311cf8da836e46141b877173bd7dc12653ef (diff) | |
| download | jedecma-master.tar.gz | |
Diffstat (limited to 'MyFntSel.java')
| -rw-r--r-- | MyFntSel.java | 32 | 
1 files changed, 20 insertions, 12 deletions
| diff --git a/MyFntSel.java b/MyFntSel.java index b968b5c..0f371df 100644 --- a/MyFntSel.java +++ b/MyFntSel.java @@ -1,23 +1,23 @@ -/*   +/*   * MyFntSel.java - very basic font selector - *  + *   * Copyright (c) 2025 Stefano Marchetti - *  + *   * This file is part of Jedecma - breast ultrasound examinations archiving software - *  + *   * Jedecma is free software: you can redistribute it and/or modify   * it under the terms of the GNU General Public License as published by   * the Free Software Foundation, either version 3 of the License, or   * (at your option) any later version. - *  + *   * Jedecma is distributed in the hope that it will be useful,   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   * GNU General Public License for more details. - *  + *   * You should have received a copy of the GNU General Public License   * along with Jedecma.  If not, see <http://www.gnu.org/licenses/>. - *   + *  */ @@ -33,6 +33,7 @@ import java.awt.event.MouseEvent;  import java.awt.event.MouseListener;  import java.awt.event.WindowAdapter;  import java.awt.event.WindowEvent; +  import javax.swing.BorderFactory;  import javax.swing.BoxLayout;  import javax.swing.JButton; @@ -44,7 +45,7 @@ import javax.swing.ListSelectionModel;  public class MyFntSel extends JDialog {  	/** -	 *  +	 *  	 */  	private static final long serialVersionUID = 1L;  	private JButton okBut, defBut; @@ -155,6 +156,7 @@ public class MyFntSel extends JDialog {  		{  			MouseListener mouseListener = new MouseAdapter() { +				@Override  				public void mouseClicked(MouseEvent mouseEvent) {  					JList theList = (JList) mouseEvent.getSource();  					if (mouseEvent.getClickCount() == 1) { @@ -179,6 +181,7 @@ public class MyFntSel extends JDialog {  		{  			MouseListener mouseListener = new MouseAdapter() { +				@Override  				public void mouseClicked(MouseEvent mouseEvent) {  					JList theList = (JList) mouseEvent.getSource();  					if (mouseEvent.getClickCount() == 1) { @@ -204,6 +207,7 @@ public class MyFntSel extends JDialog {  		{  			MouseListener mouseListener = new MouseAdapter() { +				@Override  				public void mouseClicked(MouseEvent mouseEvent) {  					JList theList = (JList) mouseEvent.getSource();  					if (mouseEvent.getClickCount() == 1) { @@ -244,6 +248,7 @@ public class MyFntSel extends JDialog {  		okBut = new JButton(okString);  		okBut.setMnemonic(KeyEvent.VK_K);  		okBut.addActionListener(new ActionListener() { +			@Override  			public void actionPerformed(ActionEvent e) {  				okBut.setEnabled(false);  				selFontSt = curFontSt; @@ -260,6 +265,7 @@ public class MyFntSel extends JDialog {  		defBut = new JButton(defString);  		defBut.setMnemonic(KeyEvent.VK_K);  		defBut.addActionListener(new ActionListener() { +			@Override  			public void actionPerformed(ActionEvent e) {  				defBut.setEnabled(false);  				// updateLists(); @@ -277,6 +283,7 @@ public class MyFntSel extends JDialog {  		getContentPane().add(mainPan);  		addWindowListener(new WindowAdapter() { +			@Override  			public void windowClosing(WindowEvent e) {  				// quello che deve essere fatto alla chiusura della finestra  			} @@ -309,14 +316,14 @@ public class MyFntSel extends JDialog {  	}  	void updateLists() { -		{  +		{  			int selIndex = 0;  			for (int i = 0; i < fonts.length; i++) {  				if (fonts[i].toUpperCase().equals(curFontSt.toUpperCase())) {  					selIndex = i;  				}  			} -			fontList.setSelectedValue(fonts[selIndex], true);  +			fontList.setSelectedValue(fonts[selIndex], true);  		}  		{ @@ -327,7 +334,7 @@ public class MyFntSel extends JDialog {  					selIndex = i;  				}  			} -			sizeList.setSelectedValue(sizes[selIndex], true);  +			sizeList.setSelectedValue(sizes[selIndex], true);  		}  		{ @@ -337,7 +344,7 @@ public class MyFntSel extends JDialog {  					selIndex = i;  				}  			} -			styleList.setSelectedValue(styles[selIndex], true);  +			styleList.setSelectedValue(styles[selIndex], true);  		}  	} @@ -345,6 +352,7 @@ public class MyFntSel extends JDialog {  	void refreshGui() {  		test.setFont(new Font(curFontSt, curStyle, curSize));  		javax.swing.SwingUtilities.invokeLater(new Runnable() { +			@Override  			public void run() {  				updateLists();  				repaint(); | 
