From 604019022f008f628c13a4aa858de14a92f30eb1 Mon Sep 17 00:00:00 2001 From: Dominique Marcadet <Dominique.Marcadet@centralesupelec.fr> Date: Wed, 26 Jun 2019 08:56:29 +0200 Subject: [PATCH] rename SclFileCheckBox to FileCheckBox --- .../{SclFileCheckBox.java => FileCheckBox.java} | 4 ++-- .../scl/validator/ui/component/SclFileList.java | 12 ++++++------ .../scl/validator/ui/component/TreeFilePane.java | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) rename fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/{SclFileCheckBox.java => FileCheckBox.java} (93%) diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SclFileCheckBox.java b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/FileCheckBox.java similarity index 93% rename from fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SclFileCheckBox.java rename to fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/FileCheckBox.java index dc3884d..b0c8ee9 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SclFileCheckBox.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/FileCheckBox.java @@ -22,12 +22,12 @@ import java.io.File; import javax.swing.JCheckBox; -public class SclFileCheckBox { +public class FileCheckBox { private File file; private JCheckBox checkBox; - public SclFileCheckBox( File file ) { + public FileCheckBox( File file ) { this.file = file; this.checkBox = new JCheckBox( file.getName() ); this.checkBox.setSelected( true ); diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SclFileList.java b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SclFileList.java index f19f414..594552e 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SclFileList.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SclFileList.java @@ -37,14 +37,14 @@ import javax.swing.border.EmptyBorder; * Adapted from http://www.devx.com/tips/Tip/5342 */ @SuppressWarnings( "serial" ) -public class SclFileList extends JList< SclFileCheckBox > { +public class SclFileList extends JList< FileCheckBox > { protected static Border noFocusBorder = new EmptyBorder( 1, 1, 1, 1 ); - private DefaultListModel< SclFileCheckBox > model; + private DefaultListModel< FileCheckBox > model; public SclFileList() { - model = new DefaultListModel< SclFileCheckBox >(); + model = new DefaultListModel< FileCheckBox >(); setModel( model ); setCellRenderer( new SclFileCellRenderer() ); @@ -71,14 +71,14 @@ public class SclFileList extends JList< SclFileCheckBox > { } } - SclFileCheckBox check = new SclFileCheckBox( file ); + FileCheckBox check = new FileCheckBox( file ); model.addElement( check ); } - protected class SclFileCellRenderer implements ListCellRenderer< SclFileCheckBox > { + protected class SclFileCellRenderer implements ListCellRenderer< FileCheckBox > { @Override - public Component getListCellRendererComponent( JList< ? extends SclFileCheckBox > list, SclFileCheckBox file, int index, + public Component getListCellRendererComponent( JList< ? extends FileCheckBox > list, FileCheckBox file, int index, boolean isSelected, boolean cellHasFocus ) { JCheckBox checkbox = file.getCheckBox(); checkbox.setBackground( isSelected ? getSelectionBackground() : getBackground() ); diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/TreeFilePane.java b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/TreeFilePane.java index d5e5bf4..3bae483 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/TreeFilePane.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/TreeFilePane.java @@ -37,7 +37,7 @@ public class TreeFilePane extends JTree { private DefaultMutableTreeNode root; public TreeFilePane( File fileRoot ) { - root = new DefaultMutableTreeNode( new SclFileCheckBox( fileRoot ) ); + root = new DefaultMutableTreeNode( new FileCheckBox( fileRoot ) ); setModel( new DefaultTreeModel( root ) ); setShowsRootHandles( true ); @@ -52,14 +52,14 @@ public class TreeFilePane extends JTree { if( selRow != -1 ) { TreePath selPath = getPathForLocation( e.getX(), e.getY() ); DefaultMutableTreeNode node = (( DefaultMutableTreeNode ) selPath.getLastPathComponent() ); - SclFileCheckBox checkbox = ( SclFileCheckBox ) node.getUserObject(); + FileCheckBox checkbox = ( FileCheckBox ) node.getUserObject(); propagateInTree( node, ! checkbox.getCheckBox().isSelected() ); repaint(); } } private void propagateInTree( DefaultMutableTreeNode node, boolean selected ) { - SclFileCheckBox checkbox = ( SclFileCheckBox ) node.getUserObject(); + FileCheckBox checkbox = ( FileCheckBox ) node.getUserObject(); checkbox.getCheckBox().setSelected( selected ); for( int i = 0; i < node.getChildCount(); ++i ) { propagateInTree( ( DefaultMutableTreeNode ) node.getChildAt( i ), selected ); @@ -74,7 +74,7 @@ public class TreeFilePane extends JTree { if( files == null ) return; for( File file : files ) { - DefaultMutableTreeNode childNode = new DefaultMutableTreeNode( new SclFileCheckBox( file ) ); + DefaultMutableTreeNode childNode = new DefaultMutableTreeNode( new FileCheckBox( file ) ); node.add( childNode ); if( file.isDirectory() ) { createChildren( file, childNode ); @@ -88,7 +88,7 @@ public class TreeFilePane extends JTree { public Component getTreeCellRendererComponent( JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus ) { DefaultMutableTreeNode node = ( DefaultMutableTreeNode ) value; - SclFileCheckBox file = ( SclFileCheckBox ) node.getUserObject(); + FileCheckBox file = ( FileCheckBox ) node.getUserObject(); JCheckBox checkbox = file.getCheckBox(); checkbox.setEnabled( isEnabled() ); checkbox.setFont( getFont() ); @@ -103,7 +103,7 @@ public class TreeFilePane extends JTree { } private void getSelectedFiles( DefaultMutableTreeNode node, ArrayList< File > oclFiles ) { - SclFileCheckBox checkbox = ( SclFileCheckBox ) node.getUserObject(); + FileCheckBox checkbox = ( FileCheckBox ) node.getUserObject(); if( checkbox.getFile().isFile() ) { if( checkbox.getCheckBox().isSelected() ) { oclFiles.add( checkbox.getFile() ); -- GitLab