diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewComputerIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewComputerIcon.java new file mode 100644 index 00000000..48ae2fb2 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewComputerIcon.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.icons; + +import java.awt.Component; +import java.awt.Graphics2D; +import java.awt.geom.Path2D; +import java.awt.geom.Rectangle2D; +import javax.swing.UIManager; + +/** + * "computer" icon for {@link javax.swing.JFileChooser}. + * + * @uiDefault FileView.icon.computerColor Color + * + * @author Karl Tauber + */ +public class FlatFileViewComputerIcon + extends FlatAbstractIcon +{ + public FlatFileViewComputerIcon() { + super( 16, 16, UIManager.getColor( "FileView.icon.computerColor" ) ); + } + + @Override + protected void paintIcon( Component c, Graphics2D g ) { + /* + + + + + + + */ + + Path2D path = new Path2D.Float( Path2D.WIND_EVEN_ODD ); + path.append( new Rectangle2D.Float( 2, 3, 12, 8 ), false ); + path.append( new Rectangle2D.Float( 4, 5, 8, 4 ), false ); + g.fill( path ); + + g.fillRect( 2, 12, 12, 2 ); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewDirectoryIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewDirectoryIcon.java new file mode 100644 index 00000000..6eea068d --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewDirectoryIcon.java @@ -0,0 +1,48 @@ +/* + * Copyright 2019 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.icons; + +import java.awt.Component; +import java.awt.Graphics2D; +import javax.swing.UIManager; +import com.formdev.flatlaf.ui.FlatUIUtils; + +/** + * "directory" icon for {@link javax.swing.JFileChooser}. + * + * @uiDefault FileView.icon.directoryColor Color + * + * @author Karl Tauber + */ +public class FlatFileViewDirectoryIcon + extends FlatAbstractIcon +{ + public FlatFileViewDirectoryIcon() { + super( 16, 16, UIManager.getColor( "FileView.icon.directoryColor" ) ); + } + + @Override + protected void paintIcon( Component c, Graphics2D g ) { + /* + + + + */ + + g.fill( FlatUIUtils.createPath( 1,2, 6,2, 8,4, 15,4, 15,13, 1,13 ) ); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewFileIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewFileIcon.java new file mode 100644 index 00000000..fa9c1425 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewFileIcon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2019 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.icons; + +import java.awt.Component; +import java.awt.Graphics2D; +import javax.swing.UIManager; +import com.formdev.flatlaf.ui.FlatUIUtils; + +/** + * "file" icon for {@link javax.swing.JFileChooser}. + * + * @uiDefault FileView.icon.fileColor Color + * + * @author Karl Tauber + */ +public class FlatFileViewFileIcon + extends FlatAbstractIcon +{ + public FlatFileViewFileIcon() { + super( 16, 16, UIManager.getColor( "FileView.icon.fileColor" ) ); + } + + @Override + protected void paintIcon( Component c, Graphics2D g ) { + /* + + + + + + + */ + + g.fill( FlatUIUtils.createPath( 8,6, 8,1, 13,1, 13,15, 3,15, 3,6 ) ); + g.fill( FlatUIUtils.createPath( 3,5, 7,5, 7,1 ) ); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewFloppyDriveIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewFloppyDriveIcon.java new file mode 100644 index 00000000..02cbcf9d --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewFloppyDriveIcon.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.icons; + +import java.awt.Component; +import java.awt.Graphics2D; +import java.awt.geom.Path2D; +import javax.swing.UIManager; +import com.formdev.flatlaf.ui.FlatUIUtils; + +/** + * "floppy drive" icon for {@link javax.swing.JFileChooser}. + * + * @uiDefault FileView.icon.floppyDriveColor Color + * + * @author Karl Tauber + */ +public class FlatFileViewFloppyDriveIcon + extends FlatAbstractIcon +{ + public FlatFileViewFloppyDriveIcon() { + super( 16, 16, UIManager.getColor( "FileView.icon.floppyDriveColor" ) ); + } + + @Override + protected void paintIcon( Component c, Graphics2D g ) { + /* + + + + + + + */ + + Path2D path = new Path2D.Float( Path2D.WIND_EVEN_ODD ); + path.append( FlatUIUtils.createPath( 11,14, 11,11, 5,11, 5,14, 2,14, 2,2, 14,2, 14,14, 11,14 ), false ); + path.append( FlatUIUtils.createPath( 4,4, 4,8, 12,8, 12,4, 4,4 ), false ); + g.fill( path ); + + g.fillRect( 6, 12, 4, 2 ); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewHardDriveIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewHardDriveIcon.java new file mode 100644 index 00000000..bc03c181 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileViewHardDriveIcon.java @@ -0,0 +1,53 @@ +/* + * Copyright 2019 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.icons; + +import java.awt.Component; +import java.awt.Graphics2D; +import java.awt.geom.Path2D; +import java.awt.geom.Rectangle2D; +import javax.swing.UIManager; + +/** + * "hard drive" icon for {@link javax.swing.JFileChooser}. + * + * @uiDefault FileView.icon.hardDriveColor Color + * + * @author Karl Tauber + */ +public class FlatFileViewHardDriveIcon + extends FlatAbstractIcon +{ + public FlatFileViewHardDriveIcon() { + super( 16, 16, UIManager.getColor( "FileView.icon.hardDriveColor" ) ); + } + + @Override + protected void paintIcon( Component c, Graphics2D g ) { + /* + + + + */ + + Path2D path = new Path2D.Float( Path2D.WIND_EVEN_ODD ); + path.append( new Rectangle2D.Float( 2, 6, 12, 4 ), false ); + path.append( new Rectangle2D.Float( 12, 8, 1, 1 ), false ); + path.append( new Rectangle2D.Float( 10, 8, 1, 1 ), false ); + g.fill( path ); + } +} diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties index f9a11c90..5b20e059 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties @@ -119,6 +119,21 @@ FileChooser.icon.detailsViewColor=@icon FileChooser.icon.listViewColor=@icon +#---- FileView ---- + +FileView.directoryIcon=com.formdev.flatlaf.icons.FlatFileViewDirectoryIcon +FileView.fileIcon=com.formdev.flatlaf.icons.FlatFileViewFileIcon +FileView.computerIcon=com.formdev.flatlaf.icons.FlatFileViewComputerIcon +FileView.hardDriveIcon=com.formdev.flatlaf.icons.FlatFileViewHardDriveIcon +FileView.floppyDriveIcon=com.formdev.flatlaf.icons.FlatFileViewFloppyDriveIcon + +FileView.icon.directoryColor=@icon +FileView.icon.fileColor=@icon +FileView.icon.computerColor=@icon +FileView.icon.hardDriveColor=@icon +FileView.icon.floppyDriveColor=@icon + + #---- FormattedTextField ---- FormattedTextField.border=com.formdev.flatlaf.ui.FlatBorder diff --git a/flatlaf-core/svg/FileViewComputerIcon.svg b/flatlaf-core/svg/FileViewComputerIcon.svg new file mode 100644 index 00000000..910f29f3 --- /dev/null +++ b/flatlaf-core/svg/FileViewComputerIcon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/flatlaf-core/svg/FileViewDirectoryIcon.svg b/flatlaf-core/svg/FileViewDirectoryIcon.svg new file mode 100644 index 00000000..d01b4331 --- /dev/null +++ b/flatlaf-core/svg/FileViewDirectoryIcon.svg @@ -0,0 +1,3 @@ + + + diff --git a/flatlaf-core/svg/FileViewFileIcon.svg b/flatlaf-core/svg/FileViewFileIcon.svg new file mode 100644 index 00000000..81f06450 --- /dev/null +++ b/flatlaf-core/svg/FileViewFileIcon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/flatlaf-core/svg/FileViewFloppyDriveIcon.svg b/flatlaf-core/svg/FileViewFloppyDriveIcon.svg new file mode 100644 index 00000000..e07ed776 --- /dev/null +++ b/flatlaf-core/svg/FileViewFloppyDriveIcon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/flatlaf-core/svg/FileViewHardDriveIcon.svg b/flatlaf-core/svg/FileViewHardDriveIcon.svg new file mode 100644 index 00000000..7dce2914 --- /dev/null +++ b/flatlaf-core/svg/FileViewHardDriveIcon.svg @@ -0,0 +1,3 @@ + + + diff --git a/flatlaf-core/svg/FlatLaf Icons.sketch b/flatlaf-core/svg/FlatLaf Icons.sketch index 0f1539f7..29901de5 100644 Binary files a/flatlaf-core/svg/FlatLaf Icons.sketch and b/flatlaf-core/svg/FlatLaf Icons.sketch differ