mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 23:37:13 -06:00
Tree: use FlatUIUtils.createPath() in icon painting
This commit is contained in:
@@ -18,8 +18,8 @@ package com.formdev.flatlaf.icons;
|
|||||||
|
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.geom.Path2D;
|
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* "closed" icon for {@link javax.swing.JTree} used by {@link javax.swing.tree.DefaultTreeCellRenderer}.
|
* "closed" icon for {@link javax.swing.JTree} used by {@link javax.swing.tree.DefaultTreeCellRenderer}.
|
||||||
@@ -43,14 +43,6 @@ public class FlatTreeClosedIcon
|
|||||||
</svg>
|
</svg>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Path2D arrow = new Path2D.Float();
|
g.fill( FlatUIUtils.createPath( 1,2, 6,2, 8,4, 15,4, 15,13, 1,13 ) );
|
||||||
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 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ package com.formdev.flatlaf.icons;
|
|||||||
|
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.geom.Path2D;
|
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* "leaf" icon for {@link javax.swing.JTree} used by {@link javax.swing.tree.DefaultTreeCellRenderer}.
|
* "leaf" icon for {@link javax.swing.JTree} used by {@link javax.swing.tree.DefaultTreeCellRenderer}.
|
||||||
@@ -46,21 +46,7 @@ public class FlatTreeLeafIcon
|
|||||||
</svg>
|
</svg>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Path2D arrow = new Path2D.Float();
|
g.fill( FlatUIUtils.createPath( 8,6, 8,1, 13,1, 13,15, 3,15, 3,6 ) );
|
||||||
arrow.moveTo( 8, 6 );
|
g.fill( FlatUIUtils.createPath( 3,5, 7,5, 7,1 ) );
|
||||||
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 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ package com.formdev.flatlaf.icons;
|
|||||||
|
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.geom.Path2D;
|
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* "open" icon for {@link javax.swing.JTree} used by {@link javax.swing.tree.DefaultTreeCellRenderer}.
|
* "open" icon for {@link javax.swing.JTree} used by {@link javax.swing.tree.DefaultTreeCellRenderer}.
|
||||||
@@ -46,23 +46,7 @@ public class FlatTreeOpenIcon
|
|||||||
</svg>
|
</svg>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Path2D arrow = new Path2D.Float();
|
g.fill( FlatUIUtils.createPath( 1,2, 6,2, 8,4, 14,4, 14,6, 3.5,6, 1,11 ) );
|
||||||
arrow.moveTo( 1, 2 );
|
g.fill( FlatUIUtils.createPath( 4,7, 16,7, 13,13, 1,13 ) );
|
||||||
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 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user