mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
Tree: leafIcon, closedIcon and openIcon added
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -18,4 +18,5 @@
|
|||||||
*.gif binary
|
*.gif binary
|
||||||
*.jar binary
|
*.jar binary
|
||||||
*.png binary
|
*.png binary
|
||||||
|
*.sketch binary
|
||||||
*.zip binary
|
*.zip binary
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* "closed" icon for {@link javax.swing.JTree} used by {@link javax.swing.tree.DefaultTreeCellRenderer}.
|
||||||
|
*
|
||||||
|
* @uiDefault Tree.icon.closedColor Color
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
public class FlatTreeClosedIcon
|
||||||
|
extends FlatAbstractIcon
|
||||||
|
{
|
||||||
|
public FlatTreeClosedIcon() {
|
||||||
|
super( 16, 16, UIManager.getColor( "Tree.icon.closedColor" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void paintIcon( Component c, Graphics2D g ) {
|
||||||
|
/*
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||||
|
<path fill="#D8D8D8" fill-rule="evenodd" d="M1 2L6 2 8 4 15 4 15 13 1 13z"/>
|
||||||
|
</svg>
|
||||||
|
*/
|
||||||
|
|
||||||
|
Path2D arrow = new Path2D.Float();
|
||||||
|
arrow.moveTo( 1, 2 );
|
||||||
|
arrow.lineTo( 6, 2 );
|
||||||
|
arrow.lineTo( 8, 4 );
|
||||||
|
arrow.lineTo( 15, 4 );
|
||||||
|
arrow.lineTo( 15, 13 );
|
||||||
|
arrow.lineTo( 1, 13 );
|
||||||
|
arrow.closePath();
|
||||||
|
g.fill( arrow );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* "leaf" icon for {@link javax.swing.JTree} used by {@link javax.swing.tree.DefaultTreeCellRenderer}.
|
||||||
|
*
|
||||||
|
* @uiDefault Tree.icon.leafColor Color
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
public class FlatTreeLeafIcon
|
||||||
|
extends FlatAbstractIcon
|
||||||
|
{
|
||||||
|
public FlatTreeLeafIcon() {
|
||||||
|
super( 16, 16, UIManager.getColor( "Tree.icon.leafColor" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void paintIcon( Component c, Graphics2D g ) {
|
||||||
|
/*
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||||
|
<g fill="none" fill-rule="evenodd">
|
||||||
|
<path fill="#D8D8D8" d="M8 6L8 1 13 1 13 15 3 15 3 6z"/>
|
||||||
|
<path fill="#D8D8D8" d="M3 5L7 5 7 1z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
*/
|
||||||
|
|
||||||
|
Path2D arrow = new Path2D.Float();
|
||||||
|
arrow.moveTo( 8, 6 );
|
||||||
|
arrow.lineTo( 8, 1 );
|
||||||
|
arrow.lineTo( 13, 1 );
|
||||||
|
arrow.lineTo( 13, 15 );
|
||||||
|
arrow.lineTo( 3, 15 );
|
||||||
|
arrow.lineTo( 3, 6 );
|
||||||
|
arrow.closePath();
|
||||||
|
g.fill( arrow );
|
||||||
|
|
||||||
|
arrow = new Path2D.Float();
|
||||||
|
arrow.moveTo( 3, 5 );
|
||||||
|
arrow.lineTo( 7, 5 );
|
||||||
|
arrow.lineTo( 7, 1 );
|
||||||
|
arrow.closePath();
|
||||||
|
g.fill( arrow );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* "open" icon for {@link javax.swing.JTree} used by {@link javax.swing.tree.DefaultTreeCellRenderer}.
|
||||||
|
*
|
||||||
|
* @uiDefault Tree.icon.openColor Color
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
public class FlatTreeOpenIcon
|
||||||
|
extends FlatAbstractIcon
|
||||||
|
{
|
||||||
|
public FlatTreeOpenIcon() {
|
||||||
|
super( 16, 16, UIManager.getColor( "Tree.icon.openColor" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void paintIcon( Component c, Graphics2D g ) {
|
||||||
|
/*
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||||
|
<g fill="none" fill-rule="evenodd">
|
||||||
|
<path fill="#D8D8D8" d="M1 2L6 2 8 4 14 4 14 6 3.5 6 1 11z"/>
|
||||||
|
<path fill="#D8D8D8" d="M4 7L16 7 13 13 1 13z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
*/
|
||||||
|
|
||||||
|
Path2D arrow = new Path2D.Float();
|
||||||
|
arrow.moveTo( 1, 2 );
|
||||||
|
arrow.lineTo( 6, 2 );
|
||||||
|
arrow.lineTo( 8, 4 );
|
||||||
|
arrow.lineTo( 14, 4 );
|
||||||
|
arrow.lineTo( 14, 6 );
|
||||||
|
arrow.lineTo( 3.5, 6 );
|
||||||
|
arrow.lineTo( 1, 11 );
|
||||||
|
arrow.closePath();
|
||||||
|
g.fill( arrow );
|
||||||
|
|
||||||
|
arrow = new Path2D.Float();
|
||||||
|
arrow.moveTo( 4, 7 );
|
||||||
|
arrow.lineTo( 16, 7 );
|
||||||
|
arrow.lineTo( 13, 13 );
|
||||||
|
arrow.lineTo( 1, 13 );
|
||||||
|
arrow.closePath();
|
||||||
|
g.fill( arrow );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
@foreground=bbbbbb
|
@foreground=bbbbbb
|
||||||
@disabledText=777777
|
@disabledText=777777
|
||||||
@textComponentBackground=45494A
|
@textComponentBackground=45494A
|
||||||
|
@icon=adadad
|
||||||
|
|
||||||
|
|
||||||
#---- globals ----
|
#---- globals ----
|
||||||
@@ -144,5 +145,3 @@ TabbedPane.contentAreaColor=323232
|
|||||||
|
|
||||||
#---- Tree ----
|
#---- Tree ----
|
||||||
|
|
||||||
Tree.icon.expandedColor=adadad
|
|
||||||
Tree.icon.collapsedColor=adadad
|
|
||||||
|
|||||||
@@ -174,3 +174,12 @@ TextPane.margin=@textComponentMargin
|
|||||||
|
|
||||||
Tree.expandedIcon=com.formdev.flatlaf.icons.FlatTreeExpandedIcon
|
Tree.expandedIcon=com.formdev.flatlaf.icons.FlatTreeExpandedIcon
|
||||||
Tree.collapsedIcon=com.formdev.flatlaf.icons.FlatTreeCollapsedIcon
|
Tree.collapsedIcon=com.formdev.flatlaf.icons.FlatTreeCollapsedIcon
|
||||||
|
Tree.leafIcon=com.formdev.flatlaf.icons.FlatTreeLeafIcon
|
||||||
|
Tree.closedIcon=com.formdev.flatlaf.icons.FlatTreeClosedIcon
|
||||||
|
Tree.openIcon=com.formdev.flatlaf.icons.FlatTreeOpenIcon
|
||||||
|
|
||||||
|
Tree.icon.expandedColor=@icon
|
||||||
|
Tree.icon.collapsedColor=@icon
|
||||||
|
Tree.icon.leafColor=@icon
|
||||||
|
Tree.icon.closedColor=@icon
|
||||||
|
Tree.icon.openColor=@icon
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
@foreground=000000
|
@foreground=000000
|
||||||
@disabledText=999999
|
@disabledText=999999
|
||||||
@textComponentBackground=ffffff
|
@textComponentBackground=ffffff
|
||||||
|
@icon=afafaf
|
||||||
|
|
||||||
|
|
||||||
#---- globals ----
|
#---- globals ----
|
||||||
@@ -144,5 +145,3 @@ TabbedPane.contentAreaColor=bfbfbf
|
|||||||
|
|
||||||
#---- Tree ----
|
#---- Tree ----
|
||||||
|
|
||||||
Tree.icon.expandedColor=afafaf
|
|
||||||
Tree.icon.collapsedColor=afafaf
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
@background=ccffcc
|
@background=ccffcc
|
||||||
@textComponentBackground=ffffff
|
@textComponentBackground=ffffff
|
||||||
|
@icon=afafaf
|
||||||
|
|
||||||
|
|
||||||
#---- globals ----
|
#---- globals ----
|
||||||
@@ -138,5 +139,3 @@ TabbedPane.contentAreaColor=bbbbbb
|
|||||||
|
|
||||||
#---- Tree ----
|
#---- Tree ----
|
||||||
|
|
||||||
Tree.icon.expandedColor=ad00ad
|
|
||||||
Tree.icon.collapsedColor=00adad
|
|
||||||
|
|||||||
BIN
flatlaf-core/svg/FlatLaf Icons.sketch
Normal file
BIN
flatlaf-core/svg/FlatLaf Icons.sketch
Normal file
Binary file not shown.
3
flatlaf-core/svg/TreeClosedIcon.svg
Normal file
3
flatlaf-core/svg/TreeClosedIcon.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||||
|
<path fill="#D8D8D8" fill-rule="evenodd" d="M1 2L6 2 8 4 15 4 15 13 1 13z"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 170 B |
6
flatlaf-core/svg/TreeLeafIcon.svg
Normal file
6
flatlaf-core/svg/TreeLeafIcon.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||||
|
<g fill="none" fill-rule="evenodd">
|
||||||
|
<path fill="#D8D8D8" d="M8 6L8 1 13 1 13 15 3 15 3 6z"/>
|
||||||
|
<path fill="#D8D8D8" d="M3 5L7 5 7 1z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 242 B |
6
flatlaf-core/svg/TreeOpenIcon.svg
Normal file
6
flatlaf-core/svg/TreeOpenIcon.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||||
|
<g fill="none" fill-rule="evenodd">
|
||||||
|
<path fill="#D8D8D8" d="M1 2L6 2 8 4 14 4 14 6 3.5 6 1 11z"/>
|
||||||
|
<path fill="#D8D8D8" d="M4 7L16 7 13 13 1 13z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 255 B |
Reference in New Issue
Block a user