FileChooser: swapped detailsView and listView

This commit is contained in:
Karl Tauber
2019-09-09 17:31:56 +02:00
parent d51d79c2ad
commit 030528764a
6 changed files with 154 additions and 32 deletions

View File

@@ -39,17 +39,21 @@ public class FlatFileChooserDetailsViewIcon
/*
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<rect width="4" height="4" x="3" y="3" fill="#6E6E6E"/>
<rect width="4" height="4" x="3" y="9" fill="#6E6E6E"/>
<rect width="4" height="4" x="9" y="9" fill="#6E6E6E"/>
<rect width="4" height="4" x="9" y="3" fill="#6E6E6E"/>
<rect width="2" height="2" x="2" y="3" fill="#6E6E6E"/>
<rect width="2" height="2" x="2" y="7" fill="#6E6E6E"/>
<rect width="2" height="2" x="2" y="11" fill="#6E6E6E"/>
<rect width="8" height="2" x="6" y="3" fill="#6E6E6E"/>
<rect width="8" height="2" x="6" y="7" fill="#6E6E6E"/>
<rect width="8" height="2" x="6" y="11" fill="#6E6E6E"/>
</g>
</svg>
*/
g.fillRect( 3, 3, 4, 4 );
g.fillRect( 3, 9, 4, 4 );
g.fillRect( 9, 9, 4, 4 );
g.fillRect( 9, 3, 4, 4 );
g.fillRect( 2, 3, 2, 2 );
g.fillRect( 2, 7, 2, 2 );
g.fillRect( 2, 11, 2, 2 );
g.fillRect( 6, 3, 8, 2 );
g.fillRect( 6, 7, 8, 2 );
g.fillRect( 6, 11, 8, 2 );
}
}

View File

@@ -39,21 +39,17 @@ public class FlatFileChooserListViewIcon
/*
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<rect width="2" height="2" x="2" y="3" fill="#6E6E6E"/>
<rect width="2" height="2" x="2" y="7" fill="#6E6E6E"/>
<rect width="2" height="2" x="2" y="11" fill="#6E6E6E"/>
<rect width="8" height="2" x="6" y="3" fill="#6E6E6E"/>
<rect width="8" height="2" x="6" y="7" fill="#6E6E6E"/>
<rect width="8" height="2" x="6" y="11" fill="#6E6E6E"/>
<rect width="4" height="4" x="3" y="3" fill="#6E6E6E"/>
<rect width="4" height="4" x="3" y="9" fill="#6E6E6E"/>
<rect width="4" height="4" x="9" y="9" fill="#6E6E6E"/>
<rect width="4" height="4" x="9" y="3" fill="#6E6E6E"/>
</g>
</svg>
*/
g.fillRect( 2, 3, 2, 2 );
g.fillRect( 2, 7, 2, 2 );
g.fillRect( 2, 11, 2, 2 );
g.fillRect( 6, 3, 8, 2 );
g.fillRect( 6, 7, 8, 2 );
g.fillRect( 6, 11, 8, 2 );
g.fillRect( 3, 3, 4, 4 );
g.fillRect( 3, 9, 4, 4 );
g.fillRect( 9, 9, 4, 4 );
g.fillRect( 9, 3, 4, 4 );
}
}

View File

@@ -40,6 +40,17 @@ public class FlatChooserTest
JColorChooser colorChooser1 = new JColorChooser();
JLabel fileChooserLabel = new JLabel();
JFileChooser fileChooser1 = new JFileChooser();
JLabel label1 = new JLabel();
JLabel label2 = new JLabel();
JLabel label3 = new JLabel();
JLabel label4 = new JLabel();
JLabel label5 = new JLabel();
JLabel label6 = new JLabel();
JLabel label7 = new JLabel();
JLabel label8 = new JLabel();
JLabel label9 = new JLabel();
JLabel label10 = new JLabel();
JLabel label11 = new JLabel();
//======== this ========
setLayout(new MigLayout(
@@ -49,7 +60,8 @@ public class FlatChooserTest
"[]",
// rows
"[top]" +
"[top]"));
"[top]" +
"[]"));
//---- colorChooserLabel ----
colorChooserLabel.setText("JColorChooser:");
@@ -60,6 +72,50 @@ public class FlatChooserTest
fileChooserLabel.setText("JFileChooser:");
add(fileChooserLabel, "cell 0 1");
add(fileChooser1, "cell 1 1");
//---- label1 ----
label1.setText("icons:");
add(label1, "cell 0 2");
//---- label2 ----
label2.setIcon(UIManager.getIcon("FileView.directoryIcon"));
add(label2, "cell 1 2");
//---- label3 ----
label3.setIcon(UIManager.getIcon("FileView.fileIcon"));
add(label3, "cell 1 2");
//---- label4 ----
label4.setIcon(UIManager.getIcon("FileView.computerIcon"));
add(label4, "cell 1 2");
//---- label5 ----
label5.setIcon(UIManager.getIcon("FileView.hardDriveIcon"));
add(label5, "cell 1 2");
//---- label6 ----
label6.setIcon(UIManager.getIcon("FileView.floppyDriveIcon"));
add(label6, "cell 1 2");
//---- label7 ----
label7.setIcon(UIManager.getIcon("FileChooser.newFolderIcon"));
add(label7, "cell 1 2");
//---- label8 ----
label8.setIcon(UIManager.getIcon("FileChooser.upFolderIcon"));
add(label8, "cell 1 2");
//---- label9 ----
label9.setIcon(UIManager.getIcon("FileChooser.homeFolderIcon"));
add(label9, "cell 1 2");
//---- label10 ----
label10.setIcon(UIManager.getIcon("FileChooser.detailsViewIcon"));
add(label10, "cell 1 2");
//---- label11 ----
label11.setIcon(UIManager.getIcon("FileChooser.listViewIcon"));
add(label11, "cell 1 2");
// JFormDesigner - End of component initialization //GEN-END:initComponents
}

View File

@@ -9,7 +9,7 @@ new FormModel {
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr"
"$columnConstraints": "[][]"
"$rowConstraints": "[top][top]"
"$rowConstraints": "[top][top][]"
} ) {
name: "this"
add( new FormComponent( "javax.swing.JLabel" ) {
@@ -34,6 +34,72 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 1"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label1"
"text": "icons:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 2"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label2"
"icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.directoryIcon" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label3"
"icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.fileIcon" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label4"
"icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.computerIcon" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label5"
"icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.hardDriveIcon" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label6"
"icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.floppyDriveIcon" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label7"
"icon": new com.jformdesigner.model.SwingIcon( 2, "FileChooser.newFolderIcon" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label8"
"icon": new com.jformdesigner.model.SwingIcon( 2, "FileChooser.upFolderIcon" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label9"
"icon": new com.jformdesigner.model.SwingIcon( 2, "FileChooser.homeFolderIcon" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label10"
"icon": new com.jformdesigner.model.SwingIcon( 2, "FileChooser.detailsViewIcon" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label11"
"icon": new com.jformdesigner.model.SwingIcon( 2, "FileChooser.listViewIcon" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2"
} )
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 )
"size": new java.awt.Dimension( 790, 715 )

View File

@@ -1,8 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<rect width="4" height="4" x="3" y="3" fill="#6E6E6E"/>
<rect width="4" height="4" x="3" y="9" fill="#6E6E6E"/>
<rect width="4" height="4" x="9" y="9" fill="#6E6E6E"/>
<rect width="4" height="4" x="9" y="3" fill="#6E6E6E"/>
<rect width="2" height="2" x="2" y="3" fill="#6E6E6E"/>
<rect width="2" height="2" x="2" y="7" fill="#6E6E6E"/>
<rect width="2" height="2" x="2" y="11" fill="#6E6E6E"/>
<rect width="8" height="2" x="6" y="3" fill="#6E6E6E"/>
<rect width="8" height="2" x="6" y="7" fill="#6E6E6E"/>
<rect width="8" height="2" x="6" y="11" fill="#6E6E6E"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 376 B

After

Width:  |  Height:  |  Size: 498 B

View File

@@ -1,10 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<rect width="2" height="2" x="2" y="3" fill="#6E6E6E"/>
<rect width="2" height="2" x="2" y="7" fill="#6E6E6E"/>
<rect width="2" height="2" x="2" y="11" fill="#6E6E6E"/>
<rect width="8" height="2" x="6" y="3" fill="#6E6E6E"/>
<rect width="8" height="2" x="6" y="7" fill="#6E6E6E"/>
<rect width="8" height="2" x="6" y="11" fill="#6E6E6E"/>
<rect width="4" height="4" x="3" y="3" fill="#6E6E6E"/>
<rect width="4" height="4" x="3" y="9" fill="#6E6E6E"/>
<rect width="4" height="4" x="9" y="9" fill="#6E6E6E"/>
<rect width="4" height="4" x="9" y="3" fill="#6E6E6E"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 498 B

After

Width:  |  Height:  |  Size: 376 B