├── README.md └── ui-dashboard-007 ├── TimingFramework-0.55.jar ├── build.xml ├── build ├── built-jar.properties └── classes │ └── com │ └── raven │ ├── chart │ ├── Chart$1.class │ ├── Chart$2.class │ ├── Chart.class │ ├── LabelColor.class │ ├── LegendItem.class │ ├── LineChart$1.class │ ├── LineChart$2.class │ ├── LineChart.class │ ├── ModelChart.class │ ├── ModelLegend.class │ └── blankchart │ │ ├── BlankPlotChart$1.class │ │ ├── BlankPlotChart.class │ │ ├── BlankPlotChatRender.class │ │ ├── NiceScale.class │ │ └── SeriesSize.class │ ├── component │ ├── Header.class │ ├── Menu$1.class │ └── Menu.class │ ├── event │ └── EventMenu.class │ ├── form │ ├── Form.class │ └── Form_1.class │ ├── icon │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ ├── 6.png │ ├── 7.png │ ├── 8.png │ ├── logout.png │ ├── message.png │ ├── noti.png │ └── profile.jpg │ ├── main │ ├── Main$1.class │ ├── Main$2.class │ └── Main.class │ └── swing │ ├── ButtonBadges$1.class │ ├── ButtonBadges$2.class │ ├── ButtonBadges.class │ ├── ButtonMenu$1.class │ ├── ButtonMenu$2.class │ ├── ButtonMenu.class │ ├── ImageAvatar.class │ ├── RoundPanel.class │ ├── progress │ ├── Progress.class │ ├── ProgressCircleUI$1.class │ └── ProgressCircleUI.class │ └── scrollbar │ ├── ModernScrollBarUI$ScrollBarButton.class │ ├── ModernScrollBarUI.class │ └── ScrollBarCustom.class ├── dist ├── README.TXT ├── lib │ ├── TimingFramework-0.55.jar │ └── miglayout-4.0.jar └── ui-dashboard-007.jar ├── manifest.mf ├── miglayout-4.0.jar ├── nbproject ├── build-impl.xml ├── genfiles.properties ├── private │ └── private.properties ├── project.properties └── project.xml └── src └── com └── raven ├── chart ├── Chart.form ├── Chart.java ├── LabelColor.java ├── LegendItem.form ├── LegendItem.java ├── LineChart.form ├── LineChart.java ├── ModelChart.java ├── ModelLegend.java └── blankchart │ ├── BlankPlotChart.java │ ├── BlankPlotChatRender.java │ ├── NiceScale.java │ └── SeriesSize.java ├── component ├── Header.form ├── Header.java ├── Menu.form └── Menu.java ├── event └── EventMenu.java ├── form ├── Form.form ├── Form.java ├── Form_1.form └── Form_1.java ├── icon ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── 8.png ├── logout.png ├── message.png ├── noti.png └── profile.jpg ├── main ├── Main.form └── Main.java └── swing ├── ButtonBadges.java ├── ButtonMenu.java ├── ImageAvatar.java ├── RoundPanel.java ├── progress ├── Progress.java └── ProgressCircleUI.java └── scrollbar ├── ModernScrollBarUI.java └── ScrollBarCustom.java /README.md: -------------------------------------------------------------------------------- 1 | # java-ui-dashboard-007 2 | Date : 13/11/2021
3 | How to coding in java 4 | visit my youtube : https://www.youtube.com/c/HelloWorld-Raven/featured 5 |

6 | 7 | ![2021-11-13_171345](https://user-images.githubusercontent.com/58245926/141642458-784c3e7a-7fc1-4953-b031-b360afe5eedc.png) 8 | -------------------------------------------------------------------------------- /ui-dashboard-007/TimingFramework-0.55.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/TimingFramework-0.55.jar -------------------------------------------------------------------------------- /ui-dashboard-007/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project ui-dashboard-007. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /ui-dashboard-007/build/built-jar.properties: -------------------------------------------------------------------------------- 1 | #Sat, 13 Nov 2021 18:21:27 +0700 2 | 3 | 4 | D\:\\Raven\\youtube\\ui\ design\\ui-dashboard\ 007\\project\\ui-dashboard-007= 5 | -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/Chart$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/Chart$1.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/Chart$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/Chart$2.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/Chart.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/Chart.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/LabelColor.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/LabelColor.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/LegendItem.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/LegendItem.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/LineChart$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/LineChart$1.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/LineChart$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/LineChart$2.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/LineChart.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/LineChart.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/ModelChart.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/ModelChart.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/ModelLegend.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/ModelLegend.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/blankchart/BlankPlotChart$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/blankchart/BlankPlotChart$1.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/blankchart/BlankPlotChart.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/blankchart/BlankPlotChart.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/blankchart/BlankPlotChatRender.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/blankchart/BlankPlotChatRender.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/blankchart/NiceScale.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/blankchart/NiceScale.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/chart/blankchart/SeriesSize.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/chart/blankchart/SeriesSize.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/component/Header.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/component/Header.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/component/Menu$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/component/Menu$1.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/component/Menu.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/component/Menu.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/event/EventMenu.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/event/EventMenu.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/form/Form.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/form/Form.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/form/Form_1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/form/Form_1.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/icon/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/icon/1.png -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/icon/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/icon/2.png -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/icon/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/icon/3.png -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/icon/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/icon/4.png -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/icon/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/icon/5.png -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/icon/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/icon/6.png -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/icon/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/icon/7.png -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/icon/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/icon/8.png -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/icon/logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/icon/logout.png -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/icon/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/icon/message.png -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/icon/noti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/icon/noti.png -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/icon/profile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/icon/profile.jpg -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/main/Main$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/main/Main$1.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/main/Main$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/main/Main$2.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/main/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/main/Main.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/swing/ButtonBadges$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/swing/ButtonBadges$1.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/swing/ButtonBadges$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/swing/ButtonBadges$2.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/swing/ButtonBadges.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/swing/ButtonBadges.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/swing/ButtonMenu$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/swing/ButtonMenu$1.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/swing/ButtonMenu$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/swing/ButtonMenu$2.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/swing/ButtonMenu.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/swing/ButtonMenu.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/swing/ImageAvatar.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/swing/ImageAvatar.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/swing/RoundPanel.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/swing/RoundPanel.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/swing/progress/Progress.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/swing/progress/Progress.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/swing/progress/ProgressCircleUI$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/swing/progress/ProgressCircleUI$1.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/swing/progress/ProgressCircleUI.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/swing/progress/ProgressCircleUI.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/swing/scrollbar/ModernScrollBarUI$ScrollBarButton.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/swing/scrollbar/ModernScrollBarUI$ScrollBarButton.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/swing/scrollbar/ModernScrollBarUI.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/swing/scrollbar/ModernScrollBarUI.class -------------------------------------------------------------------------------- /ui-dashboard-007/build/classes/com/raven/swing/scrollbar/ScrollBarCustom.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/build/classes/com/raven/swing/scrollbar/ScrollBarCustom.class -------------------------------------------------------------------------------- /ui-dashboard-007/dist/README.TXT: -------------------------------------------------------------------------------- 1 | ======================== 2 | BUILD OUTPUT DESCRIPTION 3 | ======================== 4 | 5 | When you build an Java application project that has a main class, the IDE 6 | automatically copies all of the JAR 7 | files on the projects classpath to your projects dist/lib folder. The IDE 8 | also adds each of the JAR files to the Class-Path element in the application 9 | JAR files manifest file (MANIFEST.MF). 10 | 11 | To run the project from the command line, go to the dist folder and 12 | type the following: 13 | 14 | java -jar "ui-dashboard-007.jar" 15 | 16 | To distribute this project, zip up the dist folder (including the lib folder) 17 | and distribute the ZIP file. 18 | 19 | Notes: 20 | 21 | * If two JAR files on the project classpath have the same name, only the first 22 | JAR file is copied to the lib folder. 23 | * Only JAR files are copied to the lib folder. 24 | If the classpath contains other types of files or folders, these files (folders) 25 | are not copied. 26 | * If a library on the projects classpath also has a Class-Path element 27 | specified in the manifest,the content of the Class-Path element has to be on 28 | the projects runtime path. 29 | * To set a main class in a standard Java project, right-click the project node 30 | in the Projects window and choose Properties. Then click Run and enter the 31 | class name in the Main Class field. Alternatively, you can manually type the 32 | class name in the manifest Main-Class element. 33 | -------------------------------------------------------------------------------- /ui-dashboard-007/dist/lib/TimingFramework-0.55.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/dist/lib/TimingFramework-0.55.jar -------------------------------------------------------------------------------- /ui-dashboard-007/dist/lib/miglayout-4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/dist/lib/miglayout-4.0.jar -------------------------------------------------------------------------------- /ui-dashboard-007/dist/ui-dashboard-007.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/dist/ui-dashboard-007.jar -------------------------------------------------------------------------------- /ui-dashboard-007/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /ui-dashboard-007/miglayout-4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/miglayout-4.0.jar -------------------------------------------------------------------------------- /ui-dashboard-007/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=68f6a7ef 2 | build.xml.script.CRC32=12c09209 3 | build.xml.stylesheet.CRC32=f85dc8f2@1.97.0.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=68f6a7ef 7 | nbproject/build-impl.xml.script.CRC32=5bf6f666 8 | nbproject/build-impl.xml.stylesheet.CRC32=d549e5cc@1.97.0.48 9 | -------------------------------------------------------------------------------- /ui-dashboard-007/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | user.properties.file=C:\\Users\\RAVEN\\AppData\\Roaming\\NetBeans\\12.2\\build.properties 3 | -------------------------------------------------------------------------------- /ui-dashboard-007/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processor.options= 4 | annotation.processing.processors.list= 5 | annotation.processing.run.all.processors=true 6 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 7 | build.classes.dir=${build.dir}/classes 8 | build.classes.excludes=**/*.java,**/*.form 9 | # This directory is removed when the project is cleaned: 10 | build.dir=build 11 | build.generated.dir=${build.dir}/generated 12 | build.generated.sources.dir=${build.dir}/generated-sources 13 | # Only compile against the classpath explicitly listed here: 14 | build.sysclasspath=ignore 15 | build.test.classes.dir=${build.dir}/test/classes 16 | build.test.results.dir=${build.dir}/test/results 17 | # Uncomment to specify the preferred debugger connection transport: 18 | #debug.transport=dt_socket 19 | debug.classpath=\ 20 | ${run.classpath} 21 | debug.modulepath=\ 22 | ${run.modulepath} 23 | debug.test.classpath=\ 24 | ${run.test.classpath} 25 | debug.test.modulepath=\ 26 | ${run.test.modulepath} 27 | # Files in build.classes.dir which should be excluded from distribution jar 28 | dist.archive.excludes= 29 | # This directory is removed when the project is cleaned: 30 | dist.dir=dist 31 | dist.jar=${dist.dir}/ui-dashboard-007.jar 32 | dist.javadoc.dir=${dist.dir}/javadoc 33 | dist.jlink.dir=${dist.dir}/jlink 34 | dist.jlink.output=${dist.jlink.dir}/ui-dashboard-007 35 | excludes= 36 | file.reference.miglayout-4.0.jar=miglayout-4.0.jar 37 | file.reference.TimingFramework-0.55.jar=TimingFramework-0.55.jar 38 | includes=** 39 | jar.compress=false 40 | javac.classpath=\ 41 | ${file.reference.TimingFramework-0.55.jar}:\ 42 | ${file.reference.miglayout-4.0.jar} 43 | # Space-separated list of extra javac options 44 | javac.compilerargs= 45 | javac.deprecation=false 46 | javac.external.vm=true 47 | javac.modulepath= 48 | javac.processormodulepath= 49 | javac.processorpath=\ 50 | ${javac.classpath} 51 | javac.source=1.8 52 | javac.target=1.8 53 | javac.test.classpath=\ 54 | ${javac.classpath}:\ 55 | ${build.classes.dir} 56 | javac.test.modulepath=\ 57 | ${javac.modulepath} 58 | javac.test.processorpath=\ 59 | ${javac.test.classpath} 60 | javadoc.additionalparam= 61 | javadoc.author=false 62 | javadoc.encoding=${source.encoding} 63 | javadoc.html5=false 64 | javadoc.noindex=false 65 | javadoc.nonavbar=false 66 | javadoc.notree=false 67 | javadoc.private=false 68 | javadoc.splitindex=true 69 | javadoc.use=true 70 | javadoc.version=false 71 | javadoc.windowtitle= 72 | # The jlink additional root modules to resolve 73 | jlink.additionalmodules= 74 | # The jlink additional command line parameters 75 | jlink.additionalparam= 76 | jlink.launcher=true 77 | jlink.launcher.name=ui-dashboard-007 78 | main.class=com.raven.main.Main 79 | manifest.file=manifest.mf 80 | meta.inf.dir=${src.dir}/META-INF 81 | mkdist.disabled=false 82 | platform.active=JDK_1.8 83 | run.classpath=\ 84 | ${javac.classpath}:\ 85 | ${build.classes.dir} 86 | # Space-separated list of JVM arguments used when running the project. 87 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 88 | # To set system properties for unit tests define test-sys-prop.name=value: 89 | run.jvmargs= 90 | run.modulepath=\ 91 | ${javac.modulepath} 92 | run.test.classpath=\ 93 | ${javac.test.classpath}:\ 94 | ${build.test.classes.dir} 95 | run.test.modulepath=\ 96 | ${javac.test.modulepath} 97 | source.encoding=UTF-8 98 | src.dir=src 99 | test.src.dir=test 100 | -------------------------------------------------------------------------------- /ui-dashboard-007/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | ui-dashboard-007 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/chart/Chart.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
64 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/chart/Chart.java: -------------------------------------------------------------------------------- 1 | package com.raven.chart; 2 | 3 | import com.raven.chart.blankchart.BlankPlotChart; 4 | import com.raven.chart.blankchart.BlankPlotChatRender; 5 | import com.raven.chart.blankchart.SeriesSize; 6 | import java.awt.AlphaComposite; 7 | import java.awt.Color; 8 | import java.awt.Dimension; 9 | import java.awt.FontMetrics; 10 | import java.awt.GradientPaint; 11 | import java.awt.Graphics2D; 12 | import java.awt.Point; 13 | import java.awt.Polygon; 14 | import java.awt.event.MouseEvent; 15 | import java.awt.geom.Path2D; 16 | import java.awt.geom.Rectangle2D; 17 | import java.text.DecimalFormat; 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | import org.jdesktop.animation.timing.Animator; 21 | import org.jdesktop.animation.timing.TimingTarget; 22 | import org.jdesktop.animation.timing.TimingTargetAdapter; 23 | 24 | public class Chart extends javax.swing.JPanel { 25 | 26 | DecimalFormat df = new DecimalFormat("#,##0.##"); 27 | private List legends = new ArrayList<>(); 28 | private List model = new ArrayList<>(); 29 | private final int seriesSize = 18; 30 | private final int seriesSpace = 10; 31 | private final Animator animator; 32 | private float animate; 33 | private String showLabel; 34 | private Point labelLocation = new Point(); 35 | 36 | public Chart() { 37 | initComponents(); 38 | setOpaque(false); 39 | TimingTarget target = new TimingTargetAdapter() { 40 | @Override 41 | public void timingEvent(float fraction) { 42 | animate = fraction; 43 | repaint(); 44 | } 45 | }; 46 | animator = new Animator(800, target); 47 | animator.setResolution(0); 48 | animator.setAcceleration(0.5f); 49 | animator.setDeceleration(0.5f); 50 | blankPlotChart.setBlankPlotChatRender(new BlankPlotChatRender() { 51 | @Override 52 | public int getMaxLegend() { 53 | return legends.size(); 54 | } 55 | 56 | @Override 57 | public String getLabelText(int index) { 58 | return model.get(index).getLabel(); 59 | } 60 | 61 | @Override 62 | public void renderSeries(BlankPlotChart chart, Graphics2D g2, SeriesSize size, int index) { 63 | double totalSeriesWidth = (seriesSize * legends.size()) + (seriesSpace * (legends.size() - 1)); 64 | double x = (size.getWidth() - totalSeriesWidth) / 2; 65 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f)); 66 | for (int i = 0; i < legends.size(); i++) { 67 | ModelLegend legend = legends.get(i); 68 | double seriesValues = chart.getSeriesValuesOf(model.get(index).getValues()[i], size.getHeight()) * animate; 69 | int s = seriesSize / 2; 70 | int sy = seriesSize / 3; 71 | int px[] = {(int) (size.getX() + x), (int) (size.getX() + x + s), (int) (size.getX() + x + s), (int) (size.getX() + x)}; 72 | int py[] = {(int) (size.getY() + size.getHeight() - seriesValues), (int) (size.getY() + size.getHeight() - seriesValues + sy), (int) (size.getY() + size.getHeight() + sy), (int) (size.getY() + size.getHeight())}; 73 | GradientPaint gra = new GradientPaint((int) (size.getX() + x) - s, 0, legend.getColorLight(), (int) (size.getX() + x + s), 0, legend.getColor()); 74 | g2.setPaint(gra); 75 | g2.fillPolygon(px, py, px.length); 76 | int px1[] = {(int) (size.getX() + x + s), (int) (size.getX() + x + seriesSize), (int) (size.getX() + x + seriesSize), (int) (size.getX() + x + s)}; 77 | int py1[] = {(int) (size.getY() + size.getHeight() - seriesValues + sy), (int) (size.getY() + size.getHeight() - seriesValues), (int) (size.getY() + size.getHeight()), (int) (size.getY() + size.getHeight() + sy)}; 78 | g2.setColor(legend.getColorLight()); 79 | g2.fillPolygon(px1, py1, px1.length); 80 | int px2[] = {(int) (size.getX() + x), (int) (size.getX() + x + s), (int) (size.getX() + x + seriesSize), (int) (size.getX() + x + s)}; 81 | int py2[] = {(int) (size.getY() + size.getHeight() - seriesValues), (int) (size.getY() + size.getHeight() - seriesValues - sy), (int) (size.getY() + size.getHeight() - seriesValues), (int) (size.getY() + size.getHeight() - seriesValues + sy)}; 82 | g2.fillPolygon(px2, py2, px2.length); 83 | x += seriesSpace + seriesSize; 84 | } 85 | if (showLabel != null) { 86 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f)); 87 | Dimension s = getLabelWidth(showLabel, g2); 88 | int space = 3; 89 | int spaceTop = 5; 90 | g2.setColor(new Color(30, 30, 30)); 91 | g2.fillRoundRect(labelLocation.x - s.width / 2 - 3, labelLocation.y - s.height - space * 2 - spaceTop, s.width + space * 2, s.height + space * 2, 10, 10); 92 | g2.setColor(new Color(200, 200, 200)); 93 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f)); 94 | g2.drawString(showLabel, labelLocation.x - s.width / 2, labelLocation.y - spaceTop - space * 2); 95 | } 96 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f)); 97 | } 98 | 99 | @Override 100 | public void renderSeries(BlankPlotChart chart, Graphics2D g2, SeriesSize size, int index, List gra) { 101 | } 102 | 103 | @Override 104 | public void renderGraphics(Graphics2D g2, List gra) { 105 | 106 | } 107 | 108 | @Override 109 | public boolean mouseMoving(BlankPlotChart chart, MouseEvent evt, Graphics2D g2, SeriesSize size, int index) { 110 | double totalSeriesWidth = (seriesSize * legends.size()) + (seriesSpace * (legends.size() - 1)); 111 | double x = (size.getWidth() - totalSeriesWidth) / 2; 112 | for (int i = 0; i < legends.size(); i++) { 113 | double seriesValues = chart.getSeriesValuesOf(model.get(index).getValues()[i], size.getHeight()) * animate; 114 | int s = seriesSize / 2; 115 | int sy = seriesSize / 3; 116 | int px[] = {(int) (size.getX() + x), (int) (size.getX() + x + s), (int) (size.getX() + x + seriesSize), (int) (size.getX() + x + seriesSize), (int) (size.getX() + x + s), (int) (size.getX() + x)}; 117 | int py[] = {(int) (size.getY() + size.getHeight() - seriesValues), (int) (size.getY() + size.getHeight() - seriesValues - sy), (int) (size.getY() + size.getHeight() - seriesValues), (int) (size.getY() + size.getHeight()), (int) (size.getY() + size.getHeight() + sy), (int) (size.getY() + size.getHeight())}; 118 | if (new Polygon(px, py, px.length).contains(evt.getPoint())) { 119 | double data = model.get(index).getValues()[i]; 120 | showLabel = df.format(data); 121 | labelLocation.setLocation((int) (size.getX() + x + s), (int) (size.getY() + size.getHeight() - seriesValues - sy)); 122 | chart.repaint(); 123 | return true; 124 | } 125 | x += seriesSpace + seriesSize; 126 | } 127 | return false; 128 | } 129 | }); 130 | } 131 | 132 | public void addLegend(String name, Color color, Color color1) { 133 | ModelLegend data = new ModelLegend(name, color, color1); 134 | legends.add(data); 135 | panelLegend.add(new LegendItem(data)); 136 | panelLegend.repaint(); 137 | panelLegend.revalidate(); 138 | } 139 | 140 | public void addData(ModelChart data) { 141 | model.add(data); 142 | blankPlotChart.setLabelCount(model.size()); 143 | double max = data.getMaxValues(); 144 | if (max > blankPlotChart.getMaxValues()) { 145 | blankPlotChart.setMaxValues(max); 146 | } 147 | } 148 | 149 | public void clear() { 150 | animate = 0; 151 | showLabel = null; 152 | blankPlotChart.setLabelCount(0); 153 | model.clear(); 154 | repaint(); 155 | } 156 | 157 | public void start() { 158 | showLabel = null; 159 | if (!animator.isRunning()) { 160 | animator.start(); 161 | } 162 | } 163 | 164 | private Dimension getLabelWidth(String text, Graphics2D g2) { 165 | FontMetrics ft = g2.getFontMetrics(); 166 | Rectangle2D r2 = ft.getStringBounds(text, g2); 167 | return new Dimension((int) r2.getWidth(), (int) r2.getHeight()); 168 | } 169 | 170 | @SuppressWarnings("unchecked") 171 | // //GEN-BEGIN:initComponents 172 | private void initComponents() { 173 | 174 | blankPlotChart = new com.raven.chart.blankchart.BlankPlotChart(); 175 | panelLegend = new javax.swing.JPanel(); 176 | 177 | setBackground(new java.awt.Color(255, 255, 255)); 178 | 179 | panelLegend.setOpaque(false); 180 | panelLegend.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 0)); 181 | 182 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); 183 | this.setLayout(layout); 184 | layout.setHorizontalGroup( 185 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 186 | .addGroup(layout.createSequentialGroup() 187 | .addContainerGap() 188 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 189 | .addComponent(panelLegend, javax.swing.GroupLayout.DEFAULT_SIZE, 573, Short.MAX_VALUE) 190 | .addComponent(blankPlotChart, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 191 | .addContainerGap()) 192 | ); 193 | layout.setVerticalGroup( 194 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 195 | .addGroup(layout.createSequentialGroup() 196 | .addContainerGap() 197 | .addComponent(blankPlotChart, javax.swing.GroupLayout.DEFAULT_SIZE, 342, Short.MAX_VALUE) 198 | .addGap(0, 0, 0) 199 | .addComponent(panelLegend, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) 200 | .addContainerGap()) 201 | ); 202 | }// //GEN-END:initComponents 203 | 204 | // Variables declaration - do not modify//GEN-BEGIN:variables 205 | private com.raven.chart.blankchart.BlankPlotChart blankPlotChart; 206 | private javax.swing.JPanel panelLegend; 207 | // End of variables declaration//GEN-END:variables 208 | } 209 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/chart/LabelColor.java: -------------------------------------------------------------------------------- 1 | package com.raven.chart; 2 | 3 | import java.awt.Graphics; 4 | import java.awt.Graphics2D; 5 | import java.awt.RenderingHints; 6 | import javax.swing.JLabel; 7 | 8 | public class LabelColor extends JLabel { 9 | 10 | @Override 11 | protected void paintComponent(Graphics grphcs) { 12 | Graphics2D g2 = (Graphics2D) grphcs; 13 | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 14 | int width = getWidth(); 15 | int height = getHeight(); 16 | int size = Math.min(width, height) - 4; 17 | int x = (width - size) / 2; 18 | int y = (height - size) / 2; 19 | g2.setColor(getBackground()); 20 | g2.fillOval(x, y, size, size); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/chart/LegendItem.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 |
60 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/chart/LegendItem.java: -------------------------------------------------------------------------------- 1 | package com.raven.chart; 2 | 3 | public class LegendItem extends javax.swing.JPanel { 4 | 5 | public LegendItem(ModelLegend data) { 6 | initComponents(); 7 | setOpaque(false); 8 | lbColor.setBackground(data.getColor()); 9 | lbName.setText(data.getName()); 10 | } 11 | 12 | @SuppressWarnings("unchecked") 13 | // //GEN-BEGIN:initComponents 14 | private void initComponents() { 15 | 16 | lbColor = new com.raven.chart.LabelColor(); 17 | lbName = new javax.swing.JLabel(); 18 | 19 | lbColor.setText("labelColor1"); 20 | 21 | lbName.setForeground(new java.awt.Color(180, 180, 180)); 22 | lbName.setText("Name"); 23 | 24 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); 25 | this.setLayout(layout); 26 | layout.setHorizontalGroup( 27 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 28 | .addGroup(layout.createSequentialGroup() 29 | .addContainerGap() 30 | .addComponent(lbColor, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) 31 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 32 | .addComponent(lbName) 33 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 34 | ); 35 | layout.setVerticalGroup( 36 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 37 | .addGroup(layout.createSequentialGroup() 38 | .addContainerGap() 39 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 40 | .addGroup(layout.createSequentialGroup() 41 | .addComponent(lbName) 42 | .addGap(0, 0, Short.MAX_VALUE)) 43 | .addComponent(lbColor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 44 | .addContainerGap()) 45 | ); 46 | }// //GEN-END:initComponents 47 | 48 | 49 | // Variables declaration - do not modify//GEN-BEGIN:variables 50 | private com.raven.chart.LabelColor lbColor; 51 | private javax.swing.JLabel lbName; 52 | // End of variables declaration//GEN-END:variables 53 | } 54 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/chart/LineChart.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
64 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/chart/LineChart.java: -------------------------------------------------------------------------------- 1 | package com.raven.chart; 2 | 3 | import com.raven.chart.blankchart.BlankPlotChart; 4 | import com.raven.chart.blankchart.BlankPlotChatRender; 5 | import com.raven.chart.blankchart.SeriesSize; 6 | import java.awt.AlphaComposite; 7 | import java.awt.BasicStroke; 8 | import java.awt.Color; 9 | import java.awt.Dimension; 10 | import java.awt.FontMetrics; 11 | import java.awt.GradientPaint; 12 | import java.awt.Graphics2D; 13 | import java.awt.Point; 14 | import java.awt.Polygon; 15 | import java.awt.event.MouseEvent; 16 | import java.awt.geom.Path2D; 17 | import java.awt.geom.Rectangle2D; 18 | import java.text.DecimalFormat; 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | import org.jdesktop.animation.timing.Animator; 22 | import org.jdesktop.animation.timing.TimingTarget; 23 | import org.jdesktop.animation.timing.TimingTargetAdapter; 24 | 25 | public class LineChart extends javax.swing.JPanel { 26 | 27 | DecimalFormat df = new DecimalFormat("#,##0.##"); 28 | private List legends = new ArrayList<>(); 29 | private List model = new ArrayList<>(); 30 | private final int seriesSize = 18; 31 | private final int seriesSpace = 0; 32 | private final Animator animator; 33 | private float animate; 34 | private String showLabel; 35 | private Point labelLocation = new Point(); 36 | 37 | public LineChart() { 38 | initComponents(); 39 | setOpaque(false); 40 | TimingTarget target = new TimingTargetAdapter() { 41 | @Override 42 | public void timingEvent(float fraction) { 43 | animate = fraction; 44 | repaint(); 45 | } 46 | }; 47 | animator = new Animator(800, target); 48 | animator.setResolution(0); 49 | animator.setAcceleration(0.5f); 50 | animator.setDeceleration(0.5f); 51 | blankPlotChart.getNiceScale().setMaxTicks(5); 52 | blankPlotChart.setBlankPlotChatRender(new BlankPlotChatRender() { 53 | @Override 54 | public int getMaxLegend() { 55 | return legends.size(); 56 | } 57 | 58 | @Override 59 | public String getLabelText(int index) { 60 | return model.get(index).getLabel(); 61 | } 62 | 63 | @Override 64 | public void renderSeries(BlankPlotChart chart, Graphics2D g2, SeriesSize size, int index) { 65 | } 66 | 67 | @Override 68 | public void renderSeries(BlankPlotChart chart, Graphics2D g2, SeriesSize size, int index, List gra) { 69 | double totalSeriesWidth = (seriesSize * legends.size()) + (seriesSpace * (legends.size() - 1)); 70 | double x = (size.getWidth() - totalSeriesWidth) / 2; 71 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f)); 72 | int ss = seriesSize / 2; 73 | for (int i = 0; i < legends.size(); i++) { 74 | double seriesValues = chart.getSeriesValuesOf(model.get(index).getValues()[i], size.getHeight()) * animate; 75 | if (index == 0) { 76 | gra.get(i).moveTo(size.getX() + x + ss, size.getY() + size.getHeight() - seriesValues); 77 | } else { 78 | gra.get(i).lineTo(size.getX() + x + ss, size.getY() + size.getHeight() - seriesValues); 79 | } 80 | x += seriesSpace + seriesSize; 81 | } 82 | if (showLabel != null) { 83 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f)); 84 | Dimension s = getLabelWidth(showLabel, g2); 85 | int space = 3; 86 | int spaceTop = 0; 87 | g2.setColor(new Color(30, 30, 30)); 88 | g2.fillRoundRect(labelLocation.x - s.width / 2 - 3, labelLocation.y - s.height - space * 2 - spaceTop, s.width + space * 2, s.height + space * 2, 10, 10); 89 | g2.setColor(new Color(200, 200, 200)); 90 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f)); 91 | g2.drawString(showLabel, labelLocation.x - s.width / 2, labelLocation.y - spaceTop - space * 2); 92 | } 93 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f)); 94 | } 95 | 96 | @Override 97 | public void renderGraphics(Graphics2D g2, List gra) { 98 | g2.setStroke(new BasicStroke(3f)); 99 | for (int i = 0; i < gra.size(); i++) { 100 | g2.setPaint(new GradientPaint(0, 0, legends.get(i).getColor(), getWidth(), 0, legends.get(i).getColorLight())); 101 | g2.draw(gra.get(i)); 102 | } 103 | } 104 | 105 | @Override 106 | public boolean mouseMoving(BlankPlotChart chart, MouseEvent evt, Graphics2D g2, SeriesSize size, int index) { 107 | double totalSeriesWidth = (seriesSize * legends.size()) + (seriesSpace * (legends.size() - 1)); 108 | double x = (size.getWidth() - totalSeriesWidth) / 2; 109 | for (int i = 0; i < legends.size(); i++) { 110 | double seriesValues = chart.getSeriesValuesOf(model.get(index).getValues()[i], size.getHeight()) * animate; 111 | int s = seriesSize / 2; 112 | int sy = seriesSize / 3; 113 | int px[] = {(int) (size.getX() + x), (int) (size.getX() + x + s), (int) (size.getX() + x + seriesSize), (int) (size.getX() + x + seriesSize), (int) (size.getX() + x + s), (int) (size.getX() + x)}; 114 | int py[] = {(int) (size.getY() + size.getHeight() - seriesValues), (int) (size.getY() + size.getHeight() - seriesValues - sy), (int) (size.getY() + size.getHeight() - seriesValues), (int) (size.getY() + size.getHeight()), (int) (size.getY() + size.getHeight() + sy), (int) (size.getY() + size.getHeight())}; 115 | if (new Polygon(px, py, px.length).contains(evt.getPoint())) { 116 | double data = model.get(index).getValues()[i]; 117 | showLabel = df.format(data); 118 | labelLocation.setLocation((int) (size.getX() + x + s), (int) (size.getY() + size.getHeight() - seriesValues - sy)); 119 | chart.repaint(); 120 | return true; 121 | } 122 | x += seriesSpace + seriesSize; 123 | } 124 | return false; 125 | } 126 | }); 127 | } 128 | 129 | public void addLegend(String name, Color color, Color color1) { 130 | ModelLegend data = new ModelLegend(name, color, color1); 131 | legends.add(data); 132 | panelLegend.add(new LegendItem(data)); 133 | panelLegend.repaint(); 134 | panelLegend.revalidate(); 135 | } 136 | 137 | public void addData(ModelChart data) { 138 | model.add(data); 139 | blankPlotChart.setLabelCount(model.size()); 140 | double max = data.getMaxValues(); 141 | if (max > blankPlotChart.getMaxValues()) { 142 | blankPlotChart.setMaxValues(max); 143 | } 144 | } 145 | 146 | public void clear() { 147 | animate = 0; 148 | showLabel = null; 149 | blankPlotChart.setLabelCount(0); 150 | model.clear(); 151 | repaint(); 152 | } 153 | 154 | public void start() { 155 | showLabel = null; 156 | if (!animator.isRunning()) { 157 | animator.start(); 158 | } 159 | } 160 | 161 | private Dimension getLabelWidth(String text, Graphics2D g2) { 162 | FontMetrics ft = g2.getFontMetrics(); 163 | Rectangle2D r2 = ft.getStringBounds(text, g2); 164 | return new Dimension((int) r2.getWidth(), (int) r2.getHeight()); 165 | } 166 | 167 | @SuppressWarnings("unchecked") 168 | // //GEN-BEGIN:initComponents 169 | private void initComponents() { 170 | 171 | blankPlotChart = new com.raven.chart.blankchart.BlankPlotChart(); 172 | panelLegend = new javax.swing.JPanel(); 173 | 174 | setBackground(new java.awt.Color(255, 255, 255)); 175 | 176 | panelLegend.setOpaque(false); 177 | panelLegend.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 0)); 178 | 179 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); 180 | this.setLayout(layout); 181 | layout.setHorizontalGroup( 182 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 183 | .addGroup(layout.createSequentialGroup() 184 | .addContainerGap() 185 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 186 | .addComponent(panelLegend, javax.swing.GroupLayout.DEFAULT_SIZE, 573, Short.MAX_VALUE) 187 | .addComponent(blankPlotChart, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 188 | .addContainerGap()) 189 | ); 190 | layout.setVerticalGroup( 191 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 192 | .addGroup(layout.createSequentialGroup() 193 | .addContainerGap() 194 | .addComponent(blankPlotChart, javax.swing.GroupLayout.DEFAULT_SIZE, 342, Short.MAX_VALUE) 195 | .addGap(0, 0, 0) 196 | .addComponent(panelLegend, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) 197 | .addContainerGap()) 198 | ); 199 | }// //GEN-END:initComponents 200 | 201 | // Variables declaration - do not modify//GEN-BEGIN:variables 202 | private com.raven.chart.blankchart.BlankPlotChart blankPlotChart; 203 | private javax.swing.JPanel panelLegend; 204 | // End of variables declaration//GEN-END:variables 205 | } 206 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/chart/ModelChart.java: -------------------------------------------------------------------------------- 1 | package com.raven.chart; 2 | 3 | public class ModelChart { 4 | 5 | public String getLabel() { 6 | return label; 7 | } 8 | 9 | public void setLabel(String label) { 10 | this.label = label; 11 | } 12 | 13 | public double[] getValues() { 14 | return values; 15 | } 16 | 17 | public void setValues(double[] values) { 18 | this.values = values; 19 | } 20 | 21 | public ModelChart(String label, double[] values) { 22 | this.label = label; 23 | this.values = values; 24 | } 25 | 26 | public ModelChart() { 27 | } 28 | 29 | private String label; 30 | private double values[]; 31 | 32 | public double getMaxValues() { 33 | double max = 0; 34 | for (double v : values) { 35 | if (v > max) { 36 | max = v; 37 | } 38 | } 39 | return max; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/chart/ModelLegend.java: -------------------------------------------------------------------------------- 1 | package com.raven.chart; 2 | 3 | import java.awt.Color; 4 | 5 | public class ModelLegend { 6 | 7 | public String getName() { 8 | return name; 9 | } 10 | 11 | public void setName(String name) { 12 | this.name = name; 13 | } 14 | 15 | public Color getColor() { 16 | return color; 17 | } 18 | 19 | public void setColor(Color color) { 20 | this.color = color; 21 | } 22 | 23 | public Color getColorLight() { 24 | return colorLight; 25 | } 26 | 27 | public void setColorLight(Color colorLight) { 28 | this.colorLight = colorLight; 29 | } 30 | 31 | public ModelLegend(String name, Color color, Color colorLight) { 32 | this.name = name; 33 | this.color = color; 34 | this.colorLight = colorLight; 35 | } 36 | 37 | public ModelLegend() { 38 | } 39 | 40 | private String name; 41 | private Color color; 42 | private Color colorLight; 43 | } 44 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/chart/blankchart/BlankPlotChart.java: -------------------------------------------------------------------------------- 1 | package com.raven.chart.blankchart; 2 | 3 | import java.awt.Color; 4 | import java.awt.FontMetrics; 5 | import java.awt.Graphics; 6 | import java.awt.Graphics2D; 7 | import java.awt.Insets; 8 | import java.awt.RenderingHints; 9 | import java.awt.event.MouseEvent; 10 | import java.awt.event.MouseMotionAdapter; 11 | import java.awt.geom.Path2D; 12 | import java.awt.geom.Rectangle2D; 13 | import java.text.DecimalFormat; 14 | import java.util.ArrayList; 15 | import java.util.List; 16 | import javax.swing.JComponent; 17 | import javax.swing.border.EmptyBorder; 18 | 19 | public class BlankPlotChart extends JComponent { 20 | 21 | public BlankPlotChatRender getBlankPlotChatRender() { 22 | return blankPlotChatRender; 23 | } 24 | 25 | public void setBlankPlotChatRender(BlankPlotChatRender blankPlotChatRender) { 26 | this.blankPlotChatRender = blankPlotChatRender; 27 | } 28 | 29 | public double getMaxValues() { 30 | return maxValues; 31 | } 32 | 33 | public void setMaxValues(double maxValues) { 34 | this.maxValues = maxValues; 35 | niceScale.setMax(maxValues); 36 | repaint(); 37 | } 38 | 39 | public double getMinValues() { 40 | return minValues; 41 | } 42 | 43 | public int getLabelCount() { 44 | return labelCount; 45 | } 46 | 47 | public void setLabelCount(int labelCount) { 48 | this.labelCount = labelCount; 49 | } 50 | 51 | public String getValuesFormat() { 52 | return valuesFormat; 53 | } 54 | 55 | public void setValuesFormat(String valuesFormat) { 56 | this.valuesFormat = valuesFormat; 57 | format.applyPattern(valuesFormat); 58 | } 59 | 60 | private final DecimalFormat format = new DecimalFormat("#,##0.##"); 61 | private NiceScale niceScale; 62 | private double maxValues; 63 | private double minValues; 64 | private int labelCount; 65 | private String valuesFormat = "#,##0.##"; 66 | private BlankPlotChatRender blankPlotChatRender; 67 | 68 | public BlankPlotChart() { 69 | setBackground(Color.WHITE); 70 | setOpaque(false); 71 | setForeground(new Color(180, 180, 180)); 72 | setBorder(new EmptyBorder(35, 10, 10, 10)); 73 | init(); 74 | } 75 | 76 | private void init() { 77 | initValues(0, 10); 78 | addMouseMotionListener(new MouseMotionAdapter() { 79 | @Override 80 | public void mouseMoved(MouseEvent me) { 81 | mouseMove((Graphics2D) getGraphics(), me); 82 | } 83 | }); 84 | } 85 | 86 | public void initValues(double minValues, double maxValues) { 87 | this.minValues = minValues; 88 | this.maxValues = maxValues; 89 | niceScale = new NiceScale(minValues, maxValues); 90 | repaint(); 91 | } 92 | 93 | @Override 94 | protected void paintComponent(Graphics grphcs) { 95 | super.paintComponent(grphcs); 96 | if (niceScale != null) { 97 | Graphics2D g2 = (Graphics2D) grphcs; 98 | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 99 | g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); 100 | createLine(g2); 101 | createValues(g2); 102 | createLabelText(g2); 103 | renderSeries(g2); 104 | } 105 | } 106 | 107 | private void createLine(Graphics2D g2) { 108 | g2.setColor(new Color(150, 150, 150, 20)); 109 | Insets insets = getInsets(); 110 | double textHeight = getLabelTextHeight(g2); 111 | double height = getHeight() - (insets.top + insets.bottom) - textHeight; 112 | double space = height / niceScale.getMaxTicks(); 113 | double locationY = insets.bottom + textHeight; 114 | double textWidth = getMaxValuesTextWidth(g2); 115 | double spaceText = 5; 116 | for (int i = 0; i <= niceScale.getMaxTicks(); i++) { 117 | int y = (int) (getHeight() - locationY); 118 | g2.drawLine((int) (insets.left + textWidth + spaceText), y, (int) getWidth() - insets.right, y); 119 | locationY += space; 120 | } 121 | 122 | } 123 | 124 | private void createValues(Graphics2D g2) { 125 | g2.setColor(getForeground()); 126 | Insets insets = getInsets(); 127 | double textHeight = getLabelTextHeight(g2); 128 | double height = getHeight() - (insets.top + insets.bottom) - textHeight; 129 | double space = height / niceScale.getMaxTicks(); 130 | double valuesCount = niceScale.getNiceMin(); 131 | double locationY = insets.bottom + textHeight; 132 | FontMetrics ft = g2.getFontMetrics(); 133 | for (int i = 0; i <= niceScale.getMaxTicks(); i++) { 134 | String text = format.format(valuesCount); 135 | Rectangle2D r2 = ft.getStringBounds(text, g2); 136 | double stringY = r2.getCenterY() * -1; 137 | double y = getHeight() - locationY + stringY; 138 | g2.drawString(text, insets.left, (int) y); 139 | locationY += space; 140 | valuesCount += niceScale.getTickSpacing(); 141 | } 142 | } 143 | 144 | private void createLabelText(Graphics2D g2) { 145 | if (labelCount > 0) { 146 | Insets insets = getInsets(); 147 | double textWidth = getMaxValuesTextWidth(g2); 148 | double spaceText = 5; 149 | double width = getWidth() - insets.left - insets.right - textWidth - spaceText; 150 | double space = width / labelCount; 151 | double locationX = insets.left + textWidth + spaceText; 152 | double locationText = getHeight() - insets.bottom + 5; 153 | FontMetrics ft = g2.getFontMetrics(); 154 | for (int i = 0; i < labelCount; i++) { 155 | double centerX = ((locationX + space / 2)); 156 | g2.setColor(getForeground()); 157 | String text = getChartText(i); 158 | Rectangle2D r2 = ft.getStringBounds(text, g2); 159 | double textX = centerX - r2.getWidth() / 2; 160 | g2.drawString(text, (int) textX, (int) locationText); 161 | locationX += space; 162 | } 163 | } 164 | } 165 | 166 | private void renderSeries(Graphics2D g2) { 167 | if (blankPlotChatRender != null) { 168 | Insets insets = getInsets(); 169 | double textWidth = getMaxValuesTextWidth(g2); 170 | double textHeight = getLabelTextHeight(g2); 171 | double spaceText = 5; 172 | double width = getWidth() - insets.left - insets.right - textWidth - spaceText; 173 | double height = getHeight() - insets.top - insets.bottom - textHeight; 174 | double space = width / labelCount; 175 | double locationX = insets.left + textWidth + spaceText; 176 | for (int i = 0; i < labelCount; i++) { 177 | blankPlotChatRender.renderSeries(this, g2, getRectangle(i, height, space, locationX, insets.top), i); 178 | } 179 | List gra = initGra(blankPlotChatRender.getMaxLegend()); 180 | for (int i = 0; i < labelCount; i++) { 181 | blankPlotChatRender.renderSeries(this, g2, getRectangle(i, height, space, locationX, insets.top), i, gra); 182 | } 183 | blankPlotChatRender.renderGraphics(g2, gra); 184 | } 185 | } 186 | 187 | private List initGra(int size) { 188 | List list = new ArrayList<>(); 189 | for (int i = 0; i < size; i++) { 190 | list.add(new Path2D.Double()); 191 | } 192 | return list; 193 | } 194 | 195 | private void mouseMove(Graphics2D g2, MouseEvent evt) { 196 | if (blankPlotChatRender != null) { 197 | Insets insets = getInsets(); 198 | double textWidth = getMaxValuesTextWidth(g2); 199 | double textHeight = getLabelTextHeight(g2); 200 | double spaceText = 5; 201 | double width = getWidth() - insets.left - insets.right - textWidth - spaceText; 202 | double height = getHeight() - insets.top - insets.bottom - textHeight; 203 | double space = width / labelCount; 204 | double locationX = insets.left + textWidth + spaceText; 205 | for (int i = 0; i < labelCount; i++) { 206 | boolean stop = blankPlotChatRender.mouseMoving(this, evt, g2, getRectangle(i, height, space, locationX, insets.top), i); 207 | if (stop) { 208 | break; 209 | } 210 | } 211 | } 212 | } 213 | 214 | private double getMaxValuesTextWidth(Graphics2D g2) { 215 | double width = 0; 216 | FontMetrics ft = g2.getFontMetrics(); 217 | double valuesCount = niceScale.getNiceMin(); 218 | for (int i = 0; i <= niceScale.getMaxTicks(); i++) { 219 | String text = format.format(valuesCount); 220 | Rectangle2D r2 = ft.getStringBounds(text, g2); 221 | double w = r2.getWidth(); 222 | if (w > width) { 223 | width = w; 224 | } 225 | valuesCount += niceScale.getTickSpacing(); 226 | } 227 | return width; 228 | } 229 | 230 | private int getLabelTextHeight(Graphics2D g2) { 231 | FontMetrics ft = g2.getFontMetrics(); 232 | return ft.getHeight(); 233 | } 234 | 235 | private String getChartText(int index) { 236 | if (blankPlotChatRender != null) { 237 | return blankPlotChatRender.getLabelText(index); 238 | } else { 239 | return "Label"; 240 | } 241 | } 242 | 243 | public SeriesSize getRectangle(int index, double height, double space, double startX, double startY) { 244 | double x = startX + space * index; 245 | SeriesSize size = new SeriesSize(x, startY + 1, space, height); 246 | return size; 247 | } 248 | 249 | public double getSeriesValuesOf(double values, double height) { 250 | double max = niceScale.getTickSpacing() * niceScale.getMaxTicks(); 251 | double percentValues = values * 100d / max; 252 | return height * percentValues / 100d; 253 | } 254 | 255 | public NiceScale getNiceScale() { 256 | return niceScale; 257 | } 258 | 259 | public void setNiceScale(NiceScale niceScale) { 260 | this.niceScale = niceScale; 261 | } 262 | } 263 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/chart/blankchart/BlankPlotChatRender.java: -------------------------------------------------------------------------------- 1 | package com.raven.chart.blankchart; 2 | 3 | import java.awt.Graphics2D; 4 | import java.awt.event.MouseEvent; 5 | import java.awt.geom.Path2D; 6 | import java.util.List; 7 | 8 | public abstract class BlankPlotChatRender { 9 | 10 | public abstract String getLabelText(int index); 11 | 12 | public abstract void renderSeries(BlankPlotChart chart, Graphics2D g2, SeriesSize size, int index); 13 | 14 | public abstract void renderSeries(BlankPlotChart chart, Graphics2D g2, SeriesSize size, int index, List gra); 15 | 16 | public abstract boolean mouseMoving(BlankPlotChart chart, MouseEvent evt, Graphics2D g2, SeriesSize size, int index); 17 | 18 | public abstract void renderGraphics(Graphics2D g2, List gra); 19 | 20 | public abstract int getMaxLegend(); 21 | } 22 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/chart/blankchart/NiceScale.java: -------------------------------------------------------------------------------- 1 | package com.raven.chart.blankchart; 2 | 3 | public class NiceScale { 4 | 5 | private double min; 6 | private double max; 7 | private int maxTicks = 10; 8 | private double tickSpacing; 9 | private double range; 10 | private double niceMin; 11 | private double niceMax; 12 | 13 | public NiceScale(final double MIN, final double MAX) { 14 | min = MIN; 15 | max = MAX; 16 | calculate(); 17 | } 18 | 19 | private void calculate() { 20 | range = niceNum(max - min, false); 21 | tickSpacing = niceNum(range / (maxTicks - 1), true); 22 | niceMin = Math.floor(min / tickSpacing) * tickSpacing; 23 | niceMax = Math.ceil(max / tickSpacing) * tickSpacing; 24 | } 25 | 26 | private double niceNum(final double RANGE, final boolean ROUND) { 27 | double exponent; // exponent of RANGE 28 | double fraction; // fractional part of RANGE 29 | double niceFraction; // nice, rounded fraction 30 | 31 | exponent = Math.floor(Math.log10(RANGE)); 32 | fraction = RANGE / Math.pow(10, exponent); 33 | 34 | if (ROUND) { 35 | if (fraction < 1.5) { 36 | niceFraction = 1; 37 | } else if (fraction < 3) { 38 | niceFraction = 2; 39 | } else if (fraction < 7) { 40 | niceFraction = 5; 41 | } else { 42 | niceFraction = 10; 43 | } 44 | } else { 45 | if (fraction <= 1) { 46 | niceFraction = 1; 47 | } else if (fraction <= 2) { 48 | niceFraction = 2; 49 | } else if (fraction <= 5) { 50 | niceFraction = 5; 51 | } else { 52 | niceFraction = 10; 53 | } 54 | } 55 | return niceFraction * Math.pow(10, exponent); 56 | } 57 | 58 | public void setMinMax(final double MIN, final double MAX) { 59 | min = MIN; 60 | max = MAX; 61 | calculate(); 62 | } 63 | 64 | public void setMaxTicks(final int MAX_TICKS) { 65 | maxTicks = MAX_TICKS; 66 | calculate(); 67 | } 68 | 69 | public double getTickSpacing() { 70 | return tickSpacing; 71 | } 72 | 73 | public double getNiceMin() { 74 | return niceMin; 75 | } 76 | 77 | public double getNiceMax() { 78 | return niceMax; 79 | } 80 | 81 | public int getMaxTicks() { 82 | return maxTicks; 83 | } 84 | 85 | public double getMin() { 86 | return min; 87 | } 88 | 89 | public void setMin(double min) { 90 | this.min = min; 91 | calculate(); 92 | } 93 | 94 | public double getMax() { 95 | return max; 96 | } 97 | 98 | public void setMax(double max) { 99 | this.max = max; 100 | calculate(); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/chart/blankchart/SeriesSize.java: -------------------------------------------------------------------------------- 1 | package com.raven.chart.blankchart; 2 | 3 | public class SeriesSize { 4 | 5 | public double getX() { 6 | return x; 7 | } 8 | 9 | public void setX(double x) { 10 | this.x = x; 11 | } 12 | 13 | public double getY() { 14 | return y; 15 | } 16 | 17 | public void setY(double y) { 18 | this.y = y; 19 | } 20 | 21 | public double getWidth() { 22 | return width; 23 | } 24 | 25 | public void setWidth(double width) { 26 | this.width = width; 27 | } 28 | 29 | public double getHeight() { 30 | return height; 31 | } 32 | 33 | public void setHeight(double height) { 34 | this.height = height; 35 | } 36 | 37 | public SeriesSize(double x, double y, double width, double height) { 38 | this.x = x; 39 | this.y = y; 40 | this.width = width; 41 | this.height = height; 42 | } 43 | 44 | public SeriesSize() { 45 | } 46 | 47 | private double x; 48 | private double y; 49 | private double width; 50 | private double height; 51 | } 52 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/component/Header.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 |
72 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/component/Header.java: -------------------------------------------------------------------------------- 1 | package com.raven.component; 2 | 3 | import java.awt.Color; 4 | import java.awt.Graphics; 5 | import java.awt.Graphics2D; 6 | import java.awt.RenderingHints; 7 | import java.awt.geom.Area; 8 | import java.awt.geom.Rectangle2D; 9 | import java.awt.geom.RoundRectangle2D; 10 | 11 | public class Header extends javax.swing.JPanel { 12 | 13 | public Header() { 14 | initComponents(); 15 | setOpaque(false); 16 | setBackground(new Color(51, 51, 51)); 17 | } 18 | 19 | @SuppressWarnings("unchecked") 20 | // //GEN-BEGIN:initComponents 21 | private void initComponents() { 22 | 23 | buttonBadges1 = new com.raven.swing.ButtonBadges(); 24 | buttonBadges2 = new com.raven.swing.ButtonBadges(); 25 | 26 | buttonBadges1.setBackground(new java.awt.Color(25, 25, 25)); 27 | buttonBadges1.setForeground(new java.awt.Color(9, 129, 233)); 28 | buttonBadges1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/raven/icon/noti.png"))); // NOI18N 29 | buttonBadges1.setBadges(5); 30 | 31 | buttonBadges2.setBackground(new java.awt.Color(25, 25, 25)); 32 | buttonBadges2.setForeground(new java.awt.Color(247, 58, 58)); 33 | buttonBadges2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/raven/icon/message.png"))); // NOI18N 34 | buttonBadges2.setBadges(15); 35 | 36 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); 37 | this.setLayout(layout); 38 | layout.setHorizontalGroup( 39 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 40 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 41 | .addContainerGap(539, Short.MAX_VALUE) 42 | .addComponent(buttonBadges2, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE) 43 | .addGap(3, 3, 3) 44 | .addComponent(buttonBadges1, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE) 45 | .addGap(10, 10, 10)) 46 | ); 47 | layout.setVerticalGroup( 48 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 49 | .addGroup(layout.createSequentialGroup() 50 | .addContainerGap() 51 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 52 | .addComponent(buttonBadges2, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE) 53 | .addComponent(buttonBadges1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 54 | .addContainerGap()) 55 | ); 56 | }// //GEN-END:initComponents 57 | 58 | @Override 59 | public void paint(Graphics grphcs) { 60 | Graphics2D g2 = (Graphics2D) grphcs.create(); 61 | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 62 | g2.setColor(getBackground()); 63 | Area area = new Area(new RoundRectangle2D.Double(0, 0, getWidth(), getHeight(), 15, 15)); 64 | area.add(new Area(new Rectangle2D.Double(0, 20, getWidth(), getHeight()))); 65 | g2.fill(area); 66 | g2.dispose(); 67 | super.paint(grphcs); 68 | } 69 | 70 | 71 | // Variables declaration - do not modify//GEN-BEGIN:variables 72 | private com.raven.swing.ButtonBadges buttonBadges1; 73 | private com.raven.swing.ButtonBadges buttonBadges2; 74 | // End of variables declaration//GEN-END:variables 75 | } 76 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/component/Menu.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/component/Menu.java: -------------------------------------------------------------------------------- 1 | package com.raven.component; 2 | 3 | import com.raven.event.EventMenu; 4 | import com.raven.swing.ButtonMenu; 5 | import com.raven.swing.scrollbar.ScrollBarCustom; 6 | import java.awt.Color; 7 | import java.awt.Component; 8 | import java.awt.event.ActionEvent; 9 | import java.awt.event.ActionListener; 10 | import javax.swing.Icon; 11 | import javax.swing.ImageIcon; 12 | import javax.swing.JLabel; 13 | import net.miginfocom.swing.MigLayout; 14 | 15 | public class Menu extends javax.swing.JPanel { 16 | 17 | private EventMenu event; 18 | 19 | public Menu() { 20 | initComponents(); 21 | setOpaque(false); 22 | ScrollBarCustom sb = new ScrollBarCustom(); 23 | sb.setForeground(new Color(130, 130, 130, 100)); 24 | jScrollPane1.setVerticalScrollBar(sb); 25 | panelMenu.setLayout(new MigLayout("wrap, fillx, inset 3", "[fill]", "[]0[]")); 26 | } 27 | 28 | public void initMenu(EventMenu event) { 29 | this.event = event; 30 | addMenu(new ImageIcon(getClass().getResource("/com/raven/icon/1.png")), "Dashboard", 0); 31 | addMenu(new ImageIcon(getClass().getResource("/com/raven/icon/2.png")), "Application", 1); 32 | addMenu(new ImageIcon(getClass().getResource("/com/raven/icon/3.png")), "Staff", 2); 33 | addMenu(new ImageIcon(getClass().getResource("/com/raven/icon/4.png")), "Report", 3); 34 | addMenu(new ImageIcon(getClass().getResource("/com/raven/icon/5.png")), "Note", 4); 35 | addMenu(new ImageIcon(getClass().getResource("/com/raven/icon/6.png")), "Export", 5); 36 | addMenu(new ImageIcon(getClass().getResource("/com/raven/icon/7.png")), "Import", 6); 37 | addMenu(new ImageIcon(getClass().getResource("/com/raven/icon/8.png")), "Setting", 7); 38 | addEmpty(); 39 | addMenu(new ImageIcon(getClass().getResource("/com/raven/icon/logout.png")), "Logout", 8); 40 | } 41 | 42 | private void addEmpty() { 43 | panelMenu.add(new JLabel(), "push"); 44 | } 45 | 46 | private void addMenu(Icon icon, String text, int index) { 47 | ButtonMenu menu = new ButtonMenu(); 48 | menu.setIcon(icon); 49 | menu.setText(" " + text); 50 | panelMenu.add(menu); 51 | menu.addActionListener(new ActionListener() { 52 | @Override 53 | public void actionPerformed(ActionEvent ae) { 54 | event.selected(index); 55 | setSelected(menu); 56 | } 57 | }); 58 | } 59 | 60 | private void setSelected(ButtonMenu menu) { 61 | for (Component com : panelMenu.getComponents()) { 62 | if (com instanceof ButtonMenu) { 63 | ButtonMenu b = (ButtonMenu) com; 64 | b.setSelected(false); 65 | } 66 | } 67 | menu.setSelected(true); 68 | } 69 | 70 | @SuppressWarnings("unchecked") 71 | // //GEN-BEGIN:initComponents 72 | private void initComponents() { 73 | 74 | roundPanel1 = new com.raven.swing.RoundPanel(); 75 | imageAvatar1 = new com.raven.swing.ImageAvatar(); 76 | jLabel1 = new javax.swing.JLabel(); 77 | jLabel2 = new javax.swing.JLabel(); 78 | roundPanel2 = new com.raven.swing.RoundPanel(); 79 | jScrollPane1 = new javax.swing.JScrollPane(); 80 | panelMenu = new javax.swing.JPanel(); 81 | 82 | roundPanel1.setBackground(new java.awt.Color(51, 51, 51)); 83 | 84 | imageAvatar1.setForeground(new java.awt.Color(231, 231, 231)); 85 | imageAvatar1.setBorderSize(2); 86 | imageAvatar1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/raven/icon/profile.jpg"))); // NOI18N 87 | 88 | jLabel1.setFont(new java.awt.Font("sansserif", 1, 14)); // NOI18N 89 | jLabel1.setForeground(new java.awt.Color(224, 224, 224)); 90 | jLabel1.setText("User Name"); 91 | 92 | jLabel2.setForeground(new java.awt.Color(203, 203, 203)); 93 | jLabel2.setText("Admin"); 94 | 95 | javax.swing.GroupLayout roundPanel1Layout = new javax.swing.GroupLayout(roundPanel1); 96 | roundPanel1.setLayout(roundPanel1Layout); 97 | roundPanel1Layout.setHorizontalGroup( 98 | roundPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 99 | .addGroup(roundPanel1Layout.createSequentialGroup() 100 | .addGap(10, 10, 10) 101 | .addComponent(imageAvatar1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) 102 | .addGap(10, 10, 10) 103 | .addGroup(roundPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 104 | .addComponent(jLabel1) 105 | .addComponent(jLabel2)) 106 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 107 | ); 108 | roundPanel1Layout.setVerticalGroup( 109 | roundPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 110 | .addGroup(roundPanel1Layout.createSequentialGroup() 111 | .addGroup(roundPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 112 | .addGroup(roundPanel1Layout.createSequentialGroup() 113 | .addGap(21, 21, 21) 114 | .addComponent(jLabel1) 115 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 116 | .addComponent(jLabel2)) 117 | .addGroup(roundPanel1Layout.createSequentialGroup() 118 | .addGap(10, 10, 10) 119 | .addComponent(imageAvatar1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))) 120 | .addGap(10, 10, 10)) 121 | ); 122 | 123 | roundPanel2.setBackground(new java.awt.Color(51, 51, 51)); 124 | 125 | jScrollPane1.setBorder(null); 126 | jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); 127 | 128 | panelMenu.setBackground(new java.awt.Color(51, 51, 51)); 129 | 130 | javax.swing.GroupLayout panelMenuLayout = new javax.swing.GroupLayout(panelMenu); 131 | panelMenu.setLayout(panelMenuLayout); 132 | panelMenuLayout.setHorizontalGroup( 133 | panelMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 134 | .addGap(0, 208, Short.MAX_VALUE) 135 | ); 136 | panelMenuLayout.setVerticalGroup( 137 | panelMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 138 | .addGap(0, 578, Short.MAX_VALUE) 139 | ); 140 | 141 | jScrollPane1.setViewportView(panelMenu); 142 | 143 | javax.swing.GroupLayout roundPanel2Layout = new javax.swing.GroupLayout(roundPanel2); 144 | roundPanel2.setLayout(roundPanel2Layout); 145 | roundPanel2Layout.setHorizontalGroup( 146 | roundPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 147 | .addGroup(roundPanel2Layout.createSequentialGroup() 148 | .addContainerGap() 149 | .addComponent(jScrollPane1) 150 | .addContainerGap()) 151 | ); 152 | roundPanel2Layout.setVerticalGroup( 153 | roundPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 154 | .addGroup(roundPanel2Layout.createSequentialGroup() 155 | .addContainerGap() 156 | .addComponent(jScrollPane1) 157 | .addContainerGap()) 158 | ); 159 | 160 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); 161 | this.setLayout(layout); 162 | layout.setHorizontalGroup( 163 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 164 | .addComponent(roundPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 165 | .addComponent(roundPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 166 | ); 167 | layout.setVerticalGroup( 168 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 169 | .addGroup(layout.createSequentialGroup() 170 | .addComponent(roundPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 171 | .addGap(10, 10, 10) 172 | .addComponent(roundPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 173 | ); 174 | }// //GEN-END:initComponents 175 | 176 | // Variables declaration - do not modify//GEN-BEGIN:variables 177 | private com.raven.swing.ImageAvatar imageAvatar1; 178 | private javax.swing.JLabel jLabel1; 179 | private javax.swing.JLabel jLabel2; 180 | private javax.swing.JScrollPane jScrollPane1; 181 | private javax.swing.JPanel panelMenu; 182 | private com.raven.swing.RoundPanel roundPanel1; 183 | private com.raven.swing.RoundPanel roundPanel2; 184 | // End of variables declaration//GEN-END:variables 185 | } 186 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/event/EventMenu.java: -------------------------------------------------------------------------------- 1 | package com.raven.event; 2 | 3 | public interface EventMenu { 4 | 5 | public void selected(int index); 6 | } 7 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/form/Form.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/form/Form.java: -------------------------------------------------------------------------------- 1 | package com.raven.form; 2 | 3 | public class Form extends javax.swing.JPanel { 4 | 5 | public Form(int index) { 6 | initComponents(); 7 | setOpaque(false); 8 | jLabel1.setText("Form " + index); 9 | } 10 | 11 | @SuppressWarnings("unchecked") 12 | // //GEN-BEGIN:initComponents 13 | private void initComponents() { 14 | 15 | jLabel1 = new javax.swing.JLabel(); 16 | 17 | jLabel1.setFont(new java.awt.Font("sansserif", 1, 48)); // NOI18N 18 | jLabel1.setForeground(new java.awt.Color(137, 137, 137)); 19 | jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); 20 | jLabel1.setText("Form"); 21 | 22 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); 23 | this.setLayout(layout); 24 | layout.setHorizontalGroup( 25 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 26 | .addGroup(layout.createSequentialGroup() 27 | .addContainerGap() 28 | .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE) 29 | .addContainerGap()) 30 | ); 31 | layout.setVerticalGroup( 32 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 33 | .addGroup(layout.createSequentialGroup() 34 | .addContainerGap() 35 | .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 288, Short.MAX_VALUE) 36 | .addContainerGap()) 37 | ); 38 | }// //GEN-END:initComponents 39 | 40 | // Variables declaration - do not modify//GEN-BEGIN:variables 41 | private javax.swing.JLabel jLabel1; 42 | // End of variables declaration//GEN-END:variables 43 | } 44 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/form/Form_1.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/form/Form_1.java: -------------------------------------------------------------------------------- 1 | package com.raven.form; 2 | 3 | import com.raven.chart.ModelChart; 4 | import java.awt.Color; 5 | 6 | public class Form_1 extends javax.swing.JPanel { 7 | 8 | public Form_1() { 9 | initComponents(); 10 | setOpaque(false); 11 | init(); 12 | } 13 | 14 | private void init() { 15 | chart.addLegend("Income", new Color(12, 84, 175), new Color(0, 108, 247)); 16 | chart.addLegend("Expense", new Color(54, 4, 143), new Color(104, 49, 200)); 17 | chart.addLegend("Profit", new Color(5, 125, 0), new Color(95, 209, 69)); 18 | chart.addLegend("Cost", new Color(186, 37, 37), new Color(241, 100, 120)); 19 | chart.addData(new ModelChart("January", new double[]{500, 200, 80, 89})); 20 | chart.addData(new ModelChart("February", new double[]{600, 750, 90, 150})); 21 | chart.addData(new ModelChart("March", new double[]{200, 350, 460, 900})); 22 | chart.addData(new ModelChart("April", new double[]{480, 150, 750, 700})); 23 | chart.addData(new ModelChart("May", new double[]{350, 540, 300, 150})); 24 | chart.addData(new ModelChart("June", new double[]{190, 280, 81, 200})); 25 | chart.start(); 26 | lineChart.addLegend("Income", new Color(12, 84, 175), new Color(0, 108, 247)); 27 | lineChart.addLegend("Expense", new Color(54, 4, 143), new Color(104, 49, 200)); 28 | lineChart.addLegend("Profit", new Color(5, 125, 0), new Color(95, 209, 69)); 29 | lineChart.addLegend("Cost", new Color(186, 37, 37), new Color(241, 100, 120)); 30 | lineChart.addData(new ModelChart("January", new double[]{500, 200, 80, 89})); 31 | lineChart.addData(new ModelChart("February", new double[]{600, 750, 90, 150})); 32 | lineChart.addData(new ModelChart("March", new double[]{200, 350, 460, 900})); 33 | lineChart.addData(new ModelChart("April", new double[]{480, 150, 750, 700})); 34 | lineChart.addData(new ModelChart("May", new double[]{350, 540, 300, 150})); 35 | lineChart.addData(new ModelChart("June", new double[]{190, 280, 81, 200})); 36 | lineChart.start(); 37 | progress1.start(); 38 | progress2.start(); 39 | progress3.start(); 40 | } 41 | 42 | @SuppressWarnings("unchecked") 43 | // //GEN-BEGIN:initComponents 44 | private void initComponents() { 45 | 46 | roundPanel1 = new com.raven.swing.RoundPanel(); 47 | jPanel1 = new javax.swing.JPanel(); 48 | progress1 = new com.raven.swing.progress.Progress(); 49 | jLabel1 = new javax.swing.JLabel(); 50 | jLabel2 = new javax.swing.JLabel(); 51 | jPanel2 = new javax.swing.JPanel(); 52 | progress2 = new com.raven.swing.progress.Progress(); 53 | jLabel3 = new javax.swing.JLabel(); 54 | jPanel3 = new javax.swing.JPanel(); 55 | progress3 = new com.raven.swing.progress.Progress(); 56 | jLabel4 = new javax.swing.JLabel(); 57 | roundPanel2 = new com.raven.swing.RoundPanel(); 58 | chart = new com.raven.chart.Chart(); 59 | roundPanel3 = new com.raven.swing.RoundPanel(); 60 | lineChart = new com.raven.chart.LineChart(); 61 | 62 | roundPanel1.setBackground(new java.awt.Color(51, 51, 51)); 63 | 64 | jPanel1.setOpaque(false); 65 | 66 | progress1.setBackground(new java.awt.Color(66, 246, 84)); 67 | progress1.setForeground(new java.awt.Color(19, 153, 32)); 68 | progress1.setValue(60); 69 | 70 | jLabel1.setFont(new java.awt.Font("sansserif", 0, 14)); // NOI18N 71 | jLabel1.setForeground(new java.awt.Color(220, 220, 220)); 72 | jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); 73 | jLabel1.setText("Total Income Sold"); 74 | 75 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); 76 | jPanel1.setLayout(jPanel1Layout); 77 | jPanel1Layout.setHorizontalGroup( 78 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 79 | .addGroup(jPanel1Layout.createSequentialGroup() 80 | .addContainerGap() 81 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 82 | .addComponent(progress1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 83 | .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 84 | .addContainerGap()) 85 | ); 86 | jPanel1Layout.setVerticalGroup( 87 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 88 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 89 | .addContainerGap() 90 | .addComponent(jLabel1) 91 | .addGap(18, 18, 18) 92 | .addComponent(progress1, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE) 93 | .addContainerGap()) 94 | ); 95 | 96 | jLabel2.setFont(new java.awt.Font("sansserif", 1, 15)); // NOI18N 97 | jLabel2.setForeground(new java.awt.Color(220, 220, 220)); 98 | jLabel2.setText("Report Monthly"); 99 | jLabel2.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 10, 1, 1)); 100 | 101 | jPanel2.setOpaque(false); 102 | 103 | progress2.setBackground(new java.awt.Color(132, 66, 246)); 104 | progress2.setForeground(new java.awt.Color(64, 18, 153)); 105 | progress2.setValue(70); 106 | 107 | jLabel3.setFont(new java.awt.Font("sansserif", 0, 14)); // NOI18N 108 | jLabel3.setForeground(new java.awt.Color(220, 220, 220)); 109 | jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); 110 | jLabel3.setText("Total Income Profit"); 111 | 112 | javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); 113 | jPanel2.setLayout(jPanel2Layout); 114 | jPanel2Layout.setHorizontalGroup( 115 | jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 116 | .addGroup(jPanel2Layout.createSequentialGroup() 117 | .addContainerGap() 118 | .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 119 | .addComponent(progress2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 120 | .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 121 | .addContainerGap()) 122 | ); 123 | jPanel2Layout.setVerticalGroup( 124 | jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 125 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() 126 | .addContainerGap() 127 | .addComponent(jLabel3) 128 | .addGap(18, 18, 18) 129 | .addComponent(progress2, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE) 130 | .addContainerGap()) 131 | ); 132 | 133 | jPanel3.setOpaque(false); 134 | 135 | progress3.setBackground(new java.awt.Color(66, 193, 246)); 136 | progress3.setForeground(new java.awt.Color(26, 132, 181)); 137 | progress3.setValue(85); 138 | 139 | jLabel4.setFont(new java.awt.Font("sansserif", 0, 14)); // NOI18N 140 | jLabel4.setForeground(new java.awt.Color(220, 220, 220)); 141 | jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); 142 | jLabel4.setText("Total Expense"); 143 | 144 | javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); 145 | jPanel3.setLayout(jPanel3Layout); 146 | jPanel3Layout.setHorizontalGroup( 147 | jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 148 | .addGroup(jPanel3Layout.createSequentialGroup() 149 | .addContainerGap() 150 | .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 151 | .addComponent(progress3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 152 | .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 153 | .addContainerGap()) 154 | ); 155 | jPanel3Layout.setVerticalGroup( 156 | jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 157 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() 158 | .addContainerGap() 159 | .addComponent(jLabel4) 160 | .addGap(18, 18, 18) 161 | .addComponent(progress3, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE) 162 | .addContainerGap()) 163 | ); 164 | 165 | javax.swing.GroupLayout roundPanel1Layout = new javax.swing.GroupLayout(roundPanel1); 166 | roundPanel1.setLayout(roundPanel1Layout); 167 | roundPanel1Layout.setHorizontalGroup( 168 | roundPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 169 | .addGroup(roundPanel1Layout.createSequentialGroup() 170 | .addContainerGap() 171 | .addGroup(roundPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 172 | .addGroup(roundPanel1Layout.createSequentialGroup() 173 | .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 174 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 175 | .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 176 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 177 | .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 178 | .addGap(0, 0, Short.MAX_VALUE)) 179 | .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 180 | .addContainerGap()) 181 | ); 182 | roundPanel1Layout.setVerticalGroup( 183 | roundPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 184 | .addGroup(roundPanel1Layout.createSequentialGroup() 185 | .addContainerGap() 186 | .addComponent(jLabel2) 187 | .addGap(20, 20, 20) 188 | .addGroup(roundPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 189 | .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 190 | .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 191 | .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 192 | .addContainerGap()) 193 | ); 194 | 195 | roundPanel2.setBackground(new java.awt.Color(51, 51, 51)); 196 | 197 | javax.swing.GroupLayout roundPanel2Layout = new javax.swing.GroupLayout(roundPanel2); 198 | roundPanel2.setLayout(roundPanel2Layout); 199 | roundPanel2Layout.setHorizontalGroup( 200 | roundPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 201 | .addGroup(roundPanel2Layout.createSequentialGroup() 202 | .addContainerGap() 203 | .addComponent(chart, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 204 | .addContainerGap()) 205 | ); 206 | roundPanel2Layout.setVerticalGroup( 207 | roundPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 208 | .addGroup(roundPanel2Layout.createSequentialGroup() 209 | .addContainerGap() 210 | .addComponent(chart, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE) 211 | .addContainerGap()) 212 | ); 213 | 214 | roundPanel3.setBackground(new java.awt.Color(51, 51, 51)); 215 | 216 | javax.swing.GroupLayout roundPanel3Layout = new javax.swing.GroupLayout(roundPanel3); 217 | roundPanel3.setLayout(roundPanel3Layout); 218 | roundPanel3Layout.setHorizontalGroup( 219 | roundPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 220 | .addGroup(roundPanel3Layout.createSequentialGroup() 221 | .addContainerGap() 222 | .addComponent(lineChart, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 223 | .addContainerGap()) 224 | ); 225 | roundPanel3Layout.setVerticalGroup( 226 | roundPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 227 | .addGroup(roundPanel3Layout.createSequentialGroup() 228 | .addContainerGap() 229 | .addComponent(lineChart, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) 230 | .addContainerGap()) 231 | ); 232 | 233 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); 234 | this.setLayout(layout); 235 | layout.setHorizontalGroup( 236 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 237 | .addGroup(layout.createSequentialGroup() 238 | .addComponent(roundPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 239 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 240 | .addComponent(roundPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 241 | .addComponent(roundPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 242 | ); 243 | layout.setVerticalGroup( 244 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 245 | .addGroup(layout.createSequentialGroup() 246 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 247 | .addComponent(roundPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 248 | .addComponent(roundPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 249 | .addGap(10, 10, 10) 250 | .addComponent(roundPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 251 | ); 252 | }// //GEN-END:initComponents 253 | 254 | // Variables declaration - do not modify//GEN-BEGIN:variables 255 | private com.raven.chart.Chart chart; 256 | private javax.swing.JLabel jLabel1; 257 | private javax.swing.JLabel jLabel2; 258 | private javax.swing.JLabel jLabel3; 259 | private javax.swing.JLabel jLabel4; 260 | private javax.swing.JPanel jPanel1; 261 | private javax.swing.JPanel jPanel2; 262 | private javax.swing.JPanel jPanel3; 263 | private com.raven.chart.LineChart lineChart; 264 | private com.raven.swing.progress.Progress progress1; 265 | private com.raven.swing.progress.Progress progress2; 266 | private com.raven.swing.progress.Progress progress3; 267 | private com.raven.swing.RoundPanel roundPanel1; 268 | private com.raven.swing.RoundPanel roundPanel2; 269 | private com.raven.swing.RoundPanel roundPanel3; 270 | // End of variables declaration//GEN-END:variables 271 | } 272 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/icon/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/src/com/raven/icon/1.png -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/icon/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/src/com/raven/icon/2.png -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/icon/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/src/com/raven/icon/3.png -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/icon/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/src/com/raven/icon/4.png -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/icon/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/src/com/raven/icon/5.png -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/icon/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/src/com/raven/icon/6.png -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/icon/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/src/com/raven/icon/7.png -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/icon/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/src/com/raven/icon/8.png -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/icon/logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/src/com/raven/icon/logout.png -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/icon/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/src/com/raven/icon/message.png -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/icon/noti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/src/com/raven/icon/noti.png -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/icon/profile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJ-Raven/java-ui-dashboard-007/56ba26f0e5f0ee7ffcf79ea2675c9688d7eda45c/ui-dashboard-007/src/com/raven/icon/profile.jpg -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/main/Main.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 |
87 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/main/Main.java: -------------------------------------------------------------------------------- 1 | package com.raven.main; 2 | 3 | import com.raven.event.EventMenu; 4 | import com.raven.form.Form; 5 | import com.raven.form.Form_1; 6 | import java.awt.Color; 7 | import java.awt.Component; 8 | 9 | public class Main extends javax.swing.JFrame { 10 | 11 | public Main() { 12 | initComponents(); 13 | setBackground(new Color(0, 0, 0, 0)); 14 | EventMenu event = new EventMenu() { 15 | @Override 16 | public void selected(int index) { 17 | if (index == 0) { 18 | showForm(new Form_1()); 19 | } else if (index == 8) { 20 | System.out.println("Logout"); 21 | } else { 22 | showForm(new Form(index)); 23 | } 24 | } 25 | }; 26 | menu1.initMenu(event); 27 | showForm(new Form_1()); 28 | } 29 | 30 | private void showForm(Component com) { 31 | body.removeAll(); 32 | body.add(com); 33 | body.revalidate(); 34 | body.repaint(); 35 | } 36 | 37 | @SuppressWarnings("unchecked") 38 | // //GEN-BEGIN:initComponents 39 | private void initComponents() { 40 | 41 | roundPanel1 = new com.raven.swing.RoundPanel(); 42 | header2 = new com.raven.component.Header(); 43 | menu1 = new com.raven.component.Menu(); 44 | body = new javax.swing.JPanel(); 45 | 46 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 47 | setUndecorated(true); 48 | 49 | roundPanel1.setBackground(new java.awt.Color(25, 25, 25)); 50 | 51 | body.setOpaque(false); 52 | body.setLayout(new java.awt.BorderLayout()); 53 | 54 | javax.swing.GroupLayout roundPanel1Layout = new javax.swing.GroupLayout(roundPanel1); 55 | roundPanel1.setLayout(roundPanel1Layout); 56 | roundPanel1Layout.setHorizontalGroup( 57 | roundPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 58 | .addComponent(header2, javax.swing.GroupLayout.DEFAULT_SIZE, 1371, Short.MAX_VALUE) 59 | .addGroup(roundPanel1Layout.createSequentialGroup() 60 | .addGap(10, 10, 10) 61 | .addComponent(menu1, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE) 62 | .addGap(10, 10, 10) 63 | .addComponent(body, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 64 | .addGap(10, 10, 10)) 65 | ); 66 | roundPanel1Layout.setVerticalGroup( 67 | roundPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 68 | .addGroup(roundPanel1Layout.createSequentialGroup() 69 | .addComponent(header2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 70 | .addGap(10, 10, 10) 71 | .addGroup(roundPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 72 | .addComponent(menu1, javax.swing.GroupLayout.DEFAULT_SIZE, 666, Short.MAX_VALUE) 73 | .addComponent(body, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 74 | .addGap(10, 10, 10)) 75 | ); 76 | 77 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 78 | getContentPane().setLayout(layout); 79 | layout.setHorizontalGroup( 80 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 81 | .addComponent(roundPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 82 | ); 83 | layout.setVerticalGroup( 84 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 85 | .addComponent(roundPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 86 | ); 87 | 88 | pack(); 89 | setLocationRelativeTo(null); 90 | }// //GEN-END:initComponents 91 | 92 | public static void main(String args[]) { 93 | /* Set the Nimbus look and feel */ 94 | // 95 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 96 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 97 | */ 98 | try { 99 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 100 | if ("Nimbus".equals(info.getName())) { 101 | javax.swing.UIManager.setLookAndFeel(info.getClassName()); 102 | break; 103 | } 104 | } 105 | } catch (ClassNotFoundException ex) { 106 | java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 107 | } catch (InstantiationException ex) { 108 | java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 109 | } catch (IllegalAccessException ex) { 110 | java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 111 | } catch (javax.swing.UnsupportedLookAndFeelException ex) { 112 | java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 113 | } 114 | // 115 | 116 | /* Create and display the form */ 117 | java.awt.EventQueue.invokeLater(new Runnable() { 118 | public void run() { 119 | new Main().setVisible(true); 120 | } 121 | }); 122 | } 123 | 124 | // Variables declaration - do not modify//GEN-BEGIN:variables 125 | private javax.swing.JPanel body; 126 | private com.raven.component.Header header2; 127 | private com.raven.component.Menu menu1; 128 | private com.raven.swing.RoundPanel roundPanel1; 129 | // End of variables declaration//GEN-END:variables 130 | } 131 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/swing/ButtonBadges.java: -------------------------------------------------------------------------------- 1 | package com.raven.swing; 2 | 3 | import java.awt.AlphaComposite; 4 | import java.awt.Color; 5 | import java.awt.Cursor; 6 | import java.awt.FontMetrics; 7 | import java.awt.Graphics; 8 | import java.awt.Graphics2D; 9 | import java.awt.Point; 10 | import java.awt.RenderingHints; 11 | import java.awt.event.MouseAdapter; 12 | import java.awt.event.MouseEvent; 13 | import java.awt.geom.Rectangle2D; 14 | import java.awt.image.BufferedImage; 15 | import javax.swing.JButton; 16 | import javax.swing.border.EmptyBorder; 17 | import org.jdesktop.animation.timing.Animator; 18 | import org.jdesktop.animation.timing.TimingTarget; 19 | import org.jdesktop.animation.timing.TimingTargetAdapter; 20 | 21 | public class ButtonBadges extends JButton { 22 | 23 | public int getBadges() { 24 | return badges; 25 | } 26 | 27 | public void setBadges(int badges) { 28 | this.badges = badges; 29 | } 30 | 31 | public Color getEffectColor() { 32 | return effectColor; 33 | } 34 | 35 | public void setEffectColor(Color effectColor) { 36 | this.effectColor = effectColor; 37 | } 38 | 39 | private Animator animator; 40 | private int targetSize; 41 | private float animatSize; 42 | private Point pressedPoint; 43 | private float alpha; 44 | private Color effectColor = new Color(173, 173, 173); 45 | private int badges; 46 | 47 | public ButtonBadges() { 48 | setContentAreaFilled(false); 49 | setBorder(new EmptyBorder(5, 5, 5, 5)); 50 | setBackground(Color.WHITE); 51 | setCursor(new Cursor(Cursor.HAND_CURSOR)); 52 | addMouseListener(new MouseAdapter() { 53 | @Override 54 | public void mousePressed(MouseEvent me) { 55 | targetSize = Math.max(getWidth(), getHeight()) * 2; 56 | animatSize = 0; 57 | pressedPoint = me.getPoint(); 58 | alpha = 0.5f; 59 | if (animator.isRunning()) { 60 | animator.stop(); 61 | } 62 | animator.start(); 63 | } 64 | }); 65 | TimingTarget target = new TimingTargetAdapter() { 66 | @Override 67 | public void timingEvent(float fraction) { 68 | if (fraction > 0.5f) { 69 | alpha = 1 - fraction; 70 | } 71 | animatSize = fraction * targetSize; 72 | repaint(); 73 | } 74 | }; 75 | animator = new Animator(400, target); 76 | animator.setResolution(0); 77 | } 78 | 79 | @Override 80 | protected void paintComponent(Graphics grphcs) { 81 | int width = getWidth(); 82 | int height = getHeight(); 83 | int size = Math.min(width, height) - 8; 84 | int x = (width - size) / 2; 85 | int y = (height - size) / 2; 86 | BufferedImage img = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB); 87 | Graphics2D g2 = img.createGraphics(); 88 | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 89 | g2.setColor(getBackground()); 90 | g2.fillOval(0, 0, size, size); 91 | if (pressedPoint != null) { 92 | g2.setColor(effectColor); 93 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, alpha)); 94 | g2.fillOval((int) (pressedPoint.x - animatSize / 2), (int) (pressedPoint.y - animatSize / 2), (int) animatSize, (int) animatSize); 95 | } 96 | g2.dispose(); 97 | grphcs.drawImage(img, x, y, null); 98 | super.paintComponent(grphcs); 99 | } 100 | 101 | @Override 102 | public void paint(Graphics grphcs) { 103 | super.paint(grphcs); 104 | if (badges > 0) { 105 | String value = badges > 9 ? "+9" : badges + ""; 106 | int width = getWidth(); 107 | Graphics2D g2 = (Graphics2D) grphcs; 108 | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 109 | FontMetrics ft = g2.getFontMetrics(); 110 | Rectangle2D r2 = ft.getStringBounds(value, g2); 111 | int fw = (int) r2.getWidth(); 112 | int fh = (int) r2.getHeight(); 113 | g2.setColor(getForeground()); 114 | int size = Math.max(fw, fh) + 4; 115 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 0.9f)); 116 | g2.fillOval(width - size, 0, size, size); 117 | int x = (size - fw) / 2; 118 | g2.setColor(Color.WHITE); 119 | g2.setComposite(AlphaComposite.SrcOver); 120 | g2.drawString(value, width - size + x, ft.getAscent() + 1); 121 | g2.dispose(); 122 | } 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/swing/ButtonMenu.java: -------------------------------------------------------------------------------- 1 | package com.raven.swing; 2 | 3 | import java.awt.AlphaComposite; 4 | import java.awt.Color; 5 | import java.awt.Cursor; 6 | import java.awt.Graphics; 7 | import java.awt.Graphics2D; 8 | import java.awt.Point; 9 | import java.awt.RenderingHints; 10 | import java.awt.event.MouseAdapter; 11 | import java.awt.event.MouseEvent; 12 | import java.awt.geom.Area; 13 | import java.awt.geom.Ellipse2D; 14 | import java.awt.geom.RoundRectangle2D; 15 | import javax.swing.JButton; 16 | import javax.swing.border.EmptyBorder; 17 | import org.jdesktop.animation.timing.Animator; 18 | import org.jdesktop.animation.timing.TimingTarget; 19 | import org.jdesktop.animation.timing.TimingTargetAdapter; 20 | 21 | public class ButtonMenu extends JButton { 22 | 23 | public Color getEffectColor() { 24 | return effectColor; 25 | } 26 | 27 | public void setEffectColor(Color effectColor) { 28 | this.effectColor = effectColor; 29 | } 30 | 31 | private Animator animator; 32 | private int targetSize; 33 | private float animatSize; 34 | private Point pressedPoint; 35 | private float alpha; 36 | private Color effectColor = new Color(173, 173, 173); 37 | 38 | public ButtonMenu() { 39 | setContentAreaFilled(false); 40 | setBorder(new EmptyBorder(8, 10, 8, 10)); 41 | setHorizontalAlignment(JButton.LEFT); 42 | setBackground(new Color(43, 44, 75)); 43 | setForeground(new Color(250, 250, 250)); 44 | setCursor(new Cursor(Cursor.HAND_CURSOR)); 45 | addMouseListener(new MouseAdapter() { 46 | @Override 47 | public void mousePressed(MouseEvent me) { 48 | targetSize = Math.max(getWidth(), getHeight()) * 2; 49 | animatSize = 0; 50 | pressedPoint = me.getPoint(); 51 | alpha = 0.5f; 52 | if (animator.isRunning()) { 53 | animator.stop(); 54 | } 55 | animator.start(); 56 | } 57 | }); 58 | TimingTarget target = new TimingTargetAdapter() { 59 | @Override 60 | public void timingEvent(float fraction) { 61 | if (fraction > 0.5f) { 62 | alpha = 1 - fraction; 63 | } 64 | animatSize = fraction * targetSize; 65 | repaint(); 66 | } 67 | }; 68 | animator = new Animator(400, target); 69 | animator.setResolution(0); 70 | } 71 | 72 | @Override 73 | protected void paintComponent(Graphics grphcs) { 74 | int width = getWidth(); 75 | int height = getHeight(); 76 | Graphics2D g2 = (Graphics2D) grphcs; 77 | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 78 | g2.setColor(getBackground()); 79 | if (pressedPoint != null) { 80 | Area area = new Area(new RoundRectangle2D.Double(0, 0, width, height, 10, 10)); 81 | g2.setColor(effectColor); 82 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, alpha)); 83 | area.intersect(new Area(new Ellipse2D.Double((pressedPoint.x - animatSize / 2), (pressedPoint.y - animatSize / 2), animatSize, animatSize))); 84 | g2.fill(area); 85 | } 86 | g2.setComposite(AlphaComposite.SrcOver); 87 | super.paintComponent(grphcs); 88 | } 89 | 90 | @Override 91 | public void paint(Graphics grphcs) { 92 | if (isSelected()) { 93 | int width = getWidth(); 94 | int height = getHeight(); 95 | Graphics2D g2 = (Graphics2D) grphcs.create(); 96 | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 97 | g2.setColor(new Color(25, 25, 25)); 98 | g2.fillRoundRect(0, 0, width - 1, height - 1, 10, 10); 99 | } 100 | super.paint(grphcs); 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/swing/ImageAvatar.java: -------------------------------------------------------------------------------- 1 | package com.raven.swing; 2 | 3 | import java.awt.AlphaComposite; 4 | import java.awt.Composite; 5 | import java.awt.Dimension; 6 | import java.awt.Graphics; 7 | import java.awt.Graphics2D; 8 | import java.awt.Image; 9 | import java.awt.Point; 10 | import java.awt.Rectangle; 11 | import java.awt.RenderingHints; 12 | import java.awt.image.BufferedImage; 13 | import javax.swing.Icon; 14 | import javax.swing.ImageIcon; 15 | import javax.swing.JComponent; 16 | 17 | public class ImageAvatar extends JComponent { 18 | 19 | public Icon getIcon() { 20 | return icon; 21 | } 22 | 23 | public void setIcon(Icon icon) { 24 | this.icon = icon; 25 | repaint(); 26 | } 27 | 28 | public int getBorderSize() { 29 | return borderSize; 30 | } 31 | 32 | public void setBorderSize(int borderSize) { 33 | this.borderSize = borderSize; 34 | } 35 | private Icon icon; 36 | private int borderSize; 37 | 38 | @Override 39 | protected void paintComponent(Graphics grphcs) { 40 | if (icon != null) { 41 | int width = getWidth(); 42 | int height = getHeight(); 43 | int diameter = Math.min(width, height); 44 | int x = width / 2 - diameter / 2; 45 | int y = height / 2 - diameter / 2; 46 | int border = borderSize * 2; 47 | diameter -= border; 48 | Rectangle size = getAutoSize(icon, diameter); 49 | BufferedImage img = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB); 50 | Graphics2D g2_img = img.createGraphics(); 51 | g2_img.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 52 | g2_img.fillOval(0, 0, diameter, diameter); 53 | Composite composite = g2_img.getComposite(); 54 | g2_img.setComposite(AlphaComposite.SrcIn); 55 | g2_img.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); 56 | g2_img.drawImage(toImage(icon), size.x, size.y, size.width, size.height, null); 57 | g2_img.setComposite(composite); 58 | g2_img.dispose(); 59 | Graphics2D g2 = (Graphics2D) grphcs; 60 | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 61 | if (borderSize > 0) { 62 | diameter += border; 63 | g2.setColor(getForeground()); 64 | g2.fillOval(x, y, diameter, diameter); 65 | } 66 | if (isOpaque()) { 67 | g2.setColor(getBackground()); 68 | diameter -= border; 69 | g2.fillOval(x + borderSize, y + borderSize, diameter, diameter); 70 | } 71 | g2.drawImage(img, x + borderSize, y + borderSize, null); 72 | } 73 | super.paintComponent(grphcs); 74 | } 75 | 76 | private Rectangle getAutoSize(Icon image, int size) { 77 | int w = size; 78 | int h = size; 79 | int iw = image.getIconWidth(); 80 | int ih = image.getIconHeight(); 81 | double xScale = (double) w / iw; 82 | double yScale = (double) h / ih; 83 | double scale = Math.max(xScale, yScale); 84 | int width = (int) (scale * iw); 85 | int height = (int) (scale * ih); 86 | if (width < 1) { 87 | width = 1; 88 | } 89 | if (height < 1) { 90 | height = 1; 91 | } 92 | int cw = size; 93 | int ch = size; 94 | int x = (cw - width) / 2; 95 | int y = (ch - height) / 2; 96 | return new Rectangle(new Point(x, y), new Dimension(width, height)); 97 | } 98 | 99 | private Image toImage(Icon icon) { 100 | return ((ImageIcon) icon).getImage(); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/swing/RoundPanel.java: -------------------------------------------------------------------------------- 1 | package com.raven.swing; 2 | 3 | import java.awt.Graphics; 4 | import java.awt.Graphics2D; 5 | import java.awt.RenderingHints; 6 | import javax.swing.JPanel; 7 | 8 | public class RoundPanel extends JPanel { 9 | 10 | public RoundPanel() { 11 | setOpaque(false); 12 | } 13 | 14 | @Override 15 | public void paint(Graphics grphcs) { 16 | Graphics2D g2 = (Graphics2D) grphcs.create(); 17 | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 18 | g2.setColor(getBackground()); 19 | g2.fillRoundRect(0, 0, getWidth(), getHeight(), 15, 15); 20 | g2.dispose(); 21 | super.paint(grphcs); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/swing/progress/Progress.java: -------------------------------------------------------------------------------- 1 | package com.raven.swing.progress; 2 | 3 | import javax.swing.JProgressBar; 4 | 5 | public class Progress extends JProgressBar { 6 | 7 | private final ProgressCircleUI ui; 8 | 9 | public Progress() { 10 | setOpaque(false); 11 | setStringPainted(true); 12 | ui = new ProgressCircleUI(); 13 | setUI(ui); 14 | } 15 | 16 | @Override 17 | public String getString() { 18 | return ((int) (getValue() * ui.getAnimate())) + "%"; 19 | } 20 | 21 | public void start() { 22 | ui.start(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/swing/progress/ProgressCircleUI.java: -------------------------------------------------------------------------------- 1 | package com.raven.swing.progress; 2 | 3 | import java.awt.AlphaComposite; 4 | import java.awt.Color; 5 | import java.awt.Component; 6 | import java.awt.GradientPaint; 7 | import java.awt.Graphics; 8 | import java.awt.Graphics2D; 9 | import java.awt.Insets; 10 | import java.awt.RenderingHints; 11 | import java.awt.Shape; 12 | import java.awt.geom.Arc2D; 13 | import java.awt.geom.Area; 14 | import javax.swing.JComponent; 15 | import javax.swing.plaf.basic.BasicProgressBarUI; 16 | import org.jdesktop.animation.timing.Animator; 17 | import org.jdesktop.animation.timing.TimingTarget; 18 | import org.jdesktop.animation.timing.TimingTargetAdapter; 19 | 20 | public class ProgressCircleUI extends BasicProgressBarUI { 21 | 22 | public float getAnimate() { 23 | return animate; 24 | } 25 | 26 | public void setAnimate(float animate) { 27 | this.animate = animate; 28 | } 29 | 30 | private Animator animator; 31 | private float animate; 32 | 33 | public void start() { 34 | if (!animator.isRunning()) { 35 | animator.start(); 36 | } 37 | } 38 | 39 | @Override 40 | public void installUI(JComponent jc) { 41 | super.installUI(jc); 42 | TimingTarget target = new TimingTargetAdapter() { 43 | @Override 44 | public void timingEvent(float fraction) { 45 | setAnimate(fraction); 46 | progressBar.repaint(); 47 | } 48 | }; 49 | animator = new Animator(800, target); 50 | animator.setResolution(0); 51 | animator.setAcceleration(.5f); 52 | animator.setDeceleration(.5f); 53 | } 54 | 55 | @Override 56 | public void paint(Graphics g, JComponent c) { 57 | Graphics2D g2 = (Graphics2D) g.create(); 58 | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 59 | Area area = new Area(createCircle(c, 0, 0, 360)); 60 | area.subtract(new Area(createCircle(c, 15, 0, 360))); 61 | g2.setColor(new Color(216, 216, 216, 50)); 62 | g2.fill(area); 63 | g2.setComposite(AlphaComposite.SrcIn); 64 | int r = (int) (progressBar.getPercentComplete() * 360); 65 | g2.setPaint(new GradientPaint(0, 0, progressBar.getBackground(), 0, c.getHeight(), progressBar.getForeground())); 66 | Area area1 = new Area(createCircle(c, 0, 90, -r * animate)); 67 | area1.subtract(new Area(createCircle(c, 15, 0, 360))); 68 | g2.fill(area1); 69 | if (progressBar.isStringPainted()) { 70 | paintString(g); 71 | } 72 | g2.dispose(); 73 | } 74 | 75 | private Shape createCircle(Component c, int s, int start, double angle) { 76 | int width = c.getWidth(); 77 | int height = c.getHeight(); 78 | int size = Math.min(width, height) - s; 79 | int x = (width - size) / 2; 80 | int y = (height - size) / 2; 81 | return new Arc2D.Double(x, y, size, size, start, angle, Arc2D.PIE); 82 | } 83 | 84 | private void paintString(Graphics g) { 85 | Insets b = progressBar.getInsets(); 86 | int barRectWidth = progressBar.getWidth() - b.right - b.left; 87 | int barRectHeight = progressBar.getHeight() - b.top - b.bottom; 88 | g.setColor(new Color(212, 212, 212)); 89 | paintString(g, b.left, b.top, barRectWidth, barRectHeight, 0, b); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/swing/scrollbar/ModernScrollBarUI.java: -------------------------------------------------------------------------------- 1 | package com.raven.swing.scrollbar; 2 | 3 | import java.awt.Dimension; 4 | import java.awt.Graphics; 5 | import java.awt.Graphics2D; 6 | import java.awt.Rectangle; 7 | import java.awt.RenderingHints; 8 | import javax.swing.BorderFactory; 9 | import javax.swing.JButton; 10 | import javax.swing.JComponent; 11 | import javax.swing.JScrollBar; 12 | import javax.swing.plaf.basic.BasicScrollBarUI; 13 | 14 | public class ModernScrollBarUI extends BasicScrollBarUI { 15 | 16 | private final int THUMB_SIZE = 80; 17 | 18 | @Override 19 | protected Dimension getMaximumThumbSize() { 20 | if (scrollbar.getOrientation() == JScrollBar.VERTICAL) { 21 | return new Dimension(0, THUMB_SIZE); 22 | } else { 23 | return new Dimension(THUMB_SIZE, 0); 24 | } 25 | } 26 | 27 | @Override 28 | protected Dimension getMinimumThumbSize() { 29 | if (scrollbar.getOrientation() == JScrollBar.VERTICAL) { 30 | return new Dimension(0, THUMB_SIZE); 31 | } else { 32 | return new Dimension(THUMB_SIZE, 0); 33 | } 34 | } 35 | 36 | @Override 37 | protected JButton createIncreaseButton(int i) { 38 | return new ScrollBarButton(); 39 | } 40 | 41 | @Override 42 | protected JButton createDecreaseButton(int i) { 43 | return new ScrollBarButton(); 44 | } 45 | 46 | @Override 47 | protected void paintTrack(Graphics grphcs, JComponent jc, Rectangle rctngl) { 48 | 49 | } 50 | 51 | @Override 52 | protected void paintThumb(Graphics grphcs, JComponent jc, Rectangle rctngl) { 53 | Graphics2D g2 = (Graphics2D) grphcs; 54 | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 55 | int x = rctngl.x; 56 | int y = rctngl.y; 57 | int width = rctngl.width; 58 | int height = rctngl.height; 59 | if (scrollbar.getOrientation() == JScrollBar.VERTICAL) { 60 | y += 8; 61 | height -= 16; 62 | } else { 63 | x += 8; 64 | width -= 16; 65 | } 66 | g2.setColor(scrollbar.getForeground()); 67 | g2.fillRoundRect(x, y, width, height, 1, 1); 68 | } 69 | 70 | private class ScrollBarButton extends JButton { 71 | 72 | public ScrollBarButton() { 73 | setBorder(BorderFactory.createEmptyBorder()); 74 | } 75 | 76 | @Override 77 | public void paint(Graphics grphcs) { 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /ui-dashboard-007/src/com/raven/swing/scrollbar/ScrollBarCustom.java: -------------------------------------------------------------------------------- 1 | package com.raven.swing.scrollbar; 2 | 3 | import java.awt.Color; 4 | import java.awt.Dimension; 5 | import javax.swing.JScrollBar; 6 | 7 | public class ScrollBarCustom extends JScrollBar { 8 | 9 | public ScrollBarCustom() { 10 | setUI(new ModernScrollBarUI()); 11 | setPreferredSize(new Dimension(5, 5)); 12 | setForeground(new Color(94, 139, 231)); 13 | setUnitIncrement(20); 14 | setOpaque(false); 15 | } 16 | } 17 | --------------------------------------------------------------------------------