liblaf-widget-java-4.3.orig/0000755000175000017500000000000011273625514015652 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/build.xml0000644000175000017500000001747411254156612017505 0ustar drazzibdrazzib liblaf-widget-java-4.3.orig/lib/0000755000175000017500000000000011253454714016420 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/3rd/0000755000175000017500000000000011253454736016346 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/3rd/run-ghost-pagosoft.bat0000644000175000017500000000033210575721042022573 0ustar drazzibdrazzib"C:\Program Files\Java\jdk1.5.0_11\/bin/java" -Dswing.defaultlaf=com.pagosoft.plaf.PgsLookAndFeel -cp ../drop/laf-widget-tst.jar;../drop/laf-widget.jar;augmented/PgsLookAndFeel.jar test.ButtonRolloverDemo -highcontrastliblaf-widget-java-4.3.orig/3rd/augment-infonode.bat0000644000175000017500000000606110575675336022307 0ustar drazzibdrazzibmkdir TMP cd TMP "C:\Program Files\Java\jdk1.5.0_11\/bin/jar" xf ../ilf-gpl.jar "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar org.jvnet.lafwidget.ant.LafMainClassAugmenter -verbose -main net.infonode.gui.laf.InfoNodeLookAndFeel -delegates ButtonUI;CheckBoxUI;CheckBoxMenuItemUI;ColorChooserUI;DesktopIconUI;DesktopPaneUI;EditorPaneUI;FormattedTextFieldUI;LabelUI;ListUI;MenuUI;MenuBarUI;OptionPaneUI;PanelUI;PasswordFieldUI;PopupMenuUI;PopupMenuSeparatorUI;ProgressBarUI;RadioButtonUI;RadioButtonMenuItemUI;RootPaneUI;ScrollBarUI;ScrollPaneUI;SeparatorUI;SliderUI;SpinnerUI;TabbedPaneUI;TableUI;TableHeaderUI;TextAreaUI;TextFieldUI;TextPaneUI;ToggleButtonUI;ToolBarUI;ToolBarSeparatorUI;ToolTipUI;TreeUI;ViewportUI; -dir . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar org.jvnet.lafwidget.ant.UiDelegateAugmenter -verbose -pattern .*UI\u002Eclass . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.IconGhostingAugmenter -verbose -class net.infonode.gui.laf.__Forwarding__ButtonUI -method paintIcon . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.IconGhostingAugmenter -verbose -class net.infonode.gui.laf.__Forwarding__ToggleButtonUI -method paintIcon . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.infonode.gui.laf.__Forwarding__PanelUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.infonode.gui.laf.__Forwarding__MenuBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.infonode.gui.laf.__Forwarding__MenuUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.infonode.gui.laf.__Forwarding__ScrollBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.infonode.gui.laf.__Forwarding__ToolBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.infonode.gui.laf.__Forwarding__DesktopPaneUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/jar" cfm ../augmented/ilf-gpl.jar META-INF/manifest.mf . cd .. rmdir TMP /s /qliblaf-widget-java-4.3.orig/3rd/run-infonode.bat0000644000175000017500000000031410575675336021446 0ustar drazzibdrazzib"C:\Program Files\Java\jdk1.5.0_11\/bin/java" -Dswing.defaultlaf=net.infonode.gui.laf.InfoNodeLookAndFeel -cp ../drop/laf-widget-tst.jar;../drop/laf-widget.jar;augmented/ilf-gpl.jar test.check.SampleFrameliblaf-widget-java-4.3.orig/3rd/run-ghost-infonode.bat0000644000175000017500000000033310575720454022561 0ustar drazzibdrazzib"C:\Program Files\Java\jdk1.5.0_11\/bin/java" -Dswing.defaultlaf=net.infonode.gui.laf.InfoNodeLookAndFeel -cp ../drop/laf-widget-tst.jar;../drop/laf-widget.jar;augmented/ilf-gpl.jar test.ButtonRolloverDemo -highcontrastliblaf-widget-java-4.3.orig/3rd/run-napkin.bat0000644000175000017500000000032110575675336021123 0ustar drazzibdrazzib"C:\Program Files\Java\jdk1.5.0_11\/bin/java" -Dswing.defaultlaf=net.sourceforge.napkinlaf.NapkinLookAndFeel -cp ../drop/laf-widget-tst.jar;../drop/laf-widget.jar;augmented/napkinlaf.jar test.check.SampleFrameliblaf-widget-java-4.3.orig/3rd/augment-looks.bat0000644000175000017500000000553210575675430021632 0ustar drazzibdrazzibmkdir TMP cd TMP "C:\Program Files\Java\jdk1.5.0_11\/bin/jar" xf ../looks-2.1.3.jar "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../looks-2.1.3.jar;../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar org.jvnet.lafwidget.ant.LafMainClassAugmenter -verbose -main com.jgoodies.looks.plastic.PlasticXPLookAndFeel -delegates CheckBoxUI;ColorChooserUI;DesktopIconUI;DesktopPaneUI;EditorPaneUI;FormattedTextFieldUI;LabelUI;ListUI;PanelUI;ProgressBarUI;RadioButtonUI;RootPaneUI;SliderUI;TableUI;TableHeaderUI;TextFieldUI;TextPaneUI;ToolTipUI;ViewportUI; -dir . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar org.jvnet.lafwidget.ant.UiDelegateAugmenter -verbose -pattern .*UI\u002Eclass . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.IconGhostingAugmenter -verbose -class com.jgoodies.looks.plastic.PlasticButtonUI -method paintIcon . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.IconGhostingAugmenter -verbose -class com.jgoodies.looks.plastic.PlasticToggleButtonUI -method paintIcon . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.jgoodies.looks.plastic.__Forwarding__PanelUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.jgoodies.looks.plastic.PlasticMenuBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.jgoodies.looks.plastic.PlasticMenuUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.jgoodies.looks.plastic.PlasticScrollBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.jgoodies.looks.plastic.PlasticToolBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.jgoodies.looks.plastic.__Forwarding__DesktopPaneUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/jar" cfm ../augmented/looks-2.1.3.jar META-INF/manifest.mf . cd .. rmdir TMP /s /qliblaf-widget-java-4.3.orig/3rd/run-liquid.bat0000644000175000017500000000031310575675336021133 0ustar drazzibdrazzib"C:\Program Files\Java\jdk1.5.0_11\/bin/java" -Dswing.defaultlaf=com.birosoft.liquid.LiquidLookAndFeel -cp ../drop/laf-widget-tst.jar;../drop/laf-widget.jar;augmented/liquidlnf.jar test.check.SampleFrameliblaf-widget-java-4.3.orig/3rd/run-pagosoft.bat0000644000175000017500000000031310575675336021466 0ustar drazzibdrazzib"C:\Program Files\Java\jdk1.5.0_11\/bin/java" -Dswing.defaultlaf=com.pagosoft.plaf.PgsLookAndFeel -cp ../drop/laf-widget-tst.jar;../drop/laf-widget.jar;augmented/PgsLookAndFeel.jar test.check.SampleFrameliblaf-widget-java-4.3.orig/3rd/augment-pagosoft.bat0000644000175000017500000000534410575675336022333 0ustar drazzibdrazzibmkdir TMP cd TMP "C:\Program Files\Java\jdk1.5.0_11\/bin/jar" xf ../PgsLookAndFeel.jar "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar org.jvnet.lafwidget.ant.LafMainClassAugmenter -verbose -main com.pagosoft.plaf.PgsLookAndFeel -delegates ColorChooserUI;DesktopIconUI;DesktopPaneUI;InternalFrameUI;ListUI;OptionPaneUI;PanelUI;PopupMenuUI;PopupMenuSeparatorUI;RootPaneUI;SeparatorUI;SliderUI;SpinnerUI;TableUI;TableHeaderUI;TextPaneUI;ToolBarSeparatorUI;TreeUI;ViewportUI -dir . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar org.jvnet.lafwidget.ant.UiDelegateAugmenter -verbose -pattern .*UI\u002Eclass . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.IconGhostingAugmenter -verbose -class com.pagosoft.plaf.PgsButtonUI -method paintIcon . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.IconGhostingAugmenter -verbose -class com.pagosoft.plaf.PgsToggleButtonUI -method paintIcon . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.pagosoft.plaf.__Forwarding__PanelUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.pagosoft.plaf.PgsMenuBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.pagosoft.plaf.PgsMenuUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.pagosoft.plaf.PgsScrollBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.pagosoft.plaf.PgsToolBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.pagosoft.plaf.__Forwarding__DesktopPaneUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/jar" cfm ../augmented/PgsLookAndFeel.jar META-INF/manifest.mf . cd .. rmdir TMP /s /qliblaf-widget-java-4.3.orig/3rd/run-ghost-napkin.bat0000644000175000017500000000034010575721420022230 0ustar drazzibdrazzib"C:\Program Files\Java\jdk1.5.0_11\/bin/java" -Dswing.defaultlaf=net.sourceforge.napkinlaf.NapkinLookAndFeel -cp ../drop/laf-widget-tst.jar;../drop/laf-widget.jar;augmented/napkinlaf.jar test.ButtonRolloverDemo -highcontrastliblaf-widget-java-4.3.orig/3rd/run-ghost-squareness.bat0000644000175000017500000000034110575721070023143 0ustar drazzibdrazzib"C:\Program Files\Java\jdk1.5.0_11\/bin/java" -Dswing.defaultlaf=net.beeger.squareness.SquarenessLookAndFeel -cp ../drop/laf-widget-tst.jar;../drop/laf-widget.jar;augmented/squareness.jar test.ButtonRolloverDemo -highcontrastliblaf-widget-java-4.3.orig/3rd/run-looks.bat0000644000175000017500000000032710575675430020773 0ustar drazzibdrazzib"C:\Program Files\Java\jdk1.5.0_11\/bin/java" -Dswing.defaultlaf=com.jgoodies.looks.plastic.PlasticXPLookAndFeel -cp ../drop/laf-widget-tst.jar;../drop/laf-widget.jar;augmented/looks-2.1.3.jar test.check.SampleFrameliblaf-widget-java-4.3.orig/3rd/run-ghost-looks.bat0000644000175000017500000000034610575720676022121 0ustar drazzibdrazzib"C:\Program Files\Java\jdk1.5.0_11\/bin/java" -Dswing.defaultlaf=com.jgoodies.looks.plastic.PlasticXPLookAndFeel -cp ../drop/laf-widget-tst.jar;../drop/laf-widget.jar;augmented/looks-2.1.3.jar test.ButtonRolloverDemo -highcontrastliblaf-widget-java-4.3.orig/3rd/run-ghost-liquid.bat0000644000175000017500000000032610575720402022242 0ustar drazzibdrazzib"C:\Program Files\Java\jdk1.5.0_11\/bin/java" -Dswing.defaultlaf=com.birosoft.liquid.LiquidLookAndFeel -cp ../drop/laf-widget-tst.jar;../drop/laf-widget.jar;augmented/liquidlnf.jar test.ButtonRolloverDemo -contrastliblaf-widget-java-4.3.orig/3rd/augment-napkin.bat0000644000175000017500000000452210575675336021766 0ustar drazzibdrazzibmkdir TMP cd TMP "C:\Program Files\Java\jdk1.5.0_11\/bin/jar" xf ../napkinlaf.jar "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar org.jvnet.lafwidget.ant.UiDelegateAugmenter -verbose -pattern .*UI\u002Eclass . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.IconGhostingAugmenter -verbose -class net.sourceforge.napkinlaf.NapkinButtonUI -method paintIcon . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.IconGhostingAugmenter -verbose -class net.sourceforge.napkinlaf.NapkinToggleButtonUI -method paintIcon . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.sourceforge.napkinlaf.NapkinPanelUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.sourceforge.napkinlaf.NapkinMenuBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.sourceforge.napkinlaf.NapkinMenuUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.sourceforge.napkinlaf.NapkinScrollBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.sourceforge.napkinlaf.NapkinToolBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.sourceforge.napkinlaf.NapkinDesktopPaneUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/jar" cfm ../augmented/napkinlaf.jar META-INF/manifest.mf . cd .. rmdir TMP /s /qliblaf-widget-java-4.3.orig/3rd/augment-squareness.bat0000644000175000017500000000572610575701604022672 0ustar drazzibdrazzibmkdir TMP cd TMP "C:\Program Files\Java\jdk1.5.0_11\/bin/jar" xf ../squareness.jar "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar org.jvnet.lafwidget.ant.LafMainClassAugmenter -verbose -main net.beeger.squareness.SquarenessLookAndFeel -delegates CheckBoxMenuItemUI;ColorChooserUI;DesktopIconUI;DesktopPaneUI;EditorPaneUI;FormattedTextFieldUI;LabelUI;ListUI;MenuUI;MenuBarUI;MenuItemUI;OptionPaneUI;PanelUI;PasswordFieldUI;PopupMenuUI;PopupMenuSeparatorUI;RadioButtonMenuItemUI;ScrollBarUI;SeparatorUI;TableUI;TableHeaderUI;TextAreaUI;TextFieldUI;TextPaneUI;ToolBarSeparatorUI;ToolTipUI;TreeUI;ViewportUI -dir . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar org.jvnet.lafwidget.ant.UiDelegateAugmenter -verbose -pattern .*UI\u002Eclass . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.IconGhostingAugmenter -verbose -class net.beeger.squareness.delegate.SquarenessButtonUI -method paintIcon . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.IconGhostingAugmenter -verbose -class net.beeger.squareness.delegate.SquarenessToggleButtonUI -method paintIcon . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.beeger.squareness.__Forwarding__PanelUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.beeger.squareness.__Forwarding__MenuBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.beeger.squareness.__Forwarding__MenuUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.beeger.squareness.__Forwarding__ScrollBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.beeger.squareness.delegate.SquarenessToolBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class net.beeger.squareness.__Forwarding__DesktopPaneUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/jar" cfm ../augmented/squareness.jar META-INF/manifest.mf . cd .. rmdir TMP /s /qliblaf-widget-java-4.3.orig/3rd/run-substance.bat0000644000175000017500000000026710575675336021643 0ustar drazzibdrazzib"C:\Program Files\Java\jdk1.5.0_11\/bin/java" -Dswing.defaultlaf=org.jvnet.substance.SubstanceLookAndFeel -cp ../drop/laf-widget-tst.jar;augmented/substance.jar test.check.SampleFrameliblaf-widget-java-4.3.orig/3rd/run-squareness.bat0000644000175000017500000000032210575675336022035 0ustar drazzibdrazzib"C:\Program Files\Java\jdk1.5.0_11\/bin/java" -Dswing.defaultlaf=net.beeger.squareness.SquarenessLookAndFeel -cp ../drop/laf-widget-tst.jar;../drop/laf-widget.jar;augmented/squareness.jar test.check.SampleFrameliblaf-widget-java-4.3.orig/3rd/run-ghost-substance.bat0000644000175000017500000000032310575721134022742 0ustar drazzibdrazzib"C:\Program Files\Java\jdk1.5.0_11\/bin/java" -Dswing.defaultlaf=org.jvnet.substance.skin.SubstanceModerateLookAndFeel -cp ../drop/laf-widget-tst.jar;augmented/substance.jar test.ButtonRolloverDemo -highcontrastliblaf-widget-java-4.3.orig/3rd/augment-liquid.bat0000644000175000017500000000524310575675336021776 0ustar drazzibdrazzibmkdir TMP cd TMP "C:\Program Files\Java\jdk1.5.0_11\/bin/jar" xf ../liquidlnf.jar "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar org.jvnet.lafwidget.ant.LafMainClassAugmenter -verbose -main com.birosoft.liquid.LiquidLookAndFeel -delegates ColorChooserUI;DesktopIconUI;DesktopPaneUI;EditorPaneUI;LabelUI;PopupMenuUI;TextAreaUI;TextPaneUI;ToolBarSeparatorUI;ToolTipUI;TreeUI;ViewportUI; -dir . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar org.jvnet.lafwidget.ant.UiDelegateAugmenter -verbose -pattern .*UI\u002Eclass . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.IconGhostingAugmenter -verbose -class com.birosoft.liquid.LiquidButtonUI -method paintIcon . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.IconGhostingAugmenter -verbose -class com.birosoft.liquid.LiquidToggleButtonUI -method paintIcon . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.birosoft.liquid.LiquidPanelUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.birosoft.liquid.LiquidMenuBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.birosoft.liquid.LiquidMenuUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.birosoft.liquid.LiquidScrollBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.birosoft.liquid.LiquidToolBarUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/java" -classpath ../../drop/laf-widget.jar;../../lib/asm-all-2.2.2.jar;../../lib/ant.jar org.jvnet.lafwidget.ant.ContainerGhostingAugmenter -verbose -class com.birosoft.liquid.__Forwarding__DesktopPaneUI . "C:\Program Files\Java\jdk1.5.0_11\/bin/jar" cfm ../augmented/liquidlnf.jar META-INF/manifest.mf . cd .. rmdir TMP /s /qliblaf-widget-java-4.3.orig/build.properties0000644000175000017500000000027511253704464021073 0ustar drazzibdrazzibjdk.home=C:/Program Files/Java/jdk1.6.0_16 javac.source=1.6 javac.target=1.6 javac.encoding=ISO-8859-1 javac.debug=on javac.generate.no.warnings=off javac.args= javac.max.memory=128mliblaf-widget-java-4.3.orig/src/0000755000175000017500000000000011253454712016437 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/META-INF/0000755000175000017500000000000011253454712017577 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/META-INF/lafwidget.properties0000644000175000017500000000234511003323002023643 0ustar drazzibdrazziborg.jvnet.lafwidget.animation.effects.IconGlowWidget = javax.swing.JButton;%javax.swing.JToggleButton org.jvnet.lafwidget.animation.effects.GhostFadeWidget = javax.swing.JButton;%javax.swing.JToggleButton org.jvnet.lafwidget.desktop.DesktopIconHoverPreviewWidget = javax.swing.JInternalFrame$JDesktopIcon org.jvnet.lafwidget.menu.MenuSearchWidget = javax.swing.JMenuBar org.jvnet.lafwidget.scroll.AutoScrollWidget = javax.swing.JScrollPane org.jvnet.lafwidget.scroll.ScrollPaneSelectorWidget = javax.swing.JScrollPane org.jvnet.lafwidget.tabbed.TabHoverPreviewWidget = javax.swing.JTabbedPane org.jvnet.lafwidget.tabbed.TabOverviewDialogWidget = javax.swing.JTabbedPane org.jvnet.lafwidget.tabbed.TabPagerWidget = javax.swing.JTabbedPane org.jvnet.lafwidget.text.PasswordStrengthCheckerWidget = javax.swing.JPasswordField org.jvnet.lafwidget.text.LockBorderWidget = javax.swing.text.JTextComponent;javax.swing.JComboBox org.jvnet.lafwidget.text.SelectAllOnFocusGainWidget = javax.swing.text.JTextComponent org.jvnet.lafwidget.text.SelectOnEscapeWidget = javax.swing.text.JTextComponent org.jvnet.lafwidget.text.EditContextMenuWidget = javax.swing.text.JTextComponent org.jvnet.lafwidget.tree.dnd.TreeDragAndDropWidget = javax.swing.JTree liblaf-widget-java-4.3.orig/src/org/0000755000175000017500000000000011253454704017227 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/0000755000175000017500000000000011253454704020355 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/0000755000175000017500000000000011253454712022322 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ASM.license0000644000175000017500000000300210430131144024264 0ustar drazzibdrazzibCopyright (c) 2000-2005 INRIA, France Telecom All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/desktop/0000755000175000017500000000000011253454712023773 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/desktop/DesktopIconHoverPreviewWidget.java0000644000175000017500000002551511137001462032571 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.desktop; import java.awt.*; import java.awt.event.MouseEvent; import java.awt.image.BufferedImage; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.HashMap; import java.util.Map; import javax.swing.*; import javax.swing.JInternalFrame.JDesktopIcon; import javax.swing.border.Border; import javax.swing.event.MouseInputAdapter; import javax.swing.plaf.basic.BasicInternalFrameUI; import org.jvnet.lafwidget.*; /** * Adds internal frame thumbnail preview on desktop icon mouse hover. * * @author Kirill Grouchnikov */ public class DesktopIconHoverPreviewWidget extends LafWidgetAdapter { /** * The component that initiates the desktop icon preview (when the mouse * hover above it). */ protected JComponent compToHover; /** * Listens on the changes to the ancestor. */ protected PropertyChangeListener internalFramePropertyListener; /** * Snapshot map. */ // private static WeakHashMap snapshots = new WeakHashMap(); private BufferedImage snapshot; /** * Preview window (activated on hover). */ private JWindow previewWindow; /** * Indicates whether the corresponding desktop icon is dragged. */ private boolean isInDrag; /** * Mouse handler for the {@link #compToHover}. */ protected TitleMouseHandler titleMouseHandler; /** * Mouse handler for showing / hiding the preview window. * * @author Kirill Grouchnikov. */ protected class TitleMouseHandler extends MouseInputAdapter { @Override public void mouseEntered(MouseEvent e) { if (DesktopIconHoverPreviewWidget.this.isInDrag) return; // final BufferedImage previewImage = DesktopIconHoverPreviewWidget // .getSnapshot(DesktopIconHoverPreviewWidget.this.desktopIcon // .getInternalFrame()); BufferedImage previewImage = snapshot; if (previewImage != null) { DesktopIconHoverPreviewWidget.this.previewWindow .getContentPane().removeAll(); JLabel previewLabel = new JLabel(new ImageIcon(previewImage)); // previewLabel.setBorder(new SubstanceBorder()); DesktopIconHoverPreviewWidget.this.previewWindow .getContentPane() .add(previewLabel, BorderLayout.CENTER); DesktopIconHoverPreviewWidget.this.previewWindow.setSize( previewImage.getWidth(), previewImage.getHeight()); DesktopIconHoverPreviewWidget.this.syncPreviewWindow(true); DesktopIconHoverPreviewWidget.this.previewWindow .setVisible(true); } } @Override public void mouseExited(MouseEvent e) { DesktopIconHoverPreviewWidget.this.isInDrag = false; DesktopIconHoverPreviewWidget.this.previewWindow.dispose();// setVisible(false); } @Override public void mousePressed(MouseEvent e) { DesktopIconHoverPreviewWidget.this.previewWindow.dispose();// setVisible(false); } @Override public void mouseReleased(MouseEvent e) { DesktopIconHoverPreviewWidget.this.isInDrag = false; DesktopIconHoverPreviewWidget.this.syncPreviewWindow(true); DesktopIconHoverPreviewWidget.this.previewWindow.setVisible(true); } @Override public void mouseDragged(MouseEvent e) { DesktopIconHoverPreviewWidget.this.isInDrag = true; if (DesktopIconHoverPreviewWidget.this.previewWindow.isVisible()) { DesktopIconHoverPreviewWidget.this.syncPreviewWindow(false); DesktopIconHoverPreviewWidget.this.previewWindow.dispose();// setVisible(false); } } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installComponents() */ @Override public void installComponents() { this.previewWindow = new JWindow(); this.previewWindow.getContentPane().setLayout(new BorderLayout()); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installListeners() */ @Override public void installListeners() { this.internalFramePropertyListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if ("ancestor".equals(evt.getPropertyName())) { updateSnapshot(jcomp.getInternalFrame()); } } }; jcomp.getInternalFrame().addPropertyChangeListener( this.internalFramePropertyListener); this.titleMouseHandler = new TitleMouseHandler(); LafWidgetSupport lafSupport = LafWidgetRepository.getRepository() .getLafSupport(); this.compToHover = lafSupport.getComponentForHover(jcomp); if (this.compToHover != null) { this.compToHover.addMouseMotionListener(this.titleMouseHandler); this.compToHover.addMouseListener(this.titleMouseHandler); } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { jcomp.getInternalFrame().removePropertyChangeListener( this.internalFramePropertyListener); this.internalFramePropertyListener = null; if (this.compToHover != null) { this.compToHover.removeMouseMotionListener(this.titleMouseHandler); this.compToHover.removeMouseListener(this.titleMouseHandler); } this.titleMouseHandler = null; } /** * Synchronizes the preview window. * * @param toShow * Indication whether the preview window is shown. */ private void syncPreviewWindow(boolean toShow) { if (toShow) { int x = jcomp.getLocationOnScreen().x; int y = jcomp.getLocationOnScreen().y; this.previewWindow.setLocation(x, y - this.previewWindow.getHeight()); } } /** * Updates the snapshot of the specified internal frame. * * @param frame * Internal frame. */ private void updateSnapshot(JInternalFrame frame) { if (!frame.isShowing()) return; // Draw the current state of the internal frame to a // temp image (w/o border and decorations). It would be nice // to use Robot, but this frame may be partially obscured, // so we take our chances that the frame will be properly // drawn by the user code. int frameWidth = frame.getWidth(); int frameHeight = frame.getHeight(); int dx = 0; int dy = 0; // Now we need to remove the border and the title pane :) Border internalFrameBorder = UIManager .getBorder("InternalFrame.border"); Insets borderInsets = internalFrameBorder.getBorderInsets(frame); dx += borderInsets.left; dy += borderInsets.top; frameWidth -= (borderInsets.left + borderInsets.right); frameHeight -= (borderInsets.top + borderInsets.bottom); BasicInternalFrameUI frameUI = (BasicInternalFrameUI) frame.getUI(); JComponent frameTitlePane = frameUI.getNorthPane(); if (frameTitlePane != null) { dy += frameTitlePane.getHeight(); frameHeight -= frameTitlePane.getHeight(); } // fix for defect 112 - checking frame height and width if ((frameWidth > 0) && (frameHeight > 0)) { // draw frame (note the canvas translation) BufferedImage tempCanvas = new BufferedImage(frameWidth, frameHeight, BufferedImage.TYPE_INT_ARGB); Graphics tempCanvasGraphics = tempCanvas.getGraphics(); tempCanvasGraphics.translate(-dx, -dy); Map dbSnapshot = new HashMap(); LafWidgetUtilities.makePreviewable(frame, dbSnapshot); frame.paint(tempCanvasGraphics); LafWidgetUtilities.restorePreviewable(frame, dbSnapshot); int maxWidth = UIManager.getInt("DesktopIcon.width"); int maxHeight = maxWidth; // check if need to scale down double coef = Math.min((double) maxWidth / (double) frameWidth, (double) maxHeight / (double) frameHeight); if (coef < 1.0) { int sdWidth = (int) (coef * frameWidth); // int sdHeight = (int) (coef * frameHeight); // BufferedImage scaledDown = new BufferedImage(sdWidth, // sdHeight, // BufferedImage.TYPE_INT_ARGB); // Graphics g = scaledDown.getGraphics(); // g.drawImage(tempCanvas, 0, 0, sdWidth, sdHeight, 0, 0, // frameWidth, frameHeight, null); BufferedImage scaledDown = LafWidgetUtilities.createThumbnail( tempCanvas, sdWidth); // System.out.println("Putting " + frame.hashCode() + " // -> " + scaledDown.hashCode()); snapshot = scaledDown; // DesktopIconHoverPreviewWidget.snapshots.put(frame, // scaledDown); } else { // System.out.println("Putting " + frame.hashCode() + " // -> " + snapshot.hashCode()); snapshot = tempCanvas; // DesktopIconHoverPreviewWidget.snapshots.put(frame, // tempCanvas); } } } /** * Returns the snapshot of the specified internal frame. * * @param frame * Internal frame. * @return The snapshot of the specified internal frame. */ public synchronized BufferedImage getSnapshot(JInternalFrame frame) { // BufferedImage result = (BufferedImage) // DesktopIconHoverPreviewWidget.snapshots // .get(frame); // if (result != null) // return result; // // frame.setVisible(true); // // updateSnapshot(frame); // // frame.setVisible(false); // // return snapshots.get(frame); // return null; return this.snapshot; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/LAFAdapter.java0000644000175000017500000002510411161441616025067 0ustar drazzibdrazzibpackage org.jvnet.lafwidget; import java.awt.EventQueue; import java.util.Set; import javax.swing.*; import java.beans.*; import javax.swing.plaf.ComponentUI; import org.jvnet.lafwidget.*; public class LAFAdapter { /**The listener for global LAF changes.*/ private static ReinitListener reinitListener; /**The listener for component LAF updates.*/ private static InternalUIListener internalListener; /**Have we already initialised?*/ private static boolean initialised=false; /**The table of delegate classes for the current LAF.*/ private static UIDefaults uiDelegates; /**The list of all UI classes. *Taken from https://laf-widget.dev.java.net/docs/all-component-ui-ids.txt */ private final static String[] UI_CLASSNAMES={ "ButtonUI","CheckBoxUI","CheckBoxMenuItemUI","ColorChooserUI","ComboBoxUI","DesktopIconUI", "DesktopPaneUI","EditorPaneUI","FormattedTextFieldUI","InternalFrameUI","LabelUI","ListUI","MenuUI", "MenuBarUI","MenuItemUI","OptionPaneUI","PanelUI","PasswordFieldUI","PopupMenuUI","PopupMenuSeparatorUI", "ProgressBarUI","RadioButtonUI","RadioButtonMenuItemUI","RootPaneUI","ScrollBarUI","ScrollPaneUI", "SeparatorUI","SliderUI","SpinnerUI","SplitPaneUI","TabbedPaneUI","TableUI","TableHeaderUI","TextAreaUI", "TextFieldUI","TextPaneUI","ToggleButtonUI","ToolBarUI","ToolBarSeparatorUI","ToolTipUI","TreeUI","ViewportUI"}; private final static String LAF_PROPERTY = "Widgeted_LAFS"; /**Returns the UI as normal, but intercepts the call, so a * listener can be attached. This is called internally from Swing code * to create the UI delegate for a component. *THIS METHOD SHOULDN'T BE CALLED FROM USER CODE! */ public static ComponentUI createUI(JComponent c) { if (c == null || initialised == false) //something isn't right -> bail return null; //Now we use the same discovery mechanism to find the real createUI method ComponentUI uiObject = uiDelegates.getUI(c); //System.out.println("Creating UI: "+c.getClass()+" "+Integer.toHexString(System.identityHashCode(c))); uninstallLafWidgets(c); //here we need to check we don't add a second listener. This happens //if createUI gets called a second time, as when creating JDesktopIcons if (!isPropertyListening(c)) c.addPropertyChangeListener("UI",internalListener); return uiObject; //return the actual UI delegate } /**Tests if the property listener has already been attached to a component *@param c the component to check *@return true if the listener is already present */ private static boolean isPropertyListening(JComponent c) { PropertyChangeListener[] pc=c.getPropertyChangeListeners(); if (pc.length==0) //common-case return false; for (int i=0,ilen=pc.length;i lafWidgets=LafWidgetRepository.getRepository().getMatchingWidgets(c); if (lafWidgets.size()>0) {//if a new UI has been set for (LafWidget lw : lafWidgets) { lw.installUI(); lw.installComponents(); lw.installDefaults(); lw.installListeners(); } c.putClientProperty(LAF_PROPERTY,lafWidgets); //stash the list of installed widgets } } } /**Removes any installed widgets from the component shown. If a mapping *exists which indicates this component had widgets installed then they *are removed here and the mapping also removed. *@param c the component to uninstall widgets from */ private static void uninstallLafWidgets(JComponent c) { //if there were previously widgets installed, then uninstall them Set lafWidgets=(Set)c.getClientProperty(LAF_PROPERTY); if (lafWidgets!=null) { for (LafWidget lw : lafWidgets) { lw.uninstallListeners(); lw.uninstallDefaults(); lw.uninstallComponents(); lw.uninstallUI(); } c.putClientProperty(LAF_PROPERTY,null); //remove widget set } } /**This initialises the Widgeting system. All future components created will *be widgeted. This code maybe called from any thread and ensures that the *actual initialisation is done on the Event Thread. If called from another thread, *this method will block until the initialisation is complete. */ public static void startWidget() { widget(true); } /**This tears-down the widgeting system. Calling this method prevents any *further components being widgetised. Any existing components with widgets *will continue to have them. All system hooks will be removed and the widgeting *system will stop attaching to new components. This method is safe to call *from any thread, as the work will be done on the Event Thread. If called from *another thread, this method will block until the initialisation is complete. */ public static void stopWidget() { widget(false); } /**Private helper to start or stop the widgeting. EDT checks present here. *@param enable whether to start or stop the widgeting */ private static void widget(boolean enable) { Init init = new Init(enable); if (EventQueue.isDispatchThread()) { init.run(); } else {// This code must run on the EDT for data visibility reasons try { EventQueue.invokeAndWait(init); } catch (Exception e) { throw new RuntimeException(e); } } } /**Inserts all the substitute LAF pairs into the UIDefaults table. This also *places a LAF change listener on the UIManager. This is to cause a re-initialisation *when the LAF changes so new components created after a global LAF change will *still get widgets. */ private static class Init implements Runnable { /**Sets whether we should be setting up or tearing down the widgeting.*/ private final boolean enable; //final so it doesn't matter where this initialises from (JSR-133) private Init(final boolean enable) { this.enable=enable; } public void run() { if (!EventQueue.isDispatchThread()) throw new IllegalStateException("This must be run on the EDT"); try { //do the setup process or removal process if (enable) setup(); else tearDown(); } catch (Exception e) { initialised=false; uiDelegates=null; internalListener=null; reinitListener=null; throw new RuntimeException(e); } } public static void setup() throws Exception { //check we don't initialise twice if (initialised) return; //We use the LAF defaults table so we don't mess with the developer //table reinitListener = new ReinitListener(); internalListener = new InternalUIListener(); uiDelegates=new UIDefaults(); //stores the actual UI delegates UIDefaults defaults = UIManager.getLookAndFeelDefaults(); //Store the class for each delegate locally and replace the Swing delegate for (String uiClassID : UI_CLASSNAMES) { uiDelegates.put(uiClassID,defaults.getString(uiClassID)); defaults.put(uiClassID,LAFAdapter.class.getName()); } //listen for global LAF changes UIManager.addPropertyChangeListener(reinitListener); initialised=true; } public static void tearDown() throws Exception { if (!initialised) return; UIManager.removePropertyChangeListener(reinitListener); //reset the current UI which will overwrite all our values UIManager.setLookAndFeel(UIManager.getLookAndFeel()); uiDelegates=null; reinitListener=null; internalListener=null; initialised=false; } } /** * Listens for Look and Feel changes and re-initialises the * class. This fires from UIManager after a LAF change. */ private static class ReinitListener implements PropertyChangeListener { public void propertyChange(PropertyChangeEvent evt) { if ("lookAndFeel".equals(evt.getPropertyName())) { // The look and feel was changed so we need to re-insert // our hook into the new UIDefaults map, first de-initialise // Don't want to call tearDown() as we're already in a LAF change. UIManager.removePropertyChangeListener(reinitListener); initialised=false; uiDelegates=null; reinitListener=null; internalListener=null; startWidget(); } } } }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/LafWidget.java0000644000175000017500000003410611137001460025024 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget; import java.util.Locale; import javax.swing.*; import org.jvnet.lafwidget.preview.DefaultPreviewPainter; import org.jvnet.lafwidget.preview.PreviewPainter; import org.jvnet.lafwidget.tabbed.*; import org.jvnet.lafwidget.text.LockBorderWidget; import org.jvnet.lafwidget.text.PasswordStrengthChecker; import org.jvnet.lafwidget.utils.LafConstants; /** * Interface for LAF widgets (behavioural traits). * * @author Kirill Grouchnikov */ public interface LafWidget { /** *

* Client property name for specifying that the {@link LockBorderWidget} * should not put a lock icon. This property can be set either on a single * component or globally on {@link UIManager}. The value in both cases * should be either {@link Boolean#TRUE} or {@link Boolean#FALSE}. *

* * @since 3.2 */ public final static String NO_LOCK_ICON = "lafwidgets.noLockIcon"; /** *

* Client property name for specifying the preview painter for tabbed pane. * This property can be set either on a single tabbed pane or globally on * {@link UIManager}. The value in both cases should be an instance of * {@link TabPreviewPainter}. Default implementation of this * {@link DefaultTabPreviewPainter}. Tabbed panes that have associated * preview painters (set either on tabbed pane itself or globally on * {@link UIManager}, have two widgets installed: *

*
    *
  • Tab overview dialog from {@link TabOverviewDialogWidget}.
  • *
  • Tab hover preview from {@link TabHoverPreviewWidget}.
  • *
* *

* Here is an example of tabbed pane with default tab preview painter * installed: *

* * *   JTabbedPane jtp = new JTabbedPane();
*   jtp.putClientProperty(LafWidget.TABBED_PANE_PREVIEW_PAINTER,
*     new DefaultTabPreviewPainter()); *
*/ public final static String TABBED_PANE_PREVIEW_PAINTER = "lafwidgets.tabbedpanePreviewPainter"; /** *

* Client property name for specifying the preview painter for a component. * This property can be set either on a component or globally on * {@link UIManager}. The value in both cases should be an instance of * {@link PreviewPainter}. Default implementation is available in the * {@link DefaultPreviewPainter}. *

* *

* Here is an example of a scroll pane with default preview painter * installed on the internal component: *

* * * JPanel myPanel = new JPanel();
* myPanel.putClientProperty(LafWidget.PANE_PREVIEW_PAINTER,
*   new DefaultPreviewPainter());
* JScrollPane jsp = new JScrollPane(myPanel); *
*/ public final static String COMPONENT_PREVIEW_PAINTER = "lafwidgets.componentPreviewPainter"; /** *

* Client property name for specifying the kind of animation on various * components. The value should be one of {@link LafConstants.AnimationKind} * enum. This property can be set either on component or globally on * {@link UIManager}. *

* *

* In order to compute the animation kind for some component, the * component's hierarchy is traversed bottom up. The first component that * has this property set, defines the animation kind. Finally, if neither * component not its ancestors define this property, the global setting on * {@link UIManager} is checked. If there is no global setting, the default * {@link LafConstants.AnimationKind#REGULAR} is taken. Here is an example: *

* *

* *   JPanel panel = new JPanel();
*   panel.putClientProperty(LafWidget.ANIMATION_KIND, AnimationKind.SLOW);
*   JButton b1 = new JButton("button1");
*   JButton b2 = new JButton("button2");
*   b2.putClientProperty(LafWidget.ANIMATION_KIND, AnimationKind.FAST); *
*

* *

* In the example above, b2 will have fast animation, and b1 * will have slow animation ("inherited" from the parent panel). *

*/ public final static String ANIMATION_KIND = "lafwidgets.animationKind"; /** *

* Client property name for specifying password strength checker for a * password field. The value should be an instance of * {@link PasswordStrengthChecker}, otherwise will be ignored. This * property must be set on a specific {@link JPasswordField}. Here is an * example: *

* * *   JPasswordField jpf = new JPasswordField("password", 10);
*   jpf.putClientProperty(LafWidget.PASSWORD_STRENGTH_CHECKER,
*     new PasswordStrengthChecker() {
*       public PasswordStrength getStrength(char[] password) {
*         if (password == null)
*           return PasswordStrength.WEAK;
*         int length = password.length;
*         if (length < 3)
*           return PasswordStrength.WEAK;
*         if (length < 6)
*           return PasswordStrength.MEDIUM;
*         return PasswordStrength.STRONG;
*     }
*
*     public String getDescription(PasswordStrength strength) {
*       if (strength == PasswordStrength.WEAK)
*         return "<html>This password is <b>way</b> too weak</html>";
*       if (strength == PasswordStrength.MEDIUM)
*         return "<html>Come on, you can do<br> a little better than that</html>";
*       if (strength == PasswordStrength.STRONG)
*         return "OK";
*       return null;
*     }
*   }); *
*/ public final static String PASSWORD_STRENGTH_CHECKER = "lafwidgets.passwordStrengthChecker"; /** *

* Client property name for specifying that the text component contents * should be selected on focus gain. This property can be set either on a * single text component or globally on {@link UIManager}. The value in * both cases should be either {@link Boolean#TRUE} or {@link Boolean#FALSE}. *

* *

* Here is an example of globally set property (all text components that * don't specify {@link Boolean#FALSE} as a client property will have the * "select all on focus gain" behaviour): *

* * *   UIManager.put(LafWidget.TEXT_SELECT_ON_FOCUS, Boolean.TRUE); * */ public final static String TEXT_SELECT_ON_FOCUS = "lafwidgets.textSelectAllOnFocus"; /** *

* Client property name for specifying that the text component contents * should flip selection on ESCAPE key press. This property can be set * either on a single text component or globally on {@link UIManager}. The * value in both cases should be either {@link Boolean#TRUE} or * {@link Boolean#FALSE}. *

* *

* Here is an example of globally set property (all text components that * don't specify {@link Boolean#FALSE} as a client property will have the * "flip select on escape" behaviour): *

* * *   UIManager.put(LafWidget.TEXT_FLIP_SELECT_ON_ESCAPE, Boolean.TRUE); * */ public final static String TEXT_FLIP_SELECT_ON_ESCAPE = "lafwidgets.textFlipSelectOnEscape"; /** *

* Client property name for specifying that the text component should have * the edit context menu (with Cut / Copy / Paste / ... menu items). This * property can be set either on a single text component or globally on * {@link UIManager}. The value in both cases should be either * {@link Boolean#TRUE} or {@link Boolean#FALSE}. *

* *

* Here is an example of globally set property (all text components that * don't specify {@link Boolean#FALSE} as a client property will have the * the edit context menu): *

* * *   UIManager.put(LafWidget.TEXT_EDIT_CONTEXT_MENU, Boolean.TRUE); * */ public final static String TEXT_EDIT_CONTEXT_MENU = "lafwidgets.textEditContextMenu"; /** * Client property name for specifying that the tree component should have * automatic drag and drop support. This property can be set either on a * single tree or globally on {@link UIManager}. The value in both cases * should be either {@link Boolean#TRUE} or {@link Boolean#FALSE}.
*
* Here is an example of globally set property (all trees that don't specify * {@link Boolean#FALSE} as a client property will have the automatic drag * and drop support):
*
* *   UIManager.put(LafWidget.TREE_AUTO_DND_SUPPORT, Boolean.TRUE); * */ public final static String TREE_AUTO_DND_SUPPORT = "lafwidgets.treeAutoDnDSupport"; /** *

* Client property name for specifying that a scroll pane should have * auto-scroll support invoked on middle-mouse button click. This property * can be installed on a single scroll pane or globally on {@link UIManager}, * and the value should be either {@link Boolean#TRUE} or * {@link Boolean#FALSE}. *

*

* Here is an example of a scroll bar that has auto-scroll installed. *

* * JScrollPane scrollPane = ...
* scrollPane.putClientProperty(LafWidget.AUTO_SCROLL, Boolean.TRUE); *
* * @since version 3.4 */ public final static String AUTO_SCROLL = "lafwidget.scroll.auto"; /** *

* Client property name for specifying that the label lookup for custom * widgets and sub-components installed by various UI delegates should * ignore the global locale (as returned by {@link Locale#getDefault()} and * use the component-specific locale (as returned by * {@link JComponent#getLocale()} instead. This property can be installed * only on a single component, and the value should be either * {@link Boolean#TRUE} or {@link Boolean#FALSE}. *

* *

* Here is an example of menu bar that will be localized according to its * own locale *

* * JMenuBar jmb = ...
* jmb.putClientProperty(LafWidget.IGNORE_GLOBAL_LOCALE, Boolean.TRUE); *
* * @since version 3.1 */ public final static String IGNORE_GLOBAL_LOCALE = "lafwidgets.ignoreGlobalLocale"; /** * Associates a component with this widget. * * @param jcomp * Component. */ public void setComponent(T jcomp); /** * Returns indication whether this widget requires custom LAF * support. Some widgets such as {@link TabOverviewDialogWidget} or * {@link TabHoverPreviewWidget} require custom implementation based on the * internals of the specific LAF. Relevant functions in the base * {@link LafWidgetSupport} support throw * {@link UnsupportedOperationException}. * * @return true if this widget requires custom * LAF support, false otherwise. */ public boolean requiresCustomLafSupport(); /** * Installs UI on the associated component. */ public void installUI(); /** * Installs default settings for the associated component. */ public void installDefaults(); /** * Installs listeners for the associated component. */ public void installListeners(); /** * Installs components for the associated component. */ public void installComponents(); /** * Uninstalls UI on the associated component. */ public void uninstallUI(); /** * Uninstalls default settings for the associated component. */ public void uninstallDefaults(); /** * Uninstalls listeners for the associated component. */ public void uninstallListeners(); /** * Uninstalls components for the associated component. */ public void uninstallComponents(); } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/0000755000175000017500000000000011253454706023264 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/dnd/0000755000175000017500000000000011253454706024031 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/dnd/DnDVetoException.java0000644000175000017500000000422011137002264030041 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tree.dnd; /** * DnDVetoException is an exception thrown to signal that a drag and drop * operation is not valid. * * @author Antonio Vieiro (antonio@antonioshome.net), $Author: kirillcool $ * @version $Revision: 1.15 $ */ public class DnDVetoException extends Exception { /** * Creates a new instance of DnDVetoException * * @param aMessage * the message to show. */ public DnDVetoException(String aMessage) { super(aMessage); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/dnd/StringTreeDnDEvent.java0000644000175000017500000000622711137002266030350 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tree.dnd; import java.util.EventObject; import javax.swing.JTree; import javax.swing.tree.TreeNode; /** * StringTreeDnDEvent is an event fired whenever a String is about to be dropped * into a node in a JTree. * * @author Antonio Vieiro (antonio@antonioshome.net), $Author: kirillcool $ * @version $Revision: 1.16 $ */ public class StringTreeDnDEvent extends EventObject { private JTree targetTree; private TreeNode targetNode; private String sourceString; /** * Creates a new instance of StringTreeDnDEvent * * @param aSourceString * the String being dragged. * @param aTargetTree * the JTree containing the node. * @param aTargetNode * the node onto which the String is about to be dropped into. */ public StringTreeDnDEvent(String aSourceString, JTree aTargetTree, TreeNode aTargetNode) { super(aSourceString); this.setSourceString(aSourceString); this.setTargetTree(aTargetTree); this.setTargetNode(aTargetNode); } public JTree getTargetTree() { return this.targetTree; } public void setTargetTree(JTree targetTree) { this.targetTree = targetTree; } public TreeNode getTargetNode() { return this.targetNode; } public void setTargetNode(TreeNode targetNode) { this.targetNode = targetNode; } public String getSourceString() { return this.sourceString; } public void setSourceString(String sourceString) { this.sourceString = sourceString; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/dnd/AutoScrollingTreeDropTarget.java0000644000175000017500000000762511137001464032275 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tree.dnd; import java.awt.Point; import java.awt.dnd.*; import javax.swing.*; class AutoScrollingTreeDropTarget extends DropTarget { private JViewport viewport; private int scrollUnits; private JTree tree; AutoScrollingTreeDropTarget(JTree aTree, DropTargetListener listener) { super(aTree, DnDConstants.ACTION_COPY_OR_MOVE, listener); this.viewport = (JViewport) SwingUtilities.getAncestorOfClass( JViewport.class, aTree); this.scrollUnits = Math.max(aTree.getRowHeight(), 16); this.tree = aTree; } private Point lastDragCursorLocn = new Point(0, 0); protected void updateAutoscroll(Point dragCursorLocn) { if (this.lastDragCursorLocn.equals(dragCursorLocn)) return; else this.lastDragCursorLocn.setLocation(dragCursorLocn); this.doAutoscroll(dragCursorLocn); } protected void initializeAutoscrolling(Point p) { this.doAutoscroll(p); } protected void clearAutoscroll() { } private static final int AUTOSCROLL_MARGIN = 16; protected void doAutoscroll(Point aPoint) { if (this.viewport == null) return; Point treePosition = this.viewport.getViewPosition(); int vH = this.viewport.getExtentSize().height; int vW = this.viewport.getExtentSize().width; Point nextPoint = null; if ((aPoint.y - treePosition.y) < AutoScrollingTreeDropTarget.AUTOSCROLL_MARGIN) { nextPoint = new Point(treePosition.x, Math.max(treePosition.y - this.scrollUnits, 0)); } else if (treePosition.y + vH - aPoint.y < AutoScrollingTreeDropTarget.AUTOSCROLL_MARGIN) { nextPoint = new Point(treePosition.x, Math.min(aPoint.y + AutoScrollingTreeDropTarget.AUTOSCROLL_MARGIN, this.tree .getHeight() - vH)); } else if (aPoint.x - treePosition.x < AutoScrollingTreeDropTarget.AUTOSCROLL_MARGIN) { nextPoint = new Point(Math.max(treePosition.x - AutoScrollingTreeDropTarget.AUTOSCROLL_MARGIN, 0), treePosition.y); } else if (treePosition.x + vW - aPoint.x < AutoScrollingTreeDropTarget.AUTOSCROLL_MARGIN) { nextPoint = new Point(Math.min(treePosition.x + AutoScrollingTreeDropTarget.AUTOSCROLL_MARGIN, this.tree .getWidth() - vW), treePosition.y); } if (nextPoint != null) this.viewport.setViewPosition(nextPoint); } }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/dnd/TreeDragAndDropWidget.java0000644000175000017500000006337111137002272031003 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tree.dnd; import java.awt.*; import java.awt.datatransfer.*; import java.awt.dnd.*; import java.awt.image.BufferedImage; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.lang.reflect.Method; import java.util.Enumeration; import java.util.EventListener; import javax.swing.JTree; import javax.swing.event.EventListenerList; import javax.swing.tree.*; import org.jvnet.lafwidget.*; /** * TreeWrapper is used to handle drag and drop and popup menus in any JTree. * * @author Antonio Vieiro (antonio@antonioshome.net), $Author: kirillcool $ * @version $Revision: 1.17 $ */ public class TreeDragAndDropWidget extends LafWidgetAdapter { /** * This to avoid excesive creation of objects in invocation. */ private static Class[] EMPTY_CLASS_ARRAY = new Class[0]; /** * This to avoid excessive reflection to find the "getTransferable" method. */ private static Method getTransferableMethod = null; /** * This to avoid excesive creation of objects in invocation. */ private static Object[] EMPTY_OBJECT_ARRAY = new Object[0]; protected DnDCellRendererProxy rendererProxy; protected DragSource dragSource; protected DropTarget dropTarget; protected MutableTreeNode dropNode; protected EventListenerList listeners; protected PropertyChangeListener propertyChangeListener; protected PropertyChangeListener cellRendererChangeListener; protected TreeDropTargetListener dropListener; protected TreeDragGestureListener gestureListener; protected DragGestureRecognizer dragGestureRecognizer; /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installListeners() */ @Override public void installListeners() { this.listeners = new EventListenerList(); this.propertyChangeListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (LafWidget.TREE_AUTO_DND_SUPPORT.equals(evt .getPropertyName())) { Object oldValue = evt.getOldValue(); Object newValue = evt.getNewValue(); boolean hadDnd = false; if (oldValue instanceof Boolean) hadDnd = ((Boolean) oldValue).booleanValue(); boolean hasDnd = false; if (newValue instanceof Boolean) hasDnd = ((Boolean) newValue).booleanValue(); if (!hadDnd && hasDnd && TreeDragAndDropWidget.this.jcomp.isEnabled()) { TreeDragAndDropWidget.this.installDnDSupport(); } if (hadDnd && !hasDnd) { TreeDragAndDropWidget.this.uninstallDnDSupport(); } } if ("enabled".equals(evt.getPropertyName())) { boolean wasEnabled = ((Boolean) evt.getOldValue()) .booleanValue(); boolean isEnabled = ((Boolean) evt.getNewValue()) .booleanValue(); if (!wasEnabled && isEnabled) { if (LafWidgetUtilities .hasAutomaticDnDSupport(TreeDragAndDropWidget.this.jcomp)) TreeDragAndDropWidget.this.installDnDSupport(); } if (wasEnabled && !isEnabled) TreeDragAndDropWidget.this.uninstallDnDSupport(); } } }; this.jcomp.addPropertyChangeListener(this.propertyChangeListener); if (this.jcomp.isEnabled() && LafWidgetUtilities.hasAutomaticDnDSupport(this.jcomp)) this.installDnDSupport(); } private void installDnDSupport() { if (this.cellRendererChangeListener != null) { // already installed. return; } this.cellRendererChangeListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { String name = evt.getPropertyName(); if (name.equals(JTree.CELL_RENDERER_PROPERTY)) { TreeCellRenderer renderer = TreeDragAndDropWidget.this.jcomp .getCellRenderer(); if (!(renderer instanceof DnDCellRendererProxy)) { TreeDragAndDropWidget.this.rendererProxy = new DnDCellRendererProxy( renderer); TreeDragAndDropWidget.this.jcomp .setCellRenderer(TreeDragAndDropWidget.this.rendererProxy); TreeDragAndDropWidget.this.jcomp.repaint(); } else TreeDragAndDropWidget.this.rendererProxy = (DnDCellRendererProxy) renderer; } } }; this.jcomp.addPropertyChangeListener(this.cellRendererChangeListener); if (this.jcomp.getCellRenderer() != null) { this.jcomp.setCellRenderer(new DnDCellRendererProxy(this.jcomp .getCellRenderer())); } this.dragSource = new DragSource(); this.gestureListener = new TreeDragGestureListener(); this.dragGestureRecognizer = this.dragSource .createDefaultDragGestureRecognizer(this.jcomp, DnDConstants.ACTION_COPY_OR_MOVE, this.gestureListener); this.dropListener = new TreeDropTargetListener(); this.dropTarget = new AutoScrollingTreeDropTarget(this.jcomp, this.dropListener); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { this.jcomp.removePropertyChangeListener(this.propertyChangeListener); this.propertyChangeListener = null; this.uninstallDnDSupport(); } private void uninstallDnDSupport() { if (this.cellRendererChangeListener != null) { this.jcomp .removePropertyChangeListener(this.cellRendererChangeListener); this.cellRendererChangeListener = null; } TreeCellRenderer tcl = this.jcomp.getCellRenderer(); if (tcl instanceof DnDCellRendererProxy) { TreeCellRenderer origRenderer = ((DnDCellRendererProxy) tcl) .getOriginalTreeCellRenderer(); this.jcomp.setCellRenderer(origRenderer); } if (this.dropListener != null) { this.dropTarget.removeDropTargetListener(this.dropListener); this.dropListener = null; this.jcomp.setDropTarget(null); } if (this.dragGestureRecognizer != null) { this.dragGestureRecognizer .removeDragGestureListener(this.gestureListener); this.gestureListener = null; this.dragGestureRecognizer = null; } } /** * Internal class that implements DragGestureListener. */ class TreeDragGestureListener implements DragGestureListener { public void dragGestureRecognized(DragGestureEvent dge) { // If tree is disabled then discard drag from it if (!TreeDragAndDropWidget.this.jcomp.isEnabled()) return; // Select the node that the user is trying to drag, if any. TreePath draggedPath = TreeDragAndDropWidget.this.jcomp .getClosestPathForLocation(dge.getDragOrigin().x, dge .getDragOrigin().y); if (draggedPath == null) return; TreeNode node = (TreeNode) draggedPath.getLastPathComponent(); if ((node instanceof MutableTreeNode) && (node.getParent() != null) && (node.getParent() instanceof MutableTreeNode)) ; else return; // Prepare the node for transfer TransferableTreeNode transferableNode = new TransferableTreeNode( TreeDragAndDropWidget.this.jcomp, (MutableTreeNode) node, TreeDragAndDropWidget.this.jcomp.isExpanded(draggedPath)); TreeDragAndDropWidget.this.rendererProxy.setDraggedNode(node); // Initialize the drag. If isDragImageSupported then build a // transparent image BufferedImage image = null; Point imageOffset = null; // Create an image with the dragged node. TreeCellRenderer renderer = TreeDragAndDropWidget.this.rendererProxy .getOriginalTreeCellRenderer(); Rectangle dragBounds = TreeDragAndDropWidget.this.jcomp .getPathBounds(draggedPath); imageOffset = new Point(dge.getDragOrigin().x - dragBounds.x, dge .getDragOrigin().y - dragBounds.y); Component component = renderer.getTreeCellRendererComponent( TreeDragAndDropWidget.this.jcomp, node, false, TreeDragAndDropWidget.this.jcomp.isExpanded(draggedPath), node.isLeaf(), 0, false); component.setSize(dragBounds.width, dragBounds.height); image = new BufferedImage(dragBounds.width, dragBounds.height, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = image.createGraphics(); g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC, 0.75f)); component.paint(g2d); g2d.dispose(); // Initiate the drag if (DragSource.isDragImageSupported()) { TreeDragAndDropWidget.this.dragSource.startDrag(dge, null, image, imageOffset, transferableNode, new TreeDragSourceListener()); } else { TreeDragAndDropWidget.this.dragSource.startDrag(dge, null, transferableNode, new TreeDragSourceListener()); } } } /** * Internal class that implements DragSourceListener. */ class TreeDragSourceListener implements DragSourceListener { public void dragExit(DragSourceEvent dse) { // dropNode = null; // rendererProxy.setDropNode( null ); // tree.repaint(); } public void dropActionChanged(DragSourceDragEvent dsde) { } public void dragOver(DragSourceDragEvent dsde) { } public void dragEnter(DragSourceDragEvent dsde) { } public void dragDropEnd(DragSourceDropEvent dsde) { TreeDragAndDropWidget.this.resetDragAndDrop(); } } class TreeDropTargetListener implements DropTargetListener { public void drop(DropTargetDropEvent dtde) { TreePath dropPath = TreeDragAndDropWidget.this.jcomp .getClosestPathForLocation(dtde.getLocation().x, dtde .getLocation().y); if (!TreeDragAndDropWidget.this.jcomp.isEnabled() || (dropPath == null)) { dtde.rejectDrop(); dtde.dropComplete(false); TreeDragAndDropWidget.this.resetDragAndDrop(); return; } TreeDragAndDropWidget.this.dropNode = (MutableTreeNode) dropPath .getLastPathComponent(); // Handle dropping java JVM local objects (tree nodes) try { dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); // Are we dropping a JVM local object? TransferableTreeNode ttn = (TransferableTreeNode) dtde .getTransferable().getTransferData( TransferableTreeNode .getJavaJVMLocalObjectFlavor()); JTree sourceTree = ttn.getSourceTree(); MutableTreeNode sourceNode = ttn.getSourceNode(); if (TreeDragAndDropWidget.this.mayDropHere(sourceTree, sourceNode, TreeDragAndDropWidget.this.dropNode)) { dtde .dropComplete(this .dropNodes( ttn.getSourceTree(), ttn.getSourceNode(), TreeDragAndDropWidget.this.jcomp, TreeDragAndDropWidget.this.dropNode, (dtde.getDropAction() & DnDConstants.ACTION_MOVE) != 0)); if (ttn.isNodeWasExpanded()) { DefaultTreeModel targetModel = (DefaultTreeModel) TreeDragAndDropWidget.this.jcomp .getModel(); TreeDragAndDropWidget.this.jcomp .expandPath(new TreePath(targetModel .getPathToRoot(ttn.getSourceNode()))); } TreeDragAndDropWidget.this.resetDragAndDrop(); } else { try { dtde.rejectDrop(); } catch (Exception e) { // An exception may be thrown here if the user leaves // and enters the window. // This is an exceptional case. } dtde.dropComplete(false); TreeDragAndDropWidget.this.resetDragAndDrop(); return; } } catch (UnsupportedFlavorException ufe) { // So this is not a JVM local object, maybe it's a String... try { String droppedString = (String) dtde.getTransferable() .getTransferData(DataFlavor.stringFlavor); if (TreeDragAndDropWidget.this.mayDropHere(droppedString, TreeDragAndDropWidget.this.jcomp, dropPath)) { dtde.dropComplete(this.dropString(droppedString)); TreeDragAndDropWidget.this.resetDragAndDrop(); } else { dtde.rejectDrop(); dtde.dropComplete(false); TreeDragAndDropWidget.this.resetDragAndDrop(); return; } } catch (Exception exception) { dtde.rejectDrop(); dtde.dropComplete(false); TreeDragAndDropWidget.this.resetDragAndDrop(); return; } } catch (Exception e) { // ClassCastException: So this is a JVM local object but not a // TransferableTreeNode, right? Well, then just discard // IOException: So there's a problem deserializing this, right? // Well, then just discard e.printStackTrace(); dtde.rejectDrop(); dtde.dropComplete(true); TreeDragAndDropWidget.this.resetDragAndDrop(); return; } } private boolean dropString(String droppedString) { // Get the mutable TreeModel DefaultTreeModel model = (DefaultTreeModel) TreeDragAndDropWidget.this.jcomp .getModel(); // Ask the listeners to handle this drop boolean doItOurselves = true; EventListener[] listeners = TreeDragAndDropWidget.this.listeners .getListeners(StringTreeDnDListener.class); if ((listeners != null) && (listeners.length > 0)) { try { StringTreeDnDEvent event = new StringTreeDnDEvent( droppedString, TreeDragAndDropWidget.this.jcomp, TreeDragAndDropWidget.this.dropNode); for (int i = 0; i < listeners.length; i++) { ((StringTreeDnDListener) listeners[i]).drop(event); } } catch (DnDVetoException exception) { doItOurselves = true; } } if (doItOurselves) { DefaultMutableTreeNode newNode = new DefaultMutableTreeNode( droppedString); MutableTreeNode parent = (MutableTreeNode) TreeDragAndDropWidget.this.dropNode .getParent(); if (TreeDragAndDropWidget.this.dropNode.isLeaf()) { int index = parent .getIndex(TreeDragAndDropWidget.this.dropNode); model.insertNodeInto(newNode, parent, index + 1); } else { model.insertNodeInto(newNode, TreeDragAndDropWidget.this.dropNode, 0); // dropNode.getChildCount() // ); } } return true; } private boolean dropNodes(JTree aSourceTree, MutableTreeNode aSourceNode, JTree aTargetTree, MutableTreeNode aDropNode, boolean move) { // Get the mutable TreeModel DefaultTreeModel sourceModel = (DefaultTreeModel) aSourceTree .getModel(); DefaultTreeModel targetModel = (DefaultTreeModel) aTargetTree .getModel(); boolean doItOurselves = true; EventListener[] listeners = TreeDragAndDropWidget.this.listeners .getListeners(TreeTreeDnDListener.class); if ((listeners != null) && (listeners.length > 0)) { try { TreeTreeDnDEvent event = new TreeTreeDnDEvent(aSourceTree, aSourceNode, aTargetTree, aDropNode); for (int i = 0; i < listeners.length; i++) { ((TreeTreeDnDListener) listeners[i]).drop(event); } } catch (DnDVetoException exception) { doItOurselves = false; } } if (doItOurselves) { MutableTreeNode sourceNodeCopy = aSourceNode; if (move) { sourceModel.removeNodeFromParent(aSourceNode); } else { sourceNodeCopy = this.recursivelyCopyNodes(targetModel, aSourceNode); } // Attach the draggedNode into the new parent MutableTreeNode parent = (MutableTreeNode) aDropNode .getParent(); if (aDropNode.isLeaf() && (parent != null)) { int index = parent.getIndex(aDropNode); targetModel.insertNodeInto(sourceNodeCopy, parent, index + 1); } else { targetModel.insertNodeInto(sourceNodeCopy, aDropNode, 0);// aDropNode.getChildCount() // ); } } return true; } private DefaultMutableTreeNode recursivelyCopyNodes( DefaultTreeModel aModel, TreeNode aNode) { DefaultMutableTreeNode copy = new DefaultMutableTreeNode(aNode .toString()); copy.setAllowsChildren(aNode.getAllowsChildren()); if (aNode.getChildCount() != 0) { Enumeration children = aNode.children(); while (children.hasMoreElements()) { TreeNode child = (TreeNode) children.nextElement(); DefaultMutableTreeNode childCopy = this .recursivelyCopyNodes(aModel, child); aModel .insertNodeInto(childCopy, copy, copy .getChildCount()); childCopy.setParent(copy); } } return copy; } public void dragExit(DropTargetEvent dte) { TreeDragAndDropWidget.this.dropNode = null; TreeDragAndDropWidget.this.rendererProxy.setDropNode(null); TreeDragAndDropWidget.this.jcomp.repaint(); } public void dropActionChanged(DropTargetDragEvent dtde) { } private Transferable getTransferable(DropTargetDragEvent dtde) { try { DropTargetContext context = dtde.getDropTargetContext(); if (TreeDragAndDropWidget.getTransferableMethod == null) { TreeDragAndDropWidget.getTransferableMethod = context .getClass().getDeclaredMethod("getTransferable", TreeDragAndDropWidget.EMPTY_CLASS_ARRAY); TreeDragAndDropWidget.getTransferableMethod .setAccessible(true); } return (Transferable) TreeDragAndDropWidget.getTransferableMethod .invoke(context, TreeDragAndDropWidget.EMPTY_OBJECT_ARRAY); } catch (Exception e) { e.printStackTrace(System.err); return null; } } /** This node to avoid too many invocations to dragOver */ private TreeNode lastDragOverNode = null; public void dragOver(DropTargetDragEvent dtde) { if (!TreeDragAndDropWidget.this.jcomp.isEnabled()) { dtde.rejectDrag(); return; } // Is this a valid node for dropping? TreePath dropPath = TreeDragAndDropWidget.this.jcomp .getClosestPathForLocation(dtde.getLocation().x, dtde .getLocation().y); TreeNode currentDropNode = (TreeNode) dropPath .getLastPathComponent(); if ((dropPath == null) || (currentDropNode == null) || currentDropNode.equals(this.lastDragOverNode)) { return; } else { this.lastDragOverNode = currentDropNode; } Transferable transferable = this.getTransferable(dtde); // dtde.getTransferable(); boolean mayDropHere = false; try { // WARNING: getTransferable available only on JDK 1.5 TransferableTreeNode transferredNode = (TransferableTreeNode) transferable .getTransferData(TransferableTreeNode .getJavaJVMLocalObjectFlavor()); JTree sourceTree = transferredNode.getSourceTree(); MutableTreeNode sourceNode = transferredNode.getSourceNode(); if (TreeDragAndDropWidget.this.mayDropHere(sourceTree, sourceNode, dropPath)) { TreeDragAndDropWidget.this.dropNode = (MutableTreeNode) dropPath .getLastPathComponent(); if (!TreeDragAndDropWidget.this.jcomp.isExpanded(dropPath)) TreeDragAndDropWidget.this.jcomp.expandPath(dropPath); mayDropHere = true; } else { TreeDragAndDropWidget.this.dropNode = null; } } catch (UnsupportedFlavorException ufe) { // Oh, this is not a TransferableTreeNode, so maybe is a String, // maybe? try { String sourceText = (String) transferable .getTransferData(DataFlavor.stringFlavor); if (TreeDragAndDropWidget.this.mayDropHere(sourceText, TreeDragAndDropWidget.this.jcomp, dropPath)) { TreeDragAndDropWidget.this.dropNode = (MutableTreeNode) dropPath .getLastPathComponent(); if (!TreeDragAndDropWidget.this.jcomp .isExpanded(dropPath)) TreeDragAndDropWidget.this.jcomp .expandPath(dropPath); mayDropHere = true; } else { TreeDragAndDropWidget.this.dropNode = null; } } catch (Exception e) { // Well, whatever, just discard TreeDragAndDropWidget.this.dropNode = null; } } catch (Exception e) { // IOException: Oh, there's a problem with serialization. Maybe // a classloader issue? Well, ummm... just discard this and say // no // ClassCastException: Oh, user is transferring a JVM object but // not a TransferableTreeNode, well, umm... just discard and say // no TreeDragAndDropWidget.this.dropNode = null; } TreeDragAndDropWidget.this.rendererProxy .setDropAllowed(mayDropHere); TreeDragAndDropWidget.this.rendererProxy .setDropNode((TreeNode) dropPath.getLastPathComponent()); TreeDragAndDropWidget.this.jcomp.repaint(); if (!mayDropHere) { dtde.rejectDrag(); } else { dtde.acceptDrag(dtde.getDropAction()); } TreeDragAndDropWidget.this.jcomp.repaint(); } public void dragEnter(DropTargetDragEvent dtde) { this.dragOver(dtde); // dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE ); } } /** * Invoked to decide if a given String can be dropped in the last path * component of the given path. * * @param aSourceString * the String being dragged. * @param aPath * the path to drop into. * @return true to allow the drop operation, false otherwise. */ private boolean mayDropHere(String aSourceString, JTree aTargetTree, TreePath aPath) { return this.mayDropHere(aSourceString, aTargetTree, (TreeNode) aPath .getLastPathComponent()); } /** * Invoked to decide if a given String can be dropped in the last path * component of the given path. * * @param aSourceString * the String being dragged. * @param aPath * the path to drop into. * @return true to allow the drop operation, false otherwise. */ private boolean mayDropHere(String aSourceString, JTree aTargetTree, TreeNode aNode) { EventListener[] listeners = this.listeners .getListeners(StringTreeDnDListener.class); if ((listeners != null) && (listeners.length > 0)) { try { StringTreeDnDEvent event = new StringTreeDnDEvent( aSourceString, aTargetTree, aNode); for (int i = 0; i < listeners.length; i++) { ((StringTreeDnDListener) listeners[i]).mayDrop(event); } } catch (DnDVetoException exception) { return false; } } return true; } /** * Invoked to decide if draggedNode can be dropped in the last path * component of the given path. * * @param aSourceTree * the source tree. * @param aSourceNode * the source node. * @param aPath * the path to drop into. * @return true to allow the drop operation, false otherwise. */ private boolean mayDropHere(JTree aSourceTree, MutableTreeNode aSourceNode, TreePath aPath) { if (aPath == null) return false; return this.mayDropHere(aSourceTree, aSourceNode, (TreeNode) aPath .getLastPathComponent()); } /** * Invoked to decide if draggedNode can be dropped into aNode. * * @param aSourceTree * the source tree. * @param aSourceNode * the source node. * @param aNode * the node to drop into. * @return true to allow the drop operation, false to avoid it. */ private boolean mayDropHere(JTree aSourceTree, MutableTreeNode aSourceNode, TreeNode aNode) { boolean mayDropHere = (aNode != aSourceNode) && (aNode instanceof MutableTreeNode) && ((aNode.getParent() == null) || (aNode.getParent() instanceof MutableTreeNode)) && (this.jcomp.getModel() instanceof DefaultTreeModel) && !((this.jcomp == aSourceTree) && TreeDragAndDropWidget .isAncestorOf(aSourceNode, aNode)); if (mayDropHere) { // Ask listeners EventListener[] listeners = this.listeners .getListeners(TreeTreeDnDListener.class); if ((listeners != null) && (listeners.length > 0)) { try { TreeTreeDnDEvent event = new TreeTreeDnDEvent(aSourceTree, aSourceNode, this.jcomp, aNode); for (int i = 0; i < listeners.length; i++) { ((TreeTreeDnDListener) listeners[i]).mayDrop(event); } } catch (DnDVetoException exception) { mayDropHere = false; } } } return mayDropHere; } /** * See if aPossibleParent is ancestor of aNode */ private static boolean isAncestorOf(TreeNode aPossibleParent, TreeNode aNode) { if ((aPossibleParent == null) || (aNode.getParent() == null)) return false; else if (aNode.getParent() == aPossibleParent) return true; else return TreeDragAndDropWidget.isAncestorOf(aPossibleParent, aNode .getParent()); } private void resetDragAndDrop() { this.dropNode = null; this.rendererProxy.setDraggedNode(null); this.rendererProxy.setDropAllowed(false); this.rendererProxy.setDropNode(null); this.jcomp.repaint(); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/dnd/TreeTreeDnDListener.java0000644000175000017500000000545211137002272030501 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tree.dnd; import java.util.EventListener; /** * TreeTreeDnDListener represents a listener that receives notifications when * some node from a tree is moved or copied into itself (or into another tree). * * @author Antonio Vieiro (antonio@antonioshome.net), $Author: kirillcool $ * @version $Revision: 1.15 $ */ public interface TreeTreeDnDListener extends EventListener { /** * Invoked to verify that a node may be dropped into another node. * * @param anEvent * a TreeTreeDnDEvent the event containing information about the * Drag and Drop operation. * @throws DnDVetoException * if the drag and drop operation is not valid. */ public void mayDrop(TreeTreeDnDEvent anEvent) throws DnDVetoException; /** * Invoked when the drop operation happens. * * @param anEvent * a TreeTreeDnDEvent the event containing information about the * Drag and Drop operation. * @throws DnDVetoException * if the drag and drop operation is not valid. */ public void drop(TreeTreeDnDEvent anEvent) throws DnDVetoException; } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/dnd/DnDBorderFactory.java0000644000175000017500000001561211137002262030017 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tree.dnd; import java.awt.*; import java.net.URL; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.border.Border; /** * DnDBorderFactory is responsible for creating node borders used under * different drag and drop operations. * * @author Antonio Vieiro (antonio@antonioshome.net), $Author: kirillcool $ * @version $Revision: 1.16 $ */ class DnDBorderFactory { /** * DropAllowedBorder is a Border that indicates that something is being * droped on top of a valid node. * * @author Antonio Vieiro (antonio@antonioshome.net), $Author: kirillcool $ * @version $Revision: 1.16 $ */ static class DropAllowedBorder implements Border { private static Insets insets = new Insets(0, 0, 3, 0); private ImageIcon plusIcon; /** * Creates a new instance of DropAllowedBorder */ public DropAllowedBorder() { URL iconURL = DropAllowedBorder.class .getResource("icons/drop-on-leaf.png"); if (iconURL != null) this.plusIcon = new ImageIcon(iconURL); } public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { int yh = y + height - 1; if (this.plusIcon != null) { this.plusIcon.paintIcon(c, g, x + 8, yh - 8); } yh -= 4; g.setColor(Color.DARK_GRAY); g.drawLine(x + 24, yh, x + 48, yh); } public Insets getBorderInsets(Component c) { return DropAllowedBorder.insets; } public boolean isBorderOpaque() { return false; } } /** * OffsetBorder is a Border that contains an offset. This is used to * "separate" the node under the drop. * * @author Antonio Vieiro (antonio@antonioshome.net), $Author: kirillcool $ * @version $Revision: 1.16 $ */ class OffsetBorder implements Border { private Insets insets = new Insets(5, 0, 0, 0); public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { // empty } public Insets getBorderInsets(Component c) { return this.insets; } public boolean isBorderOpaque() { return false; } } /** * DropOnNodeBorder is a Border that indicates that something cannot be * dropped here. * * @author Antonio Vieiro (antonio@antonioshome.net), $Author: kirillcool $ * @version $Revision: 1.16 $ */ class DropNotAllowedBorder implements Border { private Insets insets = new Insets(0, 0, 0, 0); private ImageIcon plusIcon; /** * Creates a new instance of DropOnNodeBorder */ public DropNotAllowedBorder() { URL iconURL = DnDBorderFactory.class .getResource("icons/drop-not-allowed.png"); if (iconURL != null) this.plusIcon = new ImageIcon(iconURL); } public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { if (this.plusIcon != null) { this.plusIcon.paintIcon(c, g, x, y); } // g.setColor( Color.RED ); // g.drawRect( x, y, width-1, height-1 ); } public Insets getBorderInsets(Component c) { return this.insets; } public boolean isBorderOpaque() { return false; } } /** * Creates a new instance of DnDBorderFactory */ public DnDBorderFactory() { this.setDropAllowedBorder(new DropAllowedBorder()); // DropOnFolderBorder() // ); this.setDropNotAllowedBorder(new DropNotAllowedBorder()); this.setOffsetBorder(new OffsetBorder()); this.setEmptyBorder(BorderFactory.createEmptyBorder()); } /** * Holds value of property dropAllowedBorder. */ private Border dropAllowedBorder; /** * Getter for property dropAllowedBorder. * * @return Value of property dropAllowedBorder. */ public Border getDropAllowedBorder() { return this.dropAllowedBorder; } /** * Setter for property dropAllowedBorder. * * @param dropAllowedBorder * New value of property dropAllowedBorder. */ public void setDropAllowedBorder(Border dropAllowedBorder) { this.dropAllowedBorder = dropAllowedBorder; } /** * Holds value of property dropNotAllowedBorder. */ private Border dropNotAllowedBorder; /** * Getter for property dropNotAllowedBorder. * * @return Value of property dropNotAllowedBorder. */ public Border getDropNotAllowedBorder() { return this.dropNotAllowedBorder; } /** * Setter for property dropNotAllowedBorder. * * @param dropNotAllowedBorder * New value of property dropNotAllowedBorder. */ public void setDropNotAllowedBorder(Border dropNotAllowedBorder) { this.dropNotAllowedBorder = dropNotAllowedBorder; } /** * Holds value of property offsetBorder. */ private Border offsetBorder; /** * Getter for property offsetBorder. * * @return Value of property offsetBorder. */ public Border getOffsetBorder() { return this.offsetBorder; } /** * Setter for property offsetBorder. * * @param offsetBorder * New value of property offsetBorder. */ public void setOffsetBorder(Border offsetBorder) { this.offsetBorder = offsetBorder; } private Border emptyBorder; public Border getEmptyBorder() { return this.emptyBorder; } public void setEmptyBorder(Border anEmptyBorder) { this.emptyBorder = anEmptyBorder; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/dnd/TreeTreeDnDEvent.java0000644000175000017500000000704311137002272027773 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tree.dnd; import java.util.EventObject; import javax.swing.JTree; import javax.swing.tree.TreeNode; /** * TreeTreeDnDEvent is an event fired when a node from a JTree is dropped into * another node (of the same or of other JTree). * * @author Antonio Vieiro (antonio@antonioshome.net), $Author: kirillcool $ * @version $Revision: 1.16 $ */ public class TreeTreeDnDEvent extends EventObject { private JTree sourceTree; private JTree targetTree; private TreeNode sourceNode; private TreeNode targetNode; /** * Creates a new instance of TreeTreeDnDEvent. * * @param aSourceTree * the JTree containing the dragged node. * @param aSourceNode * the TreeNode being dragged into aTargetNode. * @param aTargetTree * the JTree containing the node on which the drop operation is * about to happen. * @param aTargetNode * the TreeNode onto which aSourceNode is about to be dropped. */ public TreeTreeDnDEvent(JTree aSourceTree, TreeNode aSourceNode, JTree aTargetTree, TreeNode aTargetNode) { super(aSourceTree); this.setSourceTree(aSourceTree); this.setSourceNode(aSourceNode); this.setTargetTree(aTargetTree); this.setTargetNode(aTargetNode); } public JTree getSourceTree() { return this.sourceTree; } public void setSourceTree(JTree sourceTree) { this.sourceTree = sourceTree; } public JTree getTargetTree() { return this.targetTree; } public void setTargetTree(JTree targetTree) { this.targetTree = targetTree; } public TreeNode getSourceNode() { return this.sourceNode; } public void setSourceNode(TreeNode sourceNode) { this.sourceNode = sourceNode; } public TreeNode getTargetNode() { return this.targetNode; } public void setTargetNode(TreeNode targetNode) { this.targetNode = targetNode; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/dnd/TransferableTreeNode.java0000644000175000017500000001376711137002270030732 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tree.dnd; import java.awt.datatransfer.*; import java.io.IOException; import javax.swing.JTree; import javax.swing.tree.MutableTreeNode; /** * TransferableTreeNode is a Transferable object used to transfer TreeNodes or * Strings in drag and drop operations. * * @author Antonio Vieiro (antonio@antonioshome.net), $Author: kirillcool $ * @version $Revision: 1.16 $ */ class TransferableTreeNode implements Transferable { /** * The local JVM DataFlavor. */ private static DataFlavor javaJVMLocalObjectFlavor; /** * The supported data flavors. */ private static DataFlavor[] supportedDataFlavors; /** * Returns the Java JVM LocalObject Flavor. */ public static DataFlavor getJavaJVMLocalObjectFlavor() { if (TransferableTreeNode.javaJVMLocalObjectFlavor == null) { try { TransferableTreeNode.javaJVMLocalObjectFlavor = new DataFlavor( DataFlavor.javaJVMLocalObjectMimeType); } catch (ClassNotFoundException cnfe) { System.err.println("Cannot create JVM Local Object Flavor " + cnfe.getMessage()); } } return TransferableTreeNode.javaJVMLocalObjectFlavor; } /** * Returns the supported data flavors. */ private static DataFlavor[] getSupportedDataFlavors() { if (TransferableTreeNode.supportedDataFlavors == null) { DataFlavor localJVMFlavor = TransferableTreeNode .getJavaJVMLocalObjectFlavor(); TransferableTreeNode.supportedDataFlavors = localJVMFlavor == null ? new DataFlavor[] { DataFlavor.stringFlavor } : new DataFlavor[] { localJVMFlavor, DataFlavor.stringFlavor }; } return TransferableTreeNode.supportedDataFlavors; } /** * Creates a new instance of TransferableTreeNode. * * @param aTree * the JTree that contains de dragged node. * @param aNode * the MutableTreeNode in JTree that is to be dragged. * @param wasExpanded * true if the source node was expanded, false otherwise. */ public TransferableTreeNode(JTree aTree, MutableTreeNode aNode, boolean wasExpanded) { this.setSourceTree(aTree); this.setSourceNode(aNode); this.setNodeWasExpanded(wasExpanded); } public boolean isDataFlavorSupported(DataFlavor flavor) { DataFlavor[] flavors = TransferableTreeNode.getSupportedDataFlavors(); for (int i = 0; i < flavors.length; i++) { if (flavor.equals(flavors[i])) return true; } return false; } public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (flavor.equals(TransferableTreeNode.javaJVMLocalObjectFlavor)) { return this; } else if (flavor.equals(DataFlavor.stringFlavor)) { return this.getSourceNode().toString(); } else throw new UnsupportedFlavorException(flavor); } public DataFlavor[] getTransferDataFlavors() { return TransferableTreeNode.getSupportedDataFlavors(); } /** * Holds value of property sourceTree. */ private JTree sourceTree; /** * Getter for property sourceTree. * * @return Value of property sourceTree. */ public JTree getSourceTree() { return this.sourceTree; } /** * Setter for property sourceTree. * * @param sourceTree * New value of property sourceTree. */ public void setSourceTree(JTree sourceTree) { this.sourceTree = sourceTree; } /** * Holds value of property sourceNode. */ private MutableTreeNode sourceNode; /** * Getter for property sourceNode. * * @return Value of property sourceNode. */ public MutableTreeNode getSourceNode() { return this.sourceNode; } /** * Setter for property sourceNode. * * @param sourceNode * New value of property sourceNode. */ public void setSourceNode(MutableTreeNode sourceNode) { this.sourceNode = sourceNode; } /** * Holds value of property nodeWasExpanded. */ private boolean nodeWasExpanded; /** * Getter for property nodeWasExpanded. * * @return Value of property nodeWasExpanded. */ public boolean isNodeWasExpanded() { return this.nodeWasExpanded; } /** * Setter for property nodeWasExpanded. * * @param nodeWasExpanded * New value of property nodeWasExpanded. */ public void setNodeWasExpanded(boolean nodeWasExpanded) { this.nodeWasExpanded = nodeWasExpanded; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/dnd/icons/0000755000175000017500000000000011253454706025144 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/dnd/icons/drop-not-allowed.png0000644000175000017500000000022010432606146031026 0ustar drazzibdrazzibPNG  IHDRaWIDAT8S@!25Ӵ-ɨ#(HI+iT0L7y+5\J04,|ܶҗ{?<g#IENDB`liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/dnd/icons/drop-on-leaf.png0000644000175000017500000000102010432606146030121 0ustar drazzibdrazzibPNG  IHDR(-S PLTE tRNS@fIDATηb%+z'z[މ ,Vp:"D HP>~X|hbJ6;pa0ݗEcqN$S \?+UFFP0|'0_,Wv?O 5]“IENDB`liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/dnd/StringTreeDnDListener.java0000644000175000017500000000544511137002270031050 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tree.dnd; import java.util.EventListener; /** * StringTreeDnDListener represents a listener that is informed when a String is * about to be dropped into a node in a JTree. * * @author Antonio Vieiro (antonio@antonioshome.net), $Author: kirillcool $ * @version $Revision: 1.15 $ */ public interface StringTreeDnDListener extends EventListener { /** * Invoked to verify that aSourceString may be dropped into aTargetNode * inside aTargetTree. * * @param anEvent * a StringTreeDnDEvent containing information about the data * being dropped. * @throws DnDVetoException * if the drag and drop operation is not valid. */ public void mayDrop(StringTreeDnDEvent anEvent) throws DnDVetoException; /** * Invoked when the drop operation happens. * * @param anEvent * a StringTreeDnDEvent the event containing information about * the Drag and Drop operation. * @throws DnDVetoException * if the drag and drop operation is not valid. */ public void drop(StringTreeDnDEvent anEvent) throws DnDVetoException; } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tree/dnd/DnDCellRendererProxy.java0000644000175000017500000001342311137002264030662 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tree.dnd; import java.awt.Component; import java.awt.Image; import javax.swing.JComponent; import javax.swing.JTree; import javax.swing.border.Border; import javax.swing.tree.TreeCellRenderer; import javax.swing.tree.TreeNode; /** * DnDCellRendererProxy is a TreeCellRenderer that proxies operations to a true * TreeCellRenderer, but that draws a border around specific TreeNodes. * * @author Antonio Vieiro (antonio@antonioshome.net), $Author: kirillcool $ * @version $Revision: 1.16 $ */ class DnDCellRendererProxy extends Component implements TreeCellRenderer { private TreeCellRenderer originalTreeCellRenderer; private DnDBorderFactory borderFactory; private TreeNode draggedNode; private TreeNode dropNode; private int dropNodeRow; private Image shadowImage; private boolean fetchBorder; private Border originalBorder; /** * Creates a new instance of DragAndDropCellRenderer. * * @param trueCellRenderer * the original cell renderer. */ public DnDCellRendererProxy(TreeCellRenderer trueCellRenderer) { this.originalTreeCellRenderer = trueCellRenderer; this.borderFactory = new DnDBorderFactory(); this.fetchBorder = true; } public TreeCellRenderer getOriginalTreeCellRenderer() { return this.originalTreeCellRenderer; } public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { Component c = this.originalTreeCellRenderer .getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); TreeNode nodeToRender = (TreeNode) value; if (c instanceof JComponent) { if (this.fetchBorder) { this.fetchBorder = false; this.originalBorder = ((JComponent) c).getBorder(); } // TODO: This *REMOVES* the border in c. // TODO: Use compound borders to draw BOTH borders. JComponent jComponent = (JComponent) c; if (nodeToRender.equals(this.dropNode)) { Border border = null; if (this.isDropAllowed()) { border = this.borderFactory.getDropAllowedBorder(); this.dropNodeRow = row; } else { border = this.borderFactory.getDropNotAllowedBorder(); this.dropNodeRow = -2; } jComponent.setBorder(border); } else if (this.isDropAllowed() && (row == this.dropNodeRow + 1)) { jComponent.setBorder(this.borderFactory.getOffsetBorder()); } else { jComponent.setBorder(this.originalBorder); this.dropNodeRow = -2; } } return c; } /** * Getter for property draggedNode. * * @return Value of property draggedNode. */ public TreeNode getDraggedNode() { return this.draggedNode; } /** * Setter for property draggedNode. * * @param draggedNode * New value of property draggedNode. */ public void setDraggedNode(TreeNode draggedNode) { this.draggedNode = draggedNode; } /** * Getter for property dropNode. * * @return Value of property dropNode. */ public TreeNode getDropNode() { return this.dropNode; } /** * Setter for property dropNode. * * @param dropNode * New value of property dropNode. */ public void setDropNode(TreeNode dropNode) { this.dropNode = dropNode; if (dropNode == null) this.dropNodeRow = -2; } public String toString() { StringBuffer sb = new StringBuffer(); sb.append("[DnDCellRendererProxy for : ").append( this.originalTreeCellRenderer).append("]"); return sb.toString(); } /** * Holds value of property dropAllowed. */ private boolean dropAllowed; /** * Getter for property dropAllowed. * * @return Value of property dropAllowed. */ public boolean isDropAllowed() { return this.dropAllowed; } /** * Setter for property dropAllowed. * * @param dropAllowed * New value of property dropAllowed. */ public void setDropAllowed(boolean dropAllowed) { this.dropAllowed = dropAllowed; if (!dropAllowed) this.dropNodeRow = -2; } public void setShadowImage(Image anImage) { this.shadowImage = anImage; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/BlogOfBug.license0000644000175000017500000000107610565401054025474 0ustar drazzibdrazzibCopyright [2006-2007] [Nigel Hughes] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/Resettable.java0000644000175000017500000000363311137001460025251 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget; /** * Base interface for widgets that support the reset operation. * * @author Kirill Grouchnikov. */ public interface Resettable { /** * Resets the state of this widget. */ public void reset(); } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/UiThreadingViolationException.java0000644000175000017500000000402711137001460031124 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget; /** * This exception is thrown when the code detects violations of UI threading * rules. * * @author Kirill Grouchnikov */ public class UiThreadingViolationException extends RuntimeException { /** * Creates a new instance of this exception. * * @param message * Message. */ public UiThreadingViolationException(String message) { super(message); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/LafWidgetUtilities2.java0000644000175000017500000001070011137001460026774 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget; import java.awt.Component; import java.awt.Container; import javax.swing.*; import org.jvnet.lafwidget.preview.PreviewPainter; import org.jvnet.lafwidget.tabbed.TabPreviewPainter; import org.jvnet.lafwidget.text.PasswordStrengthChecker; /** * Various utility functions. * * @author Kirill Grouchnikov * @author Romain Guy */ public class LafWidgetUtilities2 { /** * Private constructor. Is here to enforce using static methods only. */ private LafWidgetUtilities2() { } /** * Returns the preview painter for the specified tabbed pane. * * @param tabbedPane * Tabbed pane. * @return Preview painter for the specified tabbed pane. */ public static TabPreviewPainter getTabPreviewPainter(JTabbedPane tabbedPane) { if (tabbedPane == null) return null; // check property on tabbed pane Object tabProp = tabbedPane .getClientProperty(LafWidget.TABBED_PANE_PREVIEW_PAINTER); if (tabProp instanceof TabPreviewPainter) return (TabPreviewPainter) tabProp; Object globProp = UIManager.get(LafWidget.TABBED_PANE_PREVIEW_PAINTER); if (globProp instanceof TabPreviewPainter) return (TabPreviewPainter) globProp; return null; } /** * Returns the preview painter for the specified component. * * @param comp * Component. * @return Preview painter for the specified component. * @since 2.1 */ public static PreviewPainter getComponentPreviewPainter(Component comp) { if (comp == null) return null; // check property on component if (comp instanceof JComponent) { Object compProp = ((JComponent) comp) .getClientProperty(LafWidget.COMPONENT_PREVIEW_PAINTER); if (compProp instanceof PreviewPainter) return (PreviewPainter) compProp; } // check property on parent Container parent = comp.getParent(); if (parent instanceof JComponent) { Object parentProp = ((JComponent) parent) .getClientProperty(LafWidget.COMPONENT_PREVIEW_PAINTER); if (parentProp instanceof PreviewPainter) return (PreviewPainter) parentProp; } Object globProp = UIManager.get(LafWidget.COMPONENT_PREVIEW_PAINTER); if (globProp instanceof PreviewPainter) return (PreviewPainter) globProp; return null; } /** * Returns the password strength checker for the specified password field. * * @param jpf * Password field. * @return Password strength checker for the specified password field. The * result can be null. */ public static PasswordStrengthChecker getPasswordStrengthChecker( JPasswordField jpf) { Object obj = jpf.getClientProperty(LafWidget.PASSWORD_STRENGTH_CHECKER); if ((obj != null) && (obj instanceof PasswordStrengthChecker)) return (PasswordStrengthChecker) obj; return null; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/menu/0000755000175000017500000000000011253454710023264 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/menu/MenuSearchWidget.java0000644000175000017500000007057111137001462027330 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.menu; import java.awt.*; import java.awt.event.*; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.*; import javax.swing.*; import org.jvnet.lafwidget.*; /** * Adds menu search panel to menu bars. * * @author Kirill Grouchnikov */ public class MenuSearchWidget extends LafWidgetAdapter implements Resettable { /** * Boolean flag to prevent infinite loop. Maybe need to use something more * elegant. */ private boolean inEvent = false; /** * Listens on changes to the component orientation. */ protected PropertyChangeListener propertyListener; /** * The associated search panel. */ private SearchPanel searchPanel; /** * Panel for searching the menus. * * @author Kirill Grouchnikov */ private class SearchPanel extends JPanel { /** * Toggle button for showing / hiding search controls. */ private JToggleButton searchButton; /** * Text field for entering search string. */ private JTextField searchStringField; // /** // * The associated menu bar. // */ // private JMenuBar menuBar; // /** * The result buttons. Key is {@link Integer}, value is {@link JButton}. */ private Map resultButtons; /** * Simple constructor. * * @param menuBar * The associated menu bar. */ public SearchPanel(final JMenuBar menuBar) { // this.menuBar = menuBar; this.setLayout(new SearchResultsLayout(this)); // Search button (toggle) with tooltip. LafWidgetSupport support = LafWidgetRepository.getRepository() .getLafSupport(); int iconDim = support.getLookupIconSize(); int buttonDim = support.getLookupButtonSize(); Icon searchIcon = (support == null) ? LafWidgetUtilities .getSearchIcon(iconDim, jcomp.getComponentOrientation() .isLeftToRight()) : support.getSearchIcon(iconDim, jcomp.getComponentOrientation()); this.searchButton = new JToggleButton(searchIcon); this.searchButton.setPreferredSize(new Dimension(buttonDim, buttonDim)); ResourceBundle bundle = LafWidgetUtilities .getResourceBundle(menuBar); this.searchButton.setToolTipText(bundle .getString("Tooltip.menuSearchButton")); this.searchButton.setFocusable(false); if (support != null) support.markButtonAsFlat(this.searchButton); this.add(this.searchButton); // Add action listener on the toggle button. Based on the // state of the toggle button, the search field and result buttons // will be set visible or invisible. this.searchButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { boolean toShow = SearchPanel.this.searchButton .isSelected(); SearchPanel.this.searchStringField .setVisible(toShow); SearchPanel.this.searchStringField.requestFocus(); for (JButton resultButton : SearchPanel.this.resultButtons .values()) { resultButton.setVisible(toShow); } SearchPanel.this.repaint(); SearchPanel.this.revalidate(); } }); } }); // add mouse listener to remove the search panel on mouse // click when CTRL button is pressed. this.searchButton.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { if ((e.getModifiers() & InputEvent.CTRL_MASK) != 0) { SwingUtilities.invokeLater(new Runnable() { public void run() { SearchPanel.this.removeAll(); SearchPanel.this.repaint(); jcomp.revalidate(); } }); } } }); // Search field. this.searchStringField = new JTextField(); this.searchStringField.setColumns(10); this.add(this.searchStringField); this.searchStringField.setVisible(false); this.searchStringField.setToolTipText(bundle .getString("Tooltip.menuSearchField")); // Map to hold the result buttons (need for the icon reset // on theme change and layout manager). this.resultButtons = new HashMap(); this.searchStringField.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String searchString = SearchPanel.this.searchStringField .getText().toLowerCase(); // See if there is at least one non-white space character. // This is fix for bug 54 if (searchString.trim().length() == 0) { return; } // remove all old buttons for (JButton toRemove : SearchPanel.this.resultButtons .values()) { SearchPanel.this.remove(toRemove); } SearchPanel.this.resultButtons.clear(); // find all matching menu items / menus LinkedList searchResults = SearchPanel.this .findOccurences(searchString); int count = 0; for (SearchResult searchResult : searchResults) { // show only first 16 results. if (count == 16) break; // create new button with binary icon LafWidgetSupport support = LafWidgetRepository .getRepository().getLafSupport(); Icon markerIcon = support.getNumberIcon(count + 1); JButton resultButton = new JButton(markerIcon); // set action listener (to show the menu). resultButton .addActionListener(new SearchResultListener( searchResult)); // check if the path to the menu (item) has // only enabled items. resultButton.setEnabled(searchResult.isEnabled()); SearchPanel.this.add(resultButton); SearchPanel.this.resultButtons.put(new Integer( count + 1), resultButton); resultButton.setToolTipText("" + searchResult.toString() + "
" + LafWidgetUtilities.getResourceBundle(menuBar) .getString("Tooltip.menuSearchTooltip") + ""); if (support != null) support.markButtonAsFlat(resultButton); count++; } SearchPanel.this.repaint(); jcomp.revalidate(); } }); } /** * Returns all occurences of the specified string in the menus and menu * items of the associated menu bar. * * @param searchPattern * Pattern to search (no wildcards yet). * @return All occurences of the specified string in the menus and menu * items of the associated menu bar. */ private LinkedList findOccurences(String searchPattern) { LinkedList result = new LinkedList(); LinkedList currentPath = new LinkedList(); for (int i = 0; i < jcomp.getComponentCount(); i++) { Component component = jcomp.getComponent(i); if (component instanceof JMenu) { JMenu menu = (JMenu) component; this.checkMenu(currentPath, menu, searchPattern, result); } } return result; } /** * Recursively scans the specified menu (item) and updates the list that * contains all occurences of the specified string in the contained * menus and menu items. * * @param currentPath * The path to the current menu (item). Contains * {@link JMenu}s. * @param menuItem * The menu (item) itself that is being tested. * @param searchPattern * Pattern to search (no wildcards yet). * @param matchingResults * All occurences of the specified string up until now. After * this function returns, will also contain * all occurences of the specified string in the contained * menu (item)s. Contains {@link SearchResult}s. */ private void checkMenu(LinkedList currentPath, JMenuItem menuItem, String searchPattern, LinkedList matchingResults) { String menuItemText = menuItem.getText(); if (menuItemText.toLowerCase().indexOf(searchPattern) >= 0) { matchingResults.addLast(new SearchResult(jcomp, currentPath, menuItem)); } if (menuItem instanceof JMenu) { JMenu menu = (JMenu) menuItem; currentPath.addLast(menu); for (int i = 0; i < menu.getMenuComponentCount(); i++) { Component menuComponent = menu.getMenuComponent(i); if (menuComponent instanceof JMenuItem) { JMenuItem childItem = (JMenuItem) menuComponent; this.checkMenu(currentPath, childItem, searchPattern, matchingResults); } } currentPath.removeLast(); } } /* * (non-Javadoc) * * @see java.awt.Component#setVisible(boolean) */ @Override public void setVisible(boolean aFlag) { super.setVisible(aFlag); if (aFlag) this.searchStringField.requestFocus(); } } /** * Listener on the search result button. The action itself - * show the associated menu path to the menu item that contains the string * that has been specified during the search. * * @author Kirill Grouchnikov */ private static class SearchResultListener implements ActionListener { /** * The associated search result. */ private SearchResult searchResult; /** * Simple constructor. * * @param searchResult * The associated search result. */ public SearchResultListener(SearchResult searchResult) { super(); this.searchResult = searchResult; } /* * (non-Javadoc) * * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent e) { // start opening the menus MenuElement[] menuElements = this.searchResult.menuElements; MenuSelectionManager.defaultManager().setSelectedPath(menuElements); } } /** * Single result of menu search. * * @author Kirill Grouchnikov */ private static class SearchResult { /** * Path to the menu (item). The first element is always {@link JMenuBar}, * and after each {@link JMenu} there is it's * {@link JMenu#getPopupMenu()}. */ private MenuElement[] menuElements; /** * Simple constructor. * * @param menuBar * The main menu bar. * @param menuPath * The menus leading to the matching entry. Contains * {@link JMenu}s. * @param menuLeaf * The menu (item) that matches the search pattern string. */ public SearchResult(JMenuBar menuBar, LinkedList menuPath, JMenuItem menuLeaf) { int count = 1; if (menuPath != null) count += 2 * menuPath.size(); if (menuLeaf != null) count++; this.menuElements = new MenuElement[count]; count = 0; // the first element is the menu bar itself this.menuElements[count++] = menuBar; if (menuPath != null) { for (JMenu menu : menuPath) { // JMenu menu = (JMenu) it.next(); this.menuElements[count++] = menu; // important - don't forget the popup menu of the menu this.menuElements[count++] = menu.getPopupMenu(); } } if (menuLeaf != null) this.menuElements[count] = menuLeaf; } /** * Returns the path to the menu (item). * * @return Path to the menu (item). The first element is always * {@link JMenuBar}, and after each {@link JMenu} there is it's * {@link JMenu#getPopupMenu()}. */ public MenuElement[] getMenuElements() { return this.menuElements; } /* * (non-Javadoc) * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuffer sb = new StringBuffer(); if (this.menuElements != null) { String sep = ""; for (int i = 0; i < this.menuElements.length; i++) { MenuElement menuElem = this.menuElements[i]; if (menuElem instanceof JMenuItem) { sb.append(sep); sep = " -> "; sb.append(((JMenuItem) menuElem).getText()); } } } return sb.toString(); } /** * Checks that all entries leading to the associated menu (item) are * enabled. * * @return true if all entries leading to the associated * menu (item) are enabled, false otherwise. */ public boolean isEnabled() { // all parts must be enabled for (int i = 0; i < this.menuElements.length; i++) { MenuElement menuElem = this.menuElements[i]; if (menuElem instanceof JMenuItem) { JMenuItem menuItem = (JMenuItem) menuElem; if (!menuItem.isEnabled()) return false; } } return true; } } /** * Returns the number of menu items under the specified menu item. * * @param menuItem * The root menu item. * @return The number of menu items under the specified menu item. */ private static int getMenuItemCount(JMenuItem menuItem) { int result = 1; if (menuItem instanceof JMenu) { JMenu menu = (JMenu) menuItem; for (int i = 0; i < menu.getMenuComponentCount(); i++) { Component child = menu.getMenuComponent(i); if (child instanceof JMenuItem) result += MenuSearchWidget .getMenuItemCount((JMenuItem) child); } } return result; } /** * Returns the number of menu items under the specified menu bar. * * @param menuBar * The root menu bar. * @return The number of menu items under the specified menu bar. */ public static int getMenuItemCount(JMenuBar menuBar) { int result = 0; for (int i = 0; i < menuBar.getMenuCount(); i++) { JMenu menu = menuBar.getMenu(i); if (menu != null) { result += MenuSearchWidget.getMenuItemCount(menu); } } return result; } // /** // * Hides search panels recursively on the specified component. // * // * @param comp // * Component. // * @param toRepaint // * Indication whether the relevant menu bars should be repainted. // */ // private static void hideSearchPanels(Component comp, final boolean toRepaint) // { // if (comp instanceof JFrame) { // JFrame jf = (JFrame) comp; // if (jf.getRootPane() != null) { // JMenuBar menuBar = jf.getJMenuBar(); // if (menuBar != null) { // for (int j = 0; j < menuBar.getComponentCount(); j++) { // if (menuBar.getComponent(j) instanceof SearchPanel) { // SearchPanel sPanel = (SearchPanel) menuBar // .getComponent(j); // menuBar.remove(sPanel); // if (toRepaint) // menuBar.repaint(); // break; // } // } // } // } // } // // if (comp instanceof JInternalFrame) { // JInternalFrame jif = (JInternalFrame) comp; // if (jif.getRootPane() != null) { // JMenuBar menuBar = jif.getJMenuBar(); // if (menuBar != null) { // for (int j = 0; j < menuBar.getComponentCount(); j++) { // if (menuBar.getComponent(j) instanceof SearchPanel) { // SearchPanel sPanel = (SearchPanel) menuBar // .getComponent(j); // menuBar.remove(sPanel); // if (toRepaint) // menuBar.repaint(); // break; // } // } // } // } // } // // if (comp instanceof Container) { // Container cont = (Container) comp; // for (int i = 0; i < cont.getComponentCount(); i++) { // Component child = cont.getComponent(i); // if (child instanceof JDesktopIcon) // child = ((JDesktopIcon) child).getInternalFrame(); // hideSearchPanels(child, toRepaint); // } // } // } // // /** // * Hides search panels on all menu bars (both JFrames and JInternalFrames). // * // * @param toRepaint // * Indication whether the relevant menu bars should be repainted. // */ // public static void hideSearchPanels(final boolean toRepaint) { // SwingUtilities.invokeLater(new Runnable() { // public void run() { // Frame[] frames = Frame.getFrames(); // for (int i = 0; i < frames.length; i++) { // hideSearchPanels(frames[i], toRepaint); // } // }; // }); // } // /** // * Shows search panels on all descendant internal frames of the specified // * component. // * // * @param comp // * A component. // */ // protected static void showSearchPanels(Component comp) { // if (comp instanceof JDesktopPane) { // JDesktopPane desktop = (JDesktopPane) comp; // JInternalFrame[] iFrames = desktop.getAllFrames(); // for (int i = 0; i < iFrames.length; i++) { // JInternalFrame jif = iFrames[i]; // if (jif.getRootPane() != null) { // JMenuBar menuBar = jif.getJMenuBar(); // if (menuBar != null) // SwingUtilities.updateComponentTreeUI(menuBar); // } // } // return; // } // if (comp instanceof Container) { // Container cont = (Container) comp; // for (int i = 0; i < cont.getComponentCount(); i++) { // MenuSearchWidget.showSearchPanels(cont.getComponent(i)); // } // } // } // // /** // * Shows search panels on all menu bars (both JFrames and JInternalFrames). // */ // public static void showSearchPanels() { // SwingUtilities.invokeLater(new Runnable() { // public void run() { // Frame[] frames = Frame.getFrames(); // for (int i = 0; i < frames.length; i++) { // Frame frame = frames[i]; // // if (frame instanceof JFrame) { // JFrame jf = (JFrame) frame; // if (jf.getRootPane() != null) { // JMenuBar menuBar = jf.getJMenuBar(); // if (menuBar != null) // SwingUtilities.updateComponentTreeUI(menuBar); // } // } // // fix for defect 134 - menubars on internal frames // MenuSearchWidget.showSearchPanels(frame); // } // }; // }); // } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installUI() */ @Override public void installUI() { final LafWidgetSupport lafSupport = LafWidgetRepository.getRepository() .getLafSupport(); this.searchPanel = new SearchPanel(this.jcomp); this.jcomp.add(searchPanel, this.jcomp.getComponentCount()); this.searchPanel.setVisible(lafSupport.toInstallMenuSearch(this.jcomp)); // NewMenuSearchWidget.panels.put(this.jcomp, searchPanel); // toAddListener = true; // } // if (toAddListener) { // need to add a container listener that will move a newly added // JMenu one entry before the last (so that our search panel // will always be the last). this.jcomp.addContainerListener(new ContainerAdapter() { @Override public void componentAdded(ContainerEvent e) { if (!(e.getChild() instanceof JMenu)) return; if (!inEvent) { inEvent = true; Component removed = null; for (int i = 0; i < MenuSearchWidget.this.jcomp .getComponentCount(); i++) { if (MenuSearchWidget.this.jcomp.getComponent(i) instanceof SearchPanel) { removed = MenuSearchWidget.this.jcomp .getComponent(i); break; } } if (removed != null) { MenuSearchWidget.this.jcomp.remove(removed); MenuSearchWidget.this.jcomp .add(removed, MenuSearchWidget.this.jcomp .getComponentCount()); // Show search panel only if the LAF-specific // support requests this if (lafSupport.toInstallMenuSearch(jcomp)) removed.setVisible(true); else removed.setVisible(false); } inEvent = false; } } }); // } // SearchPanel sp = (SearchPanel) // NewMenuSearchWidget.panels.get(this.jcomp); // if (sp != null) { searchPanel.applyComponentOrientation(this.jcomp .getComponentOrientation()); // } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallUI() */ @Override public void uninstallUI() { this.jcomp.remove(this.searchPanel); super.uninstallUI(); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installListeners() */ @Override public void installListeners() { super.installListeners(); this.propertyListener = new PropertyChangeListener() { public void propertyChange(final PropertyChangeEvent evt) { if ("componentOrientation".equals(evt.getPropertyName())) { // final SearchPanel sp = (SearchPanel) // NewMenuSearchWidget.panels // .get(NewMenuSearchWidget.this.jcomp); SwingUtilities.invokeLater(new Runnable() { public void run() { if (searchPanel != null) { searchPanel .applyComponentOrientation((ComponentOrientation) evt .getNewValue()); } MenuSearchWidget.this.reset(); } }); } if ("locale".equals(evt.getPropertyName())) { SwingUtilities.invokeLater(new Runnable() { public void run() { reset(); } }); } } }; this.jcomp.addPropertyChangeListener(this.propertyListener); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { this.jcomp.removePropertyChangeListener(this.propertyListener); this.propertyListener = null; } public void reset() { LafWidgetSupport support = LafWidgetRepository.getRepository() .getLafSupport(); // SearchPanel searchPanel = (SearchPanel) NewMenuSearchWidget.panels // .get(this.jcomp); if (searchPanel == null) return; for (Map.Entry entry : searchPanel.resultButtons .entrySet()) { // Map.Entry entry = (Map.Entry) it.next(); int index = entry.getKey(); JButton button = entry.getValue(); Icon markerIcon = (support == null) ? LafWidgetUtilities .getHexaMarker(index) : support.getNumberIcon(index); button.setIcon(markerIcon); } int iconDim = support.getLookupIconSize(); Icon searchIcon = (support == null) ? LafWidgetUtilities.getSearchIcon( iconDim, searchPanel.getComponentOrientation().isLeftToRight()) : support.getSearchIcon(iconDim, searchPanel .getComponentOrientation()); searchPanel.searchButton.setIcon(searchIcon); ResourceBundle bundle = LafWidgetUtilities .getResourceBundle(this.jcomp); searchPanel.searchButton.setToolTipText(bundle .getString("Tooltip.menuSearchButton")); searchPanel.searchStringField.setToolTipText(bundle .getString("Tooltip.menuSearchField")); } /** * Layout for the search panel. Note that {@link FlowLayout} is almost * perfect for us, but we need the following: *
    *
  • Minimum size to be 16*16 (for the search icon) *
  • When there isn't enough place for result buttons, they should * continue (even if they are unseen) and not flow to the next line. *
* * @author Kirill Grouchnikov */ private class SearchResultsLayout implements LayoutManager { /** * The associated search panel. */ private SearchPanel searchPanel; /** * Simple constructor. * * @param searchPanel * The associated search panel. */ public SearchResultsLayout(SearchPanel searchPanel) { this.searchPanel = searchPanel; } /* * (non-Javadoc) * * @see java.awt.LayoutManager#addLayoutComponent(java.lang.String, * java.awt.Component) */ public void addLayoutComponent(String name, Component c) { } /* * (non-Javadoc) * * @see java.awt.LayoutManager#removeLayoutComponent(java.awt.Component) */ public void removeLayoutComponent(Component c) { } /* * (non-Javadoc) * * @see java.awt.LayoutManager#preferredLayoutSize(java.awt.Container) */ public Dimension preferredLayoutSize(Container c) { if (this.searchPanel.searchButton.isSelected()) return c.getSize(); int buttonSize = LafWidgetRepository.getRepository() .getLafSupport().getLookupButtonSize(); return new Dimension(buttonSize, buttonSize); } /* * (non-Javadoc) * * @see java.awt.LayoutManager#minimumLayoutSize(java.awt.Container) */ public Dimension minimumLayoutSize(Container c) { // enough for the search icon int buttonSize = LafWidgetRepository.getRepository() .getLafSupport().getLookupButtonSize(); return new Dimension(buttonSize, buttonSize); } /* * (non-Javadoc) * * @see java.awt.LayoutManager#layoutContainer(java.awt.Container) */ public void layoutContainer(Container c) { int height = c.getHeight(); int width = c.getWidth(); if (!this.searchPanel.searchButton.isVisible()) return; boolean leftToRight = jcomp.getComponentOrientation() .isLeftToRight(); if (leftToRight) { // start from the toggle button int x = 2; int sbWidth = this.searchPanel.searchButton.getPreferredSize().width; int sbHeight = this.searchPanel.searchButton.getPreferredSize().height; this.searchPanel.searchButton.setBounds(x, (height - sbHeight) / 2, sbWidth, sbHeight); x += (sbWidth + 4); if (this.searchPanel.isVisible()) { // now - text field int tbWidth = this.searchPanel.searchStringField .getPreferredSize().width; int tbHeight = this.searchPanel.searchStringField .getPreferredSize().height; // make the text field fit in the available height tbHeight = Math.min(tbHeight, height - 2); this.searchPanel.searchStringField.setBounds(x, (height - tbHeight) / 2, tbWidth, tbHeight); x += (tbWidth + 2); // result buttons int buttonCount = this.searchPanel.resultButtons.size(); for (int i = 1; i <= buttonCount; i++) { JButton button = this.searchPanel.resultButtons.get(i); int bw = button.getPreferredSize().width; int bh = button.getPreferredSize().height; button.setBounds(x, (height - bh) / 2, bw, bh); x += (bw + 1); } } } else { // start from the toggle button int x = width - 2; int sbWidth = this.searchPanel.searchButton.getPreferredSize().width; int sbHeight = this.searchPanel.searchButton.getPreferredSize().height; this.searchPanel.searchButton.setBounds(x - sbWidth, (height - sbHeight) / 2, sbWidth, sbHeight); x -= (sbWidth + 4); if (this.searchPanel.isVisible()) { // now - text field int tbWidth = this.searchPanel.searchStringField .getPreferredSize().width; int tbHeight = this.searchPanel.searchStringField .getPreferredSize().height; // make the text field fit in the available height tbHeight = Math.min(tbHeight, height - 2); this.searchPanel.searchStringField.setBounds(x - tbWidth, (height - tbHeight) / 2, tbWidth, tbHeight); x -= (tbWidth + 2); // result buttons int buttonCount = this.searchPanel.resultButtons.size(); for (int i = 1; i <= buttonCount; i++) { JButton button = this.searchPanel.resultButtons.get(i); int bw = button.getPreferredSize().width; int bh = button.getPreferredSize().height; button.setBounds(x - bw, (height - bh) / 2, bw, bh); x -= (bw + 1); } } } } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/0000755000175000017500000000000011253454710024332 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_cs.properties0000644000175000017500000000137010605666322030344 0ustar drazzibdrazzib# Czech translation by Milan Misak TabbedPane.overviewButtonTooltip=Uka\u017E p\u0159ehled z\u00E1lo\u017Eek TabbedPane.overviewDialogTitle=P\u0159ehled z\u00E1lo\u017Eek TabbedPane.overviewDialogTitleRefresh=P\u0159ehled z\u00E1lo\u017Eek [obnov ka\u017Ed\u00FDch {0} s] TabbedPane.overviewWidgetTooltip=Klikni pro zav\u0159en\u00ED p\u0159ehledu a zvolen\u00ED z\u00E1lo\u017Eky Tooltip.menuSearchButton=Klikni pro prohled\u00E1v\u00E1n\u00ED menu Tooltip.menuSearchField=Vlo\u017E hledan\u00FD \u0159et\u011Bzec a stiskni Enter Tooltip.menuSearchTooltip=Zam\u011B\u0159it polo\u017Eku EditMenu.copy=Kop\u00EDrovat EditMenu.cut=Vyjmout EditMenu.paste=Vlo\u017Eit EditMenu.delete=Smazat EditMenu.selectAll=Vybrat v\u0161eliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_hu.properties0000644000175000017500000000176310521651114030347 0ustar drazzibdrazzibTabbedPane.overviewButtonTooltip=Lapf\u00fclek \u00e1ttekint\u00e9s\u00e9nek megjelen\u00edt\u00e9se TabbedPane.overviewDialogTitle=Lapf\u00fclek \u00e1ttekint\u00e9se TabbedPane.overviewDialogTitleRefresh=Lapf\u00fclek \u00e1ttekint\u00e9se [friss\u00edt\u00e9s {0} m\u00e1sodpercenk\u00e9nt] TabbedPane.overviewWidgetTooltip=Kattintson ide az \u00e1ttekint\u00e9s bez\u00e1r\u00e1s\u00e1hoz \u00e9s lapf\u00fcl kiv\u00e1laszt\u00e1s\u00e1hoz. Tooltip.menuSearchButton=V\u00e1lassza ezt a lehet\u00f5s\u00e9get a men\u00fckeres\u00e9si panel megjelen\u00edt\u00e9s\u00e9hez. Tooltip.menuSearchField=\u00cdrja be a keresett kifejez\u00e9st, majd a keres\u00e9shez nyomja meg az \u201eEnter\u201d billenty\u00fbt. Tooltip.menuSearchTooltip=Kattintson ide a men\u00fc megkeres\u00e9s\u00e9hez. EditMenu.copy=M\u00e1sol\u00e1s EditMenu.cut=Kiv\u00e1g\u00e1s EditMenu.paste=Beilleszt\u00e9s EditMenu.delete=T\u00f6rl\u00e9s EditMenu.selectAll=Az \u00f6sszes kijel\u00f6l\u00e9se liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_nl.properties0000644000175000017500000000115310457313314030342 0ustar drazzibdrazzib# Dutch translation by Ilana Paktor TabbedPane.overviewButtonTooltip=Toon het tab overzicht TabbedPane.overviewDialogTitle=Tab overzicht TabbedPane.overviewDialogTitleRefresh=Tab overzicht (verfrist elke {0} sec) TabbedPane.overviewWidgetTooltip=Klik om het overzich te sluiten en een tab te kiezen Tooltip.menuSearchButton=Kies om het menu search panel te zien Tooltip.menuSearchField=Vul zoek string in and klik 'Enter' om te zoeken Tooltip.menuSearchTooltip=Klik om het menu te vinden EditMenu.copy=Kopieer EditMenu.cut=Knip EditMenu.paste=Plak EditMenu.delete=Wis EditMenu.selectAll=Selecteer Alles liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_zh_CN.properties0000644000175000017500000000122010521705142030721 0ustar drazzibdrazzib# Chinese translation by Pprun TabbedPane.overviewButtonTooltip=\u663e\u793a\u9875\u7f29\u7565\u56fe TabbedPane.overviewDialogTitle=\u9875\u7f29\u7565\u56fe TabbedPane.overviewWidgetTooltip=\u5355\u51fb\u5173\u95ed\u9884\u89c8\u5e76\u8fdb\u5165\u8be5\u9875 Tooltip.menuSearchButton=\u641c\u7d22\u9762\u677f Tooltip.menuSearchField=\u8f93\u5165\u641c\u7d22\u5b57\u7b26\u4e32\u540e\u6309\u2018Enter\u2019\u8fdb\u884c\u641c\u7d22 Tooltip.menuSearchTooltip=\u5355\u51fb\u8fdb\u884c\u83dc\u5355\u5b9a\u4f4d EditMenu.copy=\u590d\u5236 EditMenu.cut=\u526a\u5207 EditMenu.paste=\u7c98\u8d34 EditMenu.delete=\u5220\u9664 EditMenu.selectAll=\u5168\u9009 liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_sv.properties0000644000175000017500000000125110521651114030353 0ustar drazzibdrazzibTabbedPane.overviewButtonTooltip=Visa flik\u00f6versikt TabbedPane.overviewDialogTitle=Flik\u00f6versikt TabbedPane.overviewDialogTitleRefresh=Flik\u00f6versikt [uppdatera var {0} sek] TabbedPane.overviewWidgetTooltip=Klicka h\u00e4r om du vill st\u00e4nga \u00f6versikten och v\u00e4lja flik Tooltip.menuSearchButton=Markera f\u00f6r att visa menys\u00f6kpanelen Tooltip.menuSearchField=Ange s\u00f6kstr\u00e4ngen och tryck p\u00e5 Retur f\u00f6r att s\u00f6ka Tooltip.menuSearchTooltip=Klicka f\u00f6r att hitta meny EditMenu.copy=Kopiera EditMenu.cut=Klipp ut EditMenu.paste=Klistra in EditMenu.delete=Ta bort EditMenu.selectAll=Markera alla liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels.properties0000644000175000017500000000111310456347160027652 0ustar drazzibdrazzib# Default labels by Kirill Grouchnikov TabbedPane.overviewButtonTooltip=Show tab overview TabbedPane.overviewDialogTitle=Tab overview TabbedPane.overviewDialogTitleRefresh=Tab overview [refresh every {0} sec] TabbedPane.overviewWidgetTooltip=Click to close overview and select tab Tooltip.menuSearchButton=Select to view menu search panel Tooltip.menuSearchField=Enter search string and press 'Enter' button to search Tooltip.menuSearchTooltip=Click to locate menu EditMenu.copy=Copy EditMenu.cut=Cut EditMenu.paste=Paste EditMenu.delete=Delete EditMenu.selectAll=Select all liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_ja.properties0000644000175000017500000000212210521670034030315 0ustar drazzibdrazzibTabbedPane.overviewButtonTooltip=\u30bf\u30d6\u306e\u6982\u8981\u3092\u8868\u793a TabbedPane.overviewDialogTitle=\u30bf\u30d6\u306e\u6982\u8981 TabbedPane.overviewDialogTitleRefresh=\u30bf\u30d6\u306e\u6982\u8981 [{0} \u79d2\u3054\u3068\u306b\u518d\u8868\u793a] TabbedPane.overviewWidgetTooltip=\u30af\u30ea\u30c3\u30af\u3057\u3066\u6982\u8981\u3092\u9589\u3058\u3001\u30bf\u30d6\u3092\u9078\u629e\u3057\u307e\u3059 Tooltip.menuSearchButton=\u30e1\u30cb\u30e5\u30fc\u691c\u7d22\u30d1\u30cd\u30eb\u3092\u8868\u793a\u3059\u308b\u306b\u306f\u3001\u9078\u629e\u3057\u307e\u3059 Tooltip.menuSearchField=\u691c\u7d22\u6587\u5b57\u5217\u3092\u5165\u529b\u3057\u3001[Enter] \u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u691c\u7d22\u3057\u307e\u3059 Tooltip.menuSearchTooltip=\u30e1\u30cb\u30e5\u30fc\u3092\u691c\u7d22\u3059\u308b\u306b\u306f\u3001\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059 EditMenu.copy=\u30b3\u30d4\u30fc EditMenu.cut=\u5207\u308a\u53d6\u308a EditMenu.paste=\u8cbc\u308a\u4ed8\u3051 EditMenu.delete=\u524a\u9664 EditMenu.selectAll=\u3059\u3079\u3066\u9078\u629e liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_pt_BR.properties0000644000175000017500000000137710457313176030755 0ustar drazzibdrazzib# Portuguese (Brazil) translation by Claudio de Oliveira Miranda TabbedPane.overviewButtonTooltip=Mostrar aba de vis\u00e3o geral TabbedPane.overviewDialogTitle=Aba de vis\u00e3o geral TabbedPane.overviewDialogTitleRefresh=Aba de vis\u00e3o geral [atualiza\u00e7\u00e3o a cada {0} s] TabbedPane.overviewWidgetTooltip=Clique aqui para fechar a aba de vis\u00e3o geral e sele\u00e7\u00e3o Tooltip.menuSearchButton=Selecione, para efetuar pesquisa na estrutura de menus Tooltip.menuSearchField=Coloque o nome de item de menu a ser pesquisado e pressione o bot\u00e3o 'Enter' Tooltip.menuSearchTooltip=Clique aqui para localizar o menu EditMenu.copy=Copiar EditMenu.cut=Recortar EditMenu.paste=Colar EditMenu.delete=Remover EditMenu.selectAll=Selecionar todosliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_ru.properties0000644000175000017500000000307510456353402030365 0ustar drazzibdrazzib# Russian translation by Kirill Grouchnikov TabbedPane.overviewButtonTooltip=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043E\u0431\u0437\u043E\u0440 \u0442\u0430\u0431\u043E\u0432 TabbedPane.overviewDialogTitle=\u041E\u0431\u0437\u043E\u0440 \u0442\u0430\u0431\u043E\u0432 TabbedPane.overviewDialogTitleRefresh=\u041E\u0431\u0437\u043E\u0440 \u0442\u0430\u0431\u043E\u0432 [\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u043A\u0430\u0436\u0434\u044B\u0435 {0} \u0441\u0435\u043A] TabbedPane.overviewWidgetTooltip=\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u043E\u0431\u0437\u043E\u0440 \u0438 \u0432\u044B\u0431\u0440\u0430\u0442\u044C \u0442\u0430\u0431 Tooltip.menuSearchButton=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u0430\u043D\u0435\u043B\u044C \u043F\u043E\u0438\u0441\u043A\u0430 \u043C\u0435\u043D\u044E Tooltip.menuSearchField=\u0412\u0432\u0435\u0441\u0442\u0438 \u0441\u0442\u0440\u043E\u043A\u0443 \u043F\u043E\u0438\u0441\u043A\u0430 \u0438 \u043D\u0430\u0436\u0430\u0442\u044C Enter \u0434\u043B\u044F \u0437\u0430\u043F\u0443\u0441\u043A\u0430 \u043F\u043E\u0438\u0441\u043A\u0430 Tooltip.menuSearchTooltip=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043C\u0435\u043D\u044E EditMenu.copy=\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C EditMenu.cut=\u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C EditMenu.paste=\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C EditMenu.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C EditMenu.selectAll=\u0412\u044B\u0434\u0435\u043B\u0438\u0442\u044C \u0432\u0441\u0451 liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_vi.properties0000644000175000017500000000167311064503572030360 0ustar drazzibdrazzib# Vietnamese translation by Thang Nguyen EditMenu.copy = Sao ch\u00E9p EditMenu.cut = C\u1EAFt EditMenu.delete = X\u00F3a EditMenu.paste = D\u00E1n EditMenu.selectAll = Ch\u1ECDn t\u1EA5t c\u1EA3 TabbedPane.overviewButtonTooltip = Hi\u1EC3n th\u1ECB c\u1EEDa s\u1ED5 xem t\u1ED5ng qu\u00E1t TabbedPane.overviewDialogTitle = Xem t\u1ED5ng qu\u00E1t c\u00E1c tab TabbedPane.overviewDialogTitleRefresh = Xem t\u1ED5ng qu\u00E1t c\u00E1c tab [l\u00E0m t\u01B0\u01A1i m\u1ED7i {0} gi\u00E2y] TabbedPane.overviewWidgetTooltip = Nh\u1EA5p chu\u1ED9t \u0111\u1EC3 \u0111\u00F3ng c\u1EEDa s\u1ED5 t\u1ED5ng qu\u00E1t v\u00E0 ch\u1ECDn tab Tooltip.menuSearchButton = Ch\u1ECDn xem menu t\u00ECm ki\u1EBFm Tooltip.menuSearchField = Nh\u1EADp chu\u1ED7i c\u1EA7n t\u00ECm v\u00E0 nh\u1EA5n 'Enter' \u0111\u1EC3 t\u00ECm Tooltip.menuSearchTooltip = Nh\u1EA5p chu\u1ED9t \u0111\u1EC3 \u0111\u1ECBnh v\u1ECB menu liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_it.properties0000644000175000017500000000122210457312362030344 0ustar drazzibdrazzib# Italian translation by Sandro Martini TabbedPane.overviewButtonTooltip=Visualizza sommario dei tab TabbedPane.overviewDialogTitle=Sommario dei tab TabbedPane.overviewDialogTitleRefresh=Sommario dei Tab [aggiorna ogni {0} sec] TabbedPane.overviewWidgetTooltip=Clicca per chiudere il sommario e selezionare il tab Tooltip.menuSearchButton=Seleziona per visualizzare il menu di ricerca Tooltip.menuSearchField=Inserisci la stringa di ricerca, poi premi il tasto 'Invio' Tooltip.menuSearchTooltip=Clicca per trovare il menu EditMenu.copy=Copia EditMenu.cut=Taglia EditMenu.paste=Incolla EditMenu.delete=Cancella EditMenu.selectAll=Seleziona tutto liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_fi.properties0000644000175000017500000000133510521651114030324 0ustar drazzibdrazzibTabbedPane.overviewButtonTooltip=N\u00e4yt\u00e4 v\u00e4lilehden yhteenveto TabbedPane.overviewDialogTitle=V\u00e4lilehden yhteenveto TabbedPane.overviewDialogTitleRefresh=V\u00e4lilehden yhteenveto [p\u00e4ivitys {0} sekunnin v\u00e4lein] TabbedPane.overviewWidgetTooltip=Sulje yhteenveto ja valitse v\u00e4lilehti napsauttamalla Tooltip.menuSearchButton=Tarkastele valikon hakupaneelia valitsemalla Tooltip.menuSearchField=Etsi m\u00e4\u00e4ritt\u00e4m\u00e4ll\u00e4 hakujono ja paina Enter-n\u00e4pp\u00e4int\u00e4 Tooltip.menuSearchTooltip=Etsi valikko napsauttamalla EditMenu.copy=Kopioi EditMenu.cut=Leikkaa EditMenu.paste=Liit\u00e4 EditMenu.delete=Poista EditMenu.selectAll=Valitse kaikki liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_fr_CA.properties0000644000175000017500000000135710521651114030704 0ustar drazzibdrazzibTabbedPane.overviewButtonTooltip=Afficher l\'aper\u00e7u des onglets TabbedPane.overviewDialogTitle=Aper\u00e7u des onglets TabbedPane.overviewDialogTitleRefresh=Aper\u00e7u des onglets [actualiser toutes les {0} sec] TabbedPane.overviewWidgetTooltip=Cliquez pour fermer l\'aper\u00e7u et s\u00e9lectionner l\'onglet Tooltip.menuSearchButton=S\u00e9lectionnez pour afficher le panneau de recherche de menu Tooltip.menuSearchField=Entrez la cha\u00eene de recherche et appuyez sur \'Entr\u00e9e\' pour effectuer la recherche Tooltip.menuSearchTooltip=Cliquez pour rep\u00e9rer le menu EditMenu.copy=Copier EditMenu.cut=Couper EditMenu.paste=Coller EditMenu.delete=Supprimer EditMenu.selectAll=S\u00e9lectionner tout liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_bg.properties0000644000175000017500000000426610457313124030330 0ustar drazzibdrazzib# Bulgarian translation by Zar Petkov TabbedPane.overviewButtonTooltip=\u041F\u043E\u043A\u0430\u0436\u0438 \u043F\u0440\u0435\u0433\u043B\u0435\u0434 \u043D\u0430 \u0435\u0442\u0438\u043A\u0435\u0442\u0438 \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0438\u0442\u0435 TabbedPane.overviewDialogTitle=\u041F\u0440\u0435\u0433\u043B\u0435\u0434 \u043D\u0430 \u0435\u0442\u0438\u043A\u0435\u0442\u0438 \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0438\u0442\u0435 TabbedPane.overviewDialogTitleRefresh=\u041F\u0440\u0435\u0433\u043B\u0435\u0434 \u043D\u0430 \u0435\u0442\u0438\u043A\u0435\u0442\u0438 \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0438\u0442\u0435 [\u043E\u0431\u043D\u043E\u0432\u0438 \u043D\u0430 \u0432\u0441\u0435\u043A\u0438 {0} \u0441\u0435\u043A] TabbedPane.overviewWidgetTooltip=\u041A\u043B\u0438\u043A\u043D\u0438 \u0437\u0430 \u0434\u0430 \u0437\u0430\u0442\u0432\u043E\u0440\u0438\u0448 \u043F\u0440\u0435\u0433\u043B\u0435\u0434\u0430 \u0438 \u0438\u0437\u0431\u043E\u0440\u0430 \u043D\u0430 \u0435\u0442\u0438\u043A\u0435\u0442 \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430\u0442\u0430 Tooltip.menuSearchButton=\u0418\u0437\u0431\u0435\u0440\u0438 \u0437\u0430 \u0434\u0430 \u0432\u0438\u0434\u0438\u0448 \u043F\u0430\u043D\u0435\u043B\u0430 \u0437\u0430 \u0442\u044A\u0440\u0441\u0435\u043D\u0435 \u0432 \u043C\u0435\u044E\u0442\u043E Tooltip.menuSearchField=\u0412\u044A\u0432\u0435\u0434\u0438 \u043D\u0438\u0437 \u0437\u0430 \u0442\u044A\u0440\u0441\u0435\u043D\u0435 \u0438 \u043D\u0430\u0442\u0438\u0441\u043D\u0438 Enter \u0437\u0430 \u0434\u0430 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u0448 \u0442\u044A\u0440\u0441\u0435\u043D\u0435 Tooltip.menuSearchTooltip=\u041A\u043B\u0438\u043A\u043D\u0438 \u0437\u0430 \u0434\u0430 \u0438\u0437\u0431\u0435\u0440\u0435\u0448 \u043C\u0435\u043D\u044E EditMenu.copy=\u041A\u043E\u043F\u0438\u0440\u0430\u0439 EditMenu.cut=\u041E\u0442\u0440\u0435\u0436\u0438 EditMenu.paste=\u0412\u043C\u044A\u043A\u043D\u0438 EditMenu.delete=\u0418\u0437\u0442\u0440\u0438\u0439 EditMenu.selectAll=\u0418\u0437\u0431\u0435\u0440\u0438 \u0432\u0441\u0438\u0447\u043A\u043E liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_es_MX.properties0000644000175000017500000000133610521651114030742 0ustar drazzibdrazzibTabbedPane.overviewButtonTooltip=Mostrar descripci\u00f3n general de ficha TabbedPane.overviewDialogTitle=Descripci\u00f3n general de ficha TabbedPane.overviewDialogTitleRefresh=Descripci\u00f3n general de ficha [actualizar cada {0} seg.] TabbedPane.overviewWidgetTooltip=Haga clic para cerrar descripci\u00f3n general y seleccionar ficha Tooltip.menuSearchButton=Seleccione para ver el panel de b\u00fasqueda del men\u00fa Tooltip.menuSearchField=Ingrese la cadena de b\u00fasqueda y presione la tecla \'Intro\' para buscar Tooltip.menuSearchTooltip=Haga clic para ubicar el men\u00fa EditMenu.copy=Copiar EditMenu.cut=Cortar EditMenu.paste=Pegar EditMenu.delete=Eliminar EditMenu.selectAll=Todas liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_pl.properties0000644000175000017500000000137510476271564030365 0ustar drazzibdrazzib# Polish translation by Maciej Zwirski TabbedPane.overviewButtonTooltip=Poka\u017C przegl\u0105d zak\u0142adek TabbedPane.overviewDialogTitle=Przegl\u0105d zak\u0142adek TabbedPane.overviewDialogTitleRefresh=Przegl\u0105d zak\u0142adek [od\u015Bwie\u017Canie co {0} sek] TabbedPane.overviewWidgetTooltip=Kliknij, aby zamkn\u0105\u0107 przegl\u0105d i wybra\u0107 zak\u0142adk\u0119 Tooltip.menuSearchButton=Wybierz, aby wy\u015Bwietli\u0107 panel wyszukiwania menu Tooltip.menuSearchField=Wpisz s\u0142owo kluczowe i naci\u015Bnij przycisk 'Enter' aby wyszuka\u0107 Tooltip.menuSearchTooltip=Kliknij, aby zlokalizowa\u0107 menu EditMenu.copy=Kopiuj EditMenu.cut=Wytnij EditMenu.paste=Wklej EditMenu.delete=Usu\u0144 EditMenu.selectAll=Zaznacz wszystko liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_fr.properties0000644000175000017500000000131510463007614030340 0ustar drazzibdrazzib# French translation by Alois Cochard TabbedPane.overviewButtonTooltip=Afficher la vue d'ensemble des onglets TabbedPane.overviewDialogTitle=Vue d'ensemble des onglets TabbedPane.overviewDialogTitleRefresh=Vue d''ensemble des onglets [rafraichir toute les {0} sec] TabbedPane.overviewWidgetTooltip=Cliquer pour fermer la vue d'ensemble et s\u00E9l\u00E9ctionner un onglet Tooltip.menuSearchButton=Voir le panel du menu de recherche Tooltip.menuSearchField=Entrer le texte a rechercher puis presser 'Enter' pour rechercher. Tooltip.menuSearchTooltip=Cliquer pour localiser le menu EditMenu.copy=Copier EditMenu.cut=Couper EditMenu.paste=Coller EditMenu.delete=Effacer EditMenu.selectAll=Slectionner Tout liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_iw.properties0000644000175000017500000000243310456352126030355 0ustar drazzibdrazzib# Hebrew translation by Kirill Grouchnikov TabbedPane.overviewButtonTooltip=\u05D4\u05E8\u05D0\u05D4 \u05E1\u05E7\u05D9\u05E8\u05EA \u05DC\u05E9\u05D5\u05E0\u05D9\u05D5\u05EA TabbedPane.overviewDialogTitle=\u05E1\u05E7\u05D9\u05E8\u05EA \u05DC\u05E9\u05D5\u05E0\u05D9\u05D5\u05EA TabbedPane.overviewDialogTitleRefresh=\u05E1\u05E7\u05D9\u05E8\u05EA \u05DC\u05E9\u05D5\u05E0\u05D9\u05D5\u05EA [\u05E8\u05E2\u05E0\u05D5\u05DF \u05DB\u05DC {0} \u05E9] TabbedPane.overviewWidgetTooltip=\u05DC\u05D7\u05E5 \u05E1\u05D2\u05D9\u05E8\u05EA \u05E1\u05E7\u05D9\u05E8\u05D4 \u05D5\u05D1\u05D7\u05D9\u05E8\u05EA \u05DC\u05E9\u05D5\u05E0\u05D9\u05EA Tooltip.menuSearchButton=\u05DC\u05D7\u05E5 \u05DC\u05D4\u05E6\u05D2\u05EA \u05E4\u05D0\u05E0\u05DC \u05D7\u05D9\u05E4\u05D5\u05E9 \u05D1\u05EA\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD Tooltip.menuSearchField=\u05D4\u05DB\u05E0\u05E1 \u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D5\u05DC\u05D7\u05E5 'Enter' \u05DC\u05D7\u05D9\u05E4\u05D5\u05E9 Tooltip.menuSearchTooltip=\u05DC\u05D7\u05E5 \u05DC\u05D0\u05D9\u05EA\u05D5\u05E8 \u05EA\u05E4\u05E8\u05D9\u05D8 EditMenu.copy=\u05D4\u05D3\u05D1\u05E7 EditMenu.cut=\u05D2\u05D6\u05D5\u05E8 EditMenu.paste=\u05D4\u05E2\u05EA\u05E7 EditMenu.delete=\u05DE\u05D7\u05E7 EditMenu.selectAll=\u05D1\u05D7\u05E8 \u05D4\u05DB\u05DC liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_ar.properties0000644000175000017500000000300110460317312030321 0ustar drazzibdrazzib# Arabic translation by QamarAlZaman Habeek TabbedPane.overviewButtonTooltip=\u0639\u0631\u0636 \u0644\u0645\u062D\u0629 \u0639\u0646 \u0627\u0644\u062C\u062F\u0648\u0644\u0629 TabbedPane.overviewDialogTitle=\u0644\u0645\u062D\u0629 \u0639\u0646 \u0627\u0644\u062C\u062F\u0648\u0644\u0629 TabbedPane.overviewDialogTitleRefresh=\u0644\u0645\u062D\u0629 \u0639\u0646 \u0627\u0644\u062C\u062F\u0648\u0644\u0629 [\u062A\u062D\u062F\u064A\u062B \u0643\u0644 {0} \u062B\u0627] TabbedPane.overviewWidgetTooltip=\u0627\u0646\u0642\u0631 \u0644\u0625\u063A\u0644\u0627\u0642 \u0627\u0644\u0644\u0645\u062D\u0629 \u0648 \u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u062C\u062F\u0648\u0644\u0629 Tooltip.menuSearchButton=\u0627\u0646\u0642\u0631 \u0644\u0625\u0638\u0647\u0627\u0631 \u0644\u0648\u062d\u0629 \u0627\u0644\u0628\u062d\u062b \u0641\u064a \u0627\u0644\u0642\u0648\u0627\u0626\u0645 Tooltip.menuSearchField=\u0627\u062f\u062e\u0644 \u0627\u0644\u0646\u0635 \u0627\u0644\u0645\u0637\u0644\u0648\u0628 \u062b\u0645 \u0627\u0636\u063a\u0637 \u0632\u0631 "\u0627\u062f\u062e\u0644" \u0644\u0644\u0628\u062d\u062b Tooltip.menuSearchTooltip=\u0627\u0646\u0642\u0631 \u0644\u062A\u062D\u062F\u064A\u062F \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0623\u0648\u0627\u0645\u0631 EditMenu.copy=\u0646\u0633\u062E EditMenu.cut=\u0642\u0635 EditMenu.paste=\u0644\u0635\u0642 EditMenu.delete=\u062D\u0630\u0641 EditMenu.selectAll=\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644 liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_pt.properties0000644000175000017500000000126310521651114030351 0ustar drazzibdrazzibTabbedPane.overviewButtonTooltip=Mostrar vis\u00e3o geral da guia TabbedPane.overviewDialogTitle=Vis\u00e3o geral da guia TabbedPane.overviewDialogTitleRefresh=Vis\u00e3o geral da guia [atualizar a cada {0} s] TabbedPane.overviewWidgetTooltip=Clicar para fechar a vis\u00e3o geral e selecionar a guia Tooltip.menuSearchButton=Selecionar para exibir o painel de procura de menus Tooltip.menuSearchField=Digitar string de procura e pressionar o bot\u00e3o \'Enter\' para procurar Tooltip.menuSearchTooltip=Clicar para localizar o menu EditMenu.copy=Copiar EditMenu.cut=Recortar EditMenu.paste=Colar EditMenu.delete=Apagar EditMenu.selectAll=Selecionar tudo liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_el.properties0000644000175000017500000000441210521651114030325 0ustar drazzibdrazzibTabbedPane.overviewButtonTooltip=\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03b5\u03c0\u03b9\u03c3\u03ba\u03cc\u03c0\u03b7\u03c3\u03b7\u03c2 \u03ba\u03b1\u03c1\u03c4\u03b5\u03bb\u03ce\u03bd TabbedPane.overviewDialogTitle=\u0395\u03c0\u03b9\u03c3\u03ba\u03cc\u03c0\u03b7\u03c3\u03b7 \u03ba\u03b1\u03c1\u03c4\u03b5\u03bb\u03ce\u03bd TabbedPane.overviewDialogTitleRefresh=\u0395\u03c0\u03b9\u03c3\u03ba\u03cc\u03c0\u03b7\u03c3\u03b7 \u03ba\u03b1\u03c1\u03c4\u03b5\u03bb\u03ce\u03bd [\u03b1\u03bd\u03b1\u03bd\u03ad\u03c9\u03c3\u03b7 \u03ba\u03ac\u03b8\u03b5 {0} \u03b4\u03b5\u03c5\u03c4.] TabbedPane.overviewWidgetTooltip=\u039a\u03ac\u03bd\u03c4\u03b5 \u03ba\u03bb\u03b9\u03ba \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03bb\u03b5\u03af\u03c3\u03b5\u03b9 \u03b7 \u03b5\u03c0\u03b9\u03c3\u03ba\u03cc\u03c0\u03b7\u03c3\u03b7 \u03ba\u03b1\u03b9 \u03b5\u03c0\u03b9\u03bb\u03ad\u03be\u03c4\u03b5 \u03ba\u03b1\u03c1\u03c4\u03ad\u03bb\u03b1 Tooltip.menuSearchButton=\u0395\u03c0\u03b9\u03bb\u03ad\u03be\u03c4\u03b5 \u03bd\u03b1 \u03b3\u03af\u03bd\u03b5\u03b9 \u03c0\u03c1\u03bf\u03b2\u03bf\u03bb\u03ae \u03c4\u03bf\u03c5 \u03c0\u03af\u03bd\u03b1\u03ba\u03b1 \u03b1\u03bd\u03b1\u03b6\u03ae\u03c4\u03b7\u03c3\u03b7\u03c2 \u03c3\u03c4\u03bf \u03bc\u03b5\u03bd\u03bf\u03cd Tooltip.menuSearchField=\u0395\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03ad\u03bd\u03b1 \u03ba\u03b5\u03af\u03bc\u03b5\u03bd\u03bf \u03b1\u03bd\u03b1\u03b6\u03ae\u03c4\u03b7\u03c3\u03b7\u03c2 \u03ba\u03b1\u03b9 \u03c0\u03b9\u03ad\u03c3\u03c4\u03b5 \u03c4\u03bf \u03c0\u03bb\u03ae\u03ba\u03c4\u03c1\u03bf \'Enter\' \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03b3\u03af\u03bd\u03b5\u03b9 \u03b1\u03bd\u03b1\u03b6\u03ae\u03c4\u03b7\u03c3\u03b7 Tooltip.menuSearchTooltip=\u039a\u03ac\u03bd\u03c4\u03b5 \u03ba\u03bb\u03b9\u03ba \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03b5\u03bd\u03c4\u03bf\u03c0\u03af\u03c3\u03b5\u03c4\u03b5 \u03ad\u03bd\u03b1 \u03bc\u03b5\u03bd\u03bf\u03cd EditMenu.copy=\u0391\u03bd\u03c4\u03b9\u03b3\u03c1\u03b1\u03c6\u03ae EditMenu.cut=\u0391\u03c0\u03bf\u03ba\u03bf\u03c0\u03ae EditMenu.paste=\u0395\u03c0\u03b9\u03ba\u03cc\u03bb\u03bb\u03b7\u03c3\u03b7 EditMenu.delete=\u0394\u03b9\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae EditMenu.selectAll=\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03cc\u03bb\u03c9\u03bd liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_th.properties0000644000175000017500000000264010521651114030341 0ustar drazzibdrazzibTabbedPane.overviewButtonTooltip=\u0e41\u0e2a\u0e14\u0e07\u0e20\u0e32\u0e1e\u0e23\u0e27\u0e21\u0e41\u0e17\u0e47\u0e1a TabbedPane.overviewDialogTitle=\u0e20\u0e32\u0e1e\u0e23\u0e27\u0e21\u0e41\u0e17\u0e47\u0e1a TabbedPane.overviewDialogTitleRefresh=\u0e20\u0e32\u0e1e\u0e23\u0e27\u0e21\u0e41\u0e17\u0e47\u0e1a [\u0e23\u0e35\u0e40\u0e1f\u0e23\u0e0a\u0e17\u0e38\u0e01\u0e46 {0} \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35] TabbedPane.overviewWidgetTooltip=\u0e04\u0e25\u0e34\u0e01\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e1b\u0e34\u0e14\u0e20\u0e32\u0e1e\u0e23\u0e27\u0e21\u0e41\u0e25\u0e30\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e41\u0e17\u0e47\u0e1a Tooltip.menuSearchButton=\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e14\u0e39\u0e41\u0e1c\u0e07\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e40\u0e21\u0e19\u0e39 Tooltip.menuSearchField=\u0e1b\u0e49\u0e2d\u0e19\u0e2a\u0e15\u0e23\u0e34\u0e07\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e41\u0e25\u0e30\u0e01\u0e14\u0e1b\u0e38\u0e48\u0e21 \'Enter\' \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e49\u0e19\u0e2b\u0e32 Tooltip.menuSearchTooltip=\u0e04\u0e25\u0e34\u0e01\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e40\u0e21\u0e19\u0e39 EditMenu.copy=\u0e04\u0e31\u0e14\u0e25\u0e2d\u0e01 EditMenu.cut=\u0e15\u0e31\u0e14 EditMenu.paste=\u0e27\u0e32\u0e07 EditMenu.delete=\u0e25\u0e1a EditMenu.selectAll=\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14 liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_de.properties0000644000175000017500000000135410457636164030337 0ustar drazzibdrazzib# German translation by Andreas Golchert TabbedPane.overviewButtonTooltip=Tab\u00FCbersicht anzeigen TabbedPane.overviewDialogTitle=Tab\u00FCbersicht TabbedPane.overviewDialogTitleRefresh=Tab\u00FCbersicht [Alle {0} Sek neu laden] TabbedPane.overviewWidgetTooltip=Klicken Sie hier, um die Tab\u00FCbersicht zu schlie\u00DFen und den Tab zu selektieren Tooltip.menuSearchButton=Klicken Sie hier, um die Men\u00fcsuchmaske anzuzeigen Tooltip.menuSearchField=Geben Sie den Suchbegriff ein und dr\u00FCcken Sie 'Enter' Tooltip.menuSearchTooltip=Klicken Sie hier, um das Men\u00FC zu finden EditMenu.copy=Kopieren EditMenu.cut=Ausschneiden EditMenu.paste=Einf\u00FCgen EditMenu.delete=L\u00F6schen EditMenu.selectAll=Alles ausw\u00E4hlen liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_ro.properties0000644000175000017500000000144110457313612030352 0ustar drazzibdrazzib# Romanian translation by Sergiu Nicolae Nacu and Ran Locar TabbedPane.overviewButtonTooltip=Arat\u0103 descrierea tabului TabbedPane.overviewDialogTitle=Descriere tab TabbedPane.overviewDialogTitleRefresh=Descriere tab [actualizare la fiecare {0} sec] TabbedPane.overviewWidgetTooltip=Apas\u0103 pentru a \u00EEnchide fereastra cu detalii \u015Fi selecteaz\u0103 tab Tooltip.menuSearchButton=Selecteaza pentru a viziona meniul panoului de c\u0103utare Tooltip.menuSearchField=Introduce\u0163i textul de c\u0103utat \u015Fi ap\u0103sa\u0163i butonul 'Enter' pentru a porni cautarea Tooltip.menuSearchTooltip=Apas\u0103 pentru a localiza meniul EditMenu.copy=Copiaz\u0103 EditMenu.cut=Taie EditMenu.paste=Lipe\u015Fte EditMenu.delete=\u015Eterge EditMenu.selectAll=Selecteaz\u0103 tot liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_tr.properties0000644000175000017500000000152110521651114030350 0ustar drazzibdrazzibTabbedPane.overviewButtonTooltip=Sekmeye genel bak\u0131\u015f\u0131 g\u00f6ster TabbedPane.overviewDialogTitle=Sekmeye genel bak\u0131\u015f TabbedPane.overviewDialogTitleRefresh=Sekmeye genel bak\u0131\u015f [{0} saniyede bir yenile] TabbedPane.overviewWidgetTooltip=Genel bak\u0131\u015f\u0131 kapatmak ve sekmeyi se\u00e7mek i\u00e7in t\u0131klay\u0131n Tooltip.menuSearchButton=Men\u00fc arama panelini g\u00f6r\u00fcnt\u00fclemek i\u00e7in t\u0131klay\u0131n Tooltip.menuSearchField=Arama dizisini girin ve aramaya ba\u015flamak i\u00e7in \"Enter\" d\u00fc\u011fmesine bas\u0131n Tooltip.menuSearchTooltip=Men\u00fcy\u00fc bulmak i\u00e7in t\u0131klay\u0131n EditMenu.copy=Kopyala EditMenu.cut=Kes EditMenu.paste=Yap\u0131\u015ft\u0131r EditMenu.delete=Sil EditMenu.selectAll=T\u00fcm\u00fcn\u00fc se\u00e7 liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_zh_TW.properties0000644000175000017500000000160210521651114030756 0ustar drazzibdrazzibTabbedPane.overviewButtonTooltip=\u986f\u793a\u9078\u9805\u6a19\u7c64\u6982\u89bd TabbedPane.overviewDialogTitle=\u9078\u9805\u6a19\u7c64\u6982\u89bd TabbedPane.overviewDialogTitleRefresh=\u9078\u9805\u6a19\u7c64\u6982\u89bd [\u6bcf\u3000{0}\u3000\u79d2\u66f4\u65b0\u4e00\u6b21] TabbedPane.overviewWidgetTooltip=\u9ede\u9078\u672c\u9215\uff0c\u95dc\u9589\u6982\u89bd\u5f8c\u9078\u64c7\u9078\u9805\u6a19\u7c64 Tooltip.menuSearchButton=\u9078\u64c7\u672c\u9215\uff0c\u6aa2\u5f0f\u76ee\u9304\u641c\u5c0b\u8996\u6846\u3002 Tooltip.menuSearchField=\u8f38\u5165\u641c\u5c0b\u5b57\u4e32\uff0c\u6309 \'Enter\' \u9375\u958b\u59cb\u641c\u5c0b Tooltip.menuSearchTooltip=\u9ede\u9078\u672c\u9215\u9078\u64c7\u76ee\u9304 EditMenu.copy=\u8907\u88fd EditMenu.cut=\u526a\u4e0b EditMenu.paste=\u8cbc\u4e0a EditMenu.delete=\u522a\u9664 EditMenu.selectAll=\u9078\u64c7\u5168\u90e8 liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_da.properties0000644000175000017500000000116710457313226030324 0ustar drazzibdrazzib# Danish translation by Carsten O. Madsen TabbedPane.overviewButtonTooltip=Vis tab overblik TabbedPane.overviewDialogTitle=Tab overblik TabbedPane.overviewDialogTitleRefresh=Tab overblik [opdater hvert {0} sek] TabbedPane.overviewWidgetTooltip=Klik for at lukke overblik og v\u00E6lge tab Tooltip.menuSearchButton=V\u00E6lg for at vise s\u00F8g efter menu panelet Tooltip.menuSearchField=Indtast s\u00F8ge streng og tryk p\u00E5 'Enter' for at s\u00F8ge Tooltip.menuSearchTooltip=Klik for at finde menu EditMenu.copy=Kopier EditMenu.cut=Klip EditMenu.paste=Inds\u00E6t EditMenu.delete=Slet EditMenu.selectAll=Marker altliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_en_US.properties0000644000175000017500000000107610521651114030741 0ustar drazzibdrazzibTabbedPane.overviewButtonTooltip=Show tab overview TabbedPane.overviewDialogTitle=Tab Overview TabbedPane.overviewDialogTitleRefresh=Tab Overview [refresh every {0} sec] TabbedPane.overviewWidgetTooltip=Click to close overview and select tab Tooltip.menuSearchButton=Select to view menu search panel Tooltip.menuSearchField=Enter search string and press \'Enter\' button to search Tooltip.menuSearchTooltip=Click to locate menu EditMenu.copy=Copy EditMenu.cut=Cut EditMenu.paste=Paste EditMenu.delete=Delete EditMenu.selectAll=Select all liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_en_GB.properties0000644000175000017500000000107610521651114030702 0ustar drazzibdrazzibTabbedPane.overviewButtonTooltip=Show tab overview TabbedPane.overviewDialogTitle=Tab overview TabbedPane.overviewDialogTitleRefresh=Tab overview [refresh every {0} sec] TabbedPane.overviewWidgetTooltip=Click to close overview and select tab Tooltip.menuSearchButton=Select to view menu search panel Tooltip.menuSearchField=Enter search string and press \'Enter\' button to search Tooltip.menuSearchTooltip=Click to locate menu EditMenu.copy=Copy EditMenu.cut=Cut EditMenu.paste=Paste EditMenu.delete=Delete EditMenu.selectAll=Select all liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_no.properties0000644000175000017500000000044510426721710030347 0ustar drazzibdrazzib# Norwegian translation by Nils-Morten Nilssen Tooltip.heapStatusPanel=Heap status. Klikk for \u00E5 kj\u00F8re garbage collector Tooltip.menuSearchButton=Klikk for \u00E5 se menys\u00F8kepanelet Tooltip.menuSearchField=Skriv s\u00F8kestrengen og trykk 'Enter' knappen for \u00E5 s\u00F8ke liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_zh_HK.properties0000644000175000017500000000146710521651114030737 0ustar drazzibdrazzibTabbedPane.overviewButtonTooltip=\u986f\u793a\u6b04\u76ee\u6982\u89bd TabbedPane.overviewDialogTitle=\u6b04\u76ee\u6982\u89bd TabbedPane.overviewDialogTitleRefresh=\u6b04\u76ee\u6982\u89bd [\u6bcf {0} \u79d2\u66f4\u65b0] TabbedPane.overviewWidgetTooltip=\u9ede\u64ca\u4f86\u95dc\u9589\u6982\u89bd\u53ca\u9078\u64c7\u6b04\u76ee Tooltip.menuSearchButton=\u9078\u64c7\u4f86\u67e5\u770b\u76ee\u9304\u641c\u5c0b\u9762\u677f Tooltip.menuSearchField=\u8f38\u5165\u641c\u5c0b\u5b57\u4e32\u53ca\u6309\u300c\u8f38\u5165\u300d\u6309\u9215\u4f86\u641c\u5c0b Tooltip.menuSearchTooltip=\u9ede\u64ca\u4f86\u627e\u51fa\u76ee\u9304\u7684\u4f4d\u7f6e EditMenu.copy=\u8907\u88fd EditMenu.cut=\u526a\u4e0b EditMenu.paste=\u8cbc\u4e0a EditMenu.delete=\u522a\u9664 EditMenu.selectAll=\u9078\u64c7\u5168\u90e8 liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/resources/Labels_es.properties0000644000175000017500000000075010434016750030341 0ustar drazzibdrazzib# Danish translation by David lvarez Len TabbedPane.overviewButtonTooltip=Muestra los paneles pesta\u00F1a TabbedPane.overviewDialogTitle=Muestra de paneles pesta\u00F1a TabbedPane.overviewWidgetTooltip=Pulse para cerrar y seleccionar el panel Tooltip.menuSearchButton=Selecciona para ver el panel de b\u00FAsqueda. Tooltip.menuSearchField=Escriba el t\u00E9rmino de b\u00FAsqueda y presione el bot\u00F3n "ENTER" para buscar. Tooltip.menuSearchTooltip=Pulse para situar el menu liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/layout/0000755000175000017500000000000011253454710023635 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/layout/TransitionLayout.java0000644000175000017500000007765311137001462030043 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.layout; import java.awt.*; import java.util.*; import javax.swing.*; import javax.swing.border.Border; import javax.swing.plaf.UIResource; import javax.swing.tree.TreePath; import org.jvnet.lafwidget.animation.*; /** * Transition layout. The public methods in this class that are not implementing * the {@link LayoutManager} are for look-and-feel usage. Application code * should use the {@link #getAlphaComposite(Component)} and * {@link #getAlphaComposite(Component, float)} methods only in custom painting * code (overriding the {@link JComponent#paintComponent(Graphics)} method. * * @author Kirill Grouchnikov. */ public class TransitionLayout implements LayoutManager { /** * The original layout manager. Handles the layout-related tasks. */ protected LayoutManager delegate; protected java.util.List eventListeners; /** * Client property that specifies the current transition state of a * component. The value is a correct multiplication of all transitions that * a component participates in. * * @see #OWN_ALPHA * @see #getCompositeAlpha(Component) * @see #getAlphaComposite(Component) * @see #getAlphaComposite(Component, float) */ public static final String ALPHA = "lafwidgets.layout.alpha"; /** * Client property that specifies the transition state of a component in a * transition that happens directly on that component. * * @see #ALPHA * @see #getCompositeAlpha(Component) * @see #getAlphaComposite(Component) * @see #getAlphaComposite(Component, float) */ public static final String OWN_ALPHA = "lafwidgets.layout.ownAlpha"; /** * Client property to store the original opacity of the component while it * is in a transition. The {@link #isOpaque(Component)} uses this property * to correctly report the "real" component opacity to the painting code. */ public static final String ORIGINAL_OPACITY = "lafwidgets.layout.originalOpacity"; // public static final String IGNORE = "lafwidgets.layout.ignore"; /** * Client property to store the current visibility of components. Since we * are playing with calls to {@link Component#setVisible(boolean)}, this * property tracks the "real" visibility. */ public static final String SHOWING = "lafwidgets.layout.showing"; /** * Client property that marks components in fade-out state. Such components * are hidden before layout out the container and reshown afterwards. */ public static final String LIMBO = "lafwidgets.layout.limbo"; /** * Client property for storing the current bounds of a component. This is * used to perform animations on components that stay visible but change * location. */ public static final String BOUNDS = "lafwidgets.layout.bounds"; /** * The associated container. */ protected Container container; protected boolean doImmediateRepaint; /** * Fade kind for animating the change in component bounds. */ public static final FadeKind COMPONENT_BOUNDS = new FadeKind( "lafwidgets.layout.componentBounds"); /** * Fade kind for animating the change in component visibility. */ public static final FadeKind COMPONENT_FADE = new FadeKind( "lafwidgets.layout.componentFade"); // protected Set added; // // protected Set removed; // protected boolean hasFades; protected boolean hasPendingLayoutRequests; protected int pendingAnimationCount; public TransitionLayout(Container container, LayoutManager delegate, boolean hasFades) { super(); this.container = container; this.delegate = delegate; this.hasFades = hasFades; this.doImmediateRepaint = false; this.hasPendingLayoutRequests = false; this.pendingAnimationCount = 0; this.eventListeners = new ArrayList(); // added = new HashSet(); // removed = new HashSet(); // this.container.addContainerListener(new ContainerAdapter() { // public void componentRemoved(ContainerEvent e) { // removed.add(e.getChild()); // } // // public void componentAdded(ContainerEvent e) { // final Component c = e.getChild(); // added.add(c); // c.addHierarchyListener(new HierarchyListener() { // public void hierarchyChanged(HierarchyEvent e) { // if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) { // Component c = e.getComponent(); // if (e.getChanged().isVisible()) { // added.add(c); // removed.remove(c); // // System.out.println(c + " added"); // } else { // removed.add(c); // added.remove(c); // // System.out.println(c + " removed"); // } // } // } // }); // } // }); } public void addLayoutComponent(String name, Component comp) { delegate.addLayoutComponent(name, comp); } public void layoutContainer(Container parent) { // SimpleDateFormat sdf = new SimpleDateFormat("hh:mm:ss.SSS"); // System.out.println("Layout at " + sdf.format(new Date())); // System.out.println("\tbefore"); if (this.getPendingAnimationCount() > 0) { this.requestLayout(); return; } fireEvent(null, TransitionLayoutEvent.TRANSITION_STARTED); this.installBorders(container); final Map oldLocations = new HashMap(); for (int i = 0; i < parent.getComponentCount(); i++) { Component c = parent.getComponent(i); JComponent jc = (JComponent) c; if (!jc.isVisible() || (hasFades && !Boolean.TRUE.equals(jc .getClientProperty(SHOWING)))) setAlpha(jc, new Float(0.0), new Float(0.0), true); if (Boolean.TRUE.equals(jc.getClientProperty(LIMBO))) jc.setVisible(false); // System.out.println("before : " + c.getClass().getName() + " [" // + c.isVisible() + "] " + c.getBounds()); oldLocations.put(jc, new Rectangle(jc.getBounds())); // jc.putClientProperty(ALPHA, new Float(0.0)); } final Map parentOpacityMap = new HashMap(); if (hasFades) makeNonOpaque(parent, parentOpacityMap); delegate.layoutContainer(parent); if (hasFades) { restoreOpaque(parent, parentOpacityMap, true); if (parentOpacityMap.size() > 0) { throw new IllegalStateException(); } } parent.repaint(); // System.out.println("Has " + parent.getComponentCount() + " comps"); for (int i = 0; i < parent.getComponentCount(); i++) { final Component comp = parent.getComponent(i); final JComponent jc = (JComponent) comp; // System.out.println("after : " + jc.getClass().getName() + " [" // + jc.isVisible() + "] " + jc.getBounds()); final Rectangle newBounds = new Rectangle(jc.getBounds()); final Rectangle oldBounds = (jc.getClientProperty(BOUNDS) instanceof Rectangle) ? (Rectangle) jc .getClientProperty(BOUNDS) : (Rectangle) oldLocations.get(jc); // boolean wasShowing = ((oldBounds.width > 0) && (oldBounds.height // > 0)) // || removed.contains(c); boolean wasShowing = Boolean.TRUE.equals(jc .getClientProperty(SHOWING)) && !FadeTracker.getInstance().isTracked(jc, COMPONENT_FADE); boolean isShowing = /* * ((newBounds.width > 0) && (newBounds.height > * 0) && */jc.isVisible() && (!Boolean.TRUE.equals(jc.getClientProperty(LIMBO))); // || added.contains(c); // if (jc instanceof JButton) { // System.out.println(((JButton) jc).getText() + " " + wasShowing // + "->" + isShowing); // } // if (jc.isVisible()) jc.putClientProperty(SHOWING, Boolean.TRUE); else jc.putClientProperty(SHOWING, null); jc.putClientProperty(BOUNDS, new Rectangle(newBounds)); if (Boolean.TRUE.equals(jc.getClientProperty(LIMBO))) jc.setVisible(true); if (!isShowing && !wasShowing) { clearAlpha(jc, true); } // removed.remove(c); // added.remove(c); if (isShowing && wasShowing) { // if (oldBounds.equals(newBounds) // && !FadeTracker.getInstance().isTracked(jc, // COMPONENT_FADE)) // setAlpha(jc, null); // jc.putClientProperty(ALPHA, null); if (!oldBounds.equals(newBounds)) { jc.setBounds(oldBounds); final Map opacity = new HashMap(); if (hasFades) makeNonOpaque(jc, opacity); // if (jc instanceof JButton) { // System.out.println(((JButton) jc).getText() + " " // + oldBounds + "->" + newBounds); // } this.animationStarted(); FadeTracker.getInstance().trackFadeIn(COMPONENT_BOUNDS, jc, false, new UIThreadFadeTrackerAdapter() { @Override public void fadeEnded(FadeKind fadeKind) { if (hasFades) { restoreOpaque(jc, opacity, true); if (opacity.size() > 0) { throw new IllegalStateException(); } } float parentAlpha = getCompositeAlpha(jc .getParent()); if (parentAlpha < 1.0f) setAlpha(jc, new Float(parentAlpha), new Float(1.0f), true); else clearAlpha(jc, true); animationEnded(); } @Override public void fadePerformed(FadeKind fadeKind, final float fade) { // if (fade == 1.0) Rectangle currBounds = new Rectangle( (int) (oldBounds.x + fade * (newBounds.x - oldBounds.x)), (int) (oldBounds.y + fade * (newBounds.y - oldBounds.y)), (int) (oldBounds.width + fade * (newBounds.width - oldBounds.width)), (int) (oldBounds.height + fade * (newBounds.height - oldBounds.height))); // System.out.println(fade + ":" // + currBounds + ":" + oldBounds // + ":" + newBounds); jc.setBounds(currBounds); fireEvent(jc, TransitionLayoutEvent.CHILD_MOVING); jc.doLayout(); if (hasFades) { // && // (jc.getClientProperty(ALPHA) // == // null)) { double coef = 1 + 2.0 * Math .abs(fade - 0.5); double alpha = 0.5 + (0.25 * coef * coef) / 2.0; setAlpha(jc, new Float( getCompositeAlpha(jc .getParent()) * alpha), new Float( alpha), true); // jc.putClientProperty(ALPHA, // new // Float( // alpha)); } repaint(jc); // jc.repaint(); } }); } } if (!wasShowing && isShowing && hasFades) { setAlpha(jc, new Float(0.0), new Float(0.0), true); // jc.putClientProperty(ALPHA, new Float(0.0f)); jc.setBounds(newBounds); final Map opacity = new HashMap(); makeNonOpaque(jc, opacity); jc.setVisible(true); this.animationStarted(); FadeTracker.getInstance().trackFadeIn(COMPONENT_FADE, jc, false, new UIThreadFadeTrackerAdapter() { @Override public void fadeEnded(FadeKind fadeKind) { float parentAlpha = getCompositeAlpha(jc .getParent()); if (parentAlpha < 1.0f) setAlpha(jc, new Float(parentAlpha), new Float(1.0f), true); else clearAlpha(jc, true); restoreOpaque(jc, opacity, true); if (opacity.size() > 0) { throw new IllegalStateException(); } animationEnded(); } @Override public void fadePerformed(FadeKind fadeKind, final float fade) { setAlpha(jc, new Float(getCompositeAlpha(jc .getParent()) * fade), new Float(fade), true); // jc.putClientProperty(ALPHA, new // Float( // fade)); // if (jc instanceof JDesktopPane) // System.out.println(jc.getClass().getName() // + " --> " // + jc.getClientProperty(ALPHA)); fireEvent(jc, TransitionLayoutEvent.CHILD_FADING_IN); repaint(jc); // jc.repaint(); } }); } if (!isShowing && wasShowing && hasFades) { float parentAlpha = getCompositeAlpha(jc.getParent()); if (parentAlpha < 1.0f) setAlpha(jc, new Float(parentAlpha), new Float(1.0f), true); else setAlpha(jc, new Float(1.0f), new Float(1.0f), true); // jc.putClientProperty(ALPHA, new Float(1.0f)); final Map opacity = new HashMap(); makeNonOpaque(jc, opacity); jc.setBounds(oldBounds); jc.putClientProperty(LIMBO, Boolean.TRUE); jc.setVisible(true); this.animationStarted(); FadeTracker.getInstance().trackFadeOut(COMPONENT_FADE, jc, false, new UIThreadFadeTrackerAdapter() { @Override public void fadeEnded(FadeKind fadeKind) { restoreOpaque(jc, opacity, true); if (opacity.size() > 0) { throw new IllegalStateException(); } jc.setBounds(newBounds); jc.setVisible(false); jc.putClientProperty(SHOWING, null); jc.putClientProperty(LIMBO, null); clearAlpha(jc, true); // jc.putClientProperty(IGNORE, // Boolean.TRUE); animationEnded(); } @Override public void fadePerformed(FadeKind fadeKind, final float fade) { setAlpha(jc, new Float(getCompositeAlpha(jc .getParent()) * fade), new Float(fade), true); // jc.putClientProperty(ALPHA, new // Float( // fade)); fireEvent(jc, TransitionLayoutEvent.CHILD_FADING_OUT); repaint(jc); // jc.repaint(); } }); } } // added.clear(); // removed.clear(); // if (isShowing && !wasShowing) { // if (c instanceof JComponent) { // ((JComponent) c).putClientProperty(ALPHA, new Double(0.0f)); // } // } if (this.getPendingAnimationCount() == 0) this.fireEvent(null, TransitionLayoutEvent.TRANSITION_ENDED); } public Dimension minimumLayoutSize(Container parent) { return delegate.minimumLayoutSize(parent); } public Dimension preferredLayoutSize(Container parent) { return delegate.preferredLayoutSize(parent); } public void removeLayoutComponent(Component comp) { delegate.removeLayoutComponent(comp); } /** * Makes the specified component and all its descendants non-opaque. * * @param comp * Component. * @param opacitySnapshot * The "snapshot" map that will contain the original opacity * status of the specified component and all its descendants. */ public static void makeNonOpaque(Component comp, Map opacitySnapshot) { if (comp instanceof JComponent) { JComponent jcomp = (JComponent) comp; opacitySnapshot.put(comp, jcomp.isOpaque()); jcomp.putClientProperty(ORIGINAL_OPACITY, Boolean.valueOf(jcomp .isOpaque())); // System.out.println(jcomp.getClass().getName() + " : " // + jcomp.isOpaque() + " --> false"); jcomp.setOpaque(false); } if (comp instanceof Container) { Container cont = (Container) comp; for (int i = 0; i < cont.getComponentCount(); i++) makeNonOpaque(cont.getComponent(i), opacitySnapshot); } } /** * Restores the opacity of the specified component and all its descendants. * * @param comp * Component. * @param opacitySnapshot * The "snapshot" map that contains the original opacity status * of the specified component and all its descendants. */ public static void restoreOpaque(Component comp, Map opacitySnapshot, boolean toCleanup) { if (comp instanceof JComponent) { JComponent jcomp = (JComponent) comp; // snapshot may not contain opacity for table header of a table when // it's used inside tree cell renderer (wrapper in a scroll pane). if (opacitySnapshot.containsKey(jcomp)) { jcomp.setOpaque(opacitySnapshot.get(jcomp)); opacitySnapshot.remove(jcomp); } else jcomp.setOpaque(true); jcomp.putClientProperty(ORIGINAL_OPACITY, null); // System.out.println(jcomp.getClass().getName() + " --> " // + jcomp.isOpaque()); } if (comp instanceof Container) { Container cont = (Container) comp; for (int i = 0; i < cont.getComponentCount(); i++) restoreOpaque(cont.getComponent(i), opacitySnapshot, false); } if (toCleanup) { for (Map.Entry entry : opacitySnapshot .entrySet()) { if (entry.getKey() instanceof JComponent) { JComponent jcomp = (JComponent) entry.getKey(); jcomp.setOpaque(entry.getValue()); jcomp.putClientProperty(ORIGINAL_OPACITY, null); } } opacitySnapshot.clear(); } } public static void setAlpha(Component comp, Float alpha, Float ownAlpha, boolean main) { // if (main) { // System.out.println(comp.getClass().getName() + "[@" // + comp.hashCode() + "] " + " --> " + alpha); // } if (comp instanceof JComponent) { JComponent jcomp = (JComponent) comp; // else // { // System.out.println("Setting " + comp.getClass().getName() // + " to " + alpha); // } // if (jcomp instanceof JDesktopPane) // System.out.println(jcomp.getClass().getName() + " --> " // + jcomp.getClientProperty(ALPHA)); if (main) { jcomp.putClientProperty(OWN_ALPHA, ownAlpha); } else { // Here we are on a child component of fading parent. If the // child component itself is in fading animation, that animation // will correctly set the alpha based on the parent chain // translucency. // Because of this we simply return, not going to the children // of the current component (which will be / already were // traversed in the fade loop of the current component. if (FadeTracker.getInstance().isTracked(jcomp, COMPONENT_FADE)) { return; } } // if (jcomp instanceof JButton) { // JButton jb = (JButton) jcomp; // if (jb.getText().equals("2")) // System.out.println("Setting '" // + ((JButton) jcomp).getText() + "' to " + alpha); // } jcomp.putClientProperty(ALPHA, alpha); } if (comp instanceof JList) { JList list = (JList) comp; for (int i = 0; i < list.getModel().getSize(); i++) { Component rendComp = list.getCellRenderer() .getListCellRendererComponent(list, list.getModel().getElementAt(i), i, list.isSelectedIndex(i), false); setAlpha(rendComp, alpha, null, false); } } if (comp instanceof JTree) { JTree tree = (JTree) comp; for (int row = 0; row < tree.getRowCount(); row++) { TreePath path = tree.getPathForRow(row); boolean isLeaf = tree.getModel().isLeaf( path.getLastPathComponent()); Component rendComp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, path.getLastPathComponent(), tree.isRowSelected(row), tree.isExpanded(row), isLeaf, row, false); setAlpha(rendComp, alpha, null, false); } } if (comp instanceof JTable) { JTable table = (JTable) comp; for (int i = 0; i < table.getRowCount(); i++) { for (int j = 0; j < table.getColumnCount(); j++) { Component rendComp = table.getCellRenderer(i, j) .getTableCellRendererComponent(table, table.getValueAt(i, j), table.isCellSelected(i, j), false, i, j); setAlpha(rendComp, alpha, null, false); } } } if (comp instanceof Container) { Container cont = (Container) comp; for (int i = 0; i < cont.getComponentCount(); i++) setAlpha(cont.getComponent(i), alpha, null, false); } } protected static void clearAlpha(Component comp, boolean main) { // if (main) { // System.out.println(comp.getClass().getName() + "[@" // + comp.hashCode() + "] " + " --> " + alpha); // } if (comp instanceof JComponent) { JComponent jcomp = (JComponent) comp; jcomp.putClientProperty(OWN_ALPHA, null); if (!main) { // Here we are on a child component of a parent that finished // its fading. If the child component itself is in fading // animation, we do not reset its alpha. // Because of this we simply return, not going to the children // of the current component (which will be / already were // traversed in the fade loop of the current component. if (FadeTracker.getInstance().isTracked(jcomp, COMPONENT_FADE)) { return; } } jcomp.putClientProperty(ALPHA, null); } if (comp instanceof JList) { JList list = (JList) comp; for (int i = 0; i < list.getModel().getSize(); i++) { Component rendComp = list.getCellRenderer() .getListCellRendererComponent(list, list.getModel().getElementAt(i), i, list.isSelectedIndex(i), false); clearAlpha(rendComp, false); } } if (comp instanceof JTree) { JTree tree = (JTree) comp; for (int row = 0; row < tree.getRowCount(); row++) { TreePath path = tree.getPathForRow(row); boolean isLeaf = tree.getModel().isLeaf( path.getLastPathComponent()); Component rendComp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, path.getLastPathComponent(), tree.isRowSelected(row), tree.isExpanded(row), isLeaf, row, false); clearAlpha(rendComp, false); } } if (comp instanceof JTable) { JTable table = (JTable) comp; for (int i = 0; i < table.getRowCount(); i++) { for (int j = 0; j < table.getColumnCount(); j++) { Component rendComp = table.getCellRenderer(i, j) .getTableCellRendererComponent(table, table.getValueAt(i, j), table.isCellSelected(i, j), false, i, j); clearAlpha(rendComp, false); } } } if (comp instanceof Container) { Container cont = (Container) comp; for (int i = 0; i < cont.getComponentCount(); i++) clearAlpha(cont.getComponent(i), false); } } private synchronized void requestLayout() { this.hasPendingLayoutRequests = true; } private synchronized void layoutFinished() { this.hasPendingLayoutRequests = false; if (this.getPendingAnimationCount() == 0) { fireEvent(null, TransitionLayoutEvent.TRANSITION_ENDED); } } private synchronized boolean hasPendingLayoutRequests() { return this.hasPendingLayoutRequests; } private synchronized int getPendingAnimationCount() { return this.pendingAnimationCount; } private synchronized void animationStarted() { this.pendingAnimationCount++; } private synchronized void animationEnded() { this.pendingAnimationCount--; if (this.pendingAnimationCount == 0) { if (this.hasPendingLayoutRequests()) { SwingUtilities.invokeLater(new Runnable() { public void run() { layoutContainer(container); layoutFinished(); container.repaint(); // container.repaint(); } }); } else { fireEvent(null, TransitionLayoutEvent.TRANSITION_ENDED); } } } public LayoutManager getDelegate() { return delegate; } void installBorders(Component comp) { if (comp instanceof JComponent) { JComponent jcomp = ((JComponent) comp); Border border = jcomp.getBorder(); if (border != null) { if (!(border instanceof TransitionBorder)) { // System.out.println("Setting TB on " // + jcomp.getClass().getSimpleName() + "[" // + jcomp.hashCode() + "] with " // + border.getClass().getName()); if (border instanceof UIResource) jcomp.setBorder(new TransitionBorder.BorderUIResource( border)); else jcomp.setBorder(new TransitionBorder(border)); } } } if (comp instanceof Container) { Container cont = (Container) comp; for (int i = 0; i < cont.getComponentCount(); i++) { installBorders(cont.getComponent(i)); } } } void uninstallBorders(Component comp) { if (comp instanceof JComponent) { JComponent jcomp = ((JComponent) comp); Border border = jcomp.getBorder(); if (border instanceof TransitionBorder) { jcomp.setBorder(((TransitionBorder) border).getDelegate()); // System.out.println("Restored on " // + jcomp.getClass().getSimpleName() + "[" // + jcomp.hashCode() + "] " // + jcomp.getBorder().getClass().getName()); } } if (comp instanceof Container) { Container cont = (Container) comp; for (int i = 0; i < cont.getComponentCount(); i++) { uninstallBorders(cont.getComponent(i)); } } } /** * Returns the composite to use for painting the specified component. The * result should be set on the {@link Graphics2D} before any custom * rendering is done. This method can be used by application painting code * and by look-and-feel delegates. * * @param c * Component. * @param translucency * The translucency of the original painting (when the component * is not under any transition fade effect). * @param g * The original graphics context. * @return The composite to use for painting the specified component. */ public static Composite getAlphaComposite(Component c, float translucency, Graphics g) { float xFactor = 1.0f; if (g instanceof Graphics2D) { Graphics2D g2d = (Graphics2D) g; Composite existingComposite = g2d.getComposite(); if (existingComposite instanceof AlphaComposite) { AlphaComposite ac = (AlphaComposite) existingComposite; if (ac.getRule() == AlphaComposite.SRC_OVER) xFactor = ac.getAlpha(); } } float finalAlpha = translucency * xFactor; if (c instanceof JComponent) { Object alphaObj = ((JComponent) c) .getClientProperty(TransitionLayout.ALPHA); float transitionAlpha = 1.0f; if (alphaObj != null) { transitionAlpha = ((Float) alphaObj).floatValue(); } finalAlpha *= transitionAlpha; } if (finalAlpha == 1.0f) return AlphaComposite.SrcOver; return AlphaComposite.SrcOver.derive(finalAlpha); } public static Composite getAlphaComposite(Component c, float translucency) { return getAlphaComposite(c, translucency, null); } /** * Returns the composite to use for painting the specified component. The * result should be set on the {@link Graphics2D} before any custom * rendering is done. This method can be used by application painting code * and by look-and-feel delegates. * * @param c * Component. * @return The composite to use for painting the specified component. */ public static Composite getAlphaComposite(Component c, Graphics g) { return getAlphaComposite(c, 1.0f, g); } /** * Returns the composite to use for painting the specified component. The * result should be set on the {@link Graphics2D} before any custom * rendering is done. This method can be used by application painting code * and by look-and-feel delegates. * * @param c * Component. * @return The composite to use for painting the specified component. */ public static Composite getAlphaComposite(Component c) { return getAlphaComposite(c, 1.0f, null); } /** * Returns indication whether the specified component is opaque. This method * can be used by look-and-feel delegates to decide whether the component * background should be filled. Use in conjunction with * {@link #getAlphaComposite(Component)} or * {@link #getAlphaComposite(Component, float)} to correctly fill the * component background during the transition fade animations. Note that * during the transition fades, the components are marked as non-opaque so * that Swing will handle them correctly. This means that calling * {@link Component#isOpaque()} will return false, incorrectly * signifying to the painting code that the background fill should be * omitted. * * @param c * Component. * @return true if the specified component is opaque, * false otherwise. */ public static boolean isOpaque(Component c) { if (c.isOpaque()) return true; if (c instanceof JComponent) { return Boolean.TRUE.equals(((JComponent) c) .getClientProperty(ORIGINAL_OPACITY)); } return false; } void setDoImmediateRepaint(boolean doImmediateRepaint) { this.doImmediateRepaint = doImmediateRepaint; } protected void repaint(Component comp) { if (this.doImmediateRepaint && (comp instanceof JComponent)) { final JComponent jc = (JComponent) comp; SwingUtilities.invokeLater(new Runnable() { public void run() { jc.paintImmediately(0, 0, jc.getWidth(), jc.getHeight()); } }); return; } comp.repaint(); } /** * Returns the composite alpha for the specified component. The same * component can participate in several transitions - a button may be being * hidden while the panel that contains the button is being hidden (switched * out to another tab in a tabbed pane). In this case, the resulting alpha * for the button is multiplication of the alpha of the button fade and the * alpha of the panel fade. This method returns the multiplication of all * the alpha fades of the specified component and its ancestors. * * @param c * Component. * @return Composite alpha for the specified component - the multiplication * of all the alpha fades of the specified component and its * ancestors */ protected float getCompositeAlpha(Component c) { float result = 1.0f; while (c != null) { if (c instanceof JComponent) { Object alphaObj = ((JComponent) c) .getClientProperty(TransitionLayout.OWN_ALPHA); float transitionAlpha = 1.0f; if (alphaObj != null) { transitionAlpha = ((Float) alphaObj).floatValue(); } result *= transitionAlpha; } c = c.getParent(); } return result; } public synchronized boolean isAnimating() { return (this.getPendingAnimationCount() > 0); } public synchronized void addTransitionLayoutListener( TransitionLayoutListener listener) { this.eventListeners.add(listener); } public synchronized void removeTransitionLayoutListener( TransitionLayoutListener listener) { this.eventListeners.remove(listener); } protected void fireEvent(Component child, int id) { TransitionLayoutEvent event = new TransitionLayoutEvent(this.container, child, id); for (Iterator it = this.eventListeners.iterator(); it.hasNext();) { TransitionLayoutListener listener = (TransitionLayoutListener) it .next(); listener.onTransitionLayoutEvent(event); } } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/layout/TransitionLayoutEvent.java0000644000175000017500000000447611137001462031036 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.layout; import java.awt.AWTEvent; import java.awt.Component; public class TransitionLayoutEvent extends AWTEvent { public static final int TRANSITION_STARTED = 100; public static final int TRANSITION_ENDED = 101; public static final int CHILD_FADING_OUT = 102; public static final int CHILD_FADING_IN = 103; public static final int CHILD_MOVING = 104; private Component child; public TransitionLayoutEvent(Component source, Component child, int id) { super(source, id); this.child = child; } public Component getChild() { return this.child; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/layout/TransitionBorder.java0000644000175000017500000001116311137001462027763 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.layout; import java.awt.*; import java.beans.PropertyChangeEvent; import javax.swing.border.Border; import javax.swing.plaf.UIResource; /** * {@link Border} implementation that respects the transition composite effects * set by the {@link TransitionLayout}. All {@link Border}s installed on the * component hierarchy are wrapped in instances of this class once the * {@link TransitionLayout} is installed on that component (with * {@link TransitionLayoutManager#track(Container, boolean)} or * {@link TransitionLayoutManager#track(Container, boolean, boolean)}. * *

* Note that installing the {@link TransitionLayout} on a component may break * applications that operate directly on the installed borders, resulting in * {@link ClassCastException} or incorrect logic being called. The relevant code * needs to be changed using the {@link #getDelegate()}. In addition, the * applications will get {@link PropertyChangeEvent}s when these borders are * set / unset. *

* * @author Kirill Grouchnikov */ public class TransitionBorder implements Border { /** * The delegate (original) border. Handles all the {@link Border} methods, * including {@link #paintBorder(Component, Graphics, int, int, int, int)} * that operates on a {@link Graphics2D} object with * {@link TransitionLayout}-relevant {@link Composite}. */ protected Border delegate; /** * Creates a new wrapper border. * * @param original * The original border. */ public TransitionBorder(Border original) { this.delegate = original; } /* * (non-Javadoc) * * @see javax.swing.border.Border#getBorderInsets(java.awt.Component) */ public Insets getBorderInsets(Component c) { return this.delegate.getBorderInsets(c); } /* * (non-Javadoc) * * @see javax.swing.border.Border#isBorderOpaque() */ public boolean isBorderOpaque() { return this.delegate.isBorderOpaque(); } /* * (non-Javadoc) * * @see javax.swing.border.Border#paintBorder(java.awt.Component, * java.awt.Graphics, int, int, int, int) */ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D graphics = (Graphics2D) g.create(); graphics.setComposite(TransitionLayout.getAlphaComposite(c)); this.delegate.paintBorder(c, graphics, x, y, width, height); graphics.dispose(); } /** * Returns the original (delegate) border. * * @return The original (delegate) border. */ public Border getDelegate() { return delegate; } /** * Wrapper border that implements the {@link UIResource} interface. * * @author Kirill Grouchnikov */ public static class BorderUIResource extends TransitionBorder implements UIResource { /** * Creates a new wrapper border. * * @param original * The original border. */ public BorderUIResource(Border original) { super(original); } } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/layout/TransitionLayoutManager.java0000644000175000017500000001374211137001462031323 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.layout; import java.awt.Container; import java.awt.LayoutManager; import org.jvnet.lafwidget.animation.FadeConfigurationManager; /** * Transition layout manager. Contains method for installing / uninstalling * transition layout effects on containers. Application code should use the * methods in this class instead of using the {@link TransitionLayout} class * directly. * * @author Kirill Grouchnikov. */ public class TransitionLayoutManager { /** * Singleton manager. */ private static TransitionLayoutManager instance; private TransitionLayoutManager() { // FadeConfigurationManager configManager = FadeConfigurationManager // .getInstance(); // configManager.allowFades(TransitionLayout.COMPONENT_BOUNDS); // configManager.allowFades(TransitionLayout.COMPONENT_FADE); } /** * Returns the manager instance. * * @return Manager instance. */ public synchronized static TransitionLayoutManager getInstance() { if (instance == null) instance = new TransitionLayoutManager(); return instance; } /** * Starts tracking the specified container adding the transition layout * effects. This method can be called on a container that already has * transition layout effects installed - in this case the call will have no * effect (preserving the transition layout effects). * * @param container * Container for transition layout effects. * @param hasFades * Indication whether the fade effects should be applied. Use * true only for look-and-feels that honour the * {@link TransitionLayout#ALPHA} client property (directly, via * calls to * {@link TransitionLayout#getAlphaComposite(java.awt.Component)} / * {@link TransitionLayout#getAlphaComposite(java.awt.Component, float)} * or with the bytecode augmentation. */ public void track(Container container, boolean hasFades) { this.track(container, hasFades, false); } /** * Starts tracking the specified container adding the transition layout * effects. Note that providing true for the * doImmediateRepaint parameter will result in very * CPU-intensive code - this is not recommended for now. This method can be * called on a container that already has transition layout effects * installed - in this case the call will have no effect (preserving the * transition layout effects). * * @param container * Container for transition layout effects. * @param hasFades * Indication whether the fade effects should be applied. Use * true only for look-and-feels that honour the * {@link TransitionLayout#ALPHA} client property (directly, via * calls to * {@link TransitionLayout#getAlphaComposite(java.awt.Component)} / * {@link TransitionLayout#getAlphaComposite(java.awt.Component, float)} * or with the bytecode augmentation. * @param doImmediateRepaint * If true, every transition step will result in * repainting the relevant component. Recommended value is * false for better performance. */ public void track(Container container, boolean hasFades, boolean doImmediateRepaint) { LayoutManager currLayout = container.getLayout(); if (currLayout instanceof TransitionLayout) return; TransitionLayout layout = new TransitionLayout(container, container .getLayout(), hasFades); layout.setDoImmediateRepaint(doImmediateRepaint); container.setLayout(layout); } /** * Removes the transition layout effects from the specified container. The * layout manager is reset to the original layout manager. This method can * be called on a container that hadn't been tracked with * {@link #track(Container, boolean)} or * {@link #track(Container, boolean, boolean)}. * * @param container * Container. */ public void untrack(Container container) { LayoutManager layout = container.getLayout(); if (layout instanceof TransitionLayout) { TransitionLayout tLayout = (TransitionLayout) layout; tLayout.uninstallBorders(container); container.setLayout(tLayout.getDelegate()); } } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/layout/TransitionLayoutListener.java0000644000175000017500000000353411137001462031534 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.layout; import java.util.EventListener; public interface TransitionLayoutListener extends EventListener { public void onTransitionLayoutEvent(TransitionLayoutEvent e); } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/combo/0000755000175000017500000000000011253454712023421 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/JiBX.license0000644000175000017500000000275110430131412024450 0ustar drazzibdrazzibCopyright (c) 2003-2005, Dennis M. Sosnoski All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of JiBX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/text/0000755000175000017500000000000011253454706023311 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/text/PasswordStrengthChecker.java0000644000175000017500000000474611137001464030763 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.text; import org.jvnet.lafwidget.utils.LafConstants.PasswordStrength; /** * Specifies the interface for the password strength checkers. * * @author Kirill Grouchnikov */ public interface PasswordStrengthChecker { /** * Computes the strength of the specified password. * * @param password * Password. * @return Password strength. */ public PasswordStrength getStrength(char[] password); /** * Returns the description of the password strength. The returned value can * contain HTML constructs and will be used as popup text on the * strength-check enabled password fields. * * @param strength * Password strength. * @return The description of the specified password strength. */ public String getDescription(PasswordStrength strength); } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/text/LockBorder.java0000644000175000017500000001155511137001464026177 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.text; import java.awt.*; import javax.swing.Icon; import javax.swing.JViewport; import javax.swing.border.Border; import javax.swing.border.EmptyBorder; import javax.swing.plaf.UIResource; import org.jvnet.lafwidget.*; /** * Border with "lock" indication. * * @author Kirill Grouchnikov */ public class LockBorder implements Border, UIResource { /** * The original (decorated) border. */ private Border originalBorder; /** * Constructs a new lock border. * * @param originalBorder * The original border. */ public LockBorder(Border originalBorder) { if (originalBorder != null) this.originalBorder = originalBorder; else this.originalBorder = new EmptyBorder(0, 0, 0, 0); } /* * (non-Javadoc) * * @see javax.swing.border.Border#getBorderInsets(java.awt.Component) */ public Insets getBorderInsets(Component c) { LafWidgetSupport lafSupport = LafWidgetRepository.getRepository() .getLafSupport(); Icon lockIcon = lafSupport.getLockIcon(); if (lockIcon == null) lockIcon = LafWidgetUtilities.getSmallLockIcon(); Insets origInsets = this.originalBorder.getBorderInsets(c); if (c.getComponentOrientation().isLeftToRight()) { return new Insets(origInsets.top, Math.max(origInsets.left, lockIcon.getIconWidth() + 2), origInsets.bottom, origInsets.right); } else { // support for RTL return new Insets(origInsets.top, origInsets.left, origInsets.bottom, Math.max(origInsets.right, lockIcon .getIconWidth() + 2)); } } /* * (non-Javadoc) * * @see javax.swing.border.Border#isBorderOpaque() */ public boolean isBorderOpaque() { return this.originalBorder.isBorderOpaque(); } /* * (non-Javadoc) * * @see javax.swing.border.Border#paintBorder(java.awt.Component, * java.awt.Graphics, int, int, int, int) */ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { this.originalBorder.paintBorder(c, g, x, y, width, height); LafWidgetSupport lafSupport = LafWidgetRepository.getRepository() .getLafSupport(); Icon lockIcon = lafSupport.getLockIcon(); if (lockIcon == null) lockIcon = LafWidgetUtilities.getSmallLockIcon(); int offsetY = 0; if (c.getParent() instanceof JViewport) { // enhancement 9 - show the lock icon of components // in JScrollPane so that it is visible in the bottom // corner of the scroll pane JViewport viewport = (JViewport) c.getParent(); // have to set to simple scroll mode since the default (blit) // results in visual artifacts due to optimized buffer-copy // painting. if (viewport.getScrollMode() != JViewport.SIMPLE_SCROLL_MODE) { viewport.setScrollMode(JViewport.SIMPLE_SCROLL_MODE); } Rectangle viewRect = viewport.getViewRect(); offsetY = c.getHeight() - viewRect.y - viewRect.height; } if (c.getComponentOrientation().isLeftToRight()) { lockIcon.paintIcon(c, g, x, y + height - lockIcon.getIconHeight() - offsetY); } else { // support for RTL lockIcon.paintIcon(c, g, x + width - lockIcon.getIconWidth(), y + height - lockIcon.getIconHeight() - offsetY); } } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/text/PasswordStrengthCheckerWidget.java0000644000175000017500000001462311137001464032122 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.text; import java.awt.*; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import javax.swing.JPasswordField; import javax.swing.UIManager; import javax.swing.border.Border; import javax.swing.plaf.BorderUIResource; import org.jvnet.lafwidget.*; import org.jvnet.lafwidget.utils.LafConstants.PasswordStrength; /** * Adds password strength indication on password fields. * * @author Kirill Grouchnikov */ public class PasswordStrengthCheckerWidget extends LafWidgetAdapter { /** * Listens on changes to {@link LafWidget#PASSWORD_STRENGTH_CHECKER} * property. */ protected PropertyChangeListener strengthCheckerListener; /** * Border with password strength indication. * * @author Kirill Grouchnikov */ private static class StrengthCheckedBorder implements Border { /** * Gutter width. */ public static final int GUTTER_WIDTH = 5; /* * (non-Javadoc) * * @see javax.swing.border.Border#isBorderOpaque() */ public boolean isBorderOpaque() { return true; } /* * (non-Javadoc) * * @see javax.swing.border.Border#getBorderInsets(java.awt.Component) */ public Insets getBorderInsets(Component c) { JPasswordField jpf = (JPasswordField) c; if (LafWidgetUtilities2.getPasswordStrengthChecker(jpf) == null) { return new Insets(0, 0, 0, 0); } else { if (c.getComponentOrientation().isLeftToRight()) return new Insets(0, 0, 0, StrengthCheckedBorder.GUTTER_WIDTH); else return new Insets(0, StrengthCheckedBorder.GUTTER_WIDTH, 0, 0); } } /* * (non-Javadoc) * * @see javax.swing.border.Border#paintBorder(java.awt.Component, * java.awt.Graphics, int, int, int, int) */ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { JPasswordField jpf = (JPasswordField) c; PasswordStrengthChecker passwordStrengthChecker = LafWidgetUtilities2 .getPasswordStrengthChecker(jpf); if (passwordStrengthChecker == null) return; PasswordStrength strength = passwordStrengthChecker.getStrength(jpf .getPassword()); LafWidgetSupport lafSupport = LafWidgetRepository.getRepository() .getLafSupport(); if (c.getComponentOrientation().isLeftToRight()) lafSupport.paintPasswordStrengthMarker(g, x + width - StrengthCheckedBorder.GUTTER_WIDTH, y, StrengthCheckedBorder.GUTTER_WIDTH, height, strength); else lafSupport.paintPasswordStrengthMarker(g, x, y, StrengthCheckedBorder.GUTTER_WIDTH, height, strength); String tooltip = passwordStrengthChecker.getDescription(strength); jpf.setToolTipText(tooltip); } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installListeners() */ @Override public void installListeners() { this.strengthCheckerListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (LafWidget.PASSWORD_STRENGTH_CHECKER.equals(evt .getPropertyName())) { Object newValue = evt.getNewValue(); Object oldValue = evt.getOldValue(); if ((newValue != null) && (newValue instanceof PasswordStrengthChecker) && (!(oldValue instanceof PasswordStrengthChecker))) { jcomp .setBorder(new BorderUIResource.CompoundBorderUIResource( jcomp.getBorder(), new StrengthCheckedBorder())); } else { // restore core border Border coreBorder = UIManager .getBorder("PasswordField.border"); jcomp.setBorder(coreBorder); jcomp.setToolTipText(null); } } } }; this.jcomp.addPropertyChangeListener(this.strengthCheckerListener); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { this.jcomp.removePropertyChangeListener(this.strengthCheckerListener); this.strengthCheckerListener = null; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installDefaults() */ @Override public void installDefaults() { super.installDefaults(); // check if the property is already set - can happen on LAF change Object checker = this.jcomp .getClientProperty(LafWidget.PASSWORD_STRENGTH_CHECKER); if ((checker != null) && (checker instanceof PasswordStrengthChecker)) { this.jcomp.setBorder(new BorderUIResource.CompoundBorderUIResource( this.jcomp.getBorder(), new StrengthCheckedBorder())); } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/text/SelectOnEscapeWidget.java0000644000175000017500000001163311225601724030152 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.text; import java.awt.event.*; import javax.swing.*; import javax.swing.text.JTextComponent; import org.jvnet.lafwidget.LafWidgetAdapter; import org.jvnet.lafwidget.LafWidgetUtilities; /** * Adds "select / deselect on Escape key press" behaviour on text components. * * @author Kirill Grouchnikov * @since 2.1 */ public class SelectOnEscapeWidget extends LafWidgetAdapter { /** * The Escape key listener. */ protected KeyListener keyListener; /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } @Override public void installUI() { super.installUI(); InputMap currMap = SwingUtilities.getUIInputMap(this.jcomp, JComponent.WHEN_FOCUSED); InputMap newMap = new InputMap(); if (currMap != null) { KeyStroke[] kss = currMap.allKeys(); for (int i = 0; i < kss.length; i++) { KeyStroke stroke = kss[i]; Object val = currMap.get(stroke); newMap.put(stroke, val); } } newMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "flipTextSelection"); this.jcomp.getActionMap().put("flipTextSelection", new AbstractAction() { public void actionPerformed(ActionEvent e) { if (LafWidgetUtilities .hasTextFlipSelectOnEscapeProperty(jcomp)) { SwingUtilities.invokeLater(new Runnable() { public void run() { int selectionLength = jcomp .getSelectionEnd() - jcomp.getSelectionStart(); if (selectionLength == 0) { jcomp.selectAll(); } else { int lastPos = jcomp.getSelectionEnd(); jcomp.setSelectionStart(0); jcomp.setSelectionEnd(0); jcomp.setCaretPosition(lastPos); } } }); } } }); SwingUtilities.replaceUIInputMap(this.jcomp, JComponent.WHEN_FOCUSED, newMap); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installListeners() */ @Override public void installListeners() { this.keyListener = new KeyAdapter() { @Override public void keyTyped(final KeyEvent e) { if (LafWidgetUtilities.hasTextFlipSelectOnEscapeProperty(jcomp) && (e.getKeyChar() == KeyEvent.VK_ESCAPE)) { SwingUtilities.invokeLater(new Runnable() { public void run() { int selectionLength = jcomp.getSelectionEnd() - jcomp.getSelectionStart(); if (selectionLength == 0) { jcomp.selectAll(); } else { int lastPos = jcomp.getSelectionEnd(); jcomp.setSelectionStart(0); jcomp.setSelectionEnd(0); jcomp.setCaretPosition(lastPos); } // dispatch to parent - especially useful // for text components in dialogs that should // be closed on pressing ESC. jcomp.getParent().dispatchEvent(e); } }); } } }; // this.jcomp.addKeyListener(this.keyListener); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { this.keyListener = null; this.jcomp.removeKeyListener(this.keyListener); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/text/edit-select-all.png0000644000175000017500000000067110474175762027001 0ustar drazzibdrazzibPNG  IHDRasBIT|dtEXtSoftwarewww.inkscape.org<KIDAT8=N@X  .   @I.A ډ)wQ52ͬ3߼7 I<> FZKlo hi1ZkjRY12i4MX,0p/ DdqvXD"$IJžc:KVi" wxS8*9Q18m6*N7qRlFId2ٰEkWZh%{x.>+ml6[0."A%AP[dQQUl$Z-<@!`fqF2t IENDB`liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/text/LockBorderWidget.java0000644000175000017500000001416411137001464027342 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.text; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import javax.swing.SwingUtilities; import javax.swing.border.Border; import org.jvnet.lafwidget.*; /** * Adds visual indication on non-editable text components. * * @author Kirill Grouchnikov */ public class LockBorderWidget extends LafWidgetAdapter { /** * Listens on all properties to decide whether a lock border should be shown / * hidden. */ protected PropertyChangeListener propertyChangeListener; /** * true if this widget is uninstalling. Fix for defect 7. */ protected boolean isUninstalling = false; /** * Name for client property that stores the original border. */ public static String ORIGINAL_BORDER = "lafwidget.internal.originalBorder"; /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installListeners() */ @Override public void installListeners() { this.propertyChangeListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { // fix for defect 5 - infinite event chain. if ("border".equals(evt.getPropertyName())) return; if (LockBorderWidget.ORIGINAL_BORDER.equals(evt .getPropertyName())) return; SwingUtilities.invokeLater(new Runnable() { public void run() { // fix for defect 7 - not removing lock border // on LAF switch if (isUninstalling) return; LafWidgetSupport lafSupport = LafWidgetRepository .getRepository().getLafSupport(); boolean hasLockIcon = lafSupport.hasLockIcon(jcomp); if (hasLockIcon) { installLockBorder(); } else { restoreOriginalBorder(); } } }); } }; this.jcomp.addPropertyChangeListener(this.propertyChangeListener); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { this.jcomp.removePropertyChangeListener(this.propertyChangeListener); this.propertyChangeListener = null; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallUI() */ @Override public void uninstallUI() { // fix for issue 7 - restoring original border on LAF switch. this.isUninstalling = true; Border original = (Border) this.jcomp .getClientProperty(LockBorderWidget.ORIGINAL_BORDER); if (original != null) { this.jcomp.setBorder(original); } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installDefaults() */ @Override public void installDefaults() { super.installDefaults(); LafWidgetSupport lafSupport = LafWidgetRepository.getRepository() .getLafSupport(); boolean hasLockIcon = lafSupport.hasLockIcon(this.jcomp); if (hasLockIcon) { Border currBorder = this.jcomp.getBorder(); this.jcomp.putClientProperty(LockBorderWidget.ORIGINAL_BORDER, currBorder); this.jcomp.setBorder(new LockBorder(currBorder)); } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallDefaults() */ @Override public void uninstallDefaults() { // fix for issue 7 - restoring original border on LAF switch. this.isUninstalling = true; this.jcomp.putClientProperty(LockBorderWidget.ORIGINAL_BORDER, null); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } /** * Installs the lock border on the associated component. */ private void installLockBorder() { if (jcomp.getClientProperty(LockBorderWidget.ORIGINAL_BORDER) instanceof Border) { // already installed return; } // need to install Border currBorder = jcomp.getBorder(); if (currBorder != null) { jcomp.putClientProperty(LockBorderWidget.ORIGINAL_BORDER, currBorder); jcomp.setBorder(new LockBorder(currBorder)); } } /** * Restores the original border on the associated component. */ private void restoreOriginalBorder() { if (jcomp.getClientProperty(LockBorderWidget.ORIGINAL_BORDER) instanceof Border) { // revert to original Border originalBorder = (Border) jcomp .getClientProperty(LockBorderWidget.ORIGINAL_BORDER); jcomp.setBorder(originalBorder); jcomp.putClientProperty(LockBorderWidget.ORIGINAL_BORDER, null); } else { // already uninstalled } } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/text/edit-delete.png0000644000175000017500000000125010474175750026205 0ustar drazzibdrazzibPNG  IHDRabKGD!~ pHYs  tIME HtEXtCommentid logowIDAT8˥OqƟw-Z* nnP(8ijMM`RB4F7'u11d08rWzwrCQ|y>| ;YqڍLhs(lEat 岵M$A.f$IBy@f.Ql64EQ ("INyΊт h4`j"úDnKL!Vg"gc8LYd :~E @`P Z_4wqR\}T.)S{&Ъ MiZ7+˲QyGk~C^]7!Ztpi8#Hy~$6 #F ('t)mG^(,+"}߱o_}d$I{= XvT,>L q3s_^y)nr:]ͬ8 +Ϟ:өٶQKKEǏ$d"ݧ( ^zCQtJ { /** * The focus listener. */ protected FocusListener focusListener; /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installListeners() */ @Override public void installListeners() { this.focusListener = new FocusAdapter() { @Override public void focusGained(FocusEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { if (LafWidgetUtilities .hasTextFocusSelectAllProperty(jcomp) && jcomp.isEditable()) jcomp.selectAll(); } }); } }; this.jcomp.addFocusListener(this.focusListener); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { this.jcomp.removeFocusListener(this.focusListener); this.focusListener = null; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/text/edit-copy.png0000644000175000017500000000076210474175742025725 0ustar drazzibdrazzibPNG  IHDRabKGDC pHYs  tIME /4IDAT8˕KKQ#3cڀ ZuBEvDDD616e007itFGoy;$3,F(Ͻmwa(z&vj5BЄ'sj^wcfnyu$IBTGE@QNV9TlGr(( ,˞H$?dYv pPRšz-,EA08vaSiJ%K дc,61Ӷ(XY^ePT䮳6֣yyrl;KUUn(zi.y}*($bBYIENDB`liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/text/edit-paste.png0000644000175000017500000000106110474175756026065 0ustar drazzibdrazzibPNG  IHDRa pHYs  tIME IDAT8˕kSQ4$1Ԕ "\\jbpv!8EmA84K.8)RHB^olF91/m ~=?T*{ϝ~I\.konΚ+*+v< |`_)h/Y2g .9.Ҵ0f LD9̤γ׫VTS yf,y_ϲxAPTB"Jqm.f!1 ނD"03sl08[y=j(߼ )>\qKa{UEEȝ<9DAU21 (mnh>A_4!5纀VҨ)onP^CDz\Z14I3XpcZ7l/D#팦$1fSU;`\13TKOxiIENDB`liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/text/EditContextMenuWidget.java0000644000175000017500000002045411137001464030372 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.text; import java.awt.Point; import java.awt.Toolkit; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.event.*; import javax.swing.*; import javax.swing.text.JTextComponent; import org.jvnet.lafwidget.LafWidgetAdapter; import org.jvnet.lafwidget.LafWidgetUtilities; /** * Adds edit context menu on text components. * * @author Kirill Grouchnikov */ public class EditContextMenuWidget extends LafWidgetAdapter { /** * Mouse listener for showing the edit context menu. */ protected MouseListener menuMouseListener; /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installListeners() */ @Override public void installListeners() { this.menuMouseListener = new MouseAdapter() { // fix for issue 8 - use mousePressed instead of // mouseClicked so that it will be triggered on Linux. @Override public void mousePressed(MouseEvent e) { this.handleMouseEvent(e); } @Override public void mouseReleased(MouseEvent e) { this.handleMouseEvent(e); } private void handleMouseEvent(MouseEvent e) { if (!LafWidgetUtilities.hasTextEditContextMenu(jcomp)) return; if (!e.isPopupTrigger()) return; // request focus jcomp.requestFocus(true); JPopupMenu editMenu = new JPopupMenu(); editMenu.add(new CutAction()); editMenu.add(new CopyAction()); editMenu.add(new PasteAction()); editMenu.addSeparator(); editMenu.add(new DeleteAction()); editMenu.add(new SelectAllAction()); Point pt = SwingUtilities.convertPoint(e.getComponent(), e .getPoint(), jcomp); editMenu.show(jcomp, pt.x, pt.y); } }; jcomp.addMouseListener(this.menuMouseListener); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { jcomp.removeMouseListener(this.menuMouseListener); this.menuMouseListener = null; } /** * Paste action. * * @author Kirill Grouchnikov */ private class PasteAction extends AbstractAction { /** * Creates new Paste action. */ public PasteAction() { super(LafWidgetUtilities.getResourceBundle(jcomp).getString( "EditMenu.paste"), new ImageIcon( EditContextMenuWidget.class.getClassLoader().getResource( "org/jvnet/lafwidget/text/edit-paste.png"))); } /* * (non-Javadoc) * * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent e) { jcomp.paste(); } /* * (non-Javadoc) * * @see javax.swing.AbstractAction#isEnabled() */ @Override public boolean isEnabled() { if (jcomp.isEditable() && jcomp.isEnabled()) { Transferable contents = Toolkit.getDefaultToolkit() .getSystemClipboard().getContents(this); return contents.isDataFlavorSupported(DataFlavor.stringFlavor); } else return false; } } /** * Select All action. * * @author Kirill Grouchnikov */ private class SelectAllAction extends AbstractAction { /** * Creates new Select All action. */ public SelectAllAction() { super(LafWidgetUtilities.getResourceBundle(jcomp).getString( "EditMenu.selectAll"), new ImageIcon( EditContextMenuWidget.class.getClassLoader().getResource( "org/jvnet/lafwidget/text/edit-select-all.png"))); } /* * (non-Javadoc) * * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent e) { jcomp.selectAll(); } /* * (non-Javadoc) * * @see javax.swing.AbstractAction#isEnabled() */ @Override public boolean isEnabled() { return jcomp.isEnabled() && (jcomp.getText().length() > 0); } } /** * Delete action. * * @author Kirill Grouchnikov */ private class DeleteAction extends AbstractAction { /** * Creates new Delete action. */ public DeleteAction() { super(LafWidgetUtilities.getResourceBundle(jcomp).getString( "EditMenu.delete"), new ImageIcon( EditContextMenuWidget.class.getClassLoader().getResource( "org/jvnet/lafwidget/text/edit-delete.png"))); } /* * (non-Javadoc) * * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent e) { jcomp.replaceSelection(null); } /* * (non-Javadoc) * * @see javax.swing.AbstractAction#isEnabled() */ @Override public boolean isEnabled() { return jcomp.isEditable() && jcomp.isEnabled() && (jcomp.getSelectedText() != null); } } /** * Cut action. * * @author Kirill Grouchnikov */ private class CutAction extends AbstractAction { /** * Creates new Cut action. */ public CutAction() { super(LafWidgetUtilities.getResourceBundle(jcomp).getString( "EditMenu.cut"), new ImageIcon(EditContextMenuWidget.class .getClassLoader().getResource( "org/jvnet/lafwidget/text/edit-cut.png"))); } /* * (non-Javadoc) * * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent e) { jcomp.cut(); } /* * (non-Javadoc) * * @see javax.swing.AbstractAction#isEnabled() */ @Override public boolean isEnabled() { return jcomp.isEditable() && jcomp.isEnabled() && (jcomp.getSelectedText() != null); } } /** * Copy action. * * @author Kirill Grouchnikov */ private class CopyAction extends AbstractAction { /** * Creates new Copy action. */ public CopyAction() { super(LafWidgetUtilities.getResourceBundle(jcomp).getString( "EditMenu.copy"), new ImageIcon(EditContextMenuWidget.class .getClassLoader().getResource( "org/jvnet/lafwidget/text/edit-copy.png"))); } /* * (non-Javadoc) * * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent e) { jcomp.copy(); } /* * (non-Javadoc) * * @see javax.swing.AbstractAction#isEnabled() */ @Override public boolean isEnabled() { return jcomp.isEnabled() && (jcomp.getSelectedText() != null); } } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/text/edit-cut.png0000644000175000017500000000144710474175746025553 0ustar drazzibdrazzibPNG  IHDRabKGDC pHYs  tIME 1hAd^IDAT8˅]HQǟsw}lhxUtaIWEd"hiXi}J$ 0m36c6uu_vMaZ? <}rG$d F`Jiym7TDb$[ccjava.version System Property.

* * Defaults to null if the runtime does not have security * access to read this property or the property does not exist. */ private static final String JAVA_VERSION = getSystemProperty("java.version"); /** * The os.name System Property. Operating system name.

* * Defaults to null if the runtime does not have security * access to read this property or the property does not exist. */ private static final String OS_NAME = getSystemProperty("os.name"); /** * The os.version System Property. Operating system version.

* * Defaults to null if the runtime does not have security * access to read this property or the property does not exist. */ private static final String OS_VERSION = getSystemProperty("os.version"); // Requesting the Java Version ******************************************** /** * True if this is Java 1.4. */ public static final boolean IS_JAVA_1_4 = startsWith(JAVA_VERSION, "1.4"); /** * True if this is Java 1.4.0_*. */ public static final boolean IS_JAVA_1_4_0 = startsWith(JAVA_VERSION, "1.4.0"); /** * True if this is Java 1.4.2 or later. Since we assume Java 1.4 * we just check for 1.4.0 and 1.4.1. */ public static final boolean IS_JAVA_1_4_2_OR_LATER = !startsWith(JAVA_VERSION, "1.4.0") && !startsWith(JAVA_VERSION, "1.4.1"); /** * True if this is Java 5.x. We check for a prefix of 1.5. */ public static final boolean IS_JAVA_5 = startsWith(JAVA_VERSION, "1.5"); /** * True if this is Java 5.x or later. Since we don't support Java 1.3, * we can check that it's not 1.4. */ public static final boolean IS_JAVA_5_OR_LATER = !IS_JAVA_1_4; /** * True if this is Java 6. We check for a prefix of 1.6. */ public static final boolean IS_JAVA_6 = startsWith(JAVA_VERSION, "1.6"); /** * True if this is Java 6.x or later. Since we don't support Java 1.3, * we can check that it's neither 1.4 nor 1.5. */ public static final boolean IS_JAVA_6_OR_LATER = !IS_JAVA_1_4 && !IS_JAVA_5; /** * True if this is Java 1.4 or Java 5. */ public static final boolean IS_JAVA_1_4_OR_5 = IS_JAVA_1_4 || IS_JAVA_5; // Requesting the Operating System Name *********************************** /** * True if this is FreeBSD. */ public static final boolean IS_OS_FREEBSD = startsWithIgnoreCase(OS_NAME, "FreeBSD"); /** * True if this is Linux. */ public static final boolean IS_OS_LINUX = startsWithIgnoreCase(OS_NAME, "Linux"); /** * True if this is OS/2. */ public static final boolean IS_OS_OS2 = startsWith(OS_NAME, "OS/2"); /** * True if this is the Mac OS X. */ public static final boolean IS_OS_MAC = startsWith(OS_NAME, "Mac"); /** * True if this is Windows. */ public static final boolean IS_OS_WINDOWS = startsWith(OS_NAME, "Windows"); /** * True if this is Windows 98/ME/2000/XP/VISTA. */ public static final boolean IS_OS_WINDOWS_MODERN = startsWith(OS_NAME, "Windows") && !startsWith(OS_VERSION, "4.0"); /** * True if this is Windows 95. * * @since 2.0 */ public static final boolean IS_OS_WINDOWS_95 = startsWith(OS_NAME, "Windows 9") && startsWith(OS_VERSION, "4.0"); /** * True if this is Windows 98. * * @since 2.0 */ public static final boolean IS_OS_WINDOWS_98 = startsWith(OS_NAME, "Windows 9") && startsWith(OS_VERSION, "4.1"); /** * True if this is Windows NT. * * @since 2.0 */ public static final boolean IS_OS_WINDOWS_NT = startsWith(OS_NAME, "Windows NT"); /** * True if this is Windows ME. * * @since 2.0 */ public static final boolean IS_OS_WINDOWS_ME = startsWith(OS_NAME, "Windows") && startsWith(OS_VERSION, "4.9"); /** * True if this is Windows 2000. * * @since 2.0 */ public static final boolean IS_OS_WINDOWS_2000 = startsWith(OS_NAME, "Windows") && startsWith(OS_VERSION, "5.0"); /** * True if this is Windows XP. */ public static final boolean IS_OS_WINDOWS_XP = startsWith(OS_NAME, "Windows") && startsWith(OS_VERSION, "5.1"); /** * True if this is Windows Vista. * * @since 2.0 */ public static final boolean IS_OS_WINDOWS_VISTA = startsWith(OS_NAME, "Windows") && startsWith(OS_VERSION, "6.0"); /** * True if this is Solaris. */ public static final boolean IS_OS_SOLARIS = startsWith(OS_NAME, "Solaris"); // Other Properties ******************************************************* /** * True if the Windows XP Look&Feel is enabled. */ public static final boolean IS_LAF_WINDOWS_XP_ENABLED = isWindowsXPLafEnabled(); /** * True if if the screen resolution is smaller than 120 dpi. * * @see Toolkit#getScreenResolution() */ public static final boolean IS_LOW_RESOLUTION = isLowResolution(); private static boolean loggingEnabled = true; private LookUtils() { // Override default constructor; prevents instantiation. } // Accessing System Configuration ***************************************** /** * Tries to look up the System property for the given key. * In untrusted environments this may throw a SecurityException. * In this case we catch the exception and answer null. * * @param key the name of the system property * @return the system property's String value, or null if there's * no such value, or a SecurityException has been caught */ public static String getSystemProperty(String key) { try { return System.getProperty(key); } catch (SecurityException e) { // log("Can't read the System property " + key + "."); return null; } } /** * Tries to look up the System property for the given key. * In untrusted environments this may throw a SecurityException. * In this case, we catch the exception and answer the default value. * * @param key the name of the system property * @param defaultValue the default value if no property exists. * @return the system property's String value, or the defaultValue * if there's no such value, or a SecurityException has been caught */ public static String getSystemProperty(String key, String defaultValue) { try { return System.getProperty(key, defaultValue); } catch (SecurityException e) { // log("Can't read the System property " + key + "."); return defaultValue; } } /** * Checks if a boolean system property has been set for the given key, * and returns the associated Boolean, or null if no value * has been set. The test for the property ignores case. * If a Boolean value has been set, a message is logged * with the given prefix. * * @param key the key used to lookup the system property value * @param logMessage a prefix used when a message is logged * @return Boolean.TRUE if the system property has been set to * "true" (case ignored), Boolean.FALSE if it has been set to * "false", null otherwise */ public static Boolean getBooleanSystemProperty(String key, String logMessage) { String value = getSystemProperty(key, ""); Boolean result; if (value.equalsIgnoreCase("false")) result = Boolean.FALSE; else if (value.equalsIgnoreCase("true")) result = Boolean.TRUE; else result = null; if (result != null) { LookUtils.log( logMessage + " have been " + (result.booleanValue() ? "en" : "dis") + "abled in the system properties."); } return result; } /** * Checks and answers whether the Windows XP style is enabled. * This method is intended to be called only if a Windows look&feel * is about to be installed or already active in the UIManager. * The XP style of the Windows look&feel is enabled by default on * Windows XP platforms since the J2SE 1.4.2; it can be disabled either * in the Windows desktop as well as in the Java runtime by setting * a System property.

* * First checks the platform, platform version and Java version. Then * checks whether the desktop property win.xpstyle.themeActive * is set or not. * * @return true if the Windows XP style is enabled */ private static boolean isWindowsXPLafEnabled() { return (IS_OS_WINDOWS_XP || IS_OS_WINDOWS_VISTA) && IS_JAVA_1_4_2_OR_LATER && Boolean.TRUE.equals(Toolkit.getDefaultToolkit(). getDesktopProperty("win.xpstyle.themeActive")) && getSystemProperty("swing.noxp") == null; } /** * Checks and answers whether we have a true color system. * * @param c the component used to determine the toolkit * @return true if the component's toolkit has a pixel size >= 24 */ public static boolean isTrueColor(Component c) { return c.getToolkit().getColorModel().getPixelSize() >= 24; } /** * Checks and answers whether this toolkit provides native drop shadows * for popups such as the Mac OS X. Currently this is used to * determine if the Looks' popup drop shadow feature is active or not * - even if it's enabled. * * @return true if the toolkit provides native drop shadows * * @see Options#isPopupDropShadowActive() */ public static boolean getToolkitUsesNativeDropShadows() { return IS_OS_MAC; } /** * Computes and returns a Color that is slightly brighter * than the specified Color. * * @param color the color used as basis for the brightened color * @return a slightly brighter color */ public static Color getSlightlyBrighter(Color color) { return getSlightlyBrighter(color, 1.1f); } /** * Computes and returns a Color that is slightly brighter * than the specified Color. * * @param color the color used as basis for the brightened color * @param factor the factor used to compute the brightness * @return a slightly brighter color */ public static Color getSlightlyBrighter(Color color, float factor) { float[] hsbValues = new float[3]; Color.RGBtoHSB( color.getRed(), color.getGreen(), color.getBlue(), hsbValues); float hue = hsbValues[0]; float saturation = hsbValues[1]; float brightness = hsbValues[2]; float newBrightness = Math.min(brightness * factor, 1.0f); return Color.getHSBColor(hue, saturation, newBrightness); } // Minimal logging ****************************************************** /** * Enables or disables the Looks logging. * * @param enabled true to enable logging, false to disable it */ public static void setLoggingEnabled(boolean enabled) { loggingEnabled = enabled; } /** * Prints a new line to the console if logging is enabled. */ public static void log() { if (loggingEnabled) { System.out.println(); } } /** * Prints the given message to the console if logging is enabled. * * @param message the message to print */ public static void log(String message) { if (loggingEnabled) { System.out.println("JGoodies Looks: " + message); } } // Private Helper Methods *********************************************** /** * Checks and answers whether the screen resolution is low or high. * Resolutions below 120 dpi are considere low, all others are high. * * @return true if the screen resolution is smaller than 120 dpi */ private static boolean isLowResolution() { return Toolkit.getDefaultToolkit().getScreenResolution() < 120; } private static boolean startsWith(String str, String prefix) { return str != null && str.startsWith(prefix); } private static boolean startsWithIgnoreCase(String str, String prefix) { return str != null && str.toUpperCase(Locale.ENGLISH).startsWith(prefix.toUpperCase(Locale.ENGLISH)); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/utils/shadow.png0000644000175000017500000000047310320627126025454 0ustar drazzibdrazzibPNG  IHDR w&+tEXtCreation TimeMi 11 Feb 2004 10:17:51 +0100ltIME ;!͌ pHYs  ~gAMA aIDATx} 0E6覫B6#w@pμzӄ7'/HV)h Xr-Yr&#c8 6P H-e_cOxQ|8,:ʩsn(1˿IENDB`liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/utils/RenderingUtils.java0000644000175000017500000001015311015350766027263 0ustar drazzibdrazzib/* * Copyright (c) 2001-2006 JGoodies Karsten Lentzsch. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of JGoodies Karsten Lentzsch nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.utils; import java.awt.*; import java.awt.print.PrinterGraphics; import java.util.*; import javax.swing.CellRendererPane; import javax.swing.SwingUtilities; public class RenderingUtils { private static final String PROP_DESKTOPHINTS = "awt.font.desktophints"; private static Map desktopHintsCache = new HashMap(); public static Map installDesktopHints(Graphics2D g2, Component c) { if (SwingUtilities.getAncestorOfClass(CellRendererPane.class, c) != null) { return null; } Map oldRenderingHints = null; Map desktopHints = desktopHints(g2); if (desktopHints != null && !desktopHints.isEmpty()) { oldRenderingHints = new HashMap(desktopHints.size()); RenderingHints.Key key; for (Iterator i = desktopHints.keySet().iterator(); i.hasNext();) { key = (RenderingHints.Key) i.next(); oldRenderingHints.put(key, g2.getRenderingHint(key)); } g2.addRenderingHints(desktopHints); } else { // the following is temporary until the Apple VM 6.0 supports the // desktop AA hinting settings. if (LookUtils.IS_JAVA_6 && LookUtils.IS_OS_MAC) { g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); } } return oldRenderingHints; } private static Map desktopHints(Graphics2D g2) { if (isPrinting(g2)) { return null; } Toolkit toolkit = Toolkit.getDefaultToolkit(); GraphicsDevice device = g2.getDeviceConfiguration().getDevice(); String deviceId = device.getIDstring(); if (!desktopHintsCache.containsKey(deviceId)) { Map desktopHints = (Map) toolkit .getDesktopProperty(PROP_DESKTOPHINTS + '.' + device.getIDstring()); if (desktopHints == null) { desktopHints = (Map) toolkit .getDesktopProperty(PROP_DESKTOPHINTS); } // It is possible to get a non-empty map but with disabled AA. if (desktopHints != null) { Object aaHint = desktopHints .get(RenderingHints.KEY_TEXT_ANTIALIASING); if ((aaHint == RenderingHints.VALUE_TEXT_ANTIALIAS_OFF) || (aaHint == RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT)) { desktopHints = null; } } if (desktopHints == null) desktopHints = new HashMap(); desktopHintsCache.put(deviceId, desktopHints); } return desktopHintsCache.get(deviceId); } private static boolean isPrinting(Graphics g) { return g instanceof PrintGraphics || g instanceof PrinterGraphics; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/utils/DeltaQueue.java0000644000175000017500000002124311137001464026356 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.utils; import java.util.*; /** * Delta queue. Follows a standard approach from OS world for effeciently * keeping tracks of scheduled events. * * @author Kirill Grouchnikov */ public class DeltaQueue { /** * Base class for entries in a {@link DeltaQueue}. * * @author Kirill Grouchnikov */ public static abstract class Deltable { /** * Delta in application specific units. */ protected int delta; /** * Creates a new delta. */ public Deltable() { super(); } /** * Returns the current delta in application specific units. * * @return The current delta in application specific units. */ public int getDelta() { return delta; } /** * Sets the new value of delta in application specific units. * * @param delta * New value of delta in application specific units. */ public void setDelta(int delta) { this.delta = delta; } /** * Increments the delta value by the specified amount. * * @param diff * Amount for incrementing the delta value. */ public void incrementDelta(int diff) { this.delta += diff; } /** * Decrements the delta value by the specified amount. * * @param diff * Amount for decrementing the delta value. */ public void decrementDelta(int diff) { this.delta -= diff; } } /** * Interface for comparing two delta instances. * * @author Kirill Grouchnikov. */ public static interface DeltaMatcher { /** * Returns true if the specified delta matches some * criteria. * * @param deltable * Delta. * @return true if the specified delta matches some * criteria, false otherwise. */ public boolean matches(Deltable deltable); } /** * List of entries. Contains {@link Deltable}s. */ protected ArrayList queue; /** * Constructs a new empty non-blocking synchronized delta queue. */ public DeltaQueue() { this.queue = new ArrayList(); } /** * Queues the specified deltable. The specified deltable is placed somewhere * in the queue based on the initial value of its delta. Note that when this * method returns, the value of a {@link Deltable#getDelta()} may have * changed. Do not reuse or change the passed deltable after this method * returns. * * @param deltable * Deltable. */ public synchronized void queue(Deltable deltable) { // locate the correct position in a time-difference queue int currDiff = deltable.getDelta(); for (int i = 0; i < this.queue.size(); i++) { Deltable currDeltable = this.queue.get(i); currDiff -= currDeltable.getDelta(); if (currDiff > 0) { continue; } if (currDiff == 0) { // scan until the next diff is more than 0 deltable.setDelta(0); for (int j = i + 1; j < this.queue.size(); j++) { Deltable nextDeltable = this.queue.get(j); if (nextDeltable.getDelta() > 0) { // put just before it this.queue.add(j, deltable); return; } } // if here - add at the end this.queue.add(this.queue.size(), deltable); return; } deltable.setDelta(currDiff + currDeltable.getDelta()); currDeltable.decrementDelta(deltable.getDelta()); this.queue.add(i, deltable); return; } // put last deltable.setDelta(currDiff); this.queue.add(this.queue.size(), deltable); } /** * Returns all deltables that have at most specified delay left. The * returned list may be empty. * * @param delay * Delay. * @return The possibly empty list of all deltables that have at most * specified delay left. */ public synchronized List dequeue(int delay) { List result = new LinkedList(); while (this.queue.size() > 0) { Deltable next = this.queue.get(0); int timeToExpire = next.getDelta(); next.decrementDelta(delay); if (next.getDelta() > 0) { break; } if (timeToExpire > 0) delay -= timeToExpire; result.add(next); this.queue.remove(0); } return result; } /** * Removes all deltas matching the specified matcher. * * @param matcher * Delta matcher. */ public synchronized void removeMatching(DeltaMatcher matcher) { // start from the end while (true) { int toRemoveInd = -1; Deltable toRemove = null; for (int i = this.queue.size() - 1; i >= 0; i--) { Deltable deltable = this.queue.get(i); if (!matcher.matches(deltable)) continue; toRemoveInd = i; toRemove = deltable; break; } if (toRemoveInd >= 0) { if (toRemoveInd < (this.queue.size() - 1)) { Deltable next = this.queue.get(toRemoveInd + 1); next.incrementDelta(toRemove.getDelta()); } this.queue.remove(toRemoveInd); } else { return; } } } /** * Dumps the contents of the delta queue. */ public void dump() { System.out.println("Dump"); for (int i = 0; i < this.queue.size(); i++) { System.out.println("\t" + this.queue.get(i)); } } /** * Test class. * * @author Kirill Grouchnikov */ private static class DeltableTest extends Deltable { /** * ID. */ private int id; /** * Creates a test delta. * * @param id * ID. * @param delta * Delta. */ public DeltableTest(int id, int delta) { super(); this.id = id; this.delta = delta; } public String toString() { return this.id + ":" + this.delta; } } /** * For testing. * * @param args * Ignored. */ public static void main(String[] args) { DeltaQueue dq = new DeltaQueue(); DeltableTest tpi11 = new DeltableTest(11, 100); dq.queue(tpi11); dq.dump(); DeltableTest tpi12 = new DeltableTest(12, 100); dq.queue(tpi12); dq.dump(); DeltableTest tpi21 = new DeltableTest(21, 200); dq.queue(tpi21); dq.dump(); DeltableTest tpi31 = new DeltableTest(31, 300); dq.queue(tpi31); dq.dump(); DeltableTest tpi13 = new DeltableTest(13, 100); dq.queue(tpi13); dq.dump(); DeltableTest tpi22 = new DeltableTest(22, 200); dq.queue(tpi22); dq.dump(); DeltableTest tpi25 = new DeltableTest(25, 250); dq.queue(tpi25); dq.dump(); DeltableTest tpi51 = new DeltableTest(51, 500); dq.queue(tpi51); dq.dump(); DeltableTest tpi05 = new DeltableTest(5, 50); dq.queue(tpi05); dq.dump(); List gr150 = dq.dequeue(100); System.out.println("Dump 150"); for (int i = 0; i < gr150.size(); i++) { DeltableTest tpi = (DeltableTest) gr150.get(i); System.out.println("\t" + tpi); } dq.dump(); dq.removeMatching(new DeltaMatcher() { public boolean matches(Deltable deltable) { return ((DeltableTest) deltable).id < 30; } }); dq.dump(); TrackableThread.requestStopAllThreads(); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/utils/ShadowPopupBorder.java0000644000175000017500000001143610570404022027727 0ustar drazzibdrazzib/* * Copyright (c) 2001-2005 JGoodies Karsten Lentzsch. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of JGoodies Karsten Lentzsch nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.utils; import java.awt.*; import javax.swing.ImageIcon; import javax.swing.JComponent; import javax.swing.border.AbstractBorder; /** * A border with a drop shadow intended to be used as the outer border * of popups. Can paint the screen background if used with heavy-weight * popup windows. * * @author Stefan Matthias Aust * @author Karsten Lentzsch * @author Andrej Golovnin * @version $Revision: 1.4 $ * * @see ShadowPopup * @see ShadowPopupFactory */ public final class ShadowPopupBorder extends AbstractBorder { /** * The drop shadow needs 5 pixels at the bottom and the right hand side. */ private static final int SHADOW_SIZE = 5; /** * The singleton instance used to draw all borders. */ private static ShadowPopupBorder instance = new ShadowPopupBorder(); /** * The drop shadow is created from a PNG image with 8 bit alpha channel. */ private static Image shadow = new ImageIcon(ShadowPopupBorder.class.getResource("shadow.png")).getImage(); // Instance Creation ***************************************************** /** * Returns the singleton instance used to draw all borders. */ public static ShadowPopupBorder getInstance() { return instance; } /** * Paints the border for the specified component with the specified * position and size. */ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { // fake drop shadow effect in case of heavy weight popups // JComponent popup = (JComponent) c; // Image hShadowBg = (Image) popup.getClientProperty(ShadowPopupFactory.PROP_HORIZONTAL_BACKGROUND); // if (hShadowBg != null) { // g.drawImage(hShadowBg, x, y + height - 5, c); // } // Image vShadowBg = (Image) popup.getClientProperty(ShadowPopupFactory.PROP_VERTICAL_BACKGROUND); // if (vShadowBg != null) { // g.drawImage(vShadowBg, x + width - 5, y, c); // } // draw drop shadow g.drawImage(shadow, x + 5, y + height - 5, x + 10, y + height, 0, 6, 5, 11, null, c); g.drawImage(shadow, x + 10, y + height - 5, x + width - 5, y + height, 5, 6, 6, 11, null, c); g.drawImage(shadow, x + width - 5, y + 5, x + width, y + 10, 6, 0, 11, 5, null, c); g.drawImage(shadow, x + width - 5, y + 10, x + width, y + height - 5, 6, 5, 11, 6, null, c); g.drawImage(shadow, x + width - 5, y + height - 5, x + width, y + height, 6, 6, 11, 11, null, c); } /** * Returns the insets of the border. */ public Insets getBorderInsets(Component c) { return new Insets(0, 0, SHADOW_SIZE, SHADOW_SIZE); } /** * Reinitializes the insets parameter with this Border's current Insets. * @param c the component for which this border insets value applies * @param insets the object to be reinitialized * @return the insets object */ public Insets getBorderInsets(Component c, Insets insets) { insets.left = insets.top = 0; insets.right = insets.bottom = SHADOW_SIZE; return insets; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/utils/TrackableThread.java0000644000175000017500000000510711137001464027341 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.utils; import java.util.*; /** * Base class for all helper threads. * * @author Kirill Grouchnikov */ public abstract class TrackableThread extends Thread { /** * All helper threads. */ private static Set threads = new HashSet(); /** * Creates new instance. */ protected TrackableThread() { super(); TrackableThread.threads.add(this); this.setDaemon(true); } /** * Issues a stop request on this thread. */ protected abstract void requestStop(); /** * Issues a stop request on all helper threads. */ public static void requestStopAllThreads() { for (TrackableThread tt : TrackableThread.threads) { tt.requestStop(); } // for (Iterator it = TrackableThread.threads.iterator(); it.hasNext();) { // TrackableThread thread = (TrackableThread) it.next(); // thread.requestStop(); // } } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/utils/LafConstants.java0000644000175000017500000001354511137001464026725 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.utils; import org.jvnet.lafwidget.animation.*; /** * Constants for the laf-widget classes. * * @author Kirill Grouchnikov */ public class LafConstants { /** * Animation kind. */ public static class AnimationKind { /** * No animation. */ public static final AnimationKind NONE = new AnimationKind( new FadeConstantStep(1.1f), "none"); /** * Animation for debug purposes (extremely-slow). */ public static final AnimationKind DEBUG_SLOW = new AnimationKind( new FadeConstantStep(.002f), "debugSlow"); /** * Animation for debug purposes (ultra-slow). */ public static final AnimationKind DEBUG = new AnimationKind( new FadeConstantStep(.01f), "debug"); /** * Animation for debug purposes (slow). */ public static final AnimationKind DEBUG_FAST = new AnimationKind( new FadeConstantStep(.05f), "debugFast"); /** * Slow animation. */ public static final AnimationKind SLOW = new AnimationKind( new FadeConstantStep(.1f), "slow"); /** * Regular (default) animation. */ public static final AnimationKind REGULAR = new AnimationKind( new FadeConstantStep(.2f), "regular"); /** * Fast animation. */ public static final AnimationKind FAST = new AnimationKind( new FadeConstantStep(.3f), "fast"); /** * Animation increment step. */ private FadeStep step; /** * Animation kind name. */ private String name; /** * Creates a new animation kind. * * @param step * Animation increment step. * @param name * Animation kind name. */ public AnimationKind(FadeStep step, String name) { this.step = step; this.name = name; } /** * Returns the step of this animation in seconds. * * @return Step of this animation in seconds. */ public FadeStep getStep() { return this.step; } /** * Returns the name of this animation. * * @return Name of this animation. */ public String getName() { return this.name; } /** * Creates a derived (accelerated or decelerated) animation kind. * * @param factor * Derivation factor. Should be greater than zero. * @return Derived animation kind. */ public AnimationKind derive(float factor) { final FadeStep origStep = this.step; final String origName = this.name; return new AnimationKind( new FadeAccelerationStep(origStep, factor), origName + ".derived." + factor); } } /** * Password strength. * * @author Kirill Grouchnikov */ public static class PasswordStrength { /** * Private constructor to prevent initialization. */ private PasswordStrength() { } /** * Weak strength. */ public static final PasswordStrength WEAK = new PasswordStrength(); /** * Medium strength. */ public static final PasswordStrength MEDIUM = new PasswordStrength(); /** * Strong strength. */ public static final PasswordStrength STRONG = new PasswordStrength(); } /** * Enumerates all available kinds of tab overview dialog. * * @author Kirill Grouchnikov */ public static class TabOverviewKind { /** * Shows a grid with all tab thumbnails. */ public static final TabOverviewKind GRID = new TabOverviewKind("grid"); /** * Shows a round carousel with all tab thumbnails. */ public static final TabOverviewKind ROUND_CAROUSEL = new TabOverviewKind( "round carousel"); /** * Shows a menu carousel with all tab thumbnails. */ public static final TabOverviewKind MENU_CAROUSEL = new TabOverviewKind( "menu carousel"); /** * Animation kind name. */ private String name; /** * Creates a new tab overview kind. * * @param name * Tab overview kind name. */ public TabOverviewKind(String name) { this.name = name; } /** * Returns the name of this animation. * * @return Name of this animation. */ public String getName() { return this.name; } } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/utils/FadeTracker.java.good0000644000175000017500000012524510570366716027447 0ustar drazzibdrazzib/* * Copyright (c) 2005-2007 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.utils; import java.awt.Component; import java.awt.Container; import java.util.*; import javax.swing.SwingUtilities; import org.jvnet.lafwidget.LafWidgetUtilities; import org.jvnet.lafwidget.utils.LafConstants.AnimationKind; /** * Tracker class for fade animations. * * @author Kirill Grouchnikov */ public class FadeTracker2 { /** * Max value for fade cycle. */ public static final int END_VALUE = 10; /** * Single instance of this class. */ private static FadeTracker2 instance; /** * All currently tracked components. Only components that are being animated * (fade-in or fade-out) are in this map. Key is * {@link ComponentId}, value is map from {@link FadeKind} to * {@link FadeState}. */ private Map> trackedComponents; /** * All currently executing fade instances. Key is {@link Long} (corresponds * to the {@link FadeState#id}, value is {@link ComponentId} - which is a * key in {@link #trackedComponents}. */ private Map fadeInstances; private long currLoopId; /** * Fade animation kind. * * @author Kirill Grouchnikov. */ public static class FadeKind { /** * Fade kind ID. */ protected String id; /** * Creates a new fade kind which is allowed by default. * * @param id * Fade kind ID. */ public FadeKind(String id) { this(id, true); } /** * Creates a new fade kind. * * @param id * Fade kind ID. * @param isDefaultAllowed * Indicates whether the newly create fade kind is allowed by * default. */ public FadeKind(String id, boolean isDefaultAllowed) { this.id = id; if (isDefaultAllowed) { FadeConfigurationManager.getInstance().allowFades(this); } } /** * Arming a component. */ public static final FadeKind ARM = new FadeKind("lafwidgets.core.arm"); /** * Pressing a component. */ public static final FadeKind PRESS = new FadeKind( "lafwidgets.core.press"); /** * Focusing a component. */ public static final FadeKind FOCUS = new FadeKind( "lafwidgets.core.focus"); /** * Enabling a component. */ public static final FadeKind ENABLE = new FadeKind( "lafwidgets.core.enable"); /** * Rollover a component. */ public static final FadeKind ROLLOVER = new FadeKind( "lafwidgets.core.rollover"); /** * Selecting a component. */ public static final FadeKind SELECTION = new FadeKind( "lafwidgets.core.selection"); /** * Fade kind that specifies the "ghosting image" effects on button icons * when the button is rolled-over. Disabled by default, use * {@link FadeConfigurationManager#allowFades(FadeKind)} to enable. */ public static final FadeKind GHOSTING_ICON_ROLLOVER = new FadeKind( "lafwidgets.core.ghosting.iconRollover", false); /** * Fade kind that specifies the "ghosting image" effects on buttons when * the button is pressed. Disabled by default, use * {@link FadeConfigurationManager#allowFades(FadeKind)} to enable. */ public static final FadeKind GHOSTING_BUTTON_PRESS = new FadeKind( "lafwidgets.core.ghosting.buttonPress", false); /* * (non-Javadoc) * * @see java.lang.Object#hashCode() */ public int hashCode() { return this.id.hashCode(); } /* * (non-Javadoc) * * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(Object obj) { if (obj instanceof FadeKind) { return this.id.equals(((FadeKind) obj).id); } return false; } // /** // * Marking a component as modified. // */ // public static final FadeKind MARKED_MODIFIED = new FadeKind( // "lafwidgets.core.arm"); } /** * Information on a single component under fade. * * @author Kirill Grouchnikov */ protected static class ComponentId { /** * UI component itself. */ public Component component; /** * ID to distinguish between different sub-components of the UI * component. For example, the tabbed pane uses this field to make * tab-specific animations. */ // public int id; public Comparable id; /** * Creates a new component ID. * * @param component * UI component itself. * @param id * ID to distinguish between different sub-components of the * UI component. */ public ComponentId(Component component, Comparable id) { this.component = component; this.id = id; } /* * (non-Javadoc) * * @see java.lang.Object#hashCode() */ public int hashCode() { int result = this.component.hashCode(); if (this.id != null) result &= (this.id.hashCode()); return result; } /* * (non-Javadoc) * * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(Object obj) { if (obj instanceof ComponentId) { ComponentId cid = (ComponentId) obj; try { boolean result = (this.component == cid.component); if (this.id == null) { result = result && (cid.id == null); } else { result = result && (this.id.compareTo(cid.id) == 0); } return result; } catch (Exception exc) { return false; } } return false; } } /** * Callback for the fade tracker. Is used when the application (some UI * delegate) wishes to execute some code on the fade. * * @author Kirill Grouchnikov */ public static interface FadeTrackerCallback { /** * Indicates that a single cycle of fade has been performed. Can be used * in order to repaint specific portion of the component. * * @param fadeKind * Fade animation kind. * @param fadeCycle10 * The current fade cycle. Is guaranteed to be in 0.0-10.0 * range. */ public void fadePerformed(FadeKind fadeKind, float fadeCycle10); /** * Indicates that the fade sequence has ended. Can be used in order to * repaint specific portion of the component. * * @param fadeKind * Fade animation kind. */ public void fadeEnded(FadeKind fadeKind); } /** * Information on the state of the faded component. * * @author Kirill Grouchnikov */ private static class FadeState { /** * Is used to create unique value for the {@link #id} field. */ protected static long counter; /** * Unique ID. */ protected long id; /** * Fade cycle. */ public float fadePosition; /** * Indication whether it's a fade-in or fade-out. */ public boolean isFadingIn; /** * Indication whether it's looping (infinite). */ public boolean isLooping; /** * Indication whether the looping fade starts fading out after reaching * the maximum value. Relevant only when {@link #isLooping} is * true. */ public boolean isLoopingReverse; /** * Indication whether the looping fade should stop at reaching the end * of the fade-out cycle. Relevant only when {@link #isLooping} is * true. */ public boolean toStopAtCycleBreak; /** * Indication whether the component parent should be repainted on each * fade cycle. */ public boolean toRepaintParent; /** * The optional callback to be called on each fade cycle. */ public FadeTrackerCallback callback; /** * Fade animation step. */ public FadeStep fadeStep; /** * Fade animation kind. */ public FadeKind fadeKind; /** * Simple constructor. * * @param fadeKind * Fade animation kind. * @param fadePosition * Fade cycle. * @param isFadingIn * Indication whether it's a fade-in or fade-out. * @param toRepaintParent * Indication whether the component parent should be * repainted on each fade cycle. */ public FadeState(FadeKind fadeKind, float fadePosition, boolean isFadingIn, boolean toRepaintParent) { super(); this.fadeKind = fadeKind; this.fadePosition = fadePosition; this.isFadingIn = isFadingIn; this.toRepaintParent = toRepaintParent; this.id = FadeState.getId(); this.isLooping = false; this.toStopAtCycleBreak = false; } /** * Sets the looping indication. * * @param isLooping * New value for the looping indication. */ public void setLooping(boolean isLooping) { this.isLooping = isLooping; } /** * Sets indication that looping fade should stop at the end of the * fade-out cycle. */ public void toStopAtCycleBreak() { if (!this.isLooping) throw new IllegalArgumentException( "Supported only on looping fades"); this.toStopAtCycleBreak = true; } /** * Returns a unique ID. * * @return Unique ID. */ protected static synchronized long getId() { return counter++; } } // private static List[] trackerValues = initializeLists(); // // static List[] /** * The fade thread. */ private FadeTrackerThread trackerThread; /** * The fade thread class. * * @author Kirill Grouchnikov */ private class FadeTrackerThread extends TrackableThread { /** * Fade thread delay. */ public static final int DELAY = 40; /** * Indication whether a stop request has been issued on * this thread. */ private boolean stopRequested; /** * Simple constructor. Defined private for singleton. * * @see #getInstance() */ public FadeTrackerThread() { super(); this.setName("Laf-Widget fade tracker"); this.stopRequested = false; } /* * (non-Javadoc) * * @see java.lang.Thread#run() */ public void run() { while (!this.stopRequested) { try { Thread.sleep(FadeTrackerThread.DELAY); } catch (InterruptedException ie) { ie.printStackTrace(); } SwingUtilities.invokeLater(new Runnable() { public void run() { FadeTracker2.this.updateComponents(); currLoopId++; } }); } } /* * (non-Javadoc) * * @see org.jvnet.substance.utils.SubstanceThread#requestStop() */ protected void requestStop() { this.stopRequested = true; FadeTracker2.this.trackerThread = null; } } /** * Simple constructor. Defined private for singleton. * * @see #getInstance() */ private FadeTracker2() { this.trackerThread = this.getThread(); this.trackedComponents = new HashMap>(); this.fadeInstances = new HashMap(); this.currLoopId = 0; // FadeConfigurationManager configManager = FadeConfigurationManager // .getInstance(); // configManager.allowFades(FadeKind.ARM); // configManager.allowFades(FadeKind.ENABLE); // configManager.allowFades(FadeKind.FOCUS); // configManager.allowFades(FadeKind.PRESS); // configManager.allowFades(FadeKind.ROLLOVER); // configManager.allowFades(FadeKind.SELECTION); // this.sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss.SSS"); // this.int2comp = new ArrayList>(); } /** * Gets singleton instance. * * @return Singleton instance. */ public synchronized static FadeTracker2 getInstance() { if (FadeTracker2.instance == null) { FadeTracker2.instance = new FadeTracker2(); } return FadeTracker2.instance; } /** * Updates all components that are currently registered with * this tracker. The update include repaint (based on the * {@link FadeState#toRepaintParent}) and optional call to the callback. */ private synchronized void updateComponents() { // if (this.comp2int.size() > 0) // System.out.println("Periodic update"); Set parents = new HashSet(); for (Iterator>> itComp = this.trackedComponents .entrySet().iterator(); itComp.hasNext();) { Map.Entry> entryComp = itComp .next(); ComponentId compId = entryComp.getKey(); Map mapComp = entryComp.getValue(); for (Iterator> itKind = mapComp .entrySet().iterator(); itKind.hasNext();) { Map.Entry entryKind = itKind.next(); FadeState state = entryKind.getValue(); boolean hasEnded = false; // Component comp = entry.getKey(); if (state.isFadingIn) { state.fadePosition += state.fadeStep.getNextStep( state.fadeKind, state.fadePosition, state.isFadingIn, state.isLooping); if (state.fadePosition > FadeTracker2.END_VALUE) { state.fadePosition = FadeTracker2.END_VALUE; if (state.isLooping) { if (state.isLoopingReverse) { state.isFadingIn = false; } else { state.fadePosition = 0.0f; if (state.toStopAtCycleBreak) { this.fadeInstances .remove(new Long(state.id)); hasEnded = true; itKind.remove(); } } } else { this.fadeInstances.remove(new Long(state.id)); hasEnded = true; itKind.remove(); } } } else { state.fadePosition -= state.fadeStep.getNextStep( state.fadeKind, state.fadePosition, state.isFadingIn, state.isLooping); if (state.fadePosition < 0) { if (state.isLooping && !state.toStopAtCycleBreak) { state.fadePosition = 0.0f; state.isFadingIn = true; } else { this.fadeInstances.remove(new Long(state.id)); hasEnded = true; itKind.remove(); } } } if (compId.component.isDisplayable()) { if (state.callback != null) { if (hasEnded) { state.callback.fadeEnded(state.fadeKind); } else { state.callback.fadePerformed(state.fadeKind, state.fadePosition); } continue; } if (state.toRepaintParent) parents.add(compId.component.getParent()); else compId.component.repaint(); } } if (mapComp.size() == 0) itComp.remove(); // System.out.println("\tState of " + comp.hashCode() + " is " // + state.fadePosition + " fading " // + (state.isFadingIn ? "in" : "out")); // long time0 = System.nanoTime(); // long time1 = System.nanoTime(); // if (entry.getKey() instanceof JButton) { // System.out.println(((JButton) entry.getKey()).getText() + " [" + // state.isFadingIn + "]: " // + (time1 - time0)); // } } for (Iterator itParent = parents.iterator(); itParent .hasNext();) { Container parent = itParent.next(); parent.repaint(); } } /** * Returns the state of the component under the specified fade kind. * * @param fadeKind * Fade kind. * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes * (where fade is performed on component "sub" parts). * @return Component state under the specified fade kind. */ private synchronized FadeState getState(FadeKind fadeKind, Component comp, Comparable componentId) { ComponentId cid = new ComponentId(comp, componentId); Map map = this.trackedComponents.get(cid); if (map == null) { map = new HashMap(); this.trackedComponents.put(cid, map); } return map.get(fadeKind); } /** * Adds new fade state for the specified component. * * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes * (where fade is performed on component "sub" parts). * @param fadeKind * Fade kind. * @param fadeState * Fade state object. */ private synchronized void addState(Component comp, Comparable componentId, FadeKind fadeKind, FadeState fadeState) { ComponentId cid = new ComponentId(comp, componentId); Map map = this.trackedComponents.get(cid); if (map == null) { map = new HashMap(); this.trackedComponents.put(cid, map); } map.put(fadeKind, fadeState); this.fadeInstances.put(fadeState.id, cid); } /** * Requests start of fade-in tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance * created (this may happen when the specified component is not * visible). */ public synchronized long trackFadeIn(FadeKind fadeKind, Component comp, boolean toRepaintParent, FadeTrackerCallback callback) { return this .trackFadeIn(fadeKind, comp, null, toRepaintParent, callback); } /** * Requests start of fade-in tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param componentId * Component id. Relevant for such components as tabbed panes * (where fade is performed on component "sub" parts). * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance * created (this may happen when the specified component is not * visible). */ public synchronized long trackFadeIn(FadeKind fadeKind, Component comp, int componentId, boolean toRepaintParent, FadeTrackerCallback callback) { return this.trackFadeIn(fadeKind, comp, new Integer(componentId), toRepaintParent, callback); } /** * Requests start of fade-in tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance * created (this may happen when the specified component is not * visible). */ public synchronized long trackFadeIn(FadeKind fadeKind, Component comp, Comparable componentId, boolean toRepaintParent, FadeTrackerCallback callback) { return this.trackFadeIn(fadeKind, comp, componentId, toRepaintParent, callback, LafWidgetUtilities.getAnimationKind(comp)); } /** * Requests start of fade-in tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @param aKind * Animation kind. Should not be null. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance * created (this may happen when the specified component is not * visible). */ public synchronized long trackFadeIn(FadeKind fadeKind, Component comp, Comparable componentId, boolean toRepaintParent, FadeTrackerCallback callback, AnimationKind aKind) { if (fadeKind == null) { throw new IllegalArgumentException("Can't pass null fadeKind"); } if ((comp == null) || (!comp.isDisplayable())) { if (callback != null) { callback.fadeEnded(fadeKind); } return -1; } if (LafWidgetUtilities.hasNoFades(comp, fadeKind)) { if (callback != null) { callback.fadeEnded(fadeKind); } else { if (toRepaintParent && comp.getParent() != null) comp.getParent().repaint(); else comp.repaint(); } return -1; } this.getThread(); // see if it's already tracked FadeState fadeState = this.getState(fadeKind, comp, componentId); if (fadeState == null) { fadeState = new FadeState(fadeKind, 0, true, toRepaintParent); fadeState.fadeStep = aKind.getStep(); if (fadeKind == FadeKind.SELECTION) { fadeState.fadeStep = new FadeAccelerationStep( fadeState.fadeStep, 2.0f); } this.addState(comp, componentId, fadeKind, fadeState); } else { fadeState.isFadingIn = true; } fadeState.callback = callback; return fadeState.id; // System.out.println(sdf.format(new Date()) // + " : starting tracking fade in on " // + comp.getClass().getName() + " [" + comp.hashCode() // + "] from " + fadeState.fadePosition); } /** * Requests start of fade-out tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance * created (this may happen when the specified component is not * visible). */ public synchronized long trackFadeOut(FadeKind fadeKind, Component comp, boolean toRepaintParent, FadeTrackerCallback callback) { return this.trackFadeOut(fadeKind, comp, null, toRepaintParent, callback); } /** * Requests start of fade-out tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param componentId * Component id. Relevant for such components as tabbed panes * (where fade is performed on component "sub" parts). * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance * created (this may happen when the specified component is not * visible). */ public synchronized long trackFadeOut(FadeKind fadeKind, Component comp, int componentId, boolean toRepaintParent, FadeTrackerCallback callback) { return this.trackFadeOut(fadeKind, comp, new Integer(componentId), toRepaintParent, callback); } /** * Requests start of fade-out tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance * created (this may happen when the specified component is not * visible). */ public synchronized long trackFadeOut(FadeKind fadeKind, Component comp, Comparable componentId, boolean toRepaintParent, FadeTrackerCallback callback) { return this.trackFadeOut(fadeKind, comp, componentId, toRepaintParent, callback, LafWidgetUtilities.getAnimationKind(comp)); } /** * Requests start of fade-out tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @param aKind * Animation kind. Should not be null. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance * created (this may happen when the specified component is not * visible). */ public synchronized long trackFadeOut(FadeKind fadeKind, Component comp, Comparable componentId, boolean toRepaintParent, FadeTrackerCallback callback, AnimationKind aKind) { if (fadeKind == null) { throw new IllegalArgumentException("Can't pass null fadeKind"); } if ((comp == null) || (!comp.isDisplayable())) { if (callback != null) { callback.fadeEnded(fadeKind); } return -1; } if (LafWidgetUtilities.hasNoFades(comp, fadeKind)) { if (callback != null) { callback.fadeEnded(fadeKind); } else { if (toRepaintParent && comp.getParent() != null) comp.getParent().repaint(); else comp.repaint(); } return -1; } this.getThread(); // see if it's already tracked FadeState fadeState = this.getState(fadeKind, comp, componentId); if (fadeState == null) { fadeState = new FadeState(fadeKind, FadeTracker2.END_VALUE, false, toRepaintParent); fadeState.fadeStep = aKind.getStep(); if (fadeKind == FadeKind.SELECTION) fadeState.fadeStep = new FadeAccelerationStep( fadeState.fadeStep, 2.0f); this.addState(comp, componentId, fadeKind, fadeState); } else { fadeState.isFadingIn = false; } fadeState.callback = callback; return fadeState.id; // System.out.println(sdf.format(new Date()) // + " : starting tracking fade out on " // + comp.getClass().getName() + " [" + comp.hashCode() // + "] from " + fadeState.fadePosition); } /** * Requests start of fade tracking on the specified component. * * @param comp * The component to track. * @param fadeKind * Fade kind. * @param isFadeIn * Indication whether fade-in or fade-out should be commenced. * @param toRepaintParent * Indication whether the component parent should be repainted. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance * created (this may happen when the specified component is not * visible). */ public synchronized long trackFade(Component comp, FadeKind fadeKind, boolean isFadeIn, boolean toRepaintParent) { return this.trackFade(comp, fadeKind, isFadeIn, toRepaintParent, null); } /** * Requests start of fade tracking on the specified component. * * @param comp * The component to track. * @param fadeKind * Fade kind. * @param isFadeIn * Indication whether fade-in or fade-out should be commenced. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance * created (this may happen when the specified component is not * visible). */ public synchronized long trackFade(Component comp, FadeKind fadeKind, boolean isFadeIn, boolean toRepaintParent, FadeTrackerCallback callback) { if (isFadeIn) return this.trackFadeIn(fadeKind, comp, toRepaintParent, callback); else return this.trackFadeOut(fadeKind, comp, toRepaintParent, callback); } /** * Requests start of looping fade tracking on the specified component. * * @param fadeKind * Fade kind. * @param animationKind * Animation kind. * @param comp * The component to track. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @param isLoopingReverse * If true, when the fade value gets to the * maximal value, the fade cycle will begin fade-out. Otherwise * the fade cycle will begin from 0, continuing to fade-in. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance * created (this may happen when the specified component is not * visible). */ public synchronized long trackFadeLooping(FadeKind fadeKind, AnimationKind animationKind, Component comp, Comparable componentId, boolean toRepaintParent, FadeTrackerCallback callback, boolean isLoopingReverse) { if (fadeKind == null) { throw new IllegalArgumentException("Can't pass null fadeKind"); } this.getThread(); if (LafWidgetUtilities.hasNoFades(comp, fadeKind)) { if (callback != null) { callback.fadeEnded(fadeKind); } else { if (toRepaintParent && comp.getParent() != null) comp.getParent().repaint(); else comp.repaint(); } return -1; } // see if it's already tracked FadeState fadeState = this.getState(fadeKind, comp, componentId); if (fadeState == null) { fadeState = new FadeState(fadeKind, 0, true, toRepaintParent); fadeState.fadeStep = animationKind.getStep(); fadeState.isLooping = true; fadeState.isLoopingReverse = isLoopingReverse; this.addState(comp, componentId, fadeKind, fadeState); } else { fadeState.isLooping = true; fadeState.isLoopingReverse = isLoopingReverse; } fadeState.callback = callback; return fadeState.id; } /** * Checks whether the specified component is being tracked by * this tracker. Effectively returns indication whether the * specified component is in fade-in or fade-out animation of the specified * kind. * * @param comp * Component. * @param fadeKind * Fade kind. * @return true if the specified component is being tracked * by this tracker, false otherwise. */ public boolean isTracked(Component comp, FadeKind fadeKind) { return this.isTracked(comp, null, fadeKind); } /** * Checks whether the specified component is being tracked by * this tracker. Effectively returns indication whether the * specified component is in fade-in or fade-out animation of the specified * kind. * * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes * (where fade is performed on component "sub" parts). * @param fadeKind * Fade kind. * @return true if the specified component is being tracked * by this tracker, false otherwise. */ public boolean isTracked(Component comp, int componentId, FadeKind fadeKind) { return this.isTracked(comp, new Integer(componentId), fadeKind); } /** * Checks whether the specified component is being tracked by * this tracker. Effectively returns indication whether the * specified component is in fade-in or fade-out animation of the specified * kind. * * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param fadeKind * Fade kind. * @return true if the specified component is being tracked * by this tracker, false otherwise. */ public boolean isTracked(Component comp, Comparable componentId, FadeKind fadeKind) { ComponentId cid = new ComponentId(comp, componentId); Map map = this.trackedComponents.get(cid); if (map == null) return false; if (fadeKind == null) return (map.size() > 0); return map.containsKey(fadeKind); } /** * Checks whether the specified component is being tracked by * this tracker. Effectively returns indication whether the * specified component is in the specified animation (fade-in / fade-out) of * the specified kind. * * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param fadeKind * Fade kind. May be null - not recommended. * @param checkFadeIn * Specifies whether the check should be done for fade-in state. * If true, the returned value will be * true only if the component is tracked and * it is in the fade-in state. * @return true if the specified component is being tracked * by this tracker, false otherwise. */ public boolean isTracked(Component comp, Comparable componentId, FadeKind fadeKind, boolean checkFadeIn) { if (fadeKind == null) { throw new IllegalArgumentException("Can't pass null fadeKind"); } ComponentId cid = new ComponentId(comp, componentId); Map map = this.trackedComponents.get(cid); if (map == null) return false; FadeState fState = (FadeState) map.get(fadeKind); if (fState == null) return false; return (fState.isFadingIn == checkFadeIn); } /** * Returns the fade cycle for the specified component. The result will be in * 0.0-10.0 range. * * @param comp * Component. * @param fadeKind * Fade kind. * @return The fade cycle for the specified component. For components that * are not tracked (when * {@link #isTracked(Component, org.jvnet.lafwidget.utils.FadeTracker.FadeKind)} * returns false), value 0 (zero) is returned. */ public synchronized float getFade10(Component comp, FadeKind fadeKind) { return this.getFade10(comp, null, fadeKind); } /** * Returns the fade cycle for the specified component. The result will be in * 0.0-10.0 range. * * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes * (where fade is performed on component "sub" parts). * @param fadeKind * Fade kind. * @return The fade cycle for the specified component. For components that * are not tracked (when * {@link #isTracked(Component, org.jvnet.lafwidget.utils.FadeTracker.FadeKind)} * returns false), value 0 (zero) is returned. */ public synchronized float getFade10(Component comp, int componentId, FadeKind fadeKind) { return this.getFade10(comp, new Integer(componentId), fadeKind); } /** * Returns the fade cycle for the specified component. The result will be in * 0.0-10.0 range. * * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param fadeKind * Fade kind. * @return The fade cycle for the specified component. For components that * are not tracked (when * {@link #isTracked(Component, org.jvnet.lafwidget.utils.FadeTracker.FadeKind)} * returns false), value 0 (zero) is returned. */ public synchronized float getFade10(Component comp, Comparable componentId, FadeKind fadeKind) { if (fadeKind == null) { throw new IllegalArgumentException("Can't pass null fadeKind"); } ComponentId cid = new ComponentId(comp, componentId); Map map = this.trackedComponents.get(cid); if ((map == null) || (map.size() == 0)) return 0; FadeState state = map.get(fadeKind); if (state == null) return 0; return state.fadePosition; } /** * Stops tracking of all components. Note that this function does not * stop the fade thread ({@link #trackerThread}). */ public synchronized void stopAllTimers() { for (Iterator>> itComp = this.trackedComponents .entrySet().iterator(); itComp.hasNext();) { Map.Entry> entryComp = itComp .next(); Map mapComp = entryComp.getValue(); for (Iterator> itKind = mapComp .entrySet().iterator(); itKind.hasNext();) { Map.Entry entryKind = itKind.next(); FadeState state = (FadeState) entryKind.getValue(); if (state.callback != null) state.callback.fadeEnded(state.fadeKind); } } this.trackedComponents.clear(); this.fadeInstances.clear(); } /** * Returns an instance of the tracker thread. * * @return The tracker thread. */ private synchronized FadeTrackerThread getThread() { if (this.trackerThread == null) { this.trackerThread = new FadeTrackerThread(); this.trackerThread.start(); } return this.trackerThread; } /** * Cancels the specified fade instance. * * @param fadeInstanceId * Fade instance ID. */ public synchronized void cancelFadeInstance(long fadeInstanceId) { ComponentId cid = (ComponentId) this.fadeInstances.get(new Long( fadeInstanceId)); if (cid != null) { Map compFades = this.trackedComponents .get(cid); for (Iterator> itKind = compFades .entrySet().iterator(); itKind.hasNext();) { Map.Entry entryKind = itKind.next(); FadeState state = (FadeState) entryKind.getValue(); if (fadeInstanceId == state.id) { itKind.remove(); state.callback.fadeEnded(state.fadeKind); } } if (compFades.size() == 0) { this.trackedComponents.remove(cid); } this.fadeInstances.remove(new Long(fadeInstanceId)); } } /** * Requests that the specified fade instance should stop at the end of the * fade-out. This method should be called only on looping fades. * * @param fadeInstanceId * Fade instance ID. */ public synchronized void requestStopOnCycleBreak(long fadeInstanceId) { ComponentId cid = this.fadeInstances.get(fadeInstanceId); if (cid != null) { Map compFades = this.trackedComponents .get(cid); for (FadeState fadeState : compFades.values()) { if (fadeInstanceId == fadeState.id) { fadeState.toStopAtCycleBreak(); } } } } public synchronized Set getAllComponentsByFadeKind( FadeKind fadeKind) { Set result = new HashSet(); for (Map.Entry> entry : this.trackedComponents .entrySet()) { Map fadeMap = entry.getValue(); if (fadeMap.containsKey(fadeKind)) result.add(entry.getKey().component); } return result; } public long getCurrLoopId() { return currLoopId; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/list/0000755000175000017500000000000011253454710023273 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/0000755000175000017500000000000011253454712023104 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/AugmentMainTask.java0000644000175000017500000001427411137001462026776 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import java.io.File; import java.util.*; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.types.Path; /** * Ant task for augmenting main LAF class. Is based on JiBX ant task * (BSD-licensed). * * @author Kirill Grouchnikov. */ public class AugmentMainTask extends Task { /** * Verbosty indication. */ private boolean m_verbose; /** * Classpath. */ private Path m_classpath; /** * Fileset. */ private List m_fileSet; /** * Main LAF classname. */ private String m_mainLafClassName; /** * List of delegates to create. */ private List m_delegatesToCreate; /* * (non-Javadoc) * * @see org.apache.tools.ant.Task#init() */ public void init() throws BuildException { super.init(); this.m_fileSet = new ArrayList(); this.m_delegatesToCreate = new ArrayList(); } /** * Returns an array of paths of all the files specified by the * <classpath> or <classpathset> tags. Note that the * <classpath> and <classpathset> tags cannot both be specified. * * @return Array of file paths. */ private String[] getPaths() { String[] pathArray = null; if (this.m_classpath != null) { // // If a tag has been set, m_classpath will // not be null. In this case, just return the array of // paths directly. // pathArray = this.m_classpath.list(); } else { // // Store the directory paths specified by each of the // tags. // pathArray = new String[this.m_fileSet.size()]; for (int i = 0; i < this.m_fileSet.size(); i++) { FileSet fileSet = this.m_fileSet.get(i); File directory = fileSet.getDir(this.getProject()); pathArray[i] = directory.getAbsolutePath(); } } return pathArray; } /* * (non-Javadoc) * * @see org.apache.tools.ant.Task#execute() */ public void execute() throws BuildException { try { // System.out.println(this.m_verbose + ", " + this.m_pattern); // for (Iterator it = this.m_delegatesToCreate .iterator(); it.hasNext();) { UiDelegateType dtc = it.next(); if (this.m_verbose) System.out.println("Will create forwarding delegate for : " + dtc.getName()); } String[] pathArr = this.getPaths(); LafMainClassAugmenter augmenter = new LafMainClassAugmenter(); if (this.m_verbose) augmenter.setVerbose(this.m_verbose); for (int i = 0; i < pathArr.length; i++) { String[] delegates = new String[this.m_delegatesToCreate.size()]; int count = 0; for (Iterator it = this.m_delegatesToCreate.iterator(); it .hasNext();) { UiDelegateType dtc = it.next(); delegates[count++] = dtc.getName(); } augmenter.setDelegatesToAdd(delegates); augmenter.process(pathArr[0], new File(pathArr[0]), this.m_mainLafClassName); } } catch (AugmentException ae) { throw new BuildException(ae); } // process(this.m_classpath, new File(args[0]), p); } /** * @param fSet */ public void addClassPathSet(FileSet fSet) { this.m_fileSet.add(fSet); } /** * @param delegate */ public void addDelegate(UiDelegateType delegate) { this.m_delegatesToCreate.add(delegate); } /** * Returns the current classpath. * * @return Current classpath. */ public Path getClasspath() { return this.m_classpath; } /** * Sets the classpath for this task. Multiple calls append the new classpath * to the current one, rather than overwriting it. * * @param classpath * The new classpath as a Path object. */ public void setClasspath(Path classpath) { if (this.m_classpath == null) { this.m_classpath = classpath; } else { this.m_classpath.append(classpath); } } /** * Creates the classpath for this task and returns it. If the classpath has * already been created, the method just returns that one. * * @return The created classpath. */ public Path createClasspath() { if (this.m_classpath == null) { this.m_classpath = new Path(this.getProject()); } return this.m_classpath; } /** * @param string */ public void setMainlafclassname(String string) { this.m_mainLafClassName = string; } /** * @param bool */ public void setVerbose(boolean bool) { this.m_verbose = bool; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/AugmentTask.java0000644000175000017500000001250211137001462026161 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.types.Path; /** * Ant task for augmenting UI delegates. Is based on JiBX ant task * (BSD-licensed). * * @author Kirill Grouchnikov. */ public class AugmentTask extends Task { /** * Pattern for matching the UI delegates. */ private String m_pattern; /** * Verbosity indication. */ private boolean m_verbose; /** * Classpath. */ private Path m_classpath; /** * Fileset. */ private List m_fileSet; /* * (non-Javadoc) * * @see org.apache.tools.ant.Task#init() */ public void init() throws BuildException { super.init(); this.m_fileSet = new ArrayList(); } /** * Returns an array of paths of all the files specified by the * <classpath> or <classpathset> tags. Note that the * <classpath> and <classpathset> tags cannot both be specified. * * @return Array of file paths. */ private String[] getPaths() { String[] pathArray = null; if (this.m_classpath != null) { // // If a tag has been set, m_classpath will // not be null. In this case, just return the array of // paths directly. // pathArray = this.m_classpath.list(); } else { // // Store the directory paths specified by each of the // tags. // pathArray = new String[this.m_fileSet.size()]; for (int i = 0; i < this.m_fileSet.size(); i++) { FileSet fileSet = this.m_fileSet.get(i); File directory = fileSet.getDir(this.getProject()); pathArray[i] = directory.getAbsolutePath(); } } return pathArray; } /* * (non-Javadoc) * * @see org.apache.tools.ant.Task#execute() */ public void execute() throws BuildException { try { String[] pathArr = this.getPaths(); UiDelegateAugmenter augmenter = new UiDelegateAugmenter(); if (this.m_verbose) augmenter.setVerbose(this.m_verbose); Pattern p = Pattern.compile(this.m_pattern); for (int i = 0; i < pathArr.length; i++) { augmenter.process(pathArr[0], new File(pathArr[0]), p); } } catch (AugmentException ae) { throw new BuildException(ae); } // process(this.m_classpath, new File(args[0]), p); } /** * @param fSet */ public void addClassPathSet(FileSet fSet) { this.m_fileSet.add(fSet); } /** * Returns the current classpath. * * @return The current classpath. */ public Path getClasspath() { return this.m_classpath; } /** * Sets the classpath for this task. Multiple calls append the new classpath * to the current one, rather than overwriting it. * * @param classpath * The new classpath as a Path object. */ public void setClasspath(Path classpath) { if (this.m_classpath == null) { this.m_classpath = classpath; } else { this.m_classpath.append(classpath); } } /** * Creates the classpath for this task and returns it. If the classpath has * already been created, the method just returns that one. * * @return The created classpath. */ public Path createClasspath() { if (this.m_classpath == null) { this.m_classpath = new Path(this.getProject()); } return this.m_classpath; } /** * @param string */ public void setPattern(String string) { this.m_pattern = string; } /** * @param bool */ public void setVerbose(boolean bool) { this.m_verbose = bool; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/AugmentException.java0000644000175000017500000000431511137001462027220 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; /** * Exception thrown when augmentation failed. * * @author Kirill Grouchnikov */ public class AugmentException extends RuntimeException { /** * Creates a new exception. * * @param message * Message. * @param cause * Cause. */ public AugmentException(String message, Throwable cause) { super(message, cause); } /** * Creates a new exception. * * @param message * Message. */ public AugmentException(String message) { super(message); } }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/UiDelegateWriterEmptyCtr.java0000644000175000017500000000703411137001462030637 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import org.objectweb.asm.*; /** * Bytecode writer for a forwarding UI delegate class with a single constructor * that gets no parameters. * * @author Kirill Grouchnikov */ public class UiDelegateWriterEmptyCtr extends ClassWriter implements Opcodes { /** * Creates a new bytecode writer. */ public UiDelegateWriterEmptyCtr() { super(false); } /** * Creates a new class. * * @param packageName * Package name. * @param className * Class name. * @param superClassName * Superclass name. * @return Class bytecode contents. */ public static byte[] createClass(String packageName, String className, String superClassName) { packageName = packageName.replace('.', '/'); superClassName = superClassName.replace('.', '/'); UiDelegateWriterEmptyCtr cw = new UiDelegateWriterEmptyCtr(); MethodVisitor mv; cw.visit(Opcodes.V1_2, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, packageName + "/" + className, null, superClassName, null); cw.visitSource(className + ".java", null); mv = cw.visitMethod(Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC, "createUI", "(Ljavax/swing/JComponent;)Ljavax/swing/plaf/ComponentUI;", null, null); mv.visitCode(); mv.visitTypeInsn(Opcodes.NEW, packageName + "/" + className); mv.visitInsn(Opcodes.DUP); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, packageName + "/" + className, "", "()V"); mv.visitInsn(Opcodes.ARETURN); mv.visitMaxs(2, 1); mv.visitEnd(); mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "", "()V", null, null); mv.visitCode(); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, superClassName, "", "()V"); mv.visitInsn(Opcodes.RETURN); mv.visitMaxs(1, 1); mv.visitEnd(); cw.visitEnd(); return cw.toByteArray(); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/Utils.java0000644000175000017500000002040711137001462025041 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.*; import javax.swing.plaf.basic.BasicLookAndFeel; import javax.swing.plaf.metal.MetalLookAndFeel; import com.sun.java.swing.plaf.windows.WindowsLookAndFeel; /** * Utility functions. * * @author Kirill Grouchnikov */ public class Utils { /** * Maps the LAF names. */ protected Map lafMap; /** * Singleton. */ protected static Utils instance = new Utils(); /** * IDs of all UI delegates. */ public static final String[] UI_IDS = new String[] { "ButtonUI", "CheckBoxUI", "CheckBoxMenuItemUI", "ColorChooserUI", "ComboBoxUI", "DesktopIconUI", "DesktopPaneUI", "EditorPaneUI", "FormattedTextFieldUI", "InternalFrameUI", "LabelUI", "ListUI", "MenuUI", "MenuBarUI", "MenuItemUI", "OptionPaneUI", "PanelUI", "PasswordFieldUI", "PopupMenuUI", "PopupMenuSeparatorUI", "ProgressBarUI", "RadioButtonUI", "RadioButtonMenuItemUI", "RootPaneUI", "ScrollBarUI", "ScrollPaneUI", "SplitPaneUI", "SliderUI", "SeparatorUI", "SpinnerUI", "ToolBarSeparatorUI", "TabbedPaneUI", "TableUI", "TableHeaderUI", "TextAreaUI", "TextFieldUI", "TextPaneUI", "ToggleButtonUI", "ToolBarUI", "ToolTipUI", "TreeUI", "ViewportUI" }; /** * Constructor. */ private Utils() { this.lafMap = new HashMap(); this.lafMap.put(BasicLookAndFeel.class.getName(), "javax.swing.plaf.basic.Basic"); this.lafMap.put(MetalLookAndFeel.class.getName(), "javax.swing.plaf.metal.Metal"); this.lafMap.put(WindowsLookAndFeel.class.getName(), "com.sun.java.swing.plaf.windows.Windows"); } /** * Returns instance. * * @return Instance. */ public static Utils getUtils() { return Utils.instance; } /** * Returns fully-qualified class name for the UI delegate based on the * specified parameters. * * @param uiKey * UI key. * @param lafClassName * Class name of the LAF. * @return Fully-qualified class name for the UI delegate. The LAF hierarchy * is searched starting from the specified class name and up. For * example, if the second parameter points to * {@link MetalLookAndFeel}, the metal delegate classname is * returned if exists; otherwise the basic delegate classname is * returned. */ public String getUIDelegate(String uiKey, String lafClassName) { try { lafClassName = lafClassName.replace('/', '.'); return this.getUIDelegate(uiKey, Class.forName(lafClassName)); } catch (ClassNotFoundException cnfe) { throw new AugmentException( "Class '" + lafClassName + "' not found", cnfe); } } /** * Returns fully-qualified class name for the UI delegate based on the * specified parameters. * * @param uiKey * UI key. * @param origLafClazz * LAF class. * @return Fully-qualified class name for the UI delegate. The LAF hierarchy * is searched starting from the specified class and up. For * example, if the second parameter points to * {@link MetalLookAndFeel}, the metal delegate classname is * returned if exists; otherwise the basic delegate classname is * returned. */ public String getUIDelegate(String uiKey, Class origLafClazz) { Class lafClazz = origLafClazz; while (lafClazz != null) { String prefix = (String) this.lafMap.get(lafClazz.getName()); if (prefix != null) { String fullClassName = prefix + uiKey; Class delegateClazz = null; try { delegateClazz = Class.forName(fullClassName); } catch (ClassNotFoundException cnfe) { } if (delegateClazz != null) return fullClassName; } lafClazz = lafClazz.getSuperclass(); } throw new AugmentException("No match for '" + uiKey + "' in '" + origLafClazz.getName() + "' hierarchy"); } /** * Returns JNI-compliant description of the specified class (type). For * example, for JButton[] this function will return * [Ljavax/swing/JButton;. * * @param clazz * Class. * @return JNI-compliant class (type) description. */ public static String getTypeDesc(Class clazz) { if (clazz.isArray()) return "[" + Utils.getTypeDesc(clazz.getComponentType()); if (clazz == void.class) return "V"; if (clazz == boolean.class) return "Z"; if (clazz == byte.class) return "B"; if (clazz == char.class) return "C"; if (clazz == short.class) return "S"; if (clazz == int.class) return "I"; if (clazz == long.class) return "J"; if (clazz == float.class) return "F"; if (clazz == double.class) return "D"; return "L" + clazz.getName().replace('.', '/') + ";"; } /** * Returns JNI-compliant description of the specified method. For example, * for void installUI(JButton button) this function will * return (Ljavax/swing/JButton;)V. * * @param method * Method. * @return JNI-compliant method description. */ public static String getMethodDesc(Method method) { StringBuffer result = new StringBuffer(); result.append("("); Class[] paramClasses = method.getParameterTypes(); for (int i = 0; i < paramClasses.length; i++) { Class paramClass = paramClasses[i]; result.append(Utils.getTypeDesc(paramClass)); } result.append(")"); result.append(Utils.getTypeDesc(method.getReturnType())); return result.toString(); } /** * Test app. * * @param args */ public static void main(String[] args) { for (Map.Entry entry : Utils.instance.lafMap.entrySet()) { //Map.Entry entry = (Map.Entry) it.next(); String lafClassName = entry.getKey(); System.out.println(lafClassName); String prefix = entry.getValue(); for (int i = 0; i < Utils.UI_IDS.length; i++) { String uiClassName = prefix + Utils.UI_IDS[i]; try { Class uiClazz = Class.forName(uiClassName); System.out.println("\t" + Utils.UI_IDS[i]); Constructor[] ctrs = uiClazz.getDeclaredConstructors(); for (int j = 0; j < ctrs.length; j++) { Constructor ctr = ctrs[j]; Class[] ctrArgs = ctr.getParameterTypes(); System.out.print("\t\t" + ctrArgs.length + " args : "); for (int k = 0; k < ctrArgs.length; k++) System.out.print(ctrArgs[k].getName() + ","); System.out.println(); } } catch (ClassNotFoundException cnfe) { } catch (Exception e) { e.printStackTrace(); } } } } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/ContainerGhostingAugmenter.java0000644000175000017500000004334311137001462031242 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import java.io.*; import java.lang.reflect.Method; import java.net.URL; import java.net.URLClassLoader; import java.util.*; import org.objectweb.asm.*; /** * Augments the UI classes with ghosting painting. Is based on sample adapter * from ASM distribution. * * @author Kirill Grouchnikov */ public class ContainerGhostingAugmenter { /** * Verbosity indication. */ private boolean isVerbose; /** * Adapter for augmenting a single class. * * @author Kirill Grouchnikov. */ protected class AugmentClassAdapter extends ClassAdapter implements Opcodes { /** * Contains all method names. */ private Set existingMethods; /** * Contains all field names. */ private Set existingFields; /** * Method to augment. */ private Method methodToAugment; /** * true if the code needs to be injected after the call * to the original implementation. */ private boolean toInjectAfterOriginal; /** * Prefix for delegate methods that will be added. */ private String prefix; /** * Creates a new augmentor. * * @param cv * Class visitor to recreate the non-augmented methods. * @param existingMethods * Contains all method names. * @param existingFields * Contains all field names. * @param methodToAugment * Method to augment. * @param toInjectAfterOriginal * true if the code needs to be injected after * the call to the original implementation. */ public AugmentClassAdapter(final ClassVisitor cv, Set existingMethods, Set existingFields, Method methodToAugment, boolean toInjectAfterOriginal) { super(cv); this.existingMethods = existingMethods; this.existingFields = existingFields; this.methodToAugment = methodToAugment; this.toInjectAfterOriginal = toInjectAfterOriginal; } /* * (non-Javadoc) * * @see org.objectweb.asm.ClassAdapter#visit(int, int, java.lang.String, * java.lang.String, java.lang.String, java.lang.String[]) */ @Override public void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) { this.prefix = "__" + name.replaceAll("/", "__") + "__container__"; super .visit(version, access, name, signature, superName, interfaces); // Check if need to add the containerGhostingMarker field (boolean) if (!this.existingFields.contains("containerGhostingMarker")) { FieldVisitor fv = this.visitField(Opcodes.ACC_PROTECTED, "containerGhostingMarker", "Z", null, null); fv.visitEnd(); } // We have three separate cases for the method that we // want to augment: // // 1. The current .class has both function and the __ version - // already has been augmented. Can be ignored. // // 2. The current .class has function but doesn't have the __ // version. Than, the original function has already been renamed to // __ (in the visitMethod). We need to create a new version for this // function that performs pre-logic, calls __ and performs the // post-logic. // // 3. The current .class doesn't have neither the function nor // the __ version. In this case we need to create the __ version // that calls super (with the original name) and the function that // performs pre-logic, calls __ and performs the post-logic. String methodName = methodToAugment.getName(); boolean hasOriginal = this.existingMethods.contains(methodName); boolean hasDelegate = this.existingMethods.contains(this.prefix + methodName); String methodSignature = Utils.getMethodDesc(methodToAugment); int paramCount = methodToAugment.getParameterTypes().length; if (ContainerGhostingAugmenter.this.isVerbose) System.out.println("... Augmenting " + methodName + " " + methodSignature + " : original - " + hasOriginal + ", delegate - " + hasDelegate + ", " + paramCount + " params"); if (!hasDelegate) { if (toInjectAfterOriginal) { this.augmentUpdateMethodAfter(!hasOriginal, name, superName, methodSignature); } else { this.augmentUpdateMethodBefore(!hasOriginal, name, superName, methodSignature); } } } /** * Augments the update method that is assumed to always * have two parameters, injecting the ghosting code before the * original implementation. * * @param toSynthOriginal * Indication whether we need to create an empty (only call * to super()) implementation. * @param className * Class name. * @param superClassName * Super class name (relevant for generating empty * implementation). * @param methodDesc * Function signature (using JNI style declaration). Example * for void installUI(JButton button): * (Ljavax/swing/JButton;)V. */ public void augmentUpdateMethodBefore(boolean toSynthOriginal, String className, String superClassName, String methodDesc) { // Some ASM woodoo. The code below was generated by using // ASMifierClassVisitor. if (toSynthOriginal) { MethodVisitor mv = this.cv.visitMethod(Opcodes.ACC_PUBLIC, this.prefix + "update", "(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 2); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, superClassName, "update", "(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V"); mv.visitInsn(RETURN); mv.visitMaxs(3, 3); mv.visitEnd(); } MethodVisitor mv = this.cv.visitMethod(ACC_PROTECTED, "update", methodDesc, null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 2); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn(INVOKESTATIC, "org/jvnet/lafwidget/animation/effects/GhostPaintingUtils", "paintGhostImages", "(Ljava/awt/Component;Ljava/awt/Graphics;)V"); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 2); mv.visitMethodInsn(INVOKEVIRTUAL, className, this.prefix + "update", "(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V"); mv.visitInsn(RETURN); mv.visitMaxs(3, 3); mv.visitEnd(); } /** * Augments the update method that is assumed to always * have two parameters, injecting the ghosting code after the * original implementation. * * @param toSynthOriginal * Indication whether we need to create an empty (only call * to super()) implementation. * @param className * Class name. * @param superClassName * Super class name (relevant for generating empty * implementation). * @param methodDesc * Function signature (using JNI style declaration). Example * for void installUI(JButton button): * (Ljavax/swing/JButton;)V. */ public void augmentUpdateMethodAfter(boolean toSynthOriginal, String className, String superClassName, String methodDesc) { // Some ASM woodoo. The code below was generated by using // ASMifierClassVisitor. if (toSynthOriginal) { MethodVisitor mv = this.cv.visitMethod(Opcodes.ACC_PUBLIC, this.prefix + "update", "(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 2); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, superClassName, "update", "(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V"); mv.visitInsn(RETURN); mv.visitMaxs(3, 3); mv.visitEnd(); } MethodVisitor mv = this.cv.visitMethod(ACC_PROTECTED, "update", methodDesc, null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 2); mv.visitMethodInsn(INVOKEVIRTUAL, className, this.prefix + "update", "(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V"); mv.visitVarInsn(ALOAD, 2); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn(INVOKESTATIC, "org/jvnet/lafwidget/animation/effects/GhostPaintingUtils", "paintGhostImages", "(Ljava/awt/Component;Ljava/awt/Graphics;)V"); mv.visitInsn(RETURN); mv.visitMaxs(3, 3); mv.visitEnd(); } /* * (non-Javadoc) * * @see org.objectweb.asm.ClassAdapter#visitMethod(int, * java.lang.String, java.lang.String, java.lang.String, * java.lang.String[]) */ @Override public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) { if (methodToAugment.getName().equals(name)) { // possible candidate for weaving. Check if has __ already if (!this.existingMethods.contains(this.prefix + name)) { // effectively renames the existing method prepending __ // to the name if (ContainerGhostingAugmenter.this.isVerbose) System.out.println("... renaming '" + name + "(" + desc + ")' to '" + (this.prefix + name) + "'"); return this.cv.visitMethod(access, this.prefix + name, desc, signature, exceptions); } } // preserve the existing method as is return this.cv.visitMethod(access, name, desc, signature, exceptions); } } /** * Augments a single class with image ghosting UI behaviour. * * @param dir * Root directory for the library that contains the class. * @param name * Fully-qualified class name. * @param toInjectAfterOriginal * true if the code needs to be injected after the * call to the original implementation. * @throws AugmentException * If the augmentation process failed. */ protected synchronized void augmentClass(String dir, final String name, final boolean toInjectAfterOriginal) { if (this.isVerbose) System.out.println("Working on " + name + ".update() [" + (toInjectAfterOriginal ? "after]" : "before]")); // gets an input stream to read the bytecode of the class String resource = dir + File.separator + name.replace('.', '/') + ".class"; Method methodToAugment = null; try { ClassLoader cl = new URLClassLoader(new URL[] { new File(dir) .toURL() }, ContainerGhostingAugmenter.class .getClassLoader()); Class clazz = cl.loadClass(name); // Start iterating over all methods and see what do we // need to augment while (clazz != null) { if (methodToAugment != null) break; Method[] methods = clazz.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if (!"update".equals(method.getName())) continue; methodToAugment = method; break; } clazz = clazz.getSuperclass(); } } catch (Exception e) { throw new AugmentException(name, e); } Set existingMethods = null; Set existingFields = null; InputStream is = null; try { is = new FileInputStream(resource); ClassReader cr = new ClassReader(is); InfoClassVisitor infoAdapter = new InfoClassVisitor(); cr.accept(infoAdapter, false); existingMethods = infoAdapter.getMethods(); existingFields = infoAdapter.getFields(); } catch (Exception e) { throw new AugmentException(name, e); } finally { try { is.close(); } catch (IOException ioe) { } } // See if the 'containerGhostingMarker' field is already defined. In // this // case the class is *not* augmented if (existingFields.contains("containerGhostingMarker")) { if (this.isVerbose) System.out .println("Not augmenting resource, field 'containerGhostingMarker' is present"); return; } // Augment the class (overriding the existing file). byte[] b; try { is = new FileInputStream(resource); ClassReader cr = new ClassReader(is); ClassWriter cw = new ClassWriter(false); ClassVisitor cv = new AugmentClassAdapter(cw, existingMethods, existingFields, methodToAugment, toInjectAfterOriginal); cr.accept(cv, false); b = cw.toByteArray(); } catch (Exception e) { throw new AugmentException(name, e); } finally { try { is.close(); } catch (IOException ioe) { } } FileOutputStream fos = null; try { fos = new FileOutputStream(resource); fos.write(b); if (this.isVerbose) System.out.println("Updated resource " + resource); } catch (Exception e) { } finally { if (fos != null) { try { fos.close(); } catch (IOException ioe) { } } } } /** * Processes a single file or a directory, augmenting all relevant classes. * * @param toStrip * The leading prefix to strip from the file names. Is used to * create fully-qualified class name. * @param file * File resource (can point to a single file or to a directory). * @param ids * List of class-method pairs to augment. * @throws AugmentException * If the augmentation process failed. */ public void process(String toStrip, File file, List ids) throws AugmentException { if (file.isDirectory()) { File[] children = file.listFiles(); for (int i = 0; i < children.length; i++) { this.process(toStrip, children[i], ids); } } else { String currClassName = file.getAbsolutePath().substring( toStrip.length() + 1); currClassName = currClassName.replace(File.separatorChar, '.'); currClassName = currClassName.substring(0, currClassName.length() - 6); for (ContainerGhostingType igt : ids) { // System.out.println(currClassName + ":" + igt.getClassName()); if (currClassName.equals(igt.getClassName())) { this.augmentClass(toStrip, igt.getClassName(), igt .isToInjectAfterOriginal()); } } } } /** * Sets the verbosity. * * @param isVerbose * New value for augmentation process verbosity. */ public void setVerbose(boolean isVerbose) { this.isVerbose = isVerbose; } /** * Test method. * * @param args * @throws AugmentException */ public static void main(final String args[]) throws AugmentException { if (args.length == 0) { System.out .println("Usage : java ... IconGhostingDelegateAugmenter [-verbose] [-pattern class_pattern] file_resource"); System.out .println("\tIf -verbose option is specified, the augmenter prints out its actions."); System.out .println("\tIf -class option if specified, its value is used as class name to augment."); System.out .println("\tIf -before option if specified, the code is injected before the original code."); System.out .println("\tThe last parameter can point to either a file or a directory. " + "The directory should be the root directory for classes."); return; } ContainerGhostingAugmenter uiDelegateAugmenter = new ContainerGhostingAugmenter(); int argNum = 0; String className = null; boolean isAfter = true; while (true) { String currArg = args[argNum]; if ("-verbose".equals(currArg)) { uiDelegateAugmenter.setVerbose(true); argNum++; continue; } if ("-class".equals(currArg)) { argNum++; className = args[argNum]; argNum++; continue; } if ("-before".equals(currArg)) { argNum++; isAfter = false; continue; } break; } File starter = new File(args[argNum]); ContainerGhostingType igt = new ContainerGhostingType(); igt.setClassName(className); igt.setToInjectAfterOriginal(isAfter); uiDelegateAugmenter.process(starter.getAbsolutePath(), starter, Arrays .asList(igt)); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/IconGhostingType.java0000644000175000017500000000610211137001462027172 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import org.apache.tools.ant.types.DataType; /** * Ant type for storing iconGhosting elements of * {@link AugmentIconGhostingTask} task. * * *

* Represents the following build snippet: *

* *

 * <iconGhosting className="org.jvnet.substance.SubstanceButtonUI"
 * methodName="paintIcon" />
 * 
* * @author Kirill Grouchnikov */ public class IconGhostingType extends DataType { /** * UI delegate class name. */ private String className; /** * Method name to augment. */ private String methodName; /** * Creates new instance. */ public IconGhostingType() { super(); } /** * Sets the UI delegate class name. * * @param name * UI delegate class name. */ public void setClassName(String name) { this.className = name; } /** * Returns the UI delegate class name. * * @return UI delegate class name. */ public String getClassName() { return this.className; } /** * Returns the method name to augment. * * @return Method name to augment. */ public String getMethodName() { return methodName; } /** * Sets the method name to augment. * * @param methodName * Method name to augment. */ public void setMethodName(String methodName) { this.methodName = methodName; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/IconGhostingAugmenter.java0000644000175000017500000006341411137001462030211 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import java.awt.Graphics; import java.awt.Rectangle; import java.io.*; import java.lang.reflect.Method; import java.net.URL; import java.net.URLClassLoader; import java.util.*; import javax.swing.JComponent; import org.objectweb.asm.*; /** * Augments the button UI classes with icon ghosting painting. Is based on * sample adapter from ASM distribution. * * @author Kirill Grouchnikov */ public class IconGhostingAugmenter { /** * Verbosity indication. */ private boolean isVerbose; /** * Adapter for augmenting a single class. * * @author Kirill Grouchnikov. */ protected class AugmentClassAdapter extends ClassAdapter implements Opcodes { /** * Contains all method names. */ private Set existingMethods; /** * Contains all field names. */ private Set existingFields; /** * Method to augment. */ private Method methodToAugment; // private Method methodInstallListeners; // // private Method methodUninstallListeners; /** * Prefix for delegate methods that will be added. */ private String prefix; /** * Creates a new augmentor. * * @param cv * Class visitor to recreate the non-augmented methods. * @param existingMethods * Contains all method names. * @param existingFields * Contains all field names. * @param methodToAugment * Method to augment. */ public AugmentClassAdapter(final ClassVisitor cv, Set existingMethods, Set existingFields, Method methodToAugment// , // Method methodInstallListeners, Method methodUninstallListeners ) { super(cv); this.existingMethods = existingMethods; this.existingFields = existingFields; this.methodToAugment = methodToAugment; // this.methodInstallListeners = methodInstallListeners; // this.methodUninstallListeners = methodUninstallListeners; } /* * (non-Javadoc) * * @see org.objectweb.asm.ClassAdapter#visit(int, int, java.lang.String, * java.lang.String, java.lang.String, java.lang.String[]) */ @Override public void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) { this.prefix = "__" + name.replaceAll("/", "__") + "__icon__"; super .visit(version, access, name, signature, superName, interfaces); // Check if need to add the iconGhostingMarker field (boolean) if (!this.existingFields.contains("iconGhostingMarker")) { FieldVisitor fv = this.visitField(Opcodes.ACC_PROTECTED, "iconGhostingMarker", "Z", null, null); fv.visitEnd(); // this.visitInnerClass(name + "$1", null, null, 0); // // fv = this.visitField(ACC_PRIVATE, "ghostModelChangeListener", // "Lorg/jvnet/lafwidget/utils/GhostingListener;", null, // null); // fv.visitEnd(); // fv = this.visitField(ACC_PROTECTED, "ghostPropertyListener", // "Ljava/beans/PropertyChangeListener;", null, null); // fv.visitEnd(); // // MethodVisitor mv = this // .visitMethod( // ACC_STATIC + ACC_SYNTHETIC, // "access$0", // "(L" // + name // + ";)Lorg/jvnet/lafwidget/utils/GhostingListener;", // null, null); // mv.visitCode(); // mv.visitVarInsn(ALOAD, 0); // mv.visitFieldInsn(GETFIELD, name, "ghostModelChangeListener", // "Lorg/jvnet/lafwidget/utils/GhostingListener;"); // mv.visitInsn(ARETURN); // mv.visitMaxs(1, 1); // mv.visitEnd(); // // mv = this // .visitMethod( // ACC_STATIC + ACC_SYNTHETIC, // "access$1", // "(L" // + name // + ";Lorg/jvnet/lafwidget/utils/GhostingListener;)V", // null, null); // mv.visitCode(); // mv.visitVarInsn(ALOAD, 0); // mv.visitVarInsn(ALOAD, 1); // mv.visitFieldInsn(PUTFIELD, name, "ghostModelChangeListener", // "Lorg/jvnet/lafwidget/utils/GhostingListener;"); // mv.visitInsn(RETURN); // mv.visitMaxs(2, 2); // mv.visitEnd(); // } // We have three separate cases for the method that we // want to augment: // // 1. The current .class has both function and the __ version - // already has been augmented. Can be ignored. // // 2. The current .class has function but doesn't have the __ // version. Than, the original function has already been renamed to // __ (in the visitMethod). We need to create a new version for this // function that performs pre-logic, calls __ and performs the // post-logic. // // 3. The current .class doesn't have neither the function nor // the __ version. In this case we need to create the __ version // that calls super (with the original name) and the function that // performs pre-logic, calls __ and performs the post-logic. Method[] toAugment = new Method[] { this.methodToAugment }; // this.methodInstallListeners, this.methodUninstallListeners }; for (Method currMethodToAugment : toAugment) { String methodName = currMethodToAugment.getName(); boolean hasOriginal = this.existingMethods.contains(methodName); boolean hasDelegate = this.existingMethods.contains(this.prefix + methodName); String methodSignature = Utils .getMethodDesc(currMethodToAugment); int paramCount = currMethodToAugment.getParameterTypes().length; if (IconGhostingAugmenter.this.isVerbose) System.out.println("... Augmenting " + methodName + " " + methodSignature + " : original - " + hasOriginal + ", delegate - " + hasDelegate + ", " + paramCount + " params"); if (!hasDelegate) { // if (methodName.equals("installListeners")) { // this.augmentInstallListeners(!hasOriginal, name, // superName, methodName, methodSignature); // } else { // if (methodName.equals("uninstallListeners")) { // this.augmentUninstallListeners(!hasOriginal, name, // superName, methodName, methodSignature); // } else { this.augmentPaintIconMethod(!hasOriginal, name, superName, methodName, methodSignature); // } // } } } } /** * Augments the paintIcon method that is assumed to * always have three parameters. * * @param toSynthOriginal * Indication whether we need to create an empty (only call * to super()) implementation. * @param className * Class name. * @param superClassName * Super class name (relevant for generating empty * implementation). * @param methodName * Method name. * @param methodDesc * Function signature (using JNI style declaration). Example * for void installUI(JButton button): * (Ljavax/swing/JButton;)V. */ public void augmentPaintIconMethod(boolean toSynthOriginal, String className, String superClassName, String methodName, String methodDesc) { // Some ASM woodoo. The code below was generated by using // ASMifierClassVisitor. if (toSynthOriginal) { MethodVisitor mv = this.cv.visitMethod(Opcodes.ACC_PUBLIC, this.prefix + methodName, methodDesc, null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 2); mv.visitVarInsn(ALOAD, 3); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, superClassName, methodName, methodDesc); mv.visitInsn(RETURN); mv.visitMaxs(4, 4); mv.visitEnd(); } MethodVisitor mv = this.cv.visitMethod(ACC_PROTECTED, methodName, methodDesc, null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 2); mv.visitLdcInsn("icon.bounds"); mv.visitTypeInsn(NEW, "java/awt/Rectangle"); mv.visitInsn(DUP); mv.visitVarInsn(ALOAD, 3); mv.visitMethodInsn(INVOKESPECIAL, "java/awt/Rectangle", "", "(Ljava/awt/Rectangle;)V"); mv.visitMethodInsn(INVOKEVIRTUAL, "javax/swing/JComponent", "putClientProperty", "(Ljava/lang/Object;Ljava/lang/Object;)V"); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/Graphics", "create", "()Ljava/awt/Graphics;"); mv.visitTypeInsn(CHECKCAST, "java/awt/Graphics2D"); mv.visitVarInsn(ASTORE, 4); mv.visitVarInsn(ALOAD, 4); mv.visitVarInsn(ALOAD, 2); mv.visitTypeInsn(CHECKCAST, "javax/swing/AbstractButton"); mv.visitVarInsn(ALOAD, 3); mv .visitMethodInsn( INVOKESTATIC, "org/jvnet/lafwidget/animation/effects/GhostPaintingUtils", "paintGhostIcon", "(Ljava/awt/Graphics2D;Ljavax/swing/AbstractButton;Ljava/awt/Rectangle;)V"); mv.visitVarInsn(ALOAD, 4); mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/Graphics2D", "dispose", "()V"); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 2); mv.visitVarInsn(ALOAD, 3); mv.visitMethodInsn(INVOKEVIRTUAL, className, this.prefix + methodName, methodDesc); mv.visitInsn(RETURN); mv.visitMaxs(5, 5); mv.visitEnd(); } /** * Augments the installListeners method. * * @param toSynthOriginal * Indication whether we need to create an empty (only call * to super()) implementation. * @param className * Class name. * @param superClassName * Super class name (relevant for generating empty * implementation). * @param methodName * Method name. * @param functionDesc * Function signature (using JNI style declaration). Example * for void installUI(JButton button): * (Ljavax/swing/JButton;)V. */ public void augmentInstallListeners(boolean toSynthOriginal, String className, String superClassName, String methodName, String functionDesc) { // Some ASM woodoo. The code below was generated by using // ASMifierClassVisitor. if (toSynthOriginal) { if (isVerbose) { System.out.println("... Creating empty '" + methodName + functionDesc + "' forwarding to super '" + superClassName + "'"); } MethodVisitor mv = this.cv.visitMethod(Opcodes.ACC_PUBLIC, this.prefix + methodName, functionDesc, null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn(INVOKESPECIAL, superClassName, "installListeners", "(Ljavax/swing/AbstractButton;)V"); mv.visitInsn(RETURN); mv.visitMaxs(2, 2); mv.visitEnd(); } if (isVerbose) { System.out.println("... Augmenting '" + methodName + functionDesc + "'"); } MethodVisitor mv = this.cv.visitMethod(Opcodes.ACC_PUBLIC, methodName, functionDesc, null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn(INVOKEVIRTUAL, className, prefix + "installListeners", functionDesc); mv.visitVarInsn(ALOAD, 0); mv.visitTypeInsn(NEW, className + "$1"); mv.visitInsn(DUP); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn(INVOKESPECIAL, className + "$1", "", "(L" + className + ";Ljavax/swing/AbstractButton;)V"); mv.visitFieldInsn(PUTFIELD, className, "ghostPropertyListener", "Ljava/beans/PropertyChangeListener;"); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 0); mv.visitFieldInsn(GETFIELD, className, "ghostPropertyListener", "Ljava/beans/PropertyChangeListener;"); mv.visitMethodInsn(INVOKEVIRTUAL, "javax/swing/AbstractButton", "addPropertyChangeListener", "(Ljava/beans/PropertyChangeListener;)V"); mv.visitVarInsn(ALOAD, 0); mv.visitTypeInsn(NEW, "org/jvnet/lafwidget/utils/GhostingListener"); mv.visitInsn(DUP); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn(INVOKEVIRTUAL, "javax/swing/AbstractButton", "getModel", "()Ljavax/swing/ButtonModel;"); mv.visitMethodInsn(INVOKESPECIAL, "org/jvnet/lafwidget/utils/GhostingListener", "", "(Ljava/awt/Component;Ljavax/swing/ButtonModel;)V"); mv.visitFieldInsn(PUTFIELD, className, "ghostModelChangeListener", "Lorg/jvnet/lafwidget/utils/GhostingListener;"); mv.visitVarInsn(ALOAD, 0); mv.visitFieldInsn(GETFIELD, className, "ghostModelChangeListener", "Lorg/jvnet/lafwidget/utils/GhostingListener;"); mv.visitMethodInsn(INVOKEVIRTUAL, "org/jvnet/lafwidget/utils/GhostingListener", "registerListeners", "()V"); mv.visitInsn(RETURN); mv.visitMaxs(5, 2); mv.visitEnd(); } /** * Augments the uninstallListeners method. * * @param toSynthOriginal * Indication whether we need to create an empty (only call * to super()) implementation. * @param className * Class name. * @param superClassName * Super class name (relevant for generating empty * implementation). * @param methodName * Method name. * @param functionDesc * Function signature (using JNI style declaration). Example * for void installUI(JButton button): * (Ljavax/swing/JButton;)V. */ public void augmentUninstallListeners(boolean toSynthOriginal, String className, String superClassName, String methodName, String functionDesc) { // Some ASM woodoo. The code below was generated by using // ASMifierClassVisitor. if (toSynthOriginal) { if (isVerbose) { System.out.println("... Creating empty '" + methodName + functionDesc + "' forwarding to super '" + superClassName + "'"); } MethodVisitor mv = this.cv.visitMethod(Opcodes.ACC_PUBLIC, this.prefix + methodName, functionDesc, null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv .visitMethodInsn(INVOKESPECIAL, superClassName, "uninstallListeners", "(Ljavax/swing/AbstractButton;)V"); mv.visitInsn(RETURN); mv.visitMaxs(2, 2); mv.visitEnd(); } if (isVerbose) { System.out.println("... Augmenting '" + methodName + functionDesc + "'"); } MethodVisitor mv = this.cv.visitMethod(Opcodes.ACC_PUBLIC, methodName, functionDesc, null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 0); mv.visitFieldInsn(GETFIELD, className, "ghostPropertyListener", "Ljava/beans/PropertyChangeListener;"); mv.visitMethodInsn(INVOKEVIRTUAL, "javax/swing/AbstractButton", "removePropertyChangeListener", "(Ljava/beans/PropertyChangeListener;)V"); mv.visitVarInsn(ALOAD, 0); mv.visitInsn(ACONST_NULL); mv.visitFieldInsn(PUTFIELD, className, "ghostPropertyListener", "Ljava/beans/PropertyChangeListener;"); mv.visitVarInsn(ALOAD, 0); mv.visitFieldInsn(GETFIELD, className, "ghostModelChangeListener", "Lorg/jvnet/lafwidget/utils/GhostingListener;"); mv.visitMethodInsn(INVOKEVIRTUAL, "org/jvnet/lafwidget/utils/GhostingListener", "unregisterListeners", "()V"); mv.visitVarInsn(ALOAD, 0); mv.visitInsn(ACONST_NULL); mv.visitFieldInsn(PUTFIELD, className, "ghostModelChangeListener", "Lorg/jvnet/lafwidget/utils/GhostingListener;"); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn(INVOKEVIRTUAL, className, prefix + "uninstallListeners", "(Ljavax/swing/AbstractButton;)V"); mv.visitInsn(RETURN); mv.visitMaxs(2, 2); mv.visitEnd(); } /* * (non-Javadoc) * * @see org.objectweb.asm.ClassAdapter#visitMethod(int, * java.lang.String, java.lang.String, java.lang.String, * java.lang.String[]) */ @Override public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) { Set toAugment = new HashSet(); toAugment.add(this.methodToAugment.getName()); // toAugment.add(this.methodInstallListeners.getName()); // toAugment.add(this.methodUninstallListeners.getName()); if (toAugment.contains(name)) { // possible candidate for weaving. Check if has __ already if (!this.existingMethods.contains(this.prefix + name)) { // effectively renames the existing method prepending __ // to the name if (IconGhostingAugmenter.this.isVerbose) System.out.println("... renaming '" + name + "(" + desc + ")' to '" + (this.prefix + name) + "'"); return this.cv.visitMethod(access, this.prefix + name, desc, signature, exceptions); } } // preserve the existing method as is return this.cv.visitMethod(access, name, desc, signature, exceptions); } } /** * Augments a single class with additional UI behaviour. * * @param dir * Root directory for the library that contains the class. * @param name * Fully-qualified class name. * @param paintIconMethodName * Method name. * @throws AugmentException * If the augmentation process failed. */ protected synchronized void augmentClass(String dir, final String name, final String paintIconMethodName) { if (this.isVerbose) System.out .println("Working on " + name + "." + paintIconMethodName); // gets an input stream to read the bytecode of the class String resource = dir + File.separator + name.replace('.', '/') + ".class"; Method methodToAugment = null; Method methodInstallListeners = null; Method methodUninstallListeners = null; try { ClassLoader cl = new URLClassLoader(new URL[] { new File(dir) .toURL() }, IconGhostingAugmenter.class.getClassLoader()); Class clazz = cl.loadClass(name); // Start iterating over all methods and see what do we // need to augment while (clazz != null) { Method[] methods = clazz.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if ((methodInstallListeners == null) && (method.getName().equals("installListeners"))) { methodInstallListeners = method; continue; } if ((methodUninstallListeners == null) && (method.getName().equals("uninstallListeners"))) { methodUninstallListeners = method; continue; } if (!paintIconMethodName.equals(method.getName())) continue; Class[] params = method.getParameterTypes(); boolean paramsOk = (params.length == 3); if (paramsOk) { paramsOk = paramsOk && (params[0] == Graphics.class); paramsOk = paramsOk && (JComponent.class .isAssignableFrom(params[1])); paramsOk = paramsOk && (params[2] == Rectangle.class); if (isVerbose) { System.out.println("Method params are " + params[0].getName() + ":" + params[1].getName() + ":" + params[2].getName() + " - " + paramsOk); } } if (!paramsOk) continue; if (methodToAugment == null) { methodToAugment = method; } } clazz = clazz.getSuperclass(); } } catch (Exception e) { throw new AugmentException(name, e); } Set existingMethods = null; Set existingFields = null; InputStream is = null; try { is = new FileInputStream(resource); ClassReader cr = new ClassReader(is); InfoClassVisitor infoAdapter = new InfoClassVisitor(); cr.accept(infoAdapter, false); existingMethods = infoAdapter.getMethods(); existingFields = infoAdapter.getFields(); } catch (Exception e) { throw new AugmentException(name, e); } finally { try { is.close(); } catch (IOException ioe) { } } // See if the 'iconGhostingMarker' field is already defined. In this // case the class is *not* augmented if (existingFields.contains("iconGhostingMarker")) { if (this.isVerbose) System.out .println("Not augmenting resource, field 'iconGhostingMarker' is present"); return; } // Augment the class (overriding the existing file). byte[] b; try { is = new FileInputStream(resource); ClassReader cr = new ClassReader(is); ClassWriter cw = new ClassWriter(false); ClassVisitor cv = new AugmentClassAdapter(cw, existingMethods, existingFields, methodToAugment// , methodInstallListeners, // methodUninstallListeners); ); cr.accept(cv, false); b = cw.toByteArray(); } catch (Exception e) { throw new AugmentException(name, e); } finally { try { is.close(); } catch (IOException ioe) { } } FileOutputStream fos = null; try { fos = new FileOutputStream(resource); fos.write(b); if (this.isVerbose) System.out.println("Updated resource " + resource); } catch (Exception e) { } finally { if (fos != null) { try { fos.close(); } catch (IOException ioe) { } } } } /** * Processes a single file or a directory, augmenting all relevant classes. * * @param toStrip * The leading prefix to strip from the file names. Is used to * create fully-qualified class name. * @param file * File resource (can point to a single file or to a directory). * @param ids * List of class-method pairs to augment. * @throws AugmentException * If the augmentation process failed. */ public void process(String toStrip, File file, List ids) throws AugmentException { if (file.isDirectory()) { File[] children = file.listFiles(); for (int i = 0; i < children.length; i++) { this.process(toStrip, children[i], ids); } } else { String currClassName = file.getAbsolutePath().substring( toStrip.length() + 1); currClassName = currClassName.replace(File.separatorChar, '.'); currClassName = currClassName.substring(0, currClassName.length() - 6); for (IconGhostingType igt : ids) { // System.out.println(currClassName + ":" + igt.getClassName()); if (currClassName.equals(igt.getClassName())) { this.augmentClass(toStrip, igt.getClassName(), igt .getMethodName()); } } } } /** * Sets the verbosity. * * @param isVerbose * New value for augmentation process verbosity. */ public void setVerbose(boolean isVerbose) { this.isVerbose = isVerbose; } /** * Test method. * * @param args * @throws AugmentException */ public static void main(final String args[]) throws AugmentException { if (args.length == 0) { System.out .println("Usage : java ... IconGhostingDelegateAugmenter [-verbose] [-pattern class_pattern] file_resource"); System.out .println("\tIf -verbose option is specified, the augmenter prints out its actions."); System.out .println("\tIf -class option is specified, its value is used as class name to augment."); System.out .println("\tIf -method option is specified, its value is used as method name to augment."); System.out .println("\tThe last parameter can point to either a file or a directory. " + "The directory should be the root directory for classes."); return; } IconGhostingAugmenter uiDelegateAugmenter = new IconGhostingAugmenter(); int argNum = 0; String className = null; String methodName = null; while (true) { String currArg = args[argNum]; if ("-verbose".equals(currArg)) { uiDelegateAugmenter.setVerbose(true); argNum++; continue; } if ("-class".equals(currArg)) { argNum++; className = args[argNum]; argNum++; continue; } if ("-method".equals(currArg)) { argNum++; methodName = args[argNum]; argNum++; continue; } break; } File starter = new File(args[argNum]); IconGhostingType igt = new IconGhostingType(); igt.setClassName(className); igt.setMethodName(methodName); uiDelegateAugmenter.process(starter.getAbsolutePath(), starter, Arrays .asList(igt)); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/AugmentContainerGhostingTask.java0000644000175000017500000001331511137001462031532 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import java.io.File; import java.util.*; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.types.Path; /** * Ant task for augmenting LAF classes with image ghosting functionality. Is * based on JiBX ant task (BSD-licensed). * * @author Kirill Grouchnikov. */ public class AugmentContainerGhostingTask extends Task { /** * Verbosty indication. */ private boolean m_verbose; /** * Classpath. */ private Path m_classpath; /** * Fileset. */ private List m_fileSet; /** * List of delegates to update. */ private List m_delegatesToUpdate; /* * (non-Javadoc) * * @see org.apache.tools.ant.Task#init() */ public void init() throws BuildException { super.init(); this.m_fileSet = new ArrayList(); this.m_delegatesToUpdate = new ArrayList(); } /** * Returns an array of paths of all the files specified by the * <classpath> or <classpathset> tags. Note that the * <classpath> and <classpathset> tags cannot both be specified. * * @return Array of file paths. */ private String[] getPaths() { String[] pathArray = null; if (this.m_classpath != null) { // // If a tag has been set, m_classpath will // not be null. In this case, just return the array of // paths directly. // pathArray = this.m_classpath.list(); } else { // // Store the directory paths specified by each of the // tags. // pathArray = new String[this.m_fileSet.size()]; for (int i = 0; i < this.m_fileSet.size(); i++) { FileSet fileSet = this.m_fileSet.get(i); File directory = fileSet.getDir(this.getProject()); pathArray[i] = directory.getAbsolutePath(); } } return pathArray; } /* * (non-Javadoc) * * @see org.apache.tools.ant.Task#execute() */ public void execute() throws BuildException { try { // System.out.println(this.m_verbose + ", " + this.m_pattern); // String[] pathArr = this.getPaths(); ContainerGhostingAugmenter augmenter = new ContainerGhostingAugmenter(); if (this.m_verbose) augmenter.setVerbose(this.m_verbose); for (int i = 0; i < pathArr.length; i++) { augmenter.process(pathArr[0], new File(pathArr[0]), this.m_delegatesToUpdate); } } catch (AugmentException ae) { throw new BuildException(ae); } // process(this.m_classpath, new File(args[0]), p); } /** * @param fSet */ public void addClassPathSet(FileSet fSet) { this.m_fileSet.add(fSet); } /** * Adds information on a single class-method pair for injecting the * container ghosting code. * * @param containerGhosting * Class-method pair for injecting the container ghosting code. */ public void addContainerGhosting(ContainerGhostingType containerGhosting) { this.m_delegatesToUpdate.add(containerGhosting); } /** * Returns the current classpath. * * @return Current classpath. */ public Path getClasspath() { return this.m_classpath; } /** * Sets the classpath for this task. Multiple calls append the new classpath * to the current one, rather than overwriting it. * * @param classpath * The new classpath as a Path object. */ public void setClasspath(Path classpath) { if (this.m_classpath == null) { this.m_classpath = classpath; } else { this.m_classpath.append(classpath); } } /** * Creates the classpath for this task and returns it. If the classpath has * already been created, the method just returns that one. * * @return The created classpath. */ public Path createClasspath() { if (this.m_classpath == null) { this.m_classpath = new Path(this.getProject()); } return this.m_classpath; } /** * @param bool */ public void setVerbose(boolean bool) { this.m_verbose = bool; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/ContainerGhostingType.java0000644000175000017500000000726011137001462030232 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import org.apache.tools.ant.types.DataType; /** * Ant type for storing containerGhosting elements of * {@link AugmentContainerGhostingTask} task. * * *

* Represents the following build snippet: *

* *

 * <containerGhosting className="org.jvnet.substance.SubstanceButtonUI"
 * toInjectAfterOriginal="true" />
 * 
* * @author Kirill Grouchnikov */ public class ContainerGhostingType extends DataType { /** * UI delegate class name. */ private String className; /** * Indicates whether the ghosting should be injected before or after the * original code. */ private boolean toInjectAfterOriginal; /** * Creates new instance. */ public ContainerGhostingType() { super(); } /** * Sets the UI delegate class name. * * @param name * UI delegate class name. */ public void setClassName(String name) { this.className = name; } /** * Returns the UI delegate class name. * * @return UI delegate class name. */ public String getClassName() { return this.className; } /** * Returns indication whether the ghosting should be injected before or * after the original code. * * @return true if the ghosting should be injected after the * original code, false if it should be injected * before the original code. */ public boolean isToInjectAfterOriginal() { return toInjectAfterOriginal; } /** * Returns indication whether the ghosting should be injected before or * after the original code. * * @param toInjectAfterOriginal * true if the ghosting should be injected after * the original code, false if it should be * injected before the original code. */ public void setToInjectAfterOriginal(boolean toInjectAfterOriginal) { this.toInjectAfterOriginal = toInjectAfterOriginal; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/InfoClassVisitor.java0000644000175000017500000000663711137001462027213 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import java.util.*; import org.objectweb.asm.*; import org.objectweb.asm.commons.EmptyVisitor; /** * Gathers information on all methods and fields of some class. * * @author Kirill Grouchnikov */ public class InfoClassVisitor extends EmptyVisitor implements Opcodes { /** * All method names. */ protected Set methods; /** * All field names. */ protected Set fields; /** * Creates a new visitor. */ public InfoClassVisitor() { this.methods = new HashSet(); this.fields = new HashSet(); } /* * (non-Javadoc) * * @see org.objectweb.asm.commons.EmptyVisitor#visitMethod(int, * java.lang.String, java.lang.String, java.lang.String, * java.lang.String[]) */ public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) { this.methods.add(name); return this; } /* * (non-Javadoc) * * @see org.objectweb.asm.commons.EmptyVisitor#visitField(int, * java.lang.String, java.lang.String, java.lang.String, * java.lang.Object) */ public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { this.fields.add(name); return this; } /** * Returns all methods of the visited class. * * @return Unmodifiable set of all methods of the visited class. */ public Set getMethods() { return Collections.unmodifiableSet(this.methods); } /** * Returns all fields of the visited class. * * @return Unmodifiable set of all fields of the visited class. */ public Set getFields() { return Collections.unmodifiableSet(this.fields); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/LafMainClassAugmenter.java0000644000175000017500000004125511137001462030112 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import java.io.*; import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.net.URL; import java.net.URLClassLoader; import java.util.Set; import javax.swing.UIDefaults; import org.objectweb.asm.*; /** * Augments the main LAF classes with laf-widget behaviour. Is based on sample * adapter from ASM distribution. * * @author Kirill Grouchnikov */ public class LafMainClassAugmenter { /** * Method name to augment. */ protected static String METHOD_NAME = "initClassDefaults"; /** * Verbosity indication. */ private boolean isVerbose; /** * Names of delegates to add. */ private String[] delegatesToAdd; /** * Class adapter that augments the UI functionality. * * @author Kirill Grouchnikov */ protected class AugmentClassAdapter extends ClassAdapter implements Opcodes { /** * Contains all method names. */ private Set existingMethods; /** * Prefix for delegate methods that will be added. */ private String prefix; /** * The original method. */ // private Method originalMethod; /** * Class name of the super class. */ private String superClassName; /** * Creates a new augmentor. * * @param cv * Class visitor to recreate the non-augmented methods. * @param existingMethods * Existing methods. * @param originalMethod * The original method. */ public AugmentClassAdapter(ClassVisitor cv, Set existingMethods, Method originalMethod) { super(cv); this.existingMethods = existingMethods; // this.originalMethod = originalMethod; } /** * Returns the superclass name. * * @return The superclass name. */ public String getSuperClassName() { return this.superClassName; } /* * (non-Javadoc) * * @see org.objectweb.asm.ClassAdapter#visit(int, int, java.lang.String, * java.lang.String, java.lang.String, java.lang.String[]) */ @Override public void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) { this.superClassName = superName; this.prefix = "__" + name.replaceAll("/", "__") + "__"; super .visit(version, access, name, signature, superName, interfaces); // We have two separate cases for the "initClassDefaults" function // that we want to augment: // // 1. The current .class has both function and the __ version - // already has been augmented. Can be ignored. // // 2. The current .class has function but doesn't have the __ // version. Than, the original function has already been renamed to // __ (in the visitMethod). We need to create a new version for this // function that performs pre-logic, calls __ and performs the // post-logic. boolean hasOriginal = this.existingMethods .contains(LafMainClassAugmenter.METHOD_NAME); boolean hasDelegate = this.existingMethods.contains(this.prefix + LafMainClassAugmenter.METHOD_NAME); // String methodSignature = // Utils.getMethodDesc(this.originalMethod); // int paramCount = this.originalMethod.getParameterTypes().length; if (LafMainClassAugmenter.this.isVerbose) System.out.println("..." + LafMainClassAugmenter.METHOD_NAME + " " + "(Ljavax/swing/UIDefaults;)V" + " : delegate - " + hasDelegate + ", 1 params"); if (!hasDelegate) { this.augmentInitClassDefaultsMethod(!hasOriginal, name, superName); } } /** * Augments the initClassDefaults method. * * @param toSynthOriginal * if true, a forwarding method will be * generated. * @param className * Class name. * @param superClassName * Super class name (relevant for generating empty * implementation). */ public void augmentInitClassDefaultsMethod(boolean toSynthOriginal, String className, String superClassName) { if (toSynthOriginal) { if (LafMainClassAugmenter.this.isVerbose) { System.out .println("... Creating empty 'initClassDefaults' forwarding to super '" + superClassName + "'"); } MethodVisitor mv = this.cv.visitMethod(ACC_PROTECTED, this.prefix + "initClassDefaults", "(Ljavax/swing/UIDefaults;)V", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn(INVOKESPECIAL, superClassName, "initClassDefaults", "(Ljavax/swing/UIDefaults;)V"); mv.visitInsn(RETURN); mv.visitMaxs(2, 2); mv.visitEnd(); } MethodVisitor mv = this.cv.visitMethod(Opcodes.ACC_PROTECTED, "initClassDefaults", "(Ljavax/swing/UIDefaults;)V", null, null); mv.visitCode(); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, className, this.prefix + "initClassDefaults", "(Ljavax/swing/UIDefaults;)V"); String packageName = className.replace('/', '.'); int lastDotIndex = packageName.lastIndexOf('.'); if (lastDotIndex >= 0) { packageName = packageName.substring(0, lastDotIndex); } else { packageName = ""; } for (int i = 0; i < LafMainClassAugmenter.this.delegatesToAdd.length; i++) { mv.visitVarInsn(Opcodes.ALOAD, 1); String delegateKey = LafMainClassAugmenter.this.delegatesToAdd[i]; String delegateValue = packageName + ".__Forwarding__" + delegateKey; if (LafMainClassAugmenter.this.isVerbose) { System.out.println("...Putting '" + delegateKey + "' -> '" + delegateValue + "'"); } mv.visitLdcInsn(delegateKey); mv.visitLdcInsn(delegateValue); mv .visitMethodInsn(Opcodes.INVOKEVIRTUAL, "javax/swing/UIDefaults", "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); mv.visitInsn(Opcodes.POP); } mv.visitInsn(Opcodes.RETURN); mv.visitMaxs(3, 2); mv.visitEnd(); } /* * (non-Javadoc) * * @see org.objectweb.asm.ClassAdapter#visitMethod(int, * java.lang.String, java.lang.String, java.lang.String, * java.lang.String[]) */ @Override public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) { // System.out.println("Visiting " + name + ":" + desc + ":" // + signature); if (LafMainClassAugmenter.METHOD_NAME.equals(name)) { // possible candidate for weaving. Check if has __ already if (!this.existingMethods.contains(this.prefix + name)) { // effectively renames the existing method prepending __ // to the name return this.cv.visitMethod(access, this.prefix + name, desc, signature, exceptions); } } // preserve the existing method as is return this.cv.visitMethod(access, name, desc, signature, exceptions); } } /** * Augments a single class with additional UI behaviour. * * @param dir * Root directory for the library that contains the class. * @param name * Fully-qualified class name. * @throws AugmentException * If the augmentation process failed. * @return The superclass name. */ protected synchronized String augmentClass(String dir, final String name) { if (this.isVerbose) System.out.println("Working on LAF main class " + name); // gets an input stream to read the bytecode of the class String resource = dir + File.separator + name.replace('.', '/') + ".class"; Method origMethod = null; try { ClassLoader cl = new URLClassLoader(new URL[] { new File(dir) .toURL() }, LafMainClassAugmenter.class.getClassLoader()); Class clazz = cl.loadClass(name); origMethod = clazz.getDeclaredMethod( LafMainClassAugmenter.METHOD_NAME, new Class[] { UIDefaults.class }); } catch (NoSuchMethodException nsme) { origMethod = null; } catch (Exception e) { e.printStackTrace(); throw new AugmentException(name, e); } Set existingMethods = null; InputStream is = null; try { is = new FileInputStream(resource); ClassReader cr = new ClassReader(is); // ClassWriter cw = new ClassWriter(false); InfoClassVisitor infoAdapter = new InfoClassVisitor(); cr.accept(infoAdapter, false); existingMethods = infoAdapter.getMethods(); } catch (Exception e) { e.printStackTrace(); throw new AugmentException(name, e); } finally { try { is.close(); } catch (IOException ioe) { } } // Augment the class (overriding the existing file). byte[] b; String superClassName = null; try { is = new FileInputStream(resource); ClassReader cr = new ClassReader(is); ClassWriter cw = new ClassWriter(false); AugmentClassAdapter cv = new AugmentClassAdapter(cw, existingMethods, origMethod); cr.accept(cv, false); b = cw.toByteArray(); superClassName = cv.getSuperClassName(); } catch (Exception e) { e.printStackTrace(); throw new AugmentException(name, e); } finally { try { is.close(); } catch (IOException ioe) { } } FileOutputStream fos = null; try { fos = new FileOutputStream(resource); fos.write(b); if (this.isVerbose) System.out.println("Updated resource " + resource); } catch (Exception e) { } finally { if (fos != null) { try { fos.close(); } catch (IOException ioe) { } } } return superClassName; } /** * Creates a new augmenter. */ public LafMainClassAugmenter() { super(); } /** * Processes a single file or a directory, augmenting all main LAF classes. * * @param toStrip * The leading prefix to strip from the file names. Is used to * create fully-qualified class name. * @param file * File resource (can point to a single file or to a directory). * @param mainClassName * The class name of the main LAF class. * @throws AugmentException * If the augmentation process failed. */ public void process(String toStrip, File file, String mainClassName) { if (file.isDirectory()) { File[] children = file.listFiles(); for (int i = 0; i < children.length; i++) { this.process(toStrip, children[i], mainClassName); } } else { String className = file.getAbsolutePath().substring( toStrip.length() + 1); className = className.replace(File.separatorChar, '.'); className = className.substring(0, className.length() - 6); if (mainClassName.equals(className)) { String superClassName = this.augmentClass(toStrip, className); // Create forwarding delegates for (int i = 0; i < this.delegatesToAdd.length; i++) { String uiKey = this.delegatesToAdd[i]; String uiSuperClassName = Utils.getUtils().getUIDelegate( uiKey, superClassName); Class[] uiSuperCtrParams = null; try { Class uiSuperClazz = Class.forName(uiSuperClassName); Constructor[] uiSuperCtrs = uiSuperClazz .getDeclaredConstructors(); if (uiSuperCtrs.length != 1) throw new AugmentException( "Unsupported base UI class " + uiSuperClassName + " - not exactly one ctr"); Constructor uiSuperCtr = uiSuperCtrs[0]; uiSuperCtrParams = uiSuperCtr.getParameterTypes(); if (uiSuperCtrParams.length > 1) throw new AugmentException( "Unsupported base UI class " + uiSuperClassName + " - " + uiSuperCtrParams.length + " parameters"); } catch (ClassNotFoundException cnfe) { throw new AugmentException( "Failed locating base UI class", cnfe); } int lastDotIndex = className.lastIndexOf('.'); String packageName = (lastDotIndex >= 0) ? className .substring(0, lastDotIndex) : ""; String uiClassName = "__Forwarding__" + uiKey; String resource = toStrip + File.separator + (packageName + File.separator + uiClassName) .replace('.', File.separatorChar) + ".class"; System.out.println("...Creating forwarding delegate"); System.out.println("...... at '" + resource + "'"); System.out.println("...... with class name '" + uiClassName + "'"); System.out.println("...... package '" + packageName + "'"); System.out.println("...... super impl '" + uiSuperClassName + "'"); byte[] b = null; if (uiSuperCtrParams.length == 0) { b = UiDelegateWriterEmptyCtr.createClass(packageName, uiClassName, uiSuperClassName); } else { b = UiDelegateWriterOneParamCtr.createClass( packageName, uiClassName, uiSuperClassName, Utils.getTypeDesc(uiSuperCtrParams[0])); } FileOutputStream fos = null; try { fos = new FileOutputStream(resource); fos.write(b); if (this.isVerbose) System.out.println("...Created resource " + resource); } catch (Exception e) { } finally { if (fos != null) { try { fos.close(); } catch (IOException ioe) { } } } } } } } /** * Sets the verbosity. * * @param isVerbose * New value for augmentation process verbosity. */ public void setVerbose(boolean isVerbose) { this.isVerbose = isVerbose; } /** * Sets the list of delegates that need to be added. * * @param delegatesToAdd * The list of delegates that need to be added. */ public void setDelegatesToAdd(String[] delegatesToAdd) { this.delegatesToAdd = delegatesToAdd; } /** * Test methods. * * @param args * @throws AugmentException */ public static void main(final String args[]) throws AugmentException { if (args.length == 0) { System.out .println("Usage : java ... LafMainClassAugmenter [-verbose]"); System.out .println("\t -main main_class_name -dir class_directory "); System.out.println("\t -delegates delegate_ui_ids"); return; } LafMainClassAugmenter augmenter = new LafMainClassAugmenter(); int argNum = 0; String mainLafClassName = null; String startDir = null; while (argNum < args.length) { String currArg = args[argNum]; if ("-verbose".equals(currArg)) { augmenter.setVerbose(true); argNum++; continue; } if ("-main".equals(currArg)) { argNum++; mainLafClassName = args[argNum]; argNum++; continue; } if ("-dir".equals(currArg)) { argNum++; startDir = args[argNum]; argNum++; continue; } if ("-delegates".equals(currArg)) { argNum++; augmenter.setDelegatesToAdd(args[argNum].split(";")); argNum++; continue; } break; } File starter = new File(startDir); augmenter.process(starter.getAbsolutePath(), starter, mainLafClassName); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/UiDelegateType.java0000644000175000017500000000475011137001462026616 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import org.apache.tools.ant.types.DataType; /** * Ant type for storing delegate elements of * {@link AugmentMainTask} task. * *

* Represents the following build snippet: *

* *

 * <delegate name="ToolTipUI" />
 * 
* * @author Kirill Grouchnikov */ public class UiDelegateType extends DataType { /** * Delegate name. */ private String name; /** * Creates new instance. */ public UiDelegateType() { super(); } /** * Sets the delegate name. * * @param name * Delegate name. */ public void setName(String name) { this.name = name; } /** * Returns the delegate name. * * @return Delegate name. */ public String getName() { return this.name; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/UiDelegateAugmenter.java0000644000175000017500000007531011137001462027624 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import java.io.*; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.net.URL; import java.net.URLClassLoader; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.swing.JComponent; import javax.swing.plaf.ComponentUI; import org.objectweb.asm.*; /** * Augments the UI classes with laf-widget behaviour. Is based on sample adapter * from ASM distribution. * * @author Kirill Grouchnikov */ public class UiDelegateAugmenter { /** * Set of methods to change (augment). */ private Set methodsToChange; /** * Verbosity indication. */ private boolean isVerbose; /** * Class adapter that augments the UI functionality. * * @author Kirill Grouchnikov */ protected class AugmentClassAdapter extends ClassAdapter implements Opcodes { /** * Contains all method names. */ private Set existingMethods; /** * Contains all field names. */ private Set existingFields; /** * Contains all methods that will be augmented. Key is {@link String}, * value is {@link Method}. */ private Map methodsToAugment; /** * Prefix for delegate methods that will be added. */ private String prefix; /** * Creates a new augmentor. * * @param cv * Class visitor to recreate the non-augmented methods. * @param existingMethods * Contains all method names. * @param existingFields * Contains all field names. * @param methodsToAugment * Contains all methods that will be augmented. Key is * {@link String}, value is {@link Method}. */ public AugmentClassAdapter(final ClassVisitor cv, Set existingMethods, Set existingFields, Map methodsToAugment) { super(cv); this.existingMethods = existingMethods; this.existingFields = existingFields; this.methodsToAugment = methodsToAugment; } /* * (non-Javadoc) * * @see org.objectweb.asm.ClassAdapter#visit(int, int, java.lang.String, * java.lang.String, java.lang.String, java.lang.String[]) */ @Override public void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) { this.prefix = "__" + name.replaceAll("/", "__") + "__"; super .visit(version, access, name, signature, superName, interfaces); // Check if need to add the lafWidgets field if (!this.existingFields.contains("lafWidgets")) { FieldVisitor fv = this.visitField(Opcodes.ACC_PROTECTED, "lafWidgets", "Ljava/util/Set;", null, null); fv.visitEnd(); } // We have three separate cases for each function that we // want to augment: // // 1. The current .class has both function and the __ version - // already has been augmented. Can be ignored. // // 2. The current .class has function but doesn't have the __ // version. Than, the original function has already been renamed to // __ (in the visitMethod). We need to create a new version for this // function that performs pre-logic, calls __ and performs the // post-logic. // // 3. The current .class doesn't have neither the function nor // the __ version. In this case we need to create the __ version // that calls super (with the original name) and the function that // performs pre-logic, calls __ and performs the post-logic. for (Iterator it = UiDelegateAugmenter.this.methodsToChange .iterator(); it.hasNext();) { String methodName = it.next(); if (!this.methodsToAugment.containsKey(methodName)) continue; boolean hasOriginal = this.existingMethods.contains(methodName); boolean hasDelegate = this.existingMethods.contains(this.prefix + methodName); Method method = this.methodsToAugment.get(methodName); String methodSignature = Utils.getMethodDesc(method); int paramCount = method.getParameterTypes().length; if (UiDelegateAugmenter.this.isVerbose) System.out.println("... Augmenting " + methodName + " " + methodSignature + " : original - " + hasOriginal + ", delegate - " + hasDelegate + ", " + paramCount + " params"); if (!hasDelegate) { if (methodName.equals("update")) { this.augmentUpdateMethod(!hasOriginal, name, superName, methodSignature); } else if (methodName.equals("installUI")) { this.augmentInstallUIMethod(!hasOriginal, name, superName, methodSignature); } else { if (method.getParameterTypes().length == 0) { this.augmentVoidMethod(!hasOriginal, name, superName, methodName, method .getModifiers()); } else { this.augmentSingleParameterMethod(!hasOriginal, name, superName, methodName, method .getModifiers(), methodSignature); } } } } } /** * Augments void UI method (w/o parameters). * * @param toSynthOriginal * Indication whether we need to create an empty (only call * to super()) implementation. * @param className * Class name. * @param superClassName * Super class name (relevant for generating empty * implementation). * @param methodName * Method name. */ public void augmentVoidMethod(boolean toSynthOriginal, String className, String superClassName, String methodName, int methodModifiers) { int modifierOpcode = Opcodes.ACC_PUBLIC; if (Modifier.isProtected(methodModifiers)) modifierOpcode = Opcodes.ACC_PROTECTED; // Some ASM woodoo. The code below was generated by using // ASMifierClassVisitor. if (toSynthOriginal) { MethodVisitor mv = this.cv.visitMethod(modifierOpcode, this.prefix + methodName, "()V", null, null); mv.visitCode(); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, superClassName, methodName, "()V"); mv.visitInsn(Opcodes.RETURN); mv.visitMaxs(1, 1); mv.visitEnd(); } MethodVisitor mv = this.cv.visitMethod(modifierOpcode, methodName, "()V", null, null); mv.visitCode(); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, className, this.prefix + methodName, "()V"); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitFieldInsn(Opcodes.GETFIELD, className, "lafWidgets", "Ljava/util/Set;"); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Set", "iterator", "()Ljava/util/Iterator;"); mv.visitVarInsn(Opcodes.ASTORE, 1); Label l0 = new Label(); mv.visitJumpInsn(Opcodes.GOTO, l0); Label l1 = new Label(); mv.visitLabel(l1); mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;"); mv .visitTypeInsn(Opcodes.CHECKCAST, "org/jvnet/lafwidget/LafWidget"); mv.visitVarInsn(Opcodes.ASTORE, 2); mv.visitVarInsn(Opcodes.ALOAD, 2); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "org/jvnet/lafwidget/LafWidget", methodName, "()V"); mv.visitLabel(l0); mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z"); mv.visitJumpInsn(Opcodes.IFNE, l1); mv.visitInsn(Opcodes.RETURN); mv.visitMaxs(1, 3); mv.visitEnd(); } /** * Augments single-parameter UI method. * * @param toSynthOriginal * Indication whether we need to create an empty (only call * to super()) implementation. * @param className * Class name. * @param superClassName * Super class name (relevant for generating empty * implementation). * @param methodName * Method name. * @param functionDesc * Function signature (using JNI style declaration). Example * for void installUI(JButton button): * (Ljavax/swing/JButton;)V. */ public void augmentSingleParameterMethod(boolean toSynthOriginal, String className, String superClassName, String methodName, int methodModifiers, String functionDesc) { int modifierOpcode = Opcodes.ACC_PUBLIC; if (Modifier.isProtected(methodModifiers)) modifierOpcode = Opcodes.ACC_PROTECTED; // Some ASM woodoo. The code below was generated by using // ASMifierClassVisitor. if (toSynthOriginal) { if (UiDelegateAugmenter.this.isVerbose) { System.out.println("... Creating empty '" + methodName + functionDesc + "' forwarding to super '" + superClassName + "'"); } MethodVisitor mv = this.cv.visitMethod(modifierOpcode, this.prefix + methodName, functionDesc, null, null); mv.visitCode(); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, superClassName, methodName, functionDesc); mv.visitInsn(Opcodes.RETURN); mv.visitMaxs(2, 2); mv.visitEnd(); } if (UiDelegateAugmenter.this.isVerbose) { System.out.println("... Augmenting '" + methodName + functionDesc + "'"); } MethodVisitor mv = this.cv.visitMethod(modifierOpcode, methodName, functionDesc, null, null); mv.visitCode(); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, className, this.prefix + methodName, functionDesc); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitFieldInsn(Opcodes.GETFIELD, className, "lafWidgets", "Ljava/util/Set;"); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Set", "iterator", "()Ljava/util/Iterator;"); mv.visitVarInsn(Opcodes.ASTORE, 2); Label l0 = new Label(); mv.visitJumpInsn(Opcodes.GOTO, l0); Label l1 = new Label(); mv.visitLabel(l1); mv.visitVarInsn(Opcodes.ALOAD, 2); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;"); mv .visitTypeInsn(Opcodes.CHECKCAST, "org/jvnet/lafwidget/LafWidget"); mv.visitVarInsn(Opcodes.ASTORE, 3); mv.visitVarInsn(Opcodes.ALOAD, 3); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "org/jvnet/lafwidget/LafWidget", methodName, "()V"); mv.visitLabel(l0); mv.visitVarInsn(Opcodes.ALOAD, 2); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z"); mv.visitJumpInsn(Opcodes.IFNE, l1); mv.visitInsn(Opcodes.RETURN); mv.visitMaxs(2, 4); mv.visitEnd(); } /** * Augments the installUI method that is assumed to always * have a single parameter. * * @param toSynthOriginal * Indication whether we need to create an empty (only call * to super()) implementation. * @param className * Class name. * @param superClassName * Super class name (relevant for generating empty * implementation). * @param functionDesc * Function signature (using JNI style declaration). Example * for void installUI(JButton button): * (Ljavax/swing/JButton;)V. */ public void augmentInstallUIMethod(boolean toSynthOriginal, String className, String superClassName, String functionDesc) { // Some ASM woodoo. The code below was generated by using // ASMifierClassVisitor. if (toSynthOriginal) { MethodVisitor mv = this.cv.visitMethod(Opcodes.ACC_PUBLIC, this.prefix + "installUI", "(Ljavax/swing/JComponent;)V", null, null); mv.visitCode(); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, superClassName, "installUI", "(Ljavax/swing/JComponent;)V"); mv.visitInsn(Opcodes.RETURN); mv.visitMaxs(2, 2); mv.visitEnd(); } MethodVisitor mv = this.cv.visitMethod(Opcodes.ACC_PUBLIC, "installUI", "(Ljavax/swing/JComponent;)V", null, null); mv.visitCode(); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitMethodInsn(Opcodes.INVOKESTATIC, "org/jvnet/lafwidget/LafWidgetRepository", "getRepository", "()Lorg/jvnet/lafwidget/LafWidgetRepository;"); mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/jvnet/lafwidget/LafWidgetRepository", "getMatchingWidgets", "(Ljavax/swing/JComponent;)Ljava/util/Set;"); mv.visitFieldInsn(Opcodes.PUTFIELD, className, "lafWidgets", "Ljava/util/Set;"); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, className, this.prefix + "installUI", "(Ljavax/swing/JComponent;)V"); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitFieldInsn(Opcodes.GETFIELD, className, "lafWidgets", "Ljava/util/Set;"); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Set", "iterator", "()Ljava/util/Iterator;"); mv.visitVarInsn(Opcodes.ASTORE, 2); Label l0 = new Label(); mv.visitJumpInsn(Opcodes.GOTO, l0); Label l1 = new Label(); mv.visitLabel(l1); mv.visitVarInsn(Opcodes.ALOAD, 2); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;"); mv .visitTypeInsn(Opcodes.CHECKCAST, "org/jvnet/lafwidget/LafWidget"); mv.visitVarInsn(Opcodes.ASTORE, 3); mv.visitVarInsn(Opcodes.ALOAD, 3); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "org/jvnet/lafwidget/LafWidget", "installUI", "()V"); mv.visitLabel(l0); mv.visitVarInsn(Opcodes.ALOAD, 2); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z"); mv.visitJumpInsn(Opcodes.IFNE, l1); mv.visitInsn(Opcodes.RETURN); mv.visitMaxs(3, 4); mv.visitEnd(); } /** * Augments the update method that is assumed to always * have two parameters. * * @param toSynthOriginal * Indication whether we need to create an empty (only call * to super()) implementation. * @param className * Class name. * @param superClassName * Super class name (relevant for generating empty * implementation). * @param functionDesc * Function signature (using JNI style declaration). Example * for void installUI(JButton button): * (Ljavax/swing/JButton;)V. */ public void augmentUpdateMethod(boolean toSynthOriginal, String className, String superClassName, String functionDesc) { // Some ASM woodoo. The code below was generated by using // ASMifierClassVisitor. if (toSynthOriginal) { MethodVisitor mv = this.cv.visitMethod(Opcodes.ACC_PUBLIC, this.prefix + "update", "(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 2); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, superClassName, "update", "(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V"); mv.visitInsn(RETURN); mv.visitMaxs(3, 3); mv.visitEnd(); } // MethodVisitor mv = this.cv.visitMethod(ACC_PUBLIC, "update", // "(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V", null, // null); // mv.visitCode(); // mv.visitVarInsn(ALOAD, 1); // mv.visitTypeInsn(CHECKCAST, "java/awt/Graphics2D"); // mv.visitVarInsn(ASTORE, 3); // mv.visitVarInsn(ALOAD, 3); // mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/Graphics2D", // "getComposite", "()Ljava/awt/Composite;"); // mv.visitVarInsn(ASTORE, 4); // mv.visitInsn(FCONST_1); // mv.visitVarInsn(FSTORE, 5); // mv.visitVarInsn(ALOAD, 4); // mv.visitTypeInsn(INSTANCEOF, "java/awt/AlphaComposite"); // Label l0 = new Label(); // mv.visitJumpInsn(IFEQ, l0); // mv.visitVarInsn(ALOAD, 4); // mv.visitTypeInsn(CHECKCAST, "java/awt/AlphaComposite"); // mv.visitVarInsn(ASTORE, 6); // mv.visitVarInsn(ALOAD, 6); // mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/AlphaComposite", // "getRule", "()I"); // mv.visitInsn(ICONST_3); // mv.visitJumpInsn(IF_ICMPNE, l0); // mv.visitVarInsn(ALOAD, 6); // mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/AlphaComposite", // "getAlpha", "()F"); // mv.visitVarInsn(FSTORE, 5); // mv.visitLabel(l0); // mv.visitVarInsn(ALOAD, 3); // mv.visitVarInsn(ALOAD, 2); // mv.visitVarInsn(FLOAD, 5); // mv.visitMethodInsn(INVOKESTATIC, // "org/jvnet/lafwidget/layout/TransitionLayout", // "getAlphaComposite", // "(Ljava/awt/Component;F)Ljava/awt/Composite;"); // mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/Graphics2D", // "setComposite", "(Ljava/awt/Composite;)V"); // mv.visitVarInsn(ALOAD, 3); // mv.visitMethodInsn(INVOKESTATIC, // "org/jvnet/lafwidget/utils/RenderingUtils", // "installDesktopHints", // "(Ljava/awt/Graphics2D;)Ljava/util/Map;"); // mv.visitVarInsn(ASTORE, 6); // mv.visitVarInsn(ALOAD, 0); // mv.visitVarInsn(ALOAD, 3); // mv.visitVarInsn(ALOAD, 2); // mv.visitMethodInsn(INVOKEVIRTUAL, className, // this.prefix + "update", // "(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V"); // mv.visitVarInsn(ALOAD, 3); // mv.visitVarInsn(ALOAD, 4); // mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/Graphics2D", // "setComposite", "(Ljava/awt/Composite;)V"); // mv.visitVarInsn(ALOAD, 6); // Label l1 = new Label(); // mv.visitJumpInsn(IFNULL, l1); // mv.visitVarInsn(ALOAD, 3); // mv.visitVarInsn(ALOAD, 6); // mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/Graphics2D", // "addRenderingHints", "(Ljava/util/Map;)V"); // mv.visitLabel(l1); // mv.visitInsn(RETURN); // mv.visitMaxs(3, 7); // mv.visitEnd(); MethodVisitor mv = this.cv.visitMethod(ACC_PUBLIC, "update", "(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 1); mv.visitTypeInsn(CHECKCAST, "java/awt/Graphics2D"); mv.visitVarInsn(ASTORE, 3); mv.visitVarInsn(ALOAD, 3); mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/Graphics2D", "getComposite", "()Ljava/awt/Composite;"); mv.visitVarInsn(ASTORE, 4); mv.visitInsn(FCONST_1); mv.visitVarInsn(FSTORE, 5); mv.visitVarInsn(ALOAD, 4); mv.visitTypeInsn(INSTANCEOF, "java/awt/AlphaComposite"); Label l0 = new Label(); mv.visitJumpInsn(IFEQ, l0); mv.visitVarInsn(ALOAD, 4); mv.visitTypeInsn(CHECKCAST, "java/awt/AlphaComposite"); mv.visitVarInsn(ASTORE, 6); mv.visitVarInsn(ALOAD, 6); mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/AlphaComposite", "getRule", "()I"); mv.visitInsn(ICONST_3); mv.visitJumpInsn(IF_ICMPNE, l0); mv.visitVarInsn(ALOAD, 6); mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/AlphaComposite", "getAlpha", "()F"); mv.visitVarInsn(FSTORE, 5); mv.visitLabel(l0); mv.visitVarInsn(ALOAD, 3); mv.visitVarInsn(ALOAD, 2); mv.visitVarInsn(FLOAD, 5); mv.visitMethodInsn(INVOKESTATIC, "org/jvnet/lafwidget/layout/TransitionLayout", "getAlphaComposite", "(Ljava/awt/Component;F)Ljava/awt/Composite;"); mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/Graphics2D", "setComposite", "(Ljava/awt/Composite;)V"); mv.visitVarInsn(ALOAD, 3); mv.visitVarInsn(ALOAD, 2); mv .visitMethodInsn(INVOKESTATIC, "org/jvnet/lafwidget/utils/RenderingUtils", "installDesktopHints", "(Ljava/awt/Graphics2D;Ljava/awt/Component;)Ljava/util/Map;"); mv.visitVarInsn(ASTORE, 6); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 3); mv.visitVarInsn(ALOAD, 2); mv.visitMethodInsn(INVOKEVIRTUAL, className, this.prefix + "update", "(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V"); mv.visitVarInsn(ALOAD, 3); mv.visitVarInsn(ALOAD, 4); mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/Graphics2D", "setComposite", "(Ljava/awt/Composite;)V"); mv.visitVarInsn(ALOAD, 6); Label l1 = new Label(); mv.visitJumpInsn(IFNULL, l1); mv.visitVarInsn(ALOAD, 3); mv.visitVarInsn(ALOAD, 6); mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/Graphics2D", "addRenderingHints", "(Ljava/util/Map;)V"); mv.visitLabel(l1); mv.visitInsn(RETURN); mv.visitMaxs(3, 7); mv.visitEnd(); } /* * (non-Javadoc) * * @see org.objectweb.asm.ClassAdapter#visitMethod(int, * java.lang.String, java.lang.String, java.lang.String, * java.lang.String[]) */ @Override public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) { if (UiDelegateAugmenter.this.methodsToChange.contains(name)) { // possible candidate for weaving. Check if has __ already if (!this.existingMethods.contains(this.prefix + name)) { // effectively renames the existing method prepending __ // to the name if (UiDelegateAugmenter.this.isVerbose) System.out.println("... renaming '" + name + "(" + desc + ")' to '" + (this.prefix + name) + "'"); return this.cv.visitMethod(access, this.prefix + name, desc, signature, exceptions); } } // preserve the existing method as is return this.cv.visitMethod(access, name, desc, signature, exceptions); } } /** * Augments a single class with additional UI behaviour. * * @param dir * Root directory for the library that contains the class. * @param name * Fully-qualified class name. * @throws AugmentException * If the augmentation process failed. */ protected synchronized void augmentClass(String dir, final String name) { if (this.isVerbose) System.out.println("Working on " + name); // gets an input stream to read the bytecode of the class String resource = dir + File.separator + name.replace('.', '/') + ".class"; Map methodsToAugment = new HashMap(); try { ClassLoader cl = new URLClassLoader(new URL[] { new File(dir) .toURL() }, UiDelegateAugmenter.class.getClassLoader()); Class clazz = cl.loadClass(name); if (!ComponentUI.class.isAssignableFrom(clazz)) { if (this.isVerbose) System.out .println("Not augmenting resource, doesn't extend ComponentUI"); return; } // Start iterating over all methods and see what do we // need to augment while (clazz != null) { Method[] methods = clazz.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { Method method = methods[i]; // this check is very important - store only the // first occurence (in the closest ancestor). if (methodsToAugment.containsKey(method.getName())) continue; if (this.methodsToChange.contains(method.getName())) { // check if it can be supported boolean isSupportedRetType = (void.class == method .getReturnType()); Class[] paramTypes = method.getParameterTypes(); boolean isSupportedParamList = (paramTypes.length == 0) || ((paramTypes.length == 1) && (JComponent.class .isAssignableFrom(paramTypes[0]))) || ("update".equals(method.getName()) && (paramTypes.length == 2)); if (isSupportedRetType && isSupportedParamList) if (Modifier.isProtected(method.getModifiers()) || Modifier.isPublic(method.getModifiers())) { methodsToAugment.put(method.getName(), method); } else { if (isVerbose) { System.out .println("Not augmenting private " + name + "." + method.getName()); } } else throw new AugmentException("Method '" + method.getName() + "' in class '" + name + "' has unsupported signature"); } } clazz = clazz.getSuperclass(); } } catch (Exception e) { throw new AugmentException(name, e); } Set existingMethods = null; Set existingFields = null; InputStream is = null; try { is = new FileInputStream(resource); ClassReader cr = new ClassReader(is); InfoClassVisitor infoAdapter = new InfoClassVisitor(); cr.accept(infoAdapter, false); existingMethods = infoAdapter.getMethods(); existingFields = infoAdapter.getFields(); } catch (Exception e) { throw new AugmentException(name, e); } finally { try { is.close(); } catch (IOException ioe) { } } // See if the' lafWidgets' field is already defined. In this // case the class is *not* augmented if (existingFields.contains("lafWidgets")) { if (this.isVerbose) System.out .println("Not augmenting resource, field 'lafWidgets' is present"); return; } // Augment the class (overriding the existing file). byte[] b; try { is = new FileInputStream(resource); ClassReader cr = new ClassReader(is); ClassWriter cw = new ClassWriter(false); ClassVisitor cv = new AugmentClassAdapter(cw, existingMethods, existingFields, methodsToAugment); cr.accept(cv, false); b = cw.toByteArray(); } catch (Exception e) { throw new AugmentException(name, e); } finally { try { is.close(); } catch (IOException ioe) { } } FileOutputStream fos = null; try { fos = new FileOutputStream(resource); fos.write(b); if (this.isVerbose) System.out.println("Updated resource " + resource); } catch (Exception e) { } finally { if (fos != null) { try { fos.close(); } catch (IOException ioe) { } } } } /** * Creates the new augmenter. */ public UiDelegateAugmenter() { super(); this.methodsToChange = new HashSet(); this.methodsToChange.add("update"); this.methodsToChange.add("installUI"); this.methodsToChange.add("installDefaults"); this.methodsToChange.add("installComponents"); this.methodsToChange.add("installListeners"); this.methodsToChange.add("uninstallUI"); this.methodsToChange.add("uninstallDefaults"); this.methodsToChange.add("uninstallComponents"); this.methodsToChange.add("uninstallListeners"); } /** * Processes a single file or a directory, augmenting all relevant classes. * * @param toStrip * The leading prefix to strip from the file names. Is used to * create fully-qualified class name. * @param file * File resource (can point to a single file or to a directory). * @param pattern * Pattern to apply to the file name (of the single file). If the * file name matches the pattern, the relevant class is * augmented. * @throws AugmentException * If the augmentation process failed. */ public void process(String toStrip, File file, Pattern pattern) throws AugmentException { if (file.isDirectory()) { File[] children = file.listFiles(); for (int i = 0; i < children.length; i++) { this.process(toStrip, children[i], pattern); } } else { Matcher m = pattern.matcher(file.getName()); if (m.matches()) { String className = file.getAbsolutePath().substring( toStrip.length() + 1); className = className.replace(File.separatorChar, '.'); this.augmentClass(toStrip, className.substring(0, className .length() - 6)); } } } /** * Sets the verbosity. * * @param isVerbose * New value for augmentation process verbosity. */ public void setVerbose(boolean isVerbose) { this.isVerbose = isVerbose; } /** * Test method. * * @param args * @throws AugmentException */ public static void main(final String args[]) throws AugmentException { if (args.length == 0) { System.out .println("Usage : java ... UiDelegateAugmenter [-verbose] [-pattern class_pattern] file_resource"); System.out .println("\tIf -verbose option is specified, the augmenter prints out its actions."); System.out .println("\tIf -pattern option is specified, its value is used as a wildcard " + "for matching the classes for augmentation."); System.out .println("\tThe last parameter can point to either a file or a directory. " + "The directory should be the root directory for classes."); return; } UiDelegateAugmenter uiDelegateAugmenter = new UiDelegateAugmenter(); int argNum = 0; String pattern = ".*UI\u002Eclass"; while (true) { String currArg = args[argNum]; if ("-verbose".equals(currArg)) { uiDelegateAugmenter.setVerbose(true); argNum++; continue; } if ("-pattern".equals(currArg)) { argNum++; pattern = args[argNum]; argNum++; continue; } break; } Pattern p = Pattern.compile(pattern); File starter = new File(args[argNum]); uiDelegateAugmenter.process(starter.getAbsolutePath(), starter, p); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/AugmentIconGhostingTask.java0000644000175000017500000001367111137001462030505 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import java.io.File; import java.util.*; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.types.Path; /** * Ant task for augmenting LAF classes with icon ghosting functionality. Is * based on JiBX ant task (BSD-licensed). * * @author Kirill Grouchnikov. */ public class AugmentIconGhostingTask extends Task { /** * Verbosty indication. */ private boolean m_verbose; /** * Classpath. */ private Path m_classpath; /** * Fileset. */ private List m_fileSet; /** * List of delegates to create. */ private List m_delegatesToUpdate; /* * (non-Javadoc) * * @see org.apache.tools.ant.Task#init() */ public void init() throws BuildException { super.init(); this.m_fileSet = new ArrayList(); this.m_delegatesToUpdate = new ArrayList(); } /** * Returns an array of paths of all the files specified by the * <classpath> or <classpathset> tags. Note that the * <classpath> and <classpathset> tags cannot both be specified. * * @return Array of file paths. */ private String[] getPaths() { String[] pathArray = null; if (this.m_classpath != null) { // // If a tag has been set, m_classpath will // not be null. In this case, just return the array of // paths directly. // pathArray = this.m_classpath.list(); } else { // // Store the directory paths specified by each of the // tags. // pathArray = new String[this.m_fileSet.size()]; for (int i = 0; i < this.m_fileSet.size(); i++) { FileSet fileSet = this.m_fileSet.get(i); File directory = fileSet.getDir(this.getProject()); pathArray[i] = directory.getAbsolutePath(); } } return pathArray; } /* * (non-Javadoc) * * @see org.apache.tools.ant.Task#execute() */ public void execute() throws BuildException { try { // System.out.println(this.m_verbose + ", " + this.m_pattern); // for (Iterator it = this.m_delegatesToUpdate .iterator(); it.hasNext();) { IconGhostingType igt = it.next(); if (this.m_verbose) System.out.println("Will inject icon ghosting code in " + igt.getClassName() + "." + igt.getMethodName()); } String[] pathArr = this.getPaths(); IconGhostingAugmenter augmenter = new IconGhostingAugmenter(); if (this.m_verbose) augmenter.setVerbose(this.m_verbose); for (int i = 0; i < pathArr.length; i++) { augmenter.process(pathArr[0], new File(pathArr[0]), this.m_delegatesToUpdate); } } catch (AugmentException ae) { throw new BuildException(ae); } // process(this.m_classpath, new File(args[0]), p); } /** * @param fSet */ public void addClassPathSet(FileSet fSet) { this.m_fileSet.add(fSet); } /** * Adds information on a single class-method pair for injecting the icon * ghosting code. * * @param iconGhosting * Class-method pair for injecting the icon ghosting code. */ public void addIconGhosting(IconGhostingType iconGhosting) { this.m_delegatesToUpdate.add(iconGhosting); } /** * Returns the current classpath. * * @return Current classpath. */ public Path getClasspath() { return this.m_classpath; } /** * Sets the classpath for this task. Multiple calls append the new classpath * to the current one, rather than overwriting it. * * @param classpath * The new classpath as a Path object. */ public void setClasspath(Path classpath) { if (this.m_classpath == null) { this.m_classpath = classpath; } else { this.m_classpath.append(classpath); } } /** * Creates the classpath for this task and returns it. If the classpath has * already been created, the method just returns that one. * * @return The created classpath. */ public Path createClasspath() { if (this.m_classpath == null) { this.m_classpath = new Path(this.getProject()); } return this.m_classpath; } /** * @param bool */ public void setVerbose(boolean bool) { this.m_verbose = bool; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ant/UiDelegateWriterOneParamCtr.java0000644000175000017500000000762111137001462031245 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.ant; import org.objectweb.asm.*; /** * Bytecode writer for a forwarding UI delegate class with a single constructor * that gets one parameter. * * @author Kirill Grouchnikov */ public class UiDelegateWriterOneParamCtr extends ClassWriter implements Opcodes { /** * Creates a new bytecode writer. */ public UiDelegateWriterOneParamCtr() { super(false); } /** * Creates a new class. * * @param packageName * Package name. * @param className * Class name. * @param superClassName * Superclass name. * @param paramClassDesc * Description of the parameter classes. * @return Class bytecode contents. */ public static byte[] createClass(String packageName, String className, String superClassName, String paramClassDesc) { packageName = packageName.replace('.', '/'); superClassName = superClassName.replace('.', '/'); UiDelegateWriterOneParamCtr cw = new UiDelegateWriterOneParamCtr(); MethodVisitor mv; cw.visit(Opcodes.V1_2, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, packageName + "/" + className, null, superClassName, null); cw.visitSource(className + ".java", null); mv = cw.visitMethod(Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC, "createUI", "(Ljavax/swing/JComponent;)Ljavax/swing/plaf/ComponentUI;", null, null); mv.visitCode(); mv.visitTypeInsn(Opcodes.NEW, packageName + "/" + className); mv.visitInsn(Opcodes.DUP); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitTypeInsn(Opcodes.CHECKCAST, paramClassDesc.substring(1, paramClassDesc.length() - 1)); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, packageName + "/" + className, "", "(" + paramClassDesc + ")V"); mv.visitInsn(Opcodes.ARETURN); mv.visitMaxs(3, 1); mv.visitEnd(); mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "", "(" + paramClassDesc + ")V", null, null); mv.visitCode(); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, superClassName, "", "(" + paramClassDesc + ")V"); mv.visitInsn(Opcodes.RETURN); mv.visitMaxs(2, 2); mv.visitEnd(); cw.visitEnd(); return cw.toByteArray(); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/ghost/0000755000175000017500000000000011253454710023444 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/LafWidgetRepository.java0000644000175000017500000003441611137001460027130 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.*; import javax.swing.JComponent; /** * Repository of LAF widgets. * * @author Kirill Grouchnikov */ public class LafWidgetRepository { /** * All registered widgets. Key is {@link Class} in the UI component * hierarchy, value is a {@link Set} of fully-qualified widget class names. */ protected Map, Set> widgets; /** * Contains fully qualified class names of widgets that should not be * installed on any components. */ protected Set widgetClassesToIgnore; /** * Currently registered LAF support. */ protected LafWidgetSupport lafSupport; /** * Indicates whether the currently registered LAF support is custom (not * {@link LafWidgetSupport}). */ protected boolean isCustomLafSupportSet; /** * Manages the components that ignore animations. */ // protected FadeIgnoreManager fadeIgnoreManager; /** * Singleton instance. */ protected static LafWidgetRepository repository; /** * Resource bundle for Substance labels. */ private static ResourceBundle LABEL_BUNDLE = null; /** * Class loader for the {@link #LABEL_BUNDLE}. * * @since version 1.1 */ private static ClassLoader labelBundleClassLoader; /** * Information on a single class. * * @author Kirill Grouchnikov */ protected static class LafWidgetClassInfo { /** * Class name. */ public String className; /** * Indicates whether the matching should be exact. */ public boolean isExact; /** * Creates a new info object. * * @param className * Class name. * @param isExact * Indicates whether the matching should be exact. */ public LafWidgetClassInfo(String className, boolean isExact) { this.className = className; this.isExact = isExact; } } /** * Creates a new repository. Marked private to enforce single instance. */ private LafWidgetRepository() { this.widgets = new HashMap, Set>(); this.lafSupport = new LafWidgetSupport(); this.isCustomLafSupportSet = false; // this.fadeIgnoreManager = new FadeIgnoreManager(); this.widgetClassesToIgnore = new HashSet(); } /** * Returns the widget repository. * * @return Widget repository. */ public static synchronized LafWidgetRepository getRepository() { if (LafWidgetRepository.repository == null) { LafWidgetRepository.repository = new LafWidgetRepository(); LafWidgetRepository.repository.populate(); // LafWidgetRepository.repository.fadeIgnoreManager.populate(); } return LafWidgetRepository.repository; } /** * Populates the repository from the specified URL. The URL should point to * a properties file, the key being the fully-qualified class name of the * widget implementation, the value being semicolon-separated * fully-qualified class names of classes in UI component hierarchy. Sample * property file: * *
	 * org.jvnet.lafwidget.text.PasswordStrengthCheckerWidget = javax.swing.JPasswordField
	 *             org.jvnet.lafwidget.text.LockBorderWidget = javax.swing.text.JTextComponent;javax.swing.JComboBox
	 * 
* * @param url * URL that points to a properties file. */ protected void populateFrom(URL url) { Properties props = new Properties(); InputStream is = null; try { is = url.openStream(); props.load(is); Enumeration names = props.propertyNames(); while (names.hasMoreElements()) { String name = (String) names.nextElement(); String value = props.getProperty(name); String[] values = value.split(";"); for (int i = 0; i < values.length; i++) { String className = values[i].trim(); boolean isExact = className.startsWith("%"); if (isExact) className = className.substring(1); try { this.registerWidget(name, Class.forName(className), isExact); } catch (ClassNotFoundException cnfe) { } } } } catch (IOException ioe) { } finally { if (is != null) { try { is.close(); } catch (IOException ioe) { } } } } /** * Populates the widget repository. The classpath is scanned for all * resources that match the name META-INF/lafwidget.properties. * * @see #populateFrom(URL) */ public void populate() { // the following is fix by Dag Joar and Christian Schlichtherle // for application running with -Xbootclasspath VM flag. In this case, // the using MyClass.class.getClassLoader() would return null, // but the context class loader will function properly // that classes will be properly loaded regardless of whether the lib is // added to the system class path, the extension class path and // regardless of the class loader architecture set up by some // frameworks. ClassLoader cl = Thread.currentThread().getContextClassLoader(); try { Enumeration rs = cl .getResources("META-INF/lafwidget.properties"); while (rs.hasMoreElements()) { URL rUrl = (URL) rs.nextElement(); this.populateFrom(rUrl); } } catch (IOException ioe) { } } /** * Registers a new widget for the specified UI classes. The list should * contain {@link Class} instances. * * @param widgetClassName * Full-qualified class name for the widget. * @param supportedClasses * Classes supported by the widget. */ public synchronized void registerWidget(String widgetClassName, List> supportedClasses) { for (Class clazz : supportedClasses) this.registerWidget(widgetClassName, clazz, false); } /** * Registers a new widget for the specified UI class. * * @param widgetClassName * Full-qualified class name for the widget. * @param supportedClass * Class supported by the widget. * @param isExact * if true, the widget will be available only for the * components of the specified class. If false, the widget * be available for the components of the specified class and all its * descendants (as defined in the {@link Class#isAssignableFrom(Class)} * ). */ public synchronized void registerWidget(String widgetClassName, Class supportedClass, boolean isExact) { if (JComponent.class.isAssignableFrom(supportedClass)) { if (!this.widgets.containsKey(supportedClass)) this.widgets.put(supportedClass, new HashSet()); } // Guard against multiple registrations of the same widget. // This can happen if more than one jar on the classpath defines // the same widget. for (LafWidgetClassInfo registered : this.widgets.get(supportedClass)) { if (registered.className.equals(widgetClassName)) return; } this.widgets.get(supportedClass).add( new LafWidgetClassInfo(widgetClassName, isExact)); } /** * Returns a set of widgets that match the specified component. The * component hierarchy is scanned bottom-up and all matching widget classes * are used to instantiate new instance of widgets. In case the {@link * #isCustomLafSupportSet} is false, only widgets that return * false in {@link LafWidget#requiresCustomLafSupport()} are * returned. * * * @param jcomp * UI component. * @return Set of widgets that match the specified component. */ public synchronized Set getMatchingWidgets(JComponent jcomp) { Set result = new HashSet(); Class clazz = jcomp.getClass(); boolean isOriginator = true; while (clazz != null) { Set registered = this.widgets.get(clazz); if (registered != null) { for (Iterator it = registered.iterator(); it .hasNext();) { LafWidgetClassInfo widgetClassInfo = it.next(); if (widgetClassInfo.isExact && !isOriginator) continue; try { String widgetClassName = widgetClassInfo.className; // check if the application requested to ignore the // specific widget if (this.widgetClassesToIgnore .contains(widgetClassName)) continue; // The code below will fail if no such class exists. // This allows safely removing the relevant widget // classes making the jar size smaller (lite versions). Object widgetObj = Class.forName(widgetClassName) .newInstance(); if (widgetObj instanceof LafWidget) { LafWidget widget = (LafWidget) widgetObj; // only add widgets that do not require special LAF // support if no such support has been set. if (!widget.requiresCustomLafSupport() || this.isCustomLafSupportSet) { widget.setComponent(jcomp); result.add(widget); } } // the exceptions are ignored - see the explanation // above. } catch (InstantiationException ie) { } catch (IllegalAccessException iae) { } catch (ClassNotFoundException cnfe) { } } } clazz = clazz.getSuperclass(); isOriginator = false; } return result; } /** * Sets LAF support. * * @param lafSupport * LAF support. * @throws IllegalArgumentException * If the LAF support is null. */ public void setLafSupport(LafWidgetSupport lafSupport) { if (lafSupport == null) throw new IllegalArgumentException("LAF support can't be null"); this.lafSupport = lafSupport; this.isCustomLafSupportSet = (this.lafSupport.getClass() != LafWidgetSupport.class); } /** * Unsets custom LAF support and reverts to the base LAF support. */ public void unsetLafSupport() { this.lafSupport = new LafWidgetSupport(); this.isCustomLafSupportSet = false; } /** * Returns the currently set LAF support. The result is guaranteed to be * non-null. * * @return Currently set non-null LAF support. */ public LafWidgetSupport getLafSupport() { return this.lafSupport; } /** * Retrieves the current label bundle. * * @return The current label bundle. * @see #resetLabelBundle() */ public static synchronized ResourceBundle getLabelBundle() { // fix for RFE 157 on Substance (allowing custom class loader for // resource bundles which can remove server calls // in applets) if (LafWidgetRepository.labelBundleClassLoader == null) { LafWidgetRepository.LABEL_BUNDLE = ResourceBundle .getBundle("org.jvnet.lafwidget.resources.Labels", Locale .getDefault()); } else { LafWidgetRepository.LABEL_BUNDLE = ResourceBundle.getBundle( "org.jvnet.lafwidget.resources.Labels", Locale.getDefault(), LafWidgetRepository.labelBundleClassLoader); } return LafWidgetRepository.LABEL_BUNDLE; } /** * Retrieves the label bundle for the specified locale. * * @param locale * Locale. * @return The label bundle for the specified locale. */ public static synchronized ResourceBundle getLabelBundle(Locale locale) { // fix for RFE 157 on Substance (allowing custom class loader for // resource bundles which can remove server calls // in applets) if (LafWidgetRepository.labelBundleClassLoader == null) { return ResourceBundle.getBundle( "org.jvnet.lafwidget.resources.Labels", locale); } else { return ResourceBundle.getBundle( "org.jvnet.lafwidget.resources.Labels", locale, LafWidgetRepository.labelBundleClassLoader); } } /** * Resets the current label bundle. Useful when the application changes * Locale at runtime. * * @see #getLabelBundle() */ public static synchronized void resetLabelBundle() { LafWidgetRepository.LABEL_BUNDLE = null; } /** * Sets the class loader for {@link #LABEL_BUNDLE}. * * @param labelBundleClassLoader * Class loader for {@link #LABEL_BUNDLE}. * @since version 1.1 */ public static void setLabelBundleClassLoader( ClassLoader labelBundleClassLoader) { LafWidgetRepository.labelBundleClassLoader = labelBundleClassLoader; } // /** // * Retrieves the manager for components that ignore animations. // * // * @return The manager for components that ignore animations. // */ // public FadeIgnoreManager getFadeIgnoreManager() { // return fadeIgnoreManager; // } /** * Marks widget with the specified class name to never be installed on any * components. * * @param widgetClassName * Fully qualified widget class name. */ public synchronized void addToIgnoreWidgets(String widgetClassName) { this.widgetClassesToIgnore.add(widgetClassName); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/LafWidgetSupport.java0000644000175000017500000003226511254157216026440 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget; import java.awt.*; import java.lang.reflect.Field; import java.lang.reflect.Method; import javax.swing.*; import javax.swing.JInternalFrame.JDesktopIcon; import javax.swing.plaf.TabbedPaneUI; import javax.swing.plaf.basic.BasicTabbedPaneUI; import javax.swing.text.JTextComponent; import org.jvnet.lafwidget.desktop.DesktopIconHoverPreviewWidget; import org.jvnet.lafwidget.menu.MenuSearchWidget; import org.jvnet.lafwidget.tabbed.TabHoverPreviewWidget; import org.jvnet.lafwidget.tabbed.TabOverviewDialogWidget; import org.jvnet.lafwidget.text.LockBorderWidget; import org.jvnet.lafwidget.text.PasswordStrengthCheckerWidget; import org.jvnet.lafwidget.utils.LafConstants; import org.jvnet.lafwidget.utils.LafConstants.PasswordStrength; /** * LAF-specific support for widgets. Each LAF should override relevant functions * based on the internal implementation. Note that if * {@link LafWidgetRepository#setLafSupport(LafWidgetSupport)} is called with a * custom implementation, that implementation should not throw exceptions in any * function. * * @author Kirill Grouchnikov */ public class LafWidgetSupport { /** * Returns the component for desktop icon hover (internal frame preview) * functionality. Is used in the {@link DesktopIconHoverPreviewWidget} * widget. * * @param desktopIcon * Desktop icon. * @return The component for desktop icon hover (internal frame preview) * functionality. */ public JComponent getComponentForHover(JDesktopIcon desktopIcon) { return desktopIcon; } /** * Returns indication whether the menu search functionality should be * installed on the specified menu bar. Is used in the * {@link MenuSearchWidget} widget. * * @param menuBar * Menu bar. * @return true if the menu search functionality should be * installed on the specified menu bar, false * otherwise. */ public boolean toInstallMenuSearch(JMenuBar menuBar) { return (MenuSearchWidget.getMenuItemCount(menuBar) > 40); } /** * Returns indication whether additional functionality should be installed * on the specified component. * * @param comp * Component. * @return true if additional functionality should be installed * on the specified component, false otherwise. */ public boolean toInstallExtraElements(Component comp) { return true; } /** * Returns the search icon that matches the specified parameters. Is used in * the {@link MenuSearchWidget} widget. * * @param dimension * Search icon dimension. * @param componentOrientation * The orientation for the search icon. Should be considered in * the implementation code for proper RTL support. * @return The search icon that matches the specified parameters. */ public Icon getSearchIcon(int dimension, ComponentOrientation componentOrientation) { return LafWidgetUtilities.getSearchIcon(dimension, componentOrientation .isLeftToRight()); } /** * Returns the icon that matches the specified number. This function is used * in {@link MenuSearchWidget} to set icons on menu search results. See * default implementation in {@link LafWidgetUtilities#getHexaMarker(int)} * that returns binary-based icons for numbers from 0 to 15. Is used in the * {@link MenuSearchWidget} widget. * * @param number * Number. * @return The icon that matches the specified number. */ public Icon getNumberIcon(int number) { return LafWidgetUtilities.getHexaMarker(number); } /** * Marks the specified button as flat. A flat button doesn't * show its background unless selected, armed, pressed or (possibly) hovered * over. Some LAFs have flat buttons on toolbars. Is used in * {@link MenuSearchWidget} and {@link TabOverviewDialogWidget} widgets. * * @param button * Button to mark as flat. */ public void markButtonAsFlat(AbstractButton button) { } /** * Returns the index of the rollover tab in the specified tabbed pane. Is * used in the {@link TabHoverPreviewWidget} widget. * * @param tabbedPane * Tabbed pane. * @return The index of the rollover tab in the specified tabbed pane. * @throws UnsupportedOperationException * In the base implementation. */ public int getRolloverTabIndex(JTabbedPane tabbedPane) { TabbedPaneUI ui = tabbedPane.getUI(); if (ui instanceof BasicTabbedPaneUI) { try { Class clazz = ui.getClass(); while (clazz != null) { try { Method mtd = clazz.getDeclaredMethod("getRolloverTab", new Class[0]); if (mtd != null) { mtd.setAccessible(true); int result = (Integer) mtd .invoke(ui, new Object[0]); return result; } } catch (NoSuchMethodException nsme) { } clazz = clazz.getSuperclass(); } } catch (Throwable t) { // ignore all fall through } } throw new UnsupportedOperationException(); } /** * Sets the tab area insets for the specified tabbed pane. Is used in the * {@link TabOverviewDialogWidget} widget. * * @param tabbedPane * Tabbed pane. * @param tabAreaInsets * Tab area insets. * @throws UnsupportedOperationException * In the base implementation. */ public void setTabAreaInsets(JTabbedPane tabbedPane, Insets tabAreaInsets) { Insets old = this.getTabAreaInsets(tabbedPane); TabbedPaneUI ui = tabbedPane.getUI(); if (ui instanceof BasicTabbedPaneUI) { try { Class clazz = ui.getClass(); while (clazz != null) { try { Field fld = clazz.getDeclaredField("tabAreaInsets"); if (fld != null) { fld.setAccessible(true); fld.set(ui, tabAreaInsets); // Fire a property change event so that the tabbed // pane can revalidate itself LafWidgetUtilities.firePropertyChangeEvent( tabbedPane, "tabAreaInsets", old, tabAreaInsets); return; } } catch (NoSuchFieldException nsfe) { } clazz = clazz.getSuperclass(); } } catch (Throwable t) { // ignore all fall through } } throw new UnsupportedOperationException(); } /** * Returns the tab area insets for the specified tabbed pane.Is used in the * {@link TabOverviewDialogWidget} widget. * * @param tabbedPane * Tabbed pane. * @return The tab area insets for the specified tabbed pane. */ public Insets getTabAreaInsets(JTabbedPane tabbedPane) { TabbedPaneUI ui = tabbedPane.getUI(); if (ui instanceof BasicTabbedPaneUI) { try { Class clazz = ui.getClass(); while (clazz != null) { try { Field fld = clazz.getDeclaredField("tabAreaInsets"); if (fld != null) { fld.setAccessible(true); Insets result = (Insets) fld.get(ui); return result; } } catch (NoSuchFieldException nsfe) { } clazz = clazz.getSuperclass(); } } catch (Throwable t) { // ignore all fall through } } Insets result = UIManager.getInsets("TabbedPane.tabAreaInsets"); if (result == null) result = new Insets(0, 0, 0, 0); return result; } /** * Returns the tab rectangle for the specified tab in a tabbed pane.Is used * in the {@link TabHoverPreviewWidget} widget. * * @param tabbedPane * Tabbed pane. * @param tabIndex * Index of a tab. * @return The tab rectangle for the specified parameters. * @throws UnsupportedOperationException * In the base implementation. */ public Rectangle getTabRectangle(JTabbedPane tabbedPane, int tabIndex) { TabbedPaneUI ui = tabbedPane.getUI(); if (ui instanceof BasicTabbedPaneUI) { try { Class clazz = ui.getClass(); while (clazz != null) { try { Field fld = clazz.getDeclaredField("rects"); if (fld != null) { fld.setAccessible(true); Rectangle[] rects = (Rectangle[]) fld.get(ui); return rects[tabIndex]; } } catch (NoSuchFieldException nsfe) { } clazz = clazz.getSuperclass(); } } catch (Throwable t) { // ignore all fall through } } throw new UnsupportedOperationException(); } /** * Paints password strength marker. Is used in the * {@link PasswordStrengthCheckerWidget} widget. The default implementation * uses orange color for {@link LafConstants.PasswordStrength#WEAK} * passwords, yellow color for {@link LafConstants.PasswordStrength#MEDIUM} * passwords and green color for * {@link LafConstants.PasswordStrength#STRONG} passwords. * * @param g * Graphics context. * @param x * X coordinate for the marker. * @param y * Y coordinate for the marker. * @param width * Marker width. * @param height * Marker height. * @param pStrength * Password strength. */ public void paintPasswordStrengthMarker(Graphics g, int x, int y, int width, int height, PasswordStrength pStrength) { Graphics2D g2 = (Graphics2D) g.create(); if (pStrength == PasswordStrength.WEAK) g2.setColor(Color.orange); if (pStrength == PasswordStrength.MEDIUM) g2.setColor(Color.yellow); if (pStrength == PasswordStrength.STRONG) g2.setColor(Color.green); g2.fillRect(x, y, width, height); g2.dispose(); } /** * Checks whether the specified component should show a lock icon. In the * default implementation, the following component show lock icons: *
    *
  • Editable comboboxes that have been marked with "use model only" * property. See {@link LafWidget#COMBO_BOX_USE_MODEL_ONLY}. *
  • Non-editable text components. *
* Is used in the {@link LockBorderWidget} widget. * * @param comp * Component. * @return true if the specified component should show a lock * icon, false otherwise. */ public boolean hasLockIcon(Component comp) { // check the NO_LOCK property if (comp instanceof JComponent) { if (Boolean.TRUE.equals(((JComponent) comp) .getClientProperty(LafWidget.NO_LOCK_ICON))) return false; } if (Boolean.TRUE.equals(UIManager.get(LafWidget.NO_LOCK_ICON))) return false; if (comp instanceof JTextComponent) { JTextComponent textComp = (JTextComponent) comp; return !textComp.isEditable(); } return false; } /** * Returns the lock icon. Is used in {@link LockBorderWidget} widget. * * @return Lock icon. Should be sufficiently small (preferrably not more * than 5-6 pixels wide). */ public Icon getLockIcon() { return LafWidgetUtilities.getSmallLockIcon(); } /** * Returns the arrow icon (the icon used in combo box drop button, scroll * bar buttons etc.). * * @param orientation * One of {@link SwingConstants#NORTH} or * {@link SwingConstants#SOUTH}. * @return Arrow icon. */ public Icon getArrowIcon(int orientation) { return null; } /** * Returns the size of the lookup icon. Override to handle high DPI mode. * * @return The size of the lookup icon. */ public int getLookupIconSize() { return 14; } /** * Returns the size of the lookup button. Override to handle high DPI mode. * * @return The size of the lookup button. */ public int getLookupButtonSize() { return 16; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/LafWidgetUtilities.java0000644000175000017500000005045511254157120026732 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget; import java.awt.*; import java.awt.geom.GeneralPath; import java.awt.image.BufferedImage; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.*; import javax.swing.*; import javax.swing.text.JTextComponent; import org.jvnet.lafwidget.animation.FadeConfigurationManager; import org.jvnet.lafwidget.animation.FadeKind; import org.jvnet.lafwidget.utils.LafConstants.AnimationKind; /** * Various utility functions. * * @author Kirill Grouchnikov * @author Romain Guy */ public class LafWidgetUtilities { /** * Name for the internal client property that marks a component as * previewable. */ public static final String PREVIEW_MODE = "lafwidgets.internal.previewMode"; /** * Private constructor. Is here to enforce using static methods only. */ private LafWidgetUtilities() { } /** * Retrieves transparent image of specified dimension. * * @param width * Image width. * @param height * Image height. * @return Transparent image of specified dimension. */ public static BufferedImage getBlankImage(int width, int height) { BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); // get graphics and set hints Graphics2D graphics = (Graphics2D) image.getGraphics().create(); graphics.setColor(new Color(0, 0, 0, 0)); graphics.setComposite(AlphaComposite.Src); graphics.fillRect(0, 0, width, height); graphics.dispose(); return image; } /** * Creates a compatible image (for efficient processing and drawing). * * @param image * The original image. * @return Compatible version of the original image. * @author Romain Guy */ public static BufferedImage createCompatibleImage(BufferedImage image) { GraphicsEnvironment e = GraphicsEnvironment .getLocalGraphicsEnvironment(); GraphicsDevice d = e.getDefaultScreenDevice(); GraphicsConfiguration c = d.getDefaultConfiguration(); BufferedImage compatibleImage = c.createCompatibleImage(image .getWidth(), image.getHeight()); Graphics g = compatibleImage.getGraphics(); g.drawImage(image, 0, 0, null); g.dispose(); return compatibleImage; } /** * Creates a thumbnail of the specified width. * * @param image * The original image. * @param requestedThumbWidth * The width of the resulting thumbnail. * @return Thumbnail of the specified width. * @author Romain Guy */ public static BufferedImage createThumbnail(BufferedImage image, int requestedThumbWidth) { float ratio = (float) image.getWidth() / (float) image.getHeight(); int width = image.getWidth(); BufferedImage thumb = image; do { width /= 2; if (width < requestedThumbWidth) { width = requestedThumbWidth; } BufferedImage temp = new BufferedImage(width, (int) (width / ratio), BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = temp.createGraphics(); g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); g2.drawImage(thumb, 0, 0, temp.getWidth(), temp.getHeight(), null); g2.dispose(); thumb = temp; } while (width != requestedThumbWidth); return thumb; } /** * Returns search icon. * * @param dimension * Icon dimension. * @param leftToRight * Indicates the orientation of the resulting icon. * @return Search icon. */ public static Icon getSearchIcon(int dimension, boolean leftToRight) { BufferedImage result = LafWidgetUtilities.getBlankImage(dimension, dimension); Graphics2D graphics = (Graphics2D) result.getGraphics().create(); graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); graphics.setColor(Color.black); graphics.setStroke(new BasicStroke(1.5f)); if (leftToRight) { int xc = (int) (0.6 * dimension); int yc = (int) (0.45 * dimension); int r = (int) (0.3 * dimension); graphics.drawOval(xc - r, yc - r, 2 * r, 2 * r); graphics.setStroke(new BasicStroke(3.0f)); GeneralPath handle = new GeneralPath(); handle.moveTo((float) (xc - r / Math.sqrt(2.0)), (float) (yc + r / Math.sqrt(2.0))); handle.lineTo(1.8f, dimension - 2.2f); graphics.draw(handle); } else { int xc = (int) (0.4 * dimension); int yc = (int) (0.45 * dimension); int r = (int) (0.3 * dimension); graphics.drawOval(xc - r, yc - r, 2 * r, 2 * r); graphics.setStroke(new BasicStroke(3.0f)); GeneralPath handle = new GeneralPath(); handle.moveTo((float) (xc + r / Math.sqrt(2.0)), (float) (yc + r / Math.sqrt(2.0))); handle.lineTo(dimension - 2.5f, dimension - 2.2f); graphics.draw(handle); } graphics.dispose(); return new ImageIcon(result); } /** * Returns small icon representation of the specified integer value. The * remainder of dividing the integer by 16 is translated to four circles * arranged in 2*2 grid. * * @param value * Integer value to represent. * @return Icon representation of the specified integer value. */ public static Icon getHexaMarker(int value) { BufferedImage result = LafWidgetUtilities.getBlankImage(9, 9); value %= 16; Color offColor = Color.gray; Color onColor = Color.black; boolean bit1 = ((value & 0x1) != 0); boolean bit2 = ((value & 0x2) != 0); boolean bit3 = ((value & 0x4) != 0); boolean bit4 = ((value & 0x8) != 0); Graphics2D graphics = (Graphics2D) result.getGraphics().create(); graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); graphics.setColor(bit1 ? onColor : offColor); graphics.fillOval(5, 5, 4, 4); graphics.setColor(bit2 ? onColor : offColor); graphics.fillOval(5, 0, 4, 4); graphics.setColor(bit3 ? onColor : offColor); graphics.fillOval(0, 5, 4, 4); graphics.setColor(bit4 ? onColor : offColor); graphics.fillOval(0, 0, 4, 4); graphics.dispose(); return new ImageIcon(result); } /** * Makes the specified component and all its descendants previewable. * * @param comp * Component. * @param dbSnapshot * The "snapshot" map that will contain the original * double-buffer status of the specified component and all its * descendants. Key is {@link JComponent}, value is * {@link Boolean}. */ public static void makePreviewable(Component comp, Map dbSnapshot) { if (comp instanceof JComponent) { JComponent jcomp = (JComponent) comp; // if (jcomp.getParent() instanceof CellRendererPane) { // System.out.println(jcomp.getClass().getSimpleName() + ":" // + jcomp.hashCode()); // } dbSnapshot.put(jcomp, Boolean.valueOf(jcomp.isDoubleBuffered())); jcomp.setDoubleBuffered(false); jcomp.putClientProperty(LafWidgetUtilities.PREVIEW_MODE, Boolean.TRUE); } if (comp instanceof Container) { Container cont = (Container) comp; for (int i = 0; i < cont.getComponentCount(); i++) LafWidgetUtilities.makePreviewable(cont.getComponent(i), dbSnapshot); } } /** * Restores the regular (non-previewable) status of the specified component * and all its descendants. * * @param comp * Component. * @param dbSnapshot * The "snapshot" map that contains the original double-buffer * status of the specified component and all its descendants. Key * is {@link JComponent}, value is {@link Boolean}. */ public static void restorePreviewable(Component comp, Map dbSnapshot) { if (comp instanceof JComponent) { JComponent jcomp = (JComponent) comp; if (dbSnapshot.containsKey(comp)) { jcomp.setDoubleBuffered(dbSnapshot.get(comp)); jcomp.putClientProperty(LafWidgetUtilities.PREVIEW_MODE, null); } else { // this can happen in case the application has // renderers (combos, ...). Take the property from the parent Component parent = comp.getParent(); if (parent instanceof JComponent) { jcomp.setDoubleBuffered(dbSnapshot.get(parent)); jcomp.putClientProperty(LafWidgetUtilities.PREVIEW_MODE, null); } // System.out.println("Not found"); // Component c = jcomp; // while (c != null) { // System.out.println("\t" + c.getClass().getSimpleName() // + ":" + c.hashCode()); // c = c.getParent(); // } } } if (comp instanceof Container) { Container cont = (Container) comp; for (int i = 0; i < cont.getComponentCount(); i++) LafWidgetUtilities.restorePreviewable(cont.getComponent(i), dbSnapshot); } } /** * Returns the animation kind of the specified component. * * @param component * Component. * @return The animation kind of the specified component. */ public static AnimationKind getAnimationKind(Component component) { JPopupMenu popupMenu = null; while (component != null) { if (component instanceof JComponent) { JComponent jcomp = (JComponent) component; Object jcompAnimationKind = jcomp .getClientProperty(LafWidget.ANIMATION_KIND); if (jcompAnimationKind instanceof AnimationKind) return (AnimationKind) jcompAnimationKind; } if (component instanceof JPopupMenu) { popupMenu = (JPopupMenu) component; } component = component.getParent(); } if (popupMenu != null) { Component invoker = popupMenu.getInvoker(); if (popupMenu != invoker) return getAnimationKind(popupMenu.getInvoker()); } Object globalAnimationKind = UIManager.get(LafWidget.ANIMATION_KIND); if (globalAnimationKind instanceof AnimationKind) return (AnimationKind) globalAnimationKind; return AnimationKind.REGULAR; } /** * Returns a lock icon. * * @return Lock icon. */ public static Icon getSmallLockIcon() { BufferedImage result = LafWidgetUtilities.getBlankImage(6, 8); Color fore = Color.black; Color fill = new Color(208, 208, 48); Graphics2D graphics = (Graphics2D) result.getGraphics().create(); graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); graphics.setColor(fill); graphics.fillRect(1, 3, 4, 4); graphics.setColor(fore); graphics.drawLine(0, 3, 0, 7); graphics.drawLine(5, 3, 5, 7); graphics.drawLine(0, 7, 5, 7); graphics.drawLine(1, 2, 4, 2); graphics.drawLine(1, 1, 1, 2); graphics.drawLine(4, 1, 4, 2); graphics.drawLine(2, 0, 3, 0); graphics.drawLine(2, 4, 3, 4); graphics.drawLine(2, 5, 3, 5); graphics.dispose(); return new ImageIcon(result); } /** * Checks whether the specified text component has * "select all on focus gain" property. * * @param textComp * Text component. * @return true if the specified text component has "select all * on focus gain" property, false otherwise. */ public static boolean hasTextFocusSelectAllProperty(JTextComponent textComp) { Component comp = textComp; while (comp != null) { if (comp instanceof JComponent) { Object textFocusSelectAllProperty = ((JComponent) comp) .getClientProperty(LafWidget.TEXT_SELECT_ON_FOCUS); if (Boolean.TRUE.equals(textFocusSelectAllProperty)) return true; if (Boolean.FALSE.equals(textFocusSelectAllProperty)) return false; } comp = comp.getParent(); } return (Boolean.TRUE.equals(UIManager .get(LafWidget.TEXT_SELECT_ON_FOCUS))); } /** * Checks whether the specified text component has "flip select on escape" * property. * * @param textComp * Text component. * @return true if the specified text component has "flip * select on escape" property, false otherwise. */ public static boolean hasTextFlipSelectOnEscapeProperty( JTextComponent textComp) { Object textFocusSelectAllProperty = textComp .getClientProperty(LafWidget.TEXT_FLIP_SELECT_ON_ESCAPE); if (Boolean.TRUE.equals(textFocusSelectAllProperty)) return true; if (Boolean.FALSE.equals(textFocusSelectAllProperty)) return false; return (Boolean.TRUE.equals(UIManager .get(LafWidget.TEXT_FLIP_SELECT_ON_ESCAPE))); } /** * Checks whether the specified text component has edit context menu * property. * * @param textComp * Text component. * @return true if the specified text component has edit * context menu property, false otherwise. */ public static boolean hasTextEditContextMenu(JTextComponent textComp) { Object textEditContextMenuProperty = textComp .getClientProperty(LafWidget.TEXT_EDIT_CONTEXT_MENU); if (Boolean.TRUE.equals(textEditContextMenuProperty)) return true; if (Boolean.FALSE.equals(textEditContextMenuProperty)) return false; return (Boolean.TRUE.equals(UIManager .get(LafWidget.TEXT_EDIT_CONTEXT_MENU))); } /** * Checks whether the specified scroll pane supports auto scroll. * * @param scrollPane * Scroll pane component. * @return true if the specified scroll pane supports auto * scroll, false otherwise. */ public static boolean hasAutoScroll(JScrollPane scrollPane) { Object compProperty = scrollPane .getClientProperty(LafWidget.AUTO_SCROLL); if (Boolean.TRUE.equals(compProperty)) return true; if (Boolean.FALSE.equals(compProperty)) return false; return (Boolean.TRUE.equals(UIManager.get(LafWidget.AUTO_SCROLL))); } /** * Checks whether the specified tree component has automatic drag and drop * support. * * @param tree * Tree component. * @return true if the specified text component has automatic * drag and drop support, false otherwise. */ public static boolean hasAutomaticDnDSupport(JTree tree) { Object dndProperty = tree .getClientProperty(LafWidget.TREE_AUTO_DND_SUPPORT); if (Boolean.TRUE.equals(dndProperty)) return true; if (Boolean.FALSE.equals(dndProperty)) return false; return (Boolean.TRUE.equals(UIManager .get(LafWidget.TREE_AUTO_DND_SUPPORT))); } /** * Checks whether the label lookup should use component-specific locale on * the specified component. * * @param jcomp * Component. * @return true if the custom labels should be looked up based * on the component locale as returned by * {@link JComponent#getLocale()}, false if the custom * labels should be looked up based on the global locale as returned * by {@link Locale#getDefault()}. */ public static boolean toIgnoreGlobalLocale(JComponent jcomp) { if (jcomp == null) return false; return Boolean.TRUE.equals(jcomp .getClientProperty(LafWidget.IGNORE_GLOBAL_LOCALE)); } /** * Returns the resource bundle for the specified component. * * @param jcomp * Component. * @return Resource bundle for the specified component. */ public static ResourceBundle getResourceBundle(JComponent jcomp) { if (toIgnoreGlobalLocale(jcomp)) { return LafWidgetRepository.getLabelBundle(jcomp.getLocale()); } else { return LafWidgetRepository.getLabelBundle(); } } /** * Checks whether the specified fade kind has no animations on the specified * component. Can be used to cull unnecessary code in animation listeners on * large tables and lists. * * @param comp * Component. * @param fadeKind * Fade kind. * @return true if the specified fade kind has no animations on * the specified component, false otherwise. */ public static boolean hasNoFades(Component comp, FadeKind fadeKind) { return (LafWidgetUtilities.getAnimationKind(comp) == AnimationKind.NONE) || (!FadeConfigurationManager.getInstance().fadeAllowed( fadeKind, comp)); } /** * Returns the current icon for the specified button. This method is for * internal use only. * * @param b * Button. * @return Icon for the specified button. */ public static Icon getIcon(AbstractButton b) { Icon icon = b.getIcon(); if (icon == null) return null; ButtonModel model = b.getModel(); Icon tmpIcon = null; if (icon != null) { if (!model.isEnabled()) { if (model.isSelected()) { tmpIcon = b.getDisabledSelectedIcon(); } else { tmpIcon = b.getDisabledIcon(); } } else if (model.isPressed() && model.isArmed()) { tmpIcon = b.getPressedIcon(); } else if (b.isRolloverEnabled() && model.isRollover()) { if (model.isSelected()) { tmpIcon = b.getRolloverSelectedIcon(); } else { tmpIcon = b.getRolloverIcon(); } } else if (model.isSelected()) { tmpIcon = b.getSelectedIcon(); } if (tmpIcon != null) { icon = tmpIcon; } } return icon; } public static boolean toIgnoreAnimations(Component comp) { if (comp instanceof JMenuItem) return false; return (SwingUtilities.getAncestorOfClass(CellRendererPane.class, comp) != null); } /** * Tests UI threading violations on changing the state the specified * component. * * @param comp * Component. * @throws UiThreadingViolationException * If the component is changing state off Event Dispatch Thread. */ public static void testComponentStateChangeThreadingViolation(Component comp) { if (!SwingUtilities.isEventDispatchThread()) { UiThreadingViolationException uiThreadingViolationError = new UiThreadingViolationException( "Component state change must be done on Event Dispatch Thread"); uiThreadingViolationError.printStackTrace(System.err); throw uiThreadingViolationError; } } /** * Fires the matching property change event on the specific component. * * @param component * Component. * @param propertyName * Property name. * @param oldValue * Old property value. * @param newValue * New property value. */ public static void firePropertyChangeEvent(JComponent component, String propertyName, Object oldValue, Object newValue) { PropertyChangeEvent pce = new PropertyChangeEvent(component, propertyName, oldValue, newValue); for (PropertyChangeListener general : component .getPropertyChangeListeners()) { general.propertyChange(pce); } for (PropertyChangeListener specific : component .getPropertyChangeListeners(propertyName)) { specific.propertyChange(pce); } } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/LafWidget.license0000644000175000017500000000305011137001552025521 0ustar drazzibdrazzibCopyright (c) 2005-2009, Kirill Grouchnikov and contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Kirill Grouchnikov and contributors nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/scroll/0000755000175000017500000000000011253454710023616 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/scroll/AutoScrollActivator.java0000644000175000017500000002274711137001462030432 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.scroll; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.Border; /** * Christopher Deckers (chrriis@nextencia.net) http://www.nextencia.net * * @author Christopher Deckers */ public class AutoScrollActivator { protected JScrollPane scrollPane; public AutoScrollActivator(JScrollPane scrollPane) { this.scrollPane = scrollPane; configureScrollPane(); } protected static class AutoScrollProperties { public Point startLocation; public Point currentLocation; public Timer timer; public AWTEventListener toolkitListener; public boolean isDragMode; public JPopupMenu iconPopupMenu; } protected AutoScrollProperties autoScrollProperties; protected void deactivateAutoScroll() { if (autoScrollProperties == null) return; autoScrollProperties.timer.stop(); Toolkit.getDefaultToolkit().removeAWTEventListener( autoScrollProperties.toolkitListener); autoScrollProperties.iconPopupMenu.setVisible(false); autoScrollProperties = null; } protected void activateAutoScroll(MouseEvent e) { autoScrollProperties = new AutoScrollProperties(); autoScrollProperties.isDragMode = false; JViewport viewport = scrollPane.getViewport(); autoScrollProperties.currentLocation = MouseInfo.getPointerInfo() .getLocation(); SwingUtilities.convertPointFromScreen( autoScrollProperties.currentLocation, viewport); autoScrollProperties.startLocation = autoScrollProperties.currentLocation; // We use a popup menu so that it can be heavyweight or lightweight // depending on the context. // By default it is probably lightweight and thus uses alpha // transparency final JPopupMenu iconPopupMenu = new JPopupMenu() { @Override public void setBorder(Border border) { // Overriden to avoid having a border set by the L&F } }; iconPopupMenu.setFocusable(false); iconPopupMenu.setOpaque(false); JLabel iconLabel = new JLabel(getAutoScrollIcon()); iconLabel.addMouseWheelListener(new MouseWheelListener() { public void mouseWheelMoved(MouseWheelEvent e) { deactivateAutoScroll(); } }); iconPopupMenu.add(iconLabel); iconPopupMenu.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { iconPopupMenu.setVisible(false); } }); autoScrollProperties.iconPopupMenu = iconPopupMenu; Dimension iconPopupMenuSize = iconPopupMenu.getPreferredSize(); iconPopupMenu.show(viewport, autoScrollProperties.startLocation.x - iconPopupMenuSize.width / 2, autoScrollProperties.startLocation.y - iconPopupMenuSize.height / 2); // Assumption: the popup menu has a parent that is itself added to the // glass pane or to a window. // Some L&F will create borders to that parent, and we don't want that. Container parent = iconPopupMenu.getParent(); if (parent instanceof JComponent) { ((JComponent) parent).setBorder(null); } ActionListener actionListener = new ActionListener() { public void actionPerformed(ActionEvent e) { JViewport viewport = scrollPane.getViewport(); Component view = viewport.getView(); if (view == null) { return; } Point viewPosition = viewport.getViewPosition(); int offsetX = autoScrollProperties.currentLocation.x - autoScrollProperties.startLocation.x; int offsetY = autoScrollProperties.currentLocation.y - autoScrollProperties.startLocation.y; offsetX = offsetX > 0 ? Math.max(0, offsetX - 4) : Math.min(0, offsetX + 4); offsetY = offsetY > 0 ? Math.max(0, offsetY - 4) : Math.min(0, offsetY + 4); viewPosition = new Point(viewPosition.x + offsetX, viewPosition.y + offsetY); Dimension extentSize = viewport.getExtentSize(); Dimension viewSize = view.getSize(); if (viewSize.width - viewPosition.x < extentSize.width) { viewPosition.x = viewSize.width - extentSize.width; } if (viewSize.height - viewPosition.y < extentSize.height) { viewPosition.y = viewSize.height - extentSize.height; } if (viewPosition.x < 0) { viewPosition.x = 0; } if (viewPosition.y < 0) { viewPosition.y = 0; } viewport.setViewPosition(viewPosition); } }; autoScrollProperties.timer = new Timer(50, actionListener); autoScrollProperties.timer.start(); autoScrollProperties.toolkitListener = new AWTEventListener() { public void eventDispatched(AWTEvent e) { int eventID = e.getID(); switch (eventID) { case MouseEvent.MOUSE_MOVED: case MouseEvent.MOUSE_DRAGGED: JViewport viewport = scrollPane.getViewport(); autoScrollProperties.currentLocation = MouseInfo .getPointerInfo().getLocation(); SwingUtilities.convertPointFromScreen( autoScrollProperties.currentLocation, viewport); if (!autoScrollProperties.isDragMode && eventID == MouseEvent.MOUSE_DRAGGED) { Dimension size = new Dimension( Math.abs(autoScrollProperties.currentLocation.x - autoScrollProperties.startLocation.x), Math.abs(autoScrollProperties.currentLocation.y - autoScrollProperties.startLocation.y)); autoScrollProperties.isDragMode = size.width > HV_IMAGE_ICON .getIconWidth() / 2 || size.height > HV_IMAGE_ICON.getIconHeight() / 2; } break; case MouseEvent.MOUSE_PRESSED: case MouseEvent.MOUSE_WHEEL: deactivateAutoScroll(); break; case MouseEvent.MOUSE_RELEASED: if (autoScrollProperties.isDragMode && ((MouseEvent) e).getButton() == 2) { deactivateAutoScroll(); } break; case WindowEvent.WINDOW_LOST_FOCUS: deactivateAutoScroll(); break; } } }; Toolkit.getDefaultToolkit().addAWTEventListener( autoScrollProperties.toolkitListener, AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_WHEEL_EVENT_MASK | AWTEvent.WINDOW_FOCUS_EVENT_MASK); } protected static class AutoScrollMouseListener extends MouseAdapter { protected AutoScrollActivator autoScrollActivator; public AutoScrollMouseListener(AutoScrollActivator autoScrollActivator) { this.autoScrollActivator = autoScrollActivator; } @Override public void mousePressed(MouseEvent e) { if (e.getButton() != 2) { return; } autoScrollActivator.activateAutoScroll(e); } } protected void configureScrollPane() { for (MouseListener mouseListener : scrollPane.getMouseListeners()) { if (mouseListener instanceof AutoScrollMouseListener) { return; } } scrollPane.addMouseListener(new AutoScrollMouseListener(this)); } protected static final ImageIcon H_IMAGE_ICON = new ImageIcon( AutoScrollActivator.class.getResource("resource/autoscroll_h.png")); protected static final ImageIcon V_IMAGE_ICON = new ImageIcon( AutoScrollActivator.class.getResource("resource/autoscroll_v.png")); protected static final ImageIcon HV_IMAGE_ICON = new ImageIcon( AutoScrollActivator.class .getResource("resource/autoscroll_all.png")); protected ImageIcon getAutoScrollIcon() { ImageIcon icon; if (scrollPane.getHorizontalScrollBar().isVisible()) { if (scrollPane.getVerticalScrollBar().isVisible()) { icon = HV_IMAGE_ICON; } else { icon = H_IMAGE_ICON; } } else { if (scrollPane.getVerticalScrollBar().isVisible()) { icon = V_IMAGE_ICON; } else { icon = HV_IMAGE_ICON; } } return icon; } public static void setAutoScrollEnabled(final JScrollPane scrollPane, boolean isEnabled) { if (isEnabled) { new AutoScrollActivator(scrollPane); } else { for (MouseListener mouseListener : scrollPane.getMouseListeners()) { if (mouseListener instanceof AutoScrollMouseListener) { scrollPane.removeMouseListener(mouseListener); return; } } } } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/scroll/ScrollPaneSelector.java0000644000175000017500000005036111137001464030224 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.scroll; import java.awt.*; import java.awt.event.*; import java.awt.geom.Area; import java.awt.image.BufferedImage; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import javax.swing.*; import javax.swing.event.MouseInputAdapter; import javax.swing.event.MouseInputListener; import org.jvnet.lafwidget.LafWidgetRepository; import org.jvnet.lafwidget.LafWidgetUtilities2; import org.jvnet.lafwidget.animation.*; import org.jvnet.lafwidget.preview.PreviewPainter; /** * ScrollPaneSelector is a little utility class that provides a means to quickly * scroll both vertically and horizontally on a single mouse click, by dragging * a selection rectangle over a "thumbnail" of the scrollPane's viewport view. *

* Once the selector is installed on a given JScrollPane instance, a little * button appears as soon as at least one of its scroll bars is made visible. *

* Contributed by the original author under BSD license. Also appears in the JDNC Incubator. * * @author weebib (Pierre LE LANNIC) * @author Kirill Grouchnikov (animations). */ public class ScrollPaneSelector extends JComponent { // static final fields private static final double MAX_SIZE = 200; // private static final Icon LAUNCH_SELECTOR_ICON = new Icon() { // public void paintIcon(Component c, Graphics g, int x, int y) { // Color tmpColor = g.getColor(); // g.setColor(Color.BLACK); // g.drawRect(2, 2, 10, 10); // g.drawRect(4, 5, 6, 4); // g.setColor(tmpColor); // } // // public int getIconWidth() { // return 15; // } // // public int getIconHeight() { // return 15; // } // }; // private static Map theInstalledScrollPaneSelectors = new HashMap(); private static final String COMPONENT_ORIENTATION = "componentOrientation"; private static FadeKind SCROLL_FADE_KIND = new FadeKind( "substancelaf.scrollSelector.scrollVisible"); private static FadeKind SCROLL_HIDE_KIND = new FadeKind( "substancelaf.scrollSelector.scrollHide"); // private static final String HAS_BEEN_UNINSTALLED = // "lafwidget.internal.scrollPaneSelector.hasBeenUninstalled"; // member fields private LayoutManager theFormerLayoutManager; private JScrollPane theScrollPane; private JComponent theComponent; private JPopupMenu thePopupMenu; private boolean toRestoreOriginal; private JButton theButton; private BufferedImage theImage; private Rectangle theStartRectangle; private Rectangle theRectangle; private Point theStartPoint; private Point thePrevPoint; private double theScale; private PropertyChangeListener propertyChangeListener; private ContainerAdapter theViewPortViewListener; // static { // FadeConfigurationManager configManager = FadeConfigurationManager // .getInstance(); // configManager.allowFades(SCROLL_FADE_KIND); // configManager.allowFades(SCROLL_HIDE_KIND); // } /** * Installs a ScrollPaneSelector to the given JScrollPane instance. * * @param aScrollPane */ // public synchronized static void installScrollPaneSelector( // JScrollPane aScrollPane) { // if (aScrollPane == null) // return; // PreviewPainter pPainter = LafWidgetUtilities // .getComponentPreviewPainter(aScrollPane); // if (pPainter == null) // return; // if (theInstalledScrollPaneSelectors.containsKey(aScrollPane)) // return; // ScrollPaneSelector scrollPaneSelector = new ScrollPaneSelector(); // scrollPaneSelector.installOnScrollPane(aScrollPane); // theInstalledScrollPaneSelectors.put(aScrollPane, scrollPaneSelector); // } // /** // * Removes the ScrollPaneSelector from the given JScrollPane. // * // * @param aScrollPane // */ // public synchronized static void uninstallScrollPaneSelector( // JScrollPane aScrollPane) { // if (aScrollPane == null) // return; // ScrollPaneSelector scrollPaneSelector = (ScrollPaneSelector) // theInstalledScrollPaneSelectors // .get(aScrollPane); // if (scrollPaneSelector == null) // return; // scrollPaneSelector.uninstallFromScrollPane(); // theInstalledScrollPaneSelectors.remove(aScrollPane); // } // -- Constructor ------ ScrollPaneSelector() { setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); theScrollPane = null; theImage = null; theStartRectangle = null; theRectangle = null; theStartPoint = null; theScale = 0.0; theButton = new JButton(); // { // @Override // public void removeNotify() { // super.removeNotify(); // if (!Boolean.TRUE.equals(theButton // .getClientProperty(HAS_BEEN_UNINSTALLED))) { // theButton.putClientProperty(HAS_BEEN_UNINSTALLED, // Boolean.TRUE); // uninstallScrollPaneSelector(theScrollPane); // } // } // // @Override // public void addNotify() { // super.addNotify(); // if (Boolean.TRUE.equals(theButton // .getClientProperty(HAS_BEEN_UNINSTALLED))) { // installScrollPaneSelector(theScrollPane); // theButton.putClientProperty(HAS_BEEN_UNINSTALLED, null); // } // } // }; LafWidgetRepository.getRepository().getLafSupport().markButtonAsFlat( theButton); theButton.setFocusable(false); theButton.setFocusPainted(false); MouseInputListener mil = new MouseInputAdapter() { @Override public void mousePressed(MouseEvent e) { Point p = e.getPoint(); SwingUtilities.convertPointToScreen(p, theButton); display(p); } @Override public void mouseReleased(MouseEvent e) { if (!thePopupMenu.isVisible()) return; // if (theStartPoint != null) { // Point newPoint = e.getPoint(); // SwingUtilities.convertPointToScreen(newPoint, (Component) e // .getSource()); // int deltaX = (int) ((newPoint.x - theStartPoint.x) / // theScale); // int deltaY = (int) ((newPoint.y - theStartPoint.y) / // theScale); // scroll(deltaX, deltaY); // } toRestoreOriginal = false; // final Component topLevel = // thePopupMenu.getTopLevelAncestor(); // final Point startCorner = topLevel.getLocationOnScreen(); // final Dimension startDim = topLevel.getSize(); // final int centerX = startCorner.x + startDim.width / 2; // final int centerY = startCorner.y + startDim.height / 2; // System.out.println(startCorner.x + ":" + startCorner.y + ":" // + startDim.width + ":" + startDim.height); thePopupMenu.setVisible(false); // FadeTracker.getInstance().trackFadeOut(SCROLL_HIDE_KIND, // thePopupMenu, false, // new FadeTracker.FadeTrackerCallback() { // public void fadeEnded(FadeKind fadeKind) { // thePopupMenu.setVisible(false); // } // // public void fadePerformed(FadeKind fadeKind, // float fadeCycle10) { // int newWidth = (int) (startDim.width // * fadeCycle); // int newHeight = (int) (startDim.height // * fadeCycle); // int newX = startCorner.x;//centerX - newWidth / 2; // int newY = startCorner.y;//centerY - newHeight / 2; // // thePopupMenu.setBounds(newX, newY, newWidth, // // newHeight); // // topLevel.setLocation(newX, newY); // topLevel.setSize(newWidth, newHeight); // // System.out.println(newX + ":" + newY + ":" // // + newWidth + ":" + newHeight); // } // }); // theStartPoint = null; // thePrevPoint = null; theStartRectangle = theRectangle; } @Override public void mouseDragged(MouseEvent e) { if (theStartPoint == null) return; if (!thePopupMenu.isShowing()) return; Point newPoint = e.getPoint(); SwingUtilities.convertPointToScreen(newPoint, (Component) e .getSource()); Rectangle popupScreenRect = new Rectangle(thePopupMenu .getLocationOnScreen(), thePopupMenu.getSize()); if (!popupScreenRect.contains(newPoint)) return; // if (theStartPoint != null) { // Point newPoint = e.getPoint(); // SwingUtilities.convertPointToScreen(newPoint, (Component) e // .getSource()); int deltaX = (int) ((newPoint.x - thePrevPoint.x) / theScale); int deltaY = (int) ((newPoint.y - thePrevPoint.y) / theScale); scroll(deltaX, deltaY, false); // final Rectangle oldRectangle = theComponent.getVisibleRect(); // final Rectangle newRectangle = new Rectangle(oldRectangle.x + // deltaX, // oldRectangle.y + deltaY, oldRectangle.width, // oldRectangle.height); // syncRectangle(); // moveRectangle(newPoint.x - theStartPoint.x, newPoint.y // - theStartPoint.y); // System.out.println(theStartPoint + ":" + newPoint); thePrevPoint = newPoint; // } } }; theButton.addMouseListener(mil); theButton.addMouseMotionListener(mil); setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); thePopupMenu = new JPopupMenu(); thePopupMenu.setLayout(new BorderLayout()); thePopupMenu.add(this, BorderLayout.CENTER); propertyChangeListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (theScrollPane == null) return; if ("componentOrientation".equals(evt.getPropertyName())) { theScrollPane.setCorner(JScrollPane.LOWER_LEADING_CORNER, null); theScrollPane.setCorner(JScrollPane.LOWER_TRAILING_CORNER, theButton); } } }; theViewPortViewListener = new ContainerAdapter() { @Override public void componentAdded(ContainerEvent e) { if (thePopupMenu.isVisible()) thePopupMenu.setVisible(false); Component comp = theScrollPane.getViewport().getView(); theComponent = (comp instanceof JComponent) ? (JComponent) comp : null; } }; thePopupMenu.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if ("visible".equals(evt.getPropertyName())) { if (!thePopupMenu.isVisible()) { setCursor(Cursor .getPredefinedCursor(Cursor.DEFAULT_CURSOR)); if (toRestoreOriginal) { int deltaX = (int) ((thePrevPoint.x - theStartPoint.x) / theScale); int deltaY = (int) ((thePrevPoint.y - theStartPoint.y) / theScale); scroll(-deltaX, -deltaY, true); } } } } }); } // -- JComponent overriden methods ------ @Override public Dimension getPreferredSize() { if (theImage == null || theRectangle == null) return new Dimension(); Insets insets = getInsets(); return new Dimension(theImage.getWidth(null) + insets.left + insets.right, theImage.getHeight(null) + insets.top + insets.bottom); } @Override protected void paintComponent(Graphics g1D) { if (theImage == null || theRectangle == null) return; Graphics2D g = (Graphics2D) g1D.create(); if (FadeTracker.getInstance().isTracked(thePopupMenu, SCROLL_HIDE_KIND)) { float fade = FadeTracker.getInstance().getFade(thePopupMenu, SCROLL_HIDE_KIND); g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, fade)); } Insets insets = getInsets(); int xOffset = insets.left; int yOffset = insets.top; int availableWidth = getWidth() - insets.left - insets.right; int availableHeight = getHeight() - insets.top - insets.bottom; g.drawImage(theImage, xOffset, yOffset, null); Color tmpColor = g.getColor(); Area area = new Area(new Rectangle(xOffset, yOffset, availableWidth, availableHeight)); area.subtract(new Area(theRectangle)); g.setColor(new Color(200, 200, 200, 128)); g.fill(area); g.setColor(Color.BLACK); g.draw(theRectangle); g.setColor(tmpColor); g.dispose(); } // -- Private methods ------ void installOnScrollPane(JScrollPane aScrollPane) { if (theScrollPane != null) uninstallFromScrollPane(); theScrollPane = aScrollPane; theFormerLayoutManager = theScrollPane.getLayout(); theScrollPane.setLayout(new TweakedScrollPaneLayout()); theScrollPane.firePropertyChange("layoutManager", false, true); theScrollPane.addPropertyChangeListener(COMPONENT_ORIENTATION, propertyChangeListener); theScrollPane.getViewport().addContainerListener( theViewPortViewListener); theScrollPane.setCorner(JScrollPane.LOWER_TRAILING_CORNER, theButton); Component comp = theScrollPane.getViewport().getView(); theComponent = (comp instanceof JComponent) ? (JComponent) comp : null; this.theButton.setIcon(LafWidgetRepository.getRepository() .getLafSupport().getSearchIcon( UIManager.getInt("ScrollBar.width") - 3, theScrollPane.getComponentOrientation())); theScrollPane.doLayout(); } void uninstallFromScrollPane() { if (theScrollPane == null) return; if (thePopupMenu.isVisible()) thePopupMenu.setVisible(false); theScrollPane.setCorner(JScrollPane.LOWER_TRAILING_CORNER, null); theScrollPane.removePropertyChangeListener(COMPONENT_ORIENTATION, propertyChangeListener); theScrollPane.getViewport().removeContainerListener( theViewPortViewListener); theScrollPane.setLayout(theFormerLayoutManager); theScrollPane.firePropertyChange("layoutManager", true, false); theScrollPane = null; } private void display(Point aPointOnScreen) { if (theComponent == null) return; PreviewPainter previewPainter = LafWidgetUtilities2 .getComponentPreviewPainter(theScrollPane); if (!previewPainter.hasPreview(theComponent.getParent(), theComponent, 0)) return; // if (previewPainter == null) { // double compWidth = theComponent.getWidth(); // double compHeight = theComponent.getHeight(); // double scaleX = MAX_SIZE / compWidth; // double scaleY = MAX_SIZE / compHeight; // theScale = Math.min(scaleX, scaleY); // theImage = new BufferedImage( // (int) (theComponent.getWidth() * theScale), // (int) (theComponent.getHeight() * theScale), // BufferedImage.TYPE_INT_RGB); // // Graphics2D g = theImage.createGraphics(); // g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, // RenderingHints.VALUE_INTERPOLATION_BILINEAR); // g.scale(theScale, theScale); // theComponent.paint(g); // g.dispose(); // } else { Dimension pDimension = previewPainter.getPreviewWindowDimension( theComponent.getParent(), theComponent, 0); double compWidth = theComponent.getWidth(); double compHeight = theComponent.getHeight(); double scaleX = pDimension.getWidth() / compWidth; double scaleY = pDimension.getHeight() / compHeight; theScale = Math.min(scaleX, scaleY); theImage = new BufferedImage( (int) (theComponent.getWidth() * theScale), (int) (theComponent .getHeight() * theScale), BufferedImage.TYPE_INT_RGB); Graphics2D g = theImage.createGraphics(); previewPainter.previewComponent(null, theComponent, 0, g, 0, 0, theImage.getWidth(), theImage.getHeight()); g.dispose(); // } theStartRectangle = theComponent.getVisibleRect(); Insets insets = getInsets(); theStartRectangle.x = (int) (theScale * theStartRectangle.x + insets.left); theStartRectangle.y = (int) (theScale * theStartRectangle.y + insets.right); theStartRectangle.width *= theScale; theStartRectangle.height *= theScale; theRectangle = theStartRectangle; Dimension pref = thePopupMenu.getPreferredSize(); Point buttonLocation = theButton.getLocationOnScreen(); Point popupLocation = new Point( (theButton.getWidth() - pref.width) / 2, (theButton.getHeight() - pref.height) / 2); Point centerPoint = new Point(buttonLocation.x + popupLocation.x + theRectangle.x + theRectangle.width / 2, buttonLocation.y + popupLocation.y + theRectangle.y + theRectangle.height / 2); try { // Attempt to move the mouse pointer to the center of the selector's // rectangle. new Robot().mouseMove(centerPoint.x, centerPoint.y); theStartPoint = centerPoint; } catch (Exception e) { // Since we cannot move the cursor, we'll move the popup instead. theStartPoint = aPointOnScreen; popupLocation.x += theStartPoint.x - centerPoint.x; popupLocation.y += theStartPoint.y - centerPoint.y; } thePrevPoint = new Point(theStartPoint); toRestoreOriginal = true; thePopupMenu.show(theButton, popupLocation.x, popupLocation.y); } private void moveRectangle(int aDeltaX, int aDeltaY) { if (theStartRectangle == null) return; Insets insets = getInsets(); Rectangle newRect = new Rectangle(theStartRectangle); newRect.x += aDeltaX; newRect.y += aDeltaY; newRect.x = Math.min(Math.max(newRect.x, insets.left), getWidth() - insets.right - newRect.width); newRect.y = Math.min(Math.max(newRect.y, insets.right), getHeight() - insets.bottom - newRect.height); Rectangle clip = new Rectangle(); Rectangle.union(theRectangle, newRect, clip); clip.grow(2, 2); theRectangle = newRect; paintImmediately(clip); } private void syncRectangle() { JViewport viewport = this.theScrollPane.getViewport(); Rectangle viewRect = viewport.getViewRect(); Insets insets = getInsets(); Rectangle newRect = new Rectangle(); newRect.x = (int) (theScale * viewRect.x + insets.left); newRect.y = (int) (theScale * viewRect.y + insets.top); newRect.width = (int) (viewRect.width * theScale); newRect.height = (int) (viewRect.height * theScale); Rectangle clip = new Rectangle(); Rectangle.union(theRectangle, newRect, clip); clip.grow(2, 2); theRectangle = newRect; // System.out.println(viewRect + "-->" + theRectangle); paintImmediately(clip); } private void scroll(final int aDeltaX, final int aDeltaY, boolean toAnimate) { if (theComponent == null) return; final Rectangle oldRectangle = theComponent.getVisibleRect(); final Rectangle newRectangle = new Rectangle(oldRectangle.x + aDeltaX, oldRectangle.y + aDeltaY, oldRectangle.width, oldRectangle.height); // Animate scrolling if (toAnimate) { FadeTracker.getInstance().trackFadeIn( ScrollPaneSelector.SCROLL_FADE_KIND, theComponent, false, new UIThreadFadeTrackerAdapter() { @Override public void fadeEnded(FadeKind fadeKind) { theComponent.scrollRectToVisible(newRectangle); syncRectangle(); } @Override public void fadePerformed(FadeKind fadeKind, float fadeCycle) { int x = (int) (oldRectangle.x + fadeCycle * aDeltaX); int y = (int) (oldRectangle.y + fadeCycle * aDeltaY); theComponent .scrollRectToVisible(new Rectangle(x, y, oldRectangle.width, oldRectangle.height)); syncRectangle(); // System.out.println(fadeCycle10 + ":" + // oldRectangle // + "-->" + newRectangle + ":" // + theComponent.getVisibleRect()); } }); } else { theComponent.scrollRectToVisible(newRectangle); syncRectangle(); } } }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/scroll/AutoScrollWidget.java0000644000175000017500000000671411137001464027717 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.scroll; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import javax.swing.JScrollPane; import org.jvnet.lafwidget.*; /** * Widget that decorates scroll panes with auto scroll. * * @author Kirill Grouchnikov */ public class AutoScrollWidget extends LafWidgetAdapter { /** * Property change listener - listens on the changes to * {@link LafWidget#AUTO_SCROLL} property. */ protected PropertyChangeListener propertyChangeListener; /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installUI() */ @Override public void installUI() { if (LafWidgetUtilities.hasAutoScroll(this.jcomp)) { AutoScrollActivator.setAutoScrollEnabled(this.jcomp, true); } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallUI() */ @Override public void uninstallUI() { AutoScrollActivator.setAutoScrollEnabled(this.jcomp, false); } @Override public void installListeners() { this.propertyChangeListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (LafWidget.AUTO_SCROLL.equals(evt.getPropertyName())) { AutoScrollActivator.setAutoScrollEnabled(jcomp, LafWidgetUtilities.hasAutoScroll(jcomp)); } } }; this.jcomp.addPropertyChangeListener(this.propertyChangeListener); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { this.jcomp.removePropertyChangeListener(this.propertyChangeListener); this.propertyChangeListener = null; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/scroll/resource/0000755000175000017500000000000011253454710025445 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/scroll/resource/autoscroll_v.png0000644000175000017500000000265510765616176030714 0ustar drazzibdrazzibPNG  IHDRr ߔgAMA7tEXtSoftwareAdobe ImageReadyqe<?IDATxbd 8Ԭuuu]eddTDEEyyyYA_|իoO>{7o<0b#Ǫcgg o^`ccǏ,>}xׅrwܙBm{{D^ww{%]~ʹm۶]o޼޹sݻ(t`bbWhhhĉ899,cf{/d]T&[OO%б^~ ?@kB1gϾ'%% % ˖.] -TuֿGCǏ-.] 5&#G_t/^-d?&sssM-Z L(XXX2331HƍϞ=%ձZz8? @0&h^+6>}:fFSSӏ䓓9͛ @w 4/_(++ke@1<h/8}  @FEE=L D HI__:&`p,&"`"q{= 1z]]]Ay @q8Ϸ\&`r\v `ޟ?P K6b\k.#t1`%F/0ہ @$0c/#"d0n~"5bd+@X$Fh3~~OﳣY` d!3@Rس 6pkjjL d'b@@|xXIaɒ%@@,<Bd߿V!O< d _)Hee,. /Z(| @0EL9СCO%>FnܸQX#002 %z9^PX|5D__77&`9%%fʕ|px…+n`vcdSNMr4@!71o%f^CK#[rMsʕ+߀ (-""߽{/˖-;cDJKKuyt1Y n_z 0콀l9P/ꏁz3Lkkk+@+ف-` ,^˿wPC2A [bF0DZc64 W  )x-g v6M}W?#`{0A>0/cIENDB`liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/scroll/resource/autoscroll_all.png0000644000175000017500000000314010765616176031205 0ustar drazzibdrazzibPNG  IHDRr ߔgAMA7tEXtSoftwareAdobe ImageReadyqe<IDATxbd 8Ԭuuu]eddTDEEyyyYA_|իoO>{7o<0b#Ǫcgg o^`ccǏ,>}xׅrwܙBm{{D^ww{%q޽{7owܩ<_{ E7 XZ:q7NNNyxx~!KجZ޽{gΜa _5dnвٳgߓeK.uo߾-n)|̻Ǐ[\t $t&@AjLeG EDDح\[ ?iӦ,7f[[[sMrf!;L8tK333ǐi#@DڵkLMM倖farHHիdӧS&R/&c?;!99c޼y/~Y 4lʭ[.? ˗/? @N汧@xegg sWW!..}  @Ss ̈́@fΜ FR-f@^ HI__I&h  I,j@Xꘀa⮮<@ Ez>jz+׭[g?nݺ2::4 Hf)0_?`fxL ڵ] ouY ̧l _KP#48Hq X>^|._çvϟ?Ae2+@XI.^Rl< X}vtt|(luǎ t4\-pb$"q[@ bM}W?#`{0A>0#oIENDB`liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/scroll/resource/autoscroll_h.png0000644000175000017500000000260510765616176030671 0ustar drazzibdrazzibPNG  IHDRr ߔgAMA7tEXtSoftwareAdobe ImageReadyqe<IDATxbd 8Ԭuuu]eddTDEEyyyYA_|իoO>{7o<0b#Ǫcgg o^`ccǏ,>}xׅrwܙBm{{D^ww{ 7opܹSy : -8q''<<<\\\^` -Z3{{RRR߁!.] ]rFّ#G/oߘmmmUΝ;7=  @0СC/ ]Thy 1_mhii1EDD2A|yʭ[.? ˗/? @>汧@x32]ׯ_!.. @=@,4za y湱'B`)gܹV^=.. %Yr#$,Q:`GAA`/q{= >?R$wuuI>Y,8@rҥP]tu>| :ޭ[ZFGG;c& H %0Xm,X/ve.̷lذSW`[@xF2 ߿ NX pך5kǧ"5|zEI`'Lf p˼ +VY /^??'`E50Dٳg gpdYw-[X%϶mv;;(Y.}W{nvP@ /^Z&qƽ|l0ǟ֋AY,Y".@`2v틊(ڀ͐byr`eZv| @ꉃc:zzJQzb*_~!@'A4-55UXR2`vc^@f,r'`?X-''GR[`ަuʕo67~|%Dz{b w%@akݾz`؃9Pؖ~z6~ ݌-|lq_`R^^jC_fPCÇbZ 8vfcj1 "pbW`ls} ,[MB3 N,vIENDB`liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/scroll/TweakedScrollPaneLayout.java0000644000175000017500000002746311137001464031235 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.scroll; import javax.swing.*; import javax.swing.border.Border; import java.awt.*; /** * A hideous hack to allow the display of the selector's button even when only * one scrollBar is visible. *

* Contributed by the original author under BSD license. Also appears in the JDNC Incubator. * * @author weebib (Pierre LE LANNIC) */ public class TweakedScrollPaneLayout extends ScrollPaneLayout { private void superlayoutContainer(Container parent) { JScrollPane scrollPane = (JScrollPane) parent; vsbPolicy = scrollPane.getVerticalScrollBarPolicy(); hsbPolicy = scrollPane.getHorizontalScrollBarPolicy(); Rectangle availR = scrollPane.getBounds(); Insets insets = parent.getInsets(); availR.x = insets.left; availR.y = insets.top; availR.width -= insets.left + insets.right; availR.height -= insets.top + insets.bottom; boolean leftToRight = scrollPane.getComponentOrientation() .isLeftToRight(); Rectangle colHeadR = new Rectangle(0, availR.y, 0, 0); if ((colHead != null) && (colHead.isVisible())) { int colHeadHeight = Math.min(availR.height, colHead .getPreferredSize().height); colHeadR.height = colHeadHeight; availR.y += colHeadHeight; availR.height -= colHeadHeight; } Rectangle rowHeadR = new Rectangle(0, 0, 0, 0); if ((rowHead != null) && (rowHead.isVisible())) { int rowHeadWidth = Math.min(availR.width, rowHead .getPreferredSize().width); rowHeadR.width = rowHeadWidth; availR.width -= rowHeadWidth; if (leftToRight) { rowHeadR.x = availR.x; availR.x += rowHeadWidth; } else { rowHeadR.x = availR.x + availR.width; } } Border viewportBorder = scrollPane.getViewportBorder(); Insets vpbInsets; if (viewportBorder != null) { vpbInsets = viewportBorder.getBorderInsets(parent); availR.x += vpbInsets.left; availR.y += vpbInsets.top; availR.width -= vpbInsets.left + vpbInsets.right; availR.height -= vpbInsets.top + vpbInsets.bottom; } else { vpbInsets = new Insets(0, 0, 0, 0); } Component view = (viewport != null) ? viewport.getView() : null; Dimension viewPrefSize = (view != null) ? view.getPreferredSize() : new Dimension(0, 0); Dimension extentSize = (viewport != null) ? viewport .toViewCoordinates(availR.getSize()) : new Dimension(0, 0); boolean viewTracksViewportWidth = false; boolean viewTracksViewportHeight = false; boolean isEmpty = (availR.width < 0 || availR.height < 0); Scrollable sv; if (!isEmpty && view instanceof Scrollable) { sv = (Scrollable) view; viewTracksViewportWidth = sv.getScrollableTracksViewportWidth(); viewTracksViewportHeight = sv.getScrollableTracksViewportHeight(); } else { sv = null; } Rectangle vsbR = new Rectangle(0, availR.y - vpbInsets.top, 0, 0); boolean vsbNeeded; if (isEmpty) { vsbNeeded = false; } else if (vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) { vsbNeeded = true; } else if (vsbPolicy == VERTICAL_SCROLLBAR_NEVER) { vsbNeeded = false; } else { // vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED vsbNeeded = !viewTracksViewportHeight && (viewPrefSize.height > extentSize.height); } if ((vsb != null) && vsbNeeded) { adjustForVSB(true, availR, vsbR, vpbInsets, leftToRight); extentSize = viewport.toViewCoordinates(availR.getSize()); } Rectangle hsbR = new Rectangle(availR.x - vpbInsets.left, 0, 0, 0); boolean hsbNeeded; if (isEmpty) { hsbNeeded = false; } else if (hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) { hsbNeeded = true; } else if (hsbPolicy == HORIZONTAL_SCROLLBAR_NEVER) { hsbNeeded = false; } else { // hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED hsbNeeded = !viewTracksViewportWidth && (viewPrefSize.width > extentSize.width); } if ((hsb != null) && hsbNeeded) { adjustForHSB(true, availR, hsbR, vpbInsets); if ((vsb != null) && !vsbNeeded && (vsbPolicy != VERTICAL_SCROLLBAR_NEVER)) { extentSize = viewport.toViewCoordinates(availR.getSize()); vsbNeeded = viewPrefSize.height > extentSize.height; if (vsbNeeded) { adjustForVSB(true, availR, vsbR, vpbInsets, leftToRight); // Hack to correct Bug 6411225 // I don't actually measure the consequences of this bug // "fix" if (!leftToRight) { hsbR.x += vsbR.width; } // end of hack } } } if (viewport != null) { viewport.setBounds(availR); if (sv != null) { extentSize = viewport.toViewCoordinates(availR.getSize()); boolean oldHSBNeeded = hsbNeeded; boolean oldVSBNeeded = vsbNeeded; viewTracksViewportWidth = sv.getScrollableTracksViewportWidth(); viewTracksViewportHeight = sv .getScrollableTracksViewportHeight(); if (vsb != null && vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED) { boolean newVSBNeeded = !viewTracksViewportHeight && (viewPrefSize.height > extentSize.height); if (newVSBNeeded != vsbNeeded) { vsbNeeded = newVSBNeeded; adjustForVSB(vsbNeeded, availR, vsbR, vpbInsets, leftToRight); extentSize = viewport.toViewCoordinates(availR .getSize()); } } if (hsb != null && hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED) { boolean newHSBbNeeded = !viewTracksViewportWidth && (viewPrefSize.width > extentSize.width); if (newHSBbNeeded != hsbNeeded) { hsbNeeded = newHSBbNeeded; adjustForHSB(hsbNeeded, availR, hsbR, vpbInsets); if ((vsb != null) && !vsbNeeded && (vsbPolicy != VERTICAL_SCROLLBAR_NEVER)) { extentSize = viewport.toViewCoordinates(availR .getSize()); vsbNeeded = viewPrefSize.height > extentSize.height; if (vsbNeeded) { adjustForVSB(true, availR, vsbR, vpbInsets, leftToRight); } } } } if (oldHSBNeeded != hsbNeeded || oldVSBNeeded != vsbNeeded) { viewport.setBounds(availR); } } } vsbR.height = availR.height + vpbInsets.top + vpbInsets.bottom; hsbR.width = availR.width + vpbInsets.left + vpbInsets.right; rowHeadR.height = availR.height + vpbInsets.top + vpbInsets.bottom; rowHeadR.y = availR.y - vpbInsets.top; colHeadR.width = availR.width + vpbInsets.left + vpbInsets.right; colHeadR.x = availR.x - vpbInsets.left; if (rowHead != null) { rowHead.setBounds(rowHeadR); } if (colHead != null) { colHead.setBounds(colHeadR); } if (vsb != null) { if (vsbNeeded) { vsb.setVisible(true); vsb.setBounds(vsbR); } else { vsb.setVisible(false); } } if (hsb != null) { if (hsbNeeded) { hsb.setVisible(true); hsb.setBounds(hsbR); } else { hsb.setVisible(false); } } // bug 6411225 ???????? if (lowerLeft != null) { lowerLeft.setBounds(leftToRight ? rowHeadR.x : vsbR.x, hsbR.y, leftToRight ? rowHeadR.width : vsbR.width, hsbR.height); } if (lowerRight != null) { lowerRight.setBounds(leftToRight ? vsbR.x : rowHeadR.x, hsbR.y, leftToRight ? vsbR.width : rowHeadR.width, hsbR.height); } if (upperLeft != null) { upperLeft.setBounds(leftToRight ? rowHeadR.x : vsbR.x, colHeadR.y, leftToRight ? rowHeadR.width : vsbR.width, colHeadR.height); } if (upperRight != null) { upperRight.setBounds(leftToRight ? vsbR.x : rowHeadR.x, colHeadR.y, leftToRight ? vsbR.width : rowHeadR.width, colHeadR.height); } } private void adjustForVSB(boolean wantsVSB, Rectangle available, Rectangle vsbR, Insets vpbInsets, boolean leftToRight) { int oldWidth = vsbR.width; if (wantsVSB) { int vsbWidth = Math.max(0, Math.min(vsb.getPreferredSize().width, available.width)); available.width -= vsbWidth; vsbR.width = vsbWidth; if (leftToRight) { vsbR.x = available.x + available.width + vpbInsets.right; } else { vsbR.x = available.x - vpbInsets.left; available.x += vsbWidth; } } else { available.width += oldWidth; } } private void adjustForHSB(boolean wantsHSB, Rectangle available, Rectangle hsbR, Insets vpbInsets) { int oldHeight = hsbR.height; if (wantsHSB) { int hsbHeight = Math.max(0, Math.min(available.height, hsb .getPreferredSize().height)); available.height -= hsbHeight; hsbR.y = available.y + available.height + vpbInsets.bottom; hsbR.height = hsbHeight; } else { available.height += oldHeight; } } public void layoutContainer(Container parent) { superlayoutContainer(parent); boolean isLeftToRight = parent.getComponentOrientation() .isLeftToRight(); if (isLeftToRight && lowerRight == null) return; if (!isLeftToRight && lowerLeft == null) return; boolean onlyVsb = (vsb != null) && vsb.isVisible() && ((hsb == null) || ((hsb != null) && (!hsb.isVisible()))); if (onlyVsb) { Rectangle vsbBounds = vsb.getBounds(); int delta = (hsb == null) ? ((Integer) (UIManager .get("ScrollBar.width"))).intValue() : hsb .getPreferredSize().height; vsbBounds.height -= delta; vsb.setBounds(vsbBounds); if (isLeftToRight) { lowerRight.setBounds(vsbBounds.x, vsbBounds.y + vsbBounds.height, vsbBounds.width, delta); lowerRight.setVisible(true); } else { lowerLeft.setBounds(vsbBounds.x, vsbBounds.y + vsbBounds.height, vsbBounds.width, delta); lowerLeft.setVisible(true); } } boolean onlyHsb = (hsb != null) && hsb.isVisible() && ((vsb == null) || ((vsb != null) && (!vsb.isVisible()))); if (onlyHsb) { Rectangle hsbBounds = hsb.getBounds(); int delta = (vsb == null) ? ((Integer) (UIManager .get("ScrollBar.width"))).intValue() : vsb .getPreferredSize().width; hsbBounds.width -= delta; if (!isLeftToRight) { hsbBounds.x += delta; } hsb.setBounds(hsbBounds); if (isLeftToRight) { lowerRight.setBounds(hsbBounds.x + hsbBounds.width, hsbBounds.y, delta, hsbBounds.height); lowerRight.setVisible(true); } else { lowerLeft.setBounds(hsbBounds.x - delta, hsbBounds.y, delta, hsbBounds.height); lowerLeft.setVisible(true); } } } }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/scroll/ScrollPaneSelectorWidget.java0000644000175000017500000001227611137001464031373 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.scroll; import java.awt.event.HierarchyEvent; import java.awt.event.HierarchyListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import javax.swing.JScrollPane; import javax.swing.plaf.basic.ComboPopup; import org.jvnet.lafwidget.*; import org.jvnet.lafwidget.preview.PreviewPainter; /** * Widget that decorates scroll panes with selector. * * @author Kirill Grouchnikov */ public class ScrollPaneSelectorWidget extends LafWidgetAdapter { /** * The scroll pane selector for the associated scroll pane. */ protected ScrollPaneSelector scrollPaneSelector; /** * Hierarchy listener - remove the selector in the scroll pane of a combo * popup. */ protected HierarchyListener hierarchyListener; /** * Property change listener - listens on the changes to * {@link LafWidget#COMPONENT_PREVIEW_PAINTER} property. */ protected PropertyChangeListener propertyChangeListener; /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installUI() */ @Override public void installUI() { if (LafWidgetRepository.getRepository().getLafSupport() .toInstallExtraElements(this.jcomp)) { PreviewPainter pPainter = LafWidgetUtilities2 .getComponentPreviewPainter(this.jcomp); if (pPainter == null) return; this.scrollPaneSelector = new ScrollPaneSelector(); this.scrollPaneSelector.installOnScrollPane(this.jcomp); } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallUI() */ @Override public void uninstallUI() { if (this.scrollPaneSelector != null) { this.scrollPaneSelector.uninstallFromScrollPane(); this.scrollPaneSelector = null; } } @Override public void installListeners() { this.hierarchyListener = new HierarchyListener() { /* * (non-Javadoc) * * @see java.awt.event.HierarchyListener#hierarchyChanged(java.awt.event.HierarchyEvent) */ public void hierarchyChanged(HierarchyEvent e) { if (jcomp.getParent() instanceof ComboPopup) { if (scrollPaneSelector != null) { scrollPaneSelector.uninstallFromScrollPane(); scrollPaneSelector = null; } } } }; this.jcomp.addHierarchyListener(this.hierarchyListener); this.propertyChangeListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (LafWidget.COMPONENT_PREVIEW_PAINTER.equals(evt .getPropertyName())) { PreviewPainter pPainter = LafWidgetUtilities2 .getComponentPreviewPainter(jcomp); // Uninstall old scroll pane selector if (scrollPaneSelector != null) { scrollPaneSelector.uninstallFromScrollPane(); scrollPaneSelector = null; } // Install new scroll pane selector if (pPainter != null) { scrollPaneSelector = new ScrollPaneSelector(); scrollPaneSelector.installOnScrollPane(jcomp); } } } }; this.jcomp.addPropertyChangeListener(this.propertyChangeListener); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { this.jcomp.removeHierarchyListener(this.hierarchyListener); this.hierarchyListener = null; this.jcomp.removePropertyChangeListener(this.propertyChangeListener); this.propertyChangeListener = null; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/TangoIcons.license0000644000175000017500000003522410622737614025744 0ustar drazzibdrazzibAttribution-ShareAlike 2.5 CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. License THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. 1. Definitions 1. "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License. 2. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License. 3. "Licensor" means the individual or entity that offers the Work under the terms of this License. 4. "Original Author" means the individual or entity who created the Work. 5. "Work" means the copyrightable work of authorship offered under the terms of this License. 6. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. 7. "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike. 2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws. 3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: 1. to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works; 2. to create and reproduce Derivative Works; 3. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works; 4. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works. 5. For the avoidance of doubt, where the work is a musical composition: 1. Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work. 2. Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions). 6. Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions). The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved. 4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: 1. You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(c), as requested. 2. You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License. 3. If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit. 5. Representations, Warranties and Disclaimer UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 7. Termination 1. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. 2. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. 8. Miscellaneous 1. Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. 2. Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. 3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. 4. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. 5. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor. Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. Creative Commons may be contacted at http://creativecommons.org/. liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tabbed/0000755000175000017500000000000011253454706023546 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tabbed/TabHoverPreviewWidget.java0000644000175000017500000001463611137001464030631 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tabbed; import java.awt.event.*; import javax.swing.JTabbedPane; import org.jvnet.lafwidget.*; /** * Adds tab preview thumbnail on tab mouse hover. * * @author Kirill Grouchnikov */ public class TabHoverPreviewWidget extends LafWidgetAdapter { /** * Mouse listener for rollover effects. */ protected MouseRolloverHandler baseRolloverHandler; /** * Mouse listener for rollover effects. * * @author Kirill Grouchnikov */ protected class MouseRolloverHandler implements MouseListener, MouseMotionListener { /** * Index of previously rolled-over tab. */ int prevRolledOver = -1; /* * (non-Javadoc) * * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent) */ public void mouseClicked(MouseEvent e) { } /* * (non-Javadoc) * * @see java.awt.event.MouseMotionListener#mouseDragged(java.awt.event.MouseEvent) */ public void mouseDragged(MouseEvent e) { } /* * (non-Javadoc) * * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent) */ public void mouseEntered(MouseEvent e) { } /* * (non-Javadoc) * * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent) */ public void mousePressed(MouseEvent e) { TabPreviewWindow.cancelPreviewRequest(); } /* * (non-Javadoc) * * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent) */ public void mouseReleased(MouseEvent e) { } /* * (non-Javadoc) * * @see java.awt.event.MouseMotionListener#mouseMoved(java.awt.event.MouseEvent) */ public void mouseMoved(MouseEvent e) { if (e.getSource() != jcomp) return; LafWidgetSupport lafSupport = LafWidgetRepository.getRepository() .getLafSupport(); int currRolledOver = 0; try { currRolledOver = lafSupport.getRolloverTabIndex(jcomp); } catch (UnsupportedOperationException uoe) { // Some problems in LAF support - may happen during the LAF // switch when this event is processed after a LAF that doesn't // have the laf-widget support is set. Just ignore it. return; } if (currRolledOver >= jcomp.getTabCount()) return; if (currRolledOver != jcomp.getSelectedIndex()) { if (currRolledOver == this.prevRolledOver) { if ((currRolledOver >= 0) && (currRolledOver < jcomp.getTabCount()) && jcomp.isEnabledAt(currRolledOver)) { TabPreviewWindow.getInstance().postPreviewRequest( jcomp, currRolledOver); } } else { if ((this.prevRolledOver >= 0) && (this.prevRolledOver < jcomp.getTabCount()) && jcomp.isEnabledAt(this.prevRolledOver)) { TabPreviewWindow.cancelPreviewRequest(); } if ((currRolledOver >= 0) && (currRolledOver < jcomp.getTabCount()) && jcomp.isEnabledAt(currRolledOver)) { TabPreviewWindow.getInstance().postPreviewRequest( jcomp, currRolledOver); } } } else { // no preview on the selected tab TabPreviewWindow.cancelPreviewRequest(); } this.prevRolledOver = currRolledOver; } /* * (non-Javadoc) * * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent) */ public void mouseExited(MouseEvent e) { if ((this.prevRolledOver >= 0) && (this.prevRolledOver < jcomp.getTabCount()) && jcomp.isEnabledAt(this.prevRolledOver)) { TabPreviewWindow.cancelPreviewRequest(); } this.prevRolledOver = -1; } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installListeners() */ @Override public void installListeners() { this.baseRolloverHandler = new MouseRolloverHandler(); this.jcomp.addMouseMotionListener(this.baseRolloverHandler); this.jcomp.addMouseListener(this.baseRolloverHandler); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { if (this.baseRolloverHandler != null) { this.jcomp.removeMouseMotionListener(this.baseRolloverHandler); this.jcomp.removeMouseListener(this.baseRolloverHandler); this.baseRolloverHandler = null; } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallUI() */ @Override public void uninstallUI() { if (TabPreviewThread.instanceRunning()) { TabPreviewThread.getInstance().cancelTabPreviewRequests(this.jcomp); } TabPreviewWindow.cancelPreviewRequest(); super.uninstallUI(); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tabbed/TabOverviewDialog.java0000644000175000017500000012203511137001464027757 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tabbed; import java.awt.*; import java.awt.event.*; import java.awt.image.BufferedImage; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.text.MessageFormat; import javax.swing.*; import javax.swing.border.*; import org.jvnet.lafwidget.*; import org.jvnet.lafwidget.animation.*; import org.jvnet.lafwidget.layout.TransitionLayoutManager; import org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewInfo; import org.jvnet.lafwidget.utils.ShadowPopupBorder; import org.jvnet.lafwidget.utils.LafConstants.TabOverviewKind; import contrib.com.blogofbug.swing.components.*; /** * Tab overview dialog. * * @author Kirill Grouchnikov */ public class TabOverviewDialog extends JDialog { /** * The associated tabbed pane. */ protected JTabbedPane tabPane; // /** // * The grid overview panel (with all thumbnails). // */ // protected JPanel gridOverviewPanel; /** * The associated preview callback. */ protected TabPreviewThread.TabPreviewCallback previewCallback; /** * Listener on LAF switches. */ protected PropertyChangeListener lafSwitchListener; /** * Handles mouse events on the tab overview dialog (such as highlighting the * currently rolled-over tab preview, closing the overview when a tab * preview is clicked, tooltips etc.) * * @author Kirill Grouchnikov */ protected class TabPreviewMouseHandler extends MouseAdapter { /** * Tab index. */ private int index; /** * Tab preview control. */ private JComponent previewControl; /** * If true, the preview uses double click to select the * tab and dismiss the tab overview dialog. */ private boolean useDoubleClick; /** * If true, the tab preview controls have rollover * effects on borders. */ private boolean hasRolloverBorderEffect; /** * Creates the mouse handler for a single tab preview control. * * @param index * Tab index. * @param previewControl * Tab preview control. * @param hasRolloverBorderEffect * If true, the preview uses double click to * select the tab and dismiss the tab overview dialog. * @param useDoubleClick * If true, the tab preview controls have * rollover effects on borders. */ public TabPreviewMouseHandler(int index, JComponent previewControl, boolean hasRolloverBorderEffect, boolean useDoubleClick) { this.index = index; this.previewControl = previewControl; this.useDoubleClick = useDoubleClick; this.hasRolloverBorderEffect = hasRolloverBorderEffect; } @Override public void mouseClicked(MouseEvent e) { if (this.useDoubleClick) { if (e.getClickCount() < 2) return; } SwingUtilities.invokeLater(new Runnable() { public void run() { TabOverviewDialog.this.dispose(); TabOverviewDialog.this.tabPane .setSelectedIndex(TabPreviewMouseHandler.this.index); } }); } @Override public void mouseEntered(MouseEvent e) { if (!this.hasRolloverBorderEffect) return; boolean isSelected = (TabOverviewDialog.this.tabPane .getSelectedIndex() == this.index); Border innerBorder = isSelected ? new LineBorder(Color.blue, 2) : new LineBorder(Color.black, 1); this.previewControl.setBorder(new CompoundBorder( new ShadowPopupBorder(), innerBorder)); // if (isSelected) // this.previewControl.setBorder(new LineBorder(Color.blue, 2)); // else // this.previewControl.setBorder(new CompoundBorder( // new EmptyBorder(1, 1, 1, 1), new LineBorder( // Color.black, 1))); } @Override public void mouseExited(MouseEvent e) { if (!this.hasRolloverBorderEffect) return; boolean isSelected = (TabOverviewDialog.this.tabPane .getSelectedIndex() == this.index); Border innerBorder = isSelected ? new LineBorder(Color.black, 2) : new LineBorder(Color.black, 1); this.previewControl.setBorder(new CompoundBorder( new ShadowPopupBorder(), innerBorder)); // if (isSelected) // this.previewControl.setBorder(new LineBorder(Color.black, 2)); // else // this.previewControl.setBorder(new CompoundBorder( // new EmptyBorder(1, 1, 1, 1), new LineBorder( // Color.black, 1))); } } /** * Tab round carousel overview panel. Contains a round carousel of tab * preview widgets. The widgets are created in a separate thread ({@link TabPreviewThread}) * and offered to the tab overview dialog via the registered implementation * of {@link TabPreviewThread.TabPreviewCallback}. This way the application * stays interactive while the tab overview dialog is being populated. * * @author Kirill Grouchnikov */ protected class TabRoundCarouselOverviewPanel extends JPanel { /** * Tab preview controls. */ protected ReflectedImageLabel[] previewControls; /** * Width of a single tab preview control. */ protected int pWidth; /** * Height of a single tab preview control. */ protected int pHeight; /** * Associated carousel. */ protected JCarosel carosel; /** * Creates a tab overview panel. * * @param dialogWidth * The width of the parent dialog. * @param dialogHeight * The height of the parent dialog. */ public TabRoundCarouselOverviewPanel(final int dialogWidth, final int dialogHeight) { // int tabCount = TabOverviewDialog.this.tabPane.getTabCount(); // this.previewControls = new HashSet(); TabPreviewThread.TabPreviewCallback previewCallback = new TabPreviewThread.TabPreviewCallback() { /* * (non-Javadoc) * * @see org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewCallback#start(javax.swing.JTabbedPane, * int, * org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewInfo) */ public void start(JTabbedPane tabPane, int tabCount, TabPreviewInfo tabPreviewInfo) { // Check if need to reallocate the preview controls. boolean isSame = (previewControls != null) && (previewControls.length == tabCount); if (isSame) return; if (previewControls != null) { for (int i = 0; i < previewControls.length; i++) { carosel.remove(previewControls[i]); } } double coef = Math.min(3.5, tabCount / 1.5); coef = Math.max(coef, 4.5); pWidth = (int) (dialogWidth / coef); pHeight = (int) (dialogHeight / coef); tabPreviewInfo.previewWidth = pWidth - 4; tabPreviewInfo.previewHeight = pHeight - 4; previewControls = new ReflectedImageLabel[tabCount]; TabPreviewPainter tpp = LafWidgetUtilities2 .getTabPreviewPainter(TabOverviewDialog.this.tabPane); for (int i = 0; i < tabCount; i++) { BufferedImage placeHolder = new BufferedImage(pWidth, pHeight, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = (Graphics2D) placeHolder.getGraphics(); g2d.setColor(UIManager.getColor("Label.background")); g2d.fillRect(0, 0, pWidth, pHeight); ReflectedImageLabel ril = (ReflectedImageLabel) carosel .add(placeHolder, tabPane.getTitleAt(i)); ril.setForeground(UIManager .getColor("Label.foreground")); ril.setBackground(UIManager .getColor("Label.background")); // TabPreviewControl previewControl = new // TabPreviewControl( // TabOverviewDialog.this.tabPane, i); ril.setPreferredSize(new Dimension(pWidth, pHeight)); // fix for issue 177 in Substance (disallowing // selection // of disabled tabs). if (tpp.isSensitiveToEvents( TabOverviewDialog.this.tabPane, i)) { ril.addMouseListener(new TabPreviewMouseHandler(i, ril, false, true)); ril .setToolTipText(LafWidgetUtilities .getResourceBundle(tabPane) .getString( "TabbedPane.overviewWidgetTooltip")); } previewControls[i] = ril; // carosel.add(previewControl); } carosel.bringToFront(previewControls[tabPane .getSelectedIndex()]); // System.err.println("Added " + previewControls.length // + " labels"); // doLayout(); // for (int i = 0; i < tabCount; i++) { // previewControls[i].revalidate(); // } // repaint(); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewCallback#offer(javax.swing.JTabbedPane, * int, java.awt.image.BufferedImage) */ public void offer(JTabbedPane tabPane, int tabIndex, BufferedImage componentSnap) { int width = componentSnap.getWidth() + 4; int height = componentSnap.getHeight() + 4; BufferedImage result = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = (Graphics2D) result.getGraphics(); g2d.setColor(UIManager.getColor("Label.background")); g2d.fillRect(0, 0, width, height); g2d.setColor(UIManager.getColor("Label.foreground")); g2d.drawRect(0, 0, width - 1, height - 1); g2d.drawImage(componentSnap, 2, 2, null); Icon tabIcon = tabPane.getIconAt(tabIndex); if (tabIcon != null) { tabIcon.paintIcon(tabPane, g2d, 2, 2); } // Component caroselComponent = carosel.add(result, tabPane // .getTitleAt(tabIndex)); // caroselComponent.setForeground(UIManager // .getColor("Label.foreground")); // System.err.println("Setting image on " + tabIndex); previewControls[tabIndex].setRichImage(result); // System.err.println("Set image on " + tabIndex); previewControls[tabIndex].repaint(); // previewControls.add(caroselComponent); // TabRoundCarouselOverviewPanel.this.previewControls[tabIndex] // .setPreviewImage(componentSnap); } }; this.carosel = new JCarosel(); this.carosel.setDepthBasedAlpha(true); // // carosel.setBackground(Color.BLACK, Color.DARK_GRAY); // carosel // .add( // TabOverviewDialog.class // .getResource( // "/contrib/com/blogofbug/examples/images/Acknowledgements.png") // .toString(), "You Rock", 128, 128); // carosel.add(TabOverviewDialog.class.getResource( // "/contrib/com/blogofbug/examples/images/Dock.png") // .toString(), "Docks Rock", 128, 128); // carosel.add(TabOverviewDialog.class.getResource( // "/contrib/com/blogofbug/examples/images/Cascade.png") // .toString(), "Cascade Icon", 128, 128); // carosel.add(TabOverviewDialog.class.getResource( // "/contrib/com/blogofbug/examples/images/Quit.png") // .toString(), "Quit Bugging", 128, 128); this.setLayout(new BorderLayout()); this.add(carosel, BorderLayout.CENTER); TabPreviewInfo previewInfo = new TabPreviewInfo(); previewInfo.tabPane = TabOverviewDialog.this.tabPane; previewInfo.previewCallback = previewCallback; // previewInfo.previewWidth = this.pWidth - 4; // previewInfo.previewHeight = this.pHeight - 20; previewInfo.toPreviewAllTabs = true; previewInfo.initiator = TabOverviewDialog.this; TabPreviewThread.getInstance().queueTabPreviewRequest(previewInfo); } } /** * Tab menu carousel overview panel. Contains a menu carousel of tab preview * widgets. The widgets are created in a separate thread ({@link TabPreviewThread}) * and offered to the tab overview dialog via the registered implementation * of {@link TabPreviewThread.TabPreviewCallback}. This way the application * stays interactive while the tab overview dialog is being populated. * * @author Kirill Grouchnikov */ protected class TabMenuCarouselOverviewPanel extends JPanel { /** * Tab preview controls. */ protected ReflectedImageLabel[] previewControls; /** * Width of a single tab preview control. */ protected int pWidth; /** * Height of a single tab preview control. */ protected int pHeight; /** * The associated carousel menu. */ protected JCarouselMenu caroselMenu; /** * Cell renderer for the carosel menu. Employs a little trick to provide * LAF-consistent painting of the cells. * * @author Kirill Grouchnikov */ protected class MenuCarouselListCellRenderer extends JLabel implements ListCellRenderer { /** * The cell renderer from the currently installed LAF. */ protected ListCellRenderer lafDefaultCellRenderer; /** * Creates the cell renderer for the carosel menu. * * @param lafDefaultCellRenderer * The cell renderer from the currently installed LAF. */ public MenuCarouselListCellRenderer( ListCellRenderer lafDefaultCellRenderer) { this.lafDefaultCellRenderer = lafDefaultCellRenderer; // if (lafDefaultCellRenderer instanceof Component) { // JComponent jc = (JComponent) lafDefaultCellRenderer; // jc.setBorder(new EmptyBorder(5, 5, 5, 5)); // jc.setFont(super.getFont().deriveFont(Font.BOLD, 14.0f)); // } } /** * Sets up the component for stamping */ public Component getListCellRendererComponent(JList jList, Object object, int i, boolean isSelected, boolean cellHasFocus) { JCarouselMenu.MenuItem item = (JCarouselMenu.MenuItem) object; Component result = this.lafDefaultCellRenderer .getListCellRendererComponent(jList, item.getLabel(), i, isSelected, cellHasFocus); if (result instanceof Component) { JComponent jc = (JComponent) result; jc.setBorder(new EmptyBorder(5, 5, 5, 5)); jc.setFont(super.getFont().deriveFont(Font.BOLD, 14.0f)); } return result; } } /** * Creates a tab overview panel. * * @param dialogWidth * The width of the parent dialog. * @param dialogHeight * The height of the parent dialog. */ public TabMenuCarouselOverviewPanel(final int dialogWidth, final int dialogHeight) { // int tabCount = TabOverviewDialog.this.tabPane.getTabCount(); // this.previewControls = new HashSet(); TabPreviewThread.TabPreviewCallback previewCallback = new TabPreviewThread.TabPreviewCallback() { /* * (non-Javadoc) * * @see org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewCallback#start(javax.swing.JTabbedPane, * int, * org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewInfo) */ public void start(JTabbedPane tabPane, int tabCount, TabPreviewInfo tabPreviewInfo) { // Check if need to reallocate the preview controls. boolean isSame = (previewControls != null) && (previewControls.length == tabCount); if (isSame) return; if (previewControls != null) { for (int i = 0; i < previewControls.length; i++) { caroselMenu.remove(previewControls[i]); } } double coef = Math.min(2.8, tabCount / 1.8); coef = Math.max(2.5, coef); pWidth = (int) (dialogWidth / coef); pHeight = (int) (dialogHeight / coef); tabPreviewInfo.previewWidth = pWidth - 4; tabPreviewInfo.previewHeight = pHeight - 4; previewControls = new ReflectedImageLabel[tabCount]; TabPreviewPainter tpp = LafWidgetUtilities2 .getTabPreviewPainter(TabOverviewDialog.this.tabPane); for (int i = 0; i < tabCount; i++) { BufferedImage placeHolder = new BufferedImage(pWidth, pHeight, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = (Graphics2D) placeHolder.getGraphics(); g2d.setColor(UIManager.getColor("Label.background")); g2d.fillRect(0, 0, pWidth, pHeight); ReflectedImageLabel ril = (ReflectedImageLabel) caroselMenu .add(placeHolder, tabPane.getTitleAt(i)); ril.setForeground(UIManager .getColor("Label.foreground")); ril.setBackground(UIManager .getColor("Label.background")); // TabPreviewControl previewControl = new // TabPreviewControl( // TabOverviewDialog.this.tabPane, i); ril.setPreferredSize(new Dimension(pWidth, pHeight)); // fix for issue 177 in Substance (disallowing // selection // of disabled tabs). if (tpp.isSensitiveToEvents( TabOverviewDialog.this.tabPane, i)) { ril.addMouseListener(new TabPreviewMouseHandler(i, ril, false, true)); ril .setToolTipText(LafWidgetUtilities .getResourceBundle(tabPane) .getString( "TabbedPane.overviewWidgetTooltip")); } previewControls[i] = ril; // carosel.add(previewControl); } caroselMenu.setSelectedIndex(tabPane.getSelectedIndex()); // System.err.println("Added " + previewControls.length // + " labels"); // doLayout(); // for (int i = 0; i < tabCount; i++) { // previewControls[i].revalidate(); // } // repaint(); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewCallback#offer(javax.swing.JTabbedPane, * int, java.awt.image.BufferedImage) */ public void offer(JTabbedPane tabPane, int tabIndex, BufferedImage componentSnap) { int width = componentSnap.getWidth() + 4; int height = componentSnap.getHeight() + 4; BufferedImage result = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = (Graphics2D) result.getGraphics(); g2d.setColor(UIManager.getColor("Label.background")); g2d.fillRect(0, 0, width, height); g2d.setColor(UIManager.getColor("Label.foreground")); g2d.drawRect(0, 0, width - 1, height - 1); g2d.drawImage(componentSnap, 2, 2, null); Icon tabIcon = tabPane.getIconAt(tabIndex); if (tabIcon != null) { tabIcon.paintIcon(tabPane, g2d, 2, 2); } // Component caroselComponent = carosel.add(result, tabPane // .getTitleAt(tabIndex)); // caroselComponent.setForeground(UIManager // .getColor("Label.foreground")); // System.err.println("Setting image on " + tabIndex); previewControls[tabIndex].setRichImage(result); // System.err.println("Set image on " + tabIndex); previewControls[tabIndex].repaint(); // previewControls.add(caroselComponent); // TabRoundCarouselOverviewPanel.this.previewControls[tabIndex] // .setPreviewImage(componentSnap); } }; this.caroselMenu = new JCarouselMenu(null); JList dummyList = new JList(); ListCellRenderer lcr = dummyList.getCellRenderer(); this.caroselMenu.setCellRenderer(new MenuCarouselListCellRenderer( lcr)); this.caroselMenu.setMenuScrollColor(UIManager .getColor("Panel.background")); this.caroselMenu.setUpDownColor(UIManager .getColor("Label.foreground")); LafWidgetSupport support = LafWidgetRepository.getRepository() .getLafSupport(); if (support != null) { this.caroselMenu.setUpDownIcons(support .getArrowIcon(SwingConstants.NORTH), support .getArrowIcon(SwingConstants.SOUTH)); } // this.carosel.setDepthBasedAlpha(true); // // carosel.setBackground(Color.BLACK, Color.DARK_GRAY); // carosel // .add( // TabOverviewDialog.class // .getResource( // "/contrib/com/blogofbug/examples/images/Acknowledgements.png") // .toString(), "You Rock", 128, 128); // carosel.add(TabOverviewDialog.class.getResource( // "/contrib/com/blogofbug/examples/images/Dock.png") // .toString(), "Docks Rock", 128, 128); // carosel.add(TabOverviewDialog.class.getResource( // "/contrib/com/blogofbug/examples/images/Cascade.png") // .toString(), "Cascade Icon", 128, 128); // carosel.add(TabOverviewDialog.class.getResource( // "/contrib/com/blogofbug/examples/images/Quit.png") // .toString(), "Quit Bugging", 128, 128); this.setLayout(new BorderLayout()); this.add(caroselMenu, BorderLayout.CENTER); TabPreviewInfo previewInfo = new TabPreviewInfo(); previewInfo.tabPane = TabOverviewDialog.this.tabPane; previewInfo.previewCallback = previewCallback; previewInfo.previewWidth = this.pWidth - 4; previewInfo.previewHeight = this.pHeight - 4; previewInfo.toPreviewAllTabs = true; previewInfo.initiator = TabOverviewDialog.this; TabPreviewThread.getInstance().queueTabPreviewRequest(previewInfo); } /* * (non-Javadoc) * * @see javax.swing.JPanel#updateUI() */ @Override public void updateUI() { super.updateUI(); if (this.caroselMenu != null) { JList dummyList = new JList(); ListCellRenderer lcr = dummyList.getCellRenderer(); this.caroselMenu .setCellRenderer(new MenuCarouselListCellRenderer(lcr)); this.caroselMenu.setMenuScrollColor(UIManager .getColor("Panel.background")); this.caroselMenu.setUpDownColor(UIManager .getColor("Label.foreground")); this.caroselMenu.setBackground(UIManager .getColor("Panel.background")); LafWidgetSupport support = LafWidgetRepository.getRepository() .getLafSupport(); if (support != null) { this.caroselMenu.setUpDownIcons(support .getArrowIcon(SwingConstants.NORTH), support .getArrowIcon(SwingConstants.SOUTH)); } } } } /** * Tab grid overview panel. Contains a grid of tab preview widgets. The * widgets are created in a separate thread ({@link TabPreviewThread}) and * offered to the tab overview dialog via the registered implementation of * {@link TabPreviewThread.TabPreviewCallback}. This way the application * stays interactive while the tab overview dialog is being populated. * * @author Kirill Grouchnikov */ protected class TabGridOverviewPanel extends JPanel { /** * Tab preview controls. */ protected TabPreviewControl[] previewControls; /** * Width of a single tab preview control. */ protected int pWidth; /** * Height of a single tab preview control. */ protected int pHeight; /** * Number of overview grid columns. */ protected int colCount; /** * Glass pane for rollover effects. */ protected TabGridOverviewGlassPane glassPane; /** * Creates a tab overview panel. * * @param dialogWidth * The width of the parent dialog. * @param dialogHeight * The height of the parent dialog. */ public TabGridOverviewPanel(final int dialogWidth, final int dialogHeight) { // int tabCount = TabOverviewDialog.this.tabPane.getTabCount(); TabPreviewThread.TabPreviewCallback previewCallback = new TabPreviewThread.TabPreviewCallback() { /* * (non-Javadoc) * * @see org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewCallback#start(javax.swing.JTabbedPane, * int, * org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewInfo) */ public void start(JTabbedPane tabPane, int tabCount, TabPreviewInfo tabPreviewInfo) { // Check if need to reallocate the preview controls. boolean isSame = (previewControls != null) && (previewControls.length == tabCount); if (isSame) return; if (previewControls != null) { for (int i = 0; i < previewControls.length; i++) { remove(previewControls[i]); } } colCount = (int) Math.sqrt(tabCount); if (colCount * colCount < tabCount) colCount++; pWidth = (dialogWidth - 8) / colCount; pHeight = (dialogHeight - 32) / colCount; tabPreviewInfo.previewWidth = pWidth - 4; tabPreviewInfo.previewHeight = pHeight - 20; previewControls = new TabPreviewControl[tabCount]; TabPreviewPainter tpp = LafWidgetUtilities2 .getTabPreviewPainter(TabOverviewDialog.this.tabPane); for (int i = 0; i < tabCount; i++) { TabPreviewControl previewControl = new TabPreviewControl( TabOverviewDialog.this.tabPane, i); // fix for issue 177 in Substance (disallowing selection // of disabled tabs). if (tpp.isSensitiveToEvents( TabOverviewDialog.this.tabPane, i)) { previewControl .addMouseListener(new TabPreviewMouseHandler( i, previewControl, true, false)); } previewControls[i] = previewControl; add(previewControl); } doLayout(); for (int i = 0; i < tabCount; i++) { previewControls[i].revalidate(); } repaint(); JRootPane rp = SwingUtilities .getRootPane(TabGridOverviewPanel.this); glassPane = new TabGridOverviewGlassPane( TabGridOverviewPanel.this); rp.setGlassPane(glassPane); glassPane.setVisible(true); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewCallback#offer(javax.swing.JTabbedPane, * int, java.awt.image.BufferedImage) */ public void offer(JTabbedPane tabPane, int tabIndex, BufferedImage componentSnap) { TabGridOverviewPanel.this.previewControls[tabIndex] .setPreviewImage(componentSnap, true); } }; this.setLayout(new TabGridOverviewPanelLayout()); // this // .putClientProperty(LafWidget.ANIMATION_KIND, // AnimationKind.SLOW); TransitionLayoutManager.getInstance().track(this, true); // this.pWidth = (dialogWidth - 8) / this.colCount; // this.pHeight = (dialogHeight - 32) / this.colCount; // TabPreviewInfo previewInfo = new TabPreviewInfo(); previewInfo.tabPane = TabOverviewDialog.this.tabPane; previewInfo.previewCallback = previewCallback; previewInfo.previewWidth = this.pWidth - 4; previewInfo.previewHeight = this.pHeight - 20; previewInfo.toPreviewAllTabs = true; previewInfo.initiator = TabOverviewDialog.this; TabPreviewThread.getInstance().queueTabPreviewRequest(previewInfo); } /** * Layout manager for the tab overview panel. * * @author Kirill Grouchnikov */ private class TabGridOverviewPanelLayout implements LayoutManager { /* * (non-Javadoc) * * @see java.awt.LayoutManager#addLayoutComponent(java.lang.String, * java.awt.Component) */ public void addLayoutComponent(String name, Component comp) { } /* * (non-Javadoc) * * @see java.awt.LayoutManager#removeLayoutComponent(java.awt.Component) */ public void removeLayoutComponent(Component comp) { } /* * (non-Javadoc) * * @see java.awt.LayoutManager#layoutContainer(java.awt.Container) */ public void layoutContainer(Container parent) { // int width = parent.getWidth(); // int height = parent.getHeight(); // if (TabGridOverviewPanel.this.previewControls == null) return; for (int i = 0; i < TabGridOverviewPanel.this.previewControls.length; i++) { TabPreviewControl previewControl = TabGridOverviewPanel.this.previewControls[i]; if (previewControl == null) continue; int rowIndex = i / TabGridOverviewPanel.this.colCount; int colIndex = i % TabGridOverviewPanel.this.colCount; previewControl.setBounds(colIndex * TabGridOverviewPanel.this.pWidth, rowIndex * TabGridOverviewPanel.this.pHeight, TabGridOverviewPanel.this.pWidth, TabGridOverviewPanel.this.pHeight); } } /* * (non-Javadoc) * * @see java.awt.LayoutManager#minimumLayoutSize(java.awt.Container) */ public Dimension minimumLayoutSize(Container parent) { return parent.getSize(); } /* * (non-Javadoc) * * @see java.awt.LayoutManager#preferredLayoutSize(java.awt.Container) */ public Dimension preferredLayoutSize(Container parent) { return this.minimumLayoutSize(parent); } } } /** * Glass pane for the tab grid overview panel. Provides rollover effects, * showing zoomed version of the tab thumbnails. * * @author Kirill Grouchnikov */ public class TabGridOverviewGlassPane extends JPanel { /** * Index of the tab thumbnail currently under the mouse pointer. */ private int currHoverIndex; /** * Mouse listeneres (one for each tab thumbnail). */ private MouseListener[] mouseListeners; /** * The associated overview panel. */ private TabGridOverviewPanel overviewPanel; /** * Creates the glass pane. * * @param overviewPanel * The associated overview panel. */ public TabGridOverviewGlassPane(final TabGridOverviewPanel overviewPanel) { this.setOpaque(false); this.overviewPanel = overviewPanel; int size = this.overviewPanel.previewControls.length; this.mouseListeners = new MouseListener[size]; this.currHoverIndex = -1; for (int i = 0; i < size; i++) { final int index = i; this.mouseListeners[i] = new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { currHoverIndex = index; overviewPanel.previewControls[index] .setToolTipText(null); FadeTracker.getInstance().trackFadeIn( FadeKind.ROLLOVER, overviewPanel.previewControls[index], false, new UIThreadFadeTrackerAdapter() { @Override public void fadePerformed( FadeKind fadeKind, float fadeCycle10) { SwingUtilities.getRootPane( overviewPanel).repaint(); } @Override public void fadeEnded(FadeKind fadeKind) { SwingUtilities.getRootPane( overviewPanel).repaint(); overviewPanel.previewControls[index] .setToolTipText(LafWidgetUtilities .getResourceBundle( tabPane) .getString( "TabbedPane.overviewWidgetTooltip")); } }); } @Override public void mouseExited(MouseEvent e) { if (currHoverIndex == index) currHoverIndex = -1; overviewPanel.previewControls[index] .setToolTipText(null); FadeTracker.getInstance().trackFadeOut( FadeKind.ROLLOVER, overviewPanel.previewControls[index], false, new UIThreadFadeTrackerAdapter() { @Override public void fadePerformed( FadeKind fadeKind, float fadeCycle10) { SwingUtilities.getRootPane( overviewPanel).repaint(); } @Override public void fadeEnded(FadeKind fadeKind) { SwingUtilities.getRootPane( overviewPanel).repaint(); } }); } }; this.overviewPanel.previewControls[i] .addMouseListener(this.mouseListeners[i]); } } /* * (non-Javadoc) * * @see javax.swing.JComponent#paintComponent(java.awt.Graphics) */ @Override protected void paintComponent(Graphics g) { Graphics2D graphics = (Graphics2D) g.create(); FadeTracker fadeTracker = FadeTracker.getInstance(); for (int i = 0; i < tabPane.getTabCount(); i++) { Component child = overviewPanel.previewControls[i]; if (fadeTracker.isTracked(child, FadeKind.ROLLOVER)) paintSingleTabComponent(graphics, i); } if (currHoverIndex >= 0) { // paint the currently hovered once again (so it'll be on top) paintSingleTabComponent(graphics, currHoverIndex); } graphics.dispose(); } /** * Paints a single tab component. * * @param graphics * Graphics context. * @param index * Tab component index. */ private void paintSingleTabComponent(Graphics2D graphics, int index) { Component child = overviewPanel.previewControls[index]; Rectangle cBounds = child.getBounds(); int dx = child.getLocationOnScreen().x - this.getLocationOnScreen().x; int dy = child.getLocationOnScreen().y - this.getLocationOnScreen().y; double factor = (index == currHoverIndex) ? 1.2 : 1.0; if (FadeTracker.getInstance().isTracked(child, FadeKind.ROLLOVER)) { factor = 1.0 + 0.2 * FadeTracker.getInstance().getFade(child, FadeKind.ROLLOVER); } int bw = (int) (cBounds.width * factor); int bh = (int) (cBounds.height * factor); BufferedImage bi = new BufferedImage(bw, bh, BufferedImage.TYPE_INT_ARGB); Graphics2D bGraphics = (Graphics2D) bi.getGraphics().create(); bGraphics.scale(factor, factor); TabPreviewControl tChild = (TabPreviewControl) child; bGraphics.setColor(tChild.getBackground()); bGraphics.fillRect(0, 0, tChild.getWidth(), tChild.getHeight()); Icon icon = tabPane.getIconAt(index); int iy = (icon == null) ? 16 : icon.getIconHeight(); if (icon != null) { icon.paintIcon(this, bGraphics, 1, 1); } String title = tabPane.getTitleAt(index); JLabel tempLabel = new JLabel(title); tempLabel.setBounds(tChild.titleLabel.getBounds()); tempLabel.setFont(tChild.titleLabel.getFont()); int bdx = tempLabel.getX(); int bdy = tempLabel.getY(); bGraphics.translate(bdx, bdy); tempLabel.paint(bGraphics); bGraphics.translate(-bdx, -bdy); bdx = 1; bdy = iy + 3; bGraphics.translate(bdx, bdy); ((TabPreviewControl) child).paintTabThumbnail(bGraphics); bGraphics.translate(-bdx, -bdy); bGraphics.setColor(Color.black); bGraphics.drawRect(0, 0, child.getWidth() - 1, child.getHeight() - 1); bGraphics.dispose(); dx -= (bw - cBounds.width) / 2; dy -= (bh - cBounds.height) / 2; // make sure that the enlarged thumbnail stays inbounds dx = Math.max(dx, 0); dy = Math.max(dy, 0); if (dx + bi.getWidth() > getWidth()) { dx -= (dx + bi.getWidth() - getWidth()); } if (dy + bi.getHeight() > getHeight()) { dy -= (dy + bi.getHeight() - getHeight()); } graphics.drawImage(bi, dx, dy, null); } } /** * Creates a new tab overview dialog. Declared private to enforce usage of * {@link #getOverviewDialog(JTabbedPane)}. * * @param tabPane * Tabbed pane. * @param overviewKind * Overview kind. * @param owner * Optional owner for the tab overview dialog. * @param modal * Modality indication. * @param dialogWidth * Tab overview dialog width. * @param dialogHeight * Tab overview dialog height. * @throws HeadlessException * @see #getOverviewDialog(JTabbedPane) */ private TabOverviewDialog(final JTabbedPane tabPane, TabOverviewKind overviewKind, Frame owner, boolean modal, int dialogWidth, int dialogHeight) throws HeadlessException { super(owner, modal); this.tabPane = tabPane; this.setLayout(new BorderLayout()); if (overviewKind == TabOverviewKind.GRID) { TabGridOverviewPanel gridOverviewPanel = new TabGridOverviewPanel( dialogWidth, dialogHeight); this.add(gridOverviewPanel, BorderLayout.CENTER); // // TabGridOverviewGlassPane glassPane = new // TabGridOverviewGlassPane( // gridOverviewPanel); // this.setGlassPane(glassPane); // glassPane.setVisible(true); } if (overviewKind == TabOverviewKind.ROUND_CAROUSEL) { this.add(new TabRoundCarouselOverviewPanel(dialogWidth, dialogHeight), BorderLayout.CENTER); } if (overviewKind == TabOverviewKind.MENU_CAROUSEL) { this .add(new TabMenuCarouselOverviewPanel(dialogWidth, dialogHeight), BorderLayout.CENTER); } this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); this.setResizable(false); this.lafSwitchListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if ("lookAndFeel".equals(evt.getPropertyName())) { SwingUtilities.invokeLater(new Runnable() { public void run() { SwingUtilities .updateComponentTreeUI(TabOverviewDialog.this); } }); } } }; UIManager.addPropertyChangeListener(this.lafSwitchListener); // Cancel all pending preview requests issued by this overview // dialog when it closes. this.addWindowListener(new WindowAdapter() { /* * (non-Javadoc) * * @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent) */ @Override public void windowClosing(WindowEvent e) { this.cancelRequests(); UIManager.removePropertyChangeListener(lafSwitchListener); } /* * (non-Javadoc) * * @see java.awt.event.WindowAdapter#windowClosed(java.awt.event.WindowEvent) */ @Override public void windowClosed(WindowEvent e) { this.cancelRequests(); UIManager.removePropertyChangeListener(lafSwitchListener); } /** * Cancels preview requests issued by this overview * dialog. */ private void cancelRequests() { if (TabPreviewThread.instanceRunning()) { TabPreviewThread.getInstance().cancelTabPreviewRequests( TabOverviewDialog.this); } } }); } /** * Returns a new instance of a tab overview dialog. * * @param tabPane * Tabbed pane. * @return Tab overview dialog for the specified tabbed pane. */ public static TabOverviewDialog getOverviewDialog(JTabbedPane tabPane) { final TabPreviewPainter previewPainter = LafWidgetUtilities2 .getTabPreviewPainter(tabPane); String title = previewPainter.toUpdatePeriodically(tabPane) ? MessageFormat .format(LafWidgetUtilities.getResourceBundle(tabPane) .getString("TabbedPane.overviewDialogTitleRefresh"), new Object[] { new Integer(previewPainter .getUpdateCycle(tabPane) / 1000) }) : LafWidgetUtilities.getResourceBundle(tabPane).getString( "TabbedPane.overviewDialogTitle"); JFrame frameForModality = previewPainter.getModalOwner(tabPane); boolean isModal = (frameForModality != null); Rectangle dialogScreenBounds = previewPainter .getPreviewDialogScreenBounds(tabPane); TabOverviewKind overviewKind = previewPainter.getOverviewKind(tabPane); final TabOverviewDialog overviewDialog = new TabOverviewDialog(tabPane, overviewKind, frameForModality, isModal, dialogScreenBounds.width, dialogScreenBounds.height); overviewDialog.setTitle(title); overviewDialog.setLocation(dialogScreenBounds.x, dialogScreenBounds.y); overviewDialog.setSize(dialogScreenBounds.width, dialogScreenBounds.height); // make sure that the tab overview dialog is disposed when // it loses focus final PropertyChangeListener activeWindowListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if ("activeWindow".equals(evt.getPropertyName())) { if (overviewDialog == evt.getOldValue()) { if (previewPainter.toDisposeOverviewOnFocusLoss()) { overviewDialog.dispose(); } } } } }; KeyboardFocusManager.getCurrentKeyboardFocusManager() .addPropertyChangeListener(activeWindowListener); // make sure that when the window with the tabbed pane is // closed, the tab overview dialog is disposed. final Window tabWindow = SwingUtilities.getWindowAncestor(tabPane); final WindowListener tabWindowListener = new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { overviewDialog.dispose(); } }; tabWindow.addWindowListener(tabWindowListener); overviewDialog.addWindowListener(new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { tabWindow.removeWindowListener(tabWindowListener); KeyboardFocusManager.getCurrentKeyboardFocusManager() .removePropertyChangeListener(activeWindowListener); } }); return overviewDialog; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tabbed/TabPreviewWindow.java0000644000175000017500000002645511137001464027653 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tabbed; import java.awt.*; import java.awt.event.*; import java.awt.image.BufferedImage; import javax.swing.*; import org.jvnet.lafwidget.*; import org.jvnet.lafwidget.animation.FadeKind; import org.jvnet.lafwidget.animation.FadeTracker; import org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewInfo; import org.jvnet.lafwidget.utils.LafConstants.AnimationKind; /** * Tab preview window. Is displayed when the mouse hovers over relevant * (previewable) tabs. * * @author Kirill Grouchnikov */ public class TabPreviewWindow extends JWindow implements ActionListener { /** * Singleton instance of tab preview window. */ protected static TabPreviewWindow instance; /** * Information on the current tab preview request. */ protected static TabPreviewInfo currTabPreviewInfo; /** * Currently running timer task. */ protected static Timer currTabPreviewTimer; /** * Returns the singleton instance of tab preview window. * * @return The singleton instance of tab preview window. */ public static synchronized TabPreviewWindow getInstance() { if (TabPreviewWindow.instance == null) { TabPreviewWindow.instance = new TabPreviewWindow(); TabPreviewWindow.instance.setLayout(new BorderLayout()); // instance.addHierarchyListener(new HierarchyListener() { // public void hierarchyChanged(HierarchyEvent e) { // System.err.println(e.getID()); // } // }); } return TabPreviewWindow.instance; } /** * Posts a preview request for a tab component in the specified tabbed pane. * * @param tabPane * Tabbed pane. * @param tabIndex * Index of the tab to preview. */ public synchronized void postPreviewRequest(JTabbedPane tabPane, int tabIndex) { TabPreviewPainter previewPainter = LafWidgetUtilities2 .getTabPreviewPainter(tabPane); if ((previewPainter == null) || (!previewPainter.hasPreviewWindow(tabPane, tabIndex))) return; // check if already showing if (currTabPreviewInfo != null) { if ((currTabPreviewInfo.tabPane == tabPane) && (currTabPreviewInfo.tabIndexToPreview == tabIndex)) return; } if (currTabPreviewTimer != null) { if (currTabPreviewTimer.isRunning()) currTabPreviewTimer.stop(); } Dimension previewDim = previewPainter.getPreviewWindowDimension( tabPane, tabIndex); int pWidth = previewDim.width; int pHeight = previewDim.height; Component tabComponent = tabPane.getComponentAt(tabIndex); if (tabComponent != null) { int width = tabComponent.getWidth(); int height = tabComponent.getHeight(); double ratio = (double) width / (double) height; double pRatio = (double) previewDim.width / (double) previewDim.height; if (pRatio > ratio) { pWidth = (int) (pHeight * ratio); } else { pHeight = (int) (pWidth / ratio); } } currTabPreviewInfo = new TabPreviewInfo(); currTabPreviewInfo.tabPane = tabPane; currTabPreviewInfo.tabIndexToPreview = tabIndex; currTabPreviewInfo.previewWidth = pWidth; currTabPreviewInfo.previewHeight = pHeight; currTabPreviewInfo.initiator = tabPane; currTabPreviewInfo.previewCallback = new TabPreviewThread.TabPreviewCallback() { /* * (non-Javadoc) * * @see * org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewCallback * #start(javax.swing.JTabbedPane, int, * org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewInfo) */ public void start(JTabbedPane tabPane, int tabCount, TabPreviewInfo tabPreviewInfo) { // Nothing to do since the callback was registered // for a specific tab. } /* * (non-Javadoc) * * @see * org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewCallback * #offer(javax.swing.JTabbedPane, int, * java.awt.image.BufferedImage) */ public void offer(JTabbedPane tabPane, int tabIndex, BufferedImage componentSnap) { if (currTabPreviewInfo == null) { // has since been cancelled return; } if ((tabPane != currTabPreviewInfo.tabPane) || (tabIndex != currTabPreviewInfo.tabIndexToPreview)) { // has since been cancelled return; } Rectangle previewScreenRectangle = TabPreviewWindow.this .getPreviewWindowScreenRect(tabPane, tabIndex, currTabPreviewInfo.previewWidth, currTabPreviewInfo.previewHeight); TabPreviewWindow.this.getContentPane().removeAll(); final JLabel previewLabel = new JLabel(new ImageIcon( componentSnap)) { @Override protected void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g.create(); FadeTracker fadeTracker = FadeTracker.getInstance(); // Check if in the middle of fade-in if (fadeTracker.isTracked(this, FadeKind.ENABLE)) { float fadeFactor = fadeTracker.getFade(this, FadeKind.ENABLE); g2.setComposite(AlphaComposite.SrcOver .derive(fadeFactor)); } super.paintComponent(g2); g2.dispose(); } }; TabPreviewWindow.this .addComponentListener(new ComponentAdapter() { @Override public void componentShown(ComponentEvent e) { previewLabel.setVisible(true); // Start fading-in of the image. FadeTracker.getInstance().trackFadeIn( FadeKind.ENABLE, previewLabel, false, null); } }); // previewLabel.setBorder(new SubstanceBorder()); previewLabel.putClientProperty(LafWidget.ANIMATION_KIND, AnimationKind.SLOW); TabPreviewWindow.this.getContentPane().add(previewLabel, BorderLayout.CENTER); TabPreviewWindow.this.setSize(previewScreenRectangle.width, previewScreenRectangle.height); TabPreviewWindow.this.setLocation(previewScreenRectangle.x, previewScreenRectangle.y); previewLabel.setVisible(false); TabPreviewWindow.this.setVisible(true); } }; int extraDelay = previewPainter.getPreviewWindowExtraDelay(tabPane, tabIndex); if (extraDelay < 0) { throw new IllegalArgumentException( "Extra delay for tab preview must be non-negative"); } currTabPreviewTimer = new Timer(2000 + extraDelay, this); currTabPreviewTimer.setRepeats(false); currTabPreviewTimer.start(); } /* * (non-Javadoc) * * @see * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent e) { if (currTabPreviewInfo == null) return; // If we are here - the delay timer has expired. // System.err.println("Post " + tabIndex); TabPreviewPainter previewPainter = LafWidgetUtilities2 .getTabPreviewPainter(currTabPreviewInfo.tabPane); if ((previewPainter == null) || (!previewPainter.hasPreviewWindow( currTabPreviewInfo.tabPane, currTabPreviewInfo.tabIndexToPreview))) return; // Queue the request with the preview thread. TabPreviewThread.getInstance().queueTabPreviewRequest( currTabPreviewInfo); } /** * Returns the screen rectangle for the preview window. * * @param tabPane * Tabbed pane. * @param tabIndex * Tab index. * @param pWidth * Preview width. * @param pHeight * Preview height. * @return The screen rectangle for the preview window. */ protected Rectangle getPreviewWindowScreenRect(JTabbedPane tabPane, int tabIndex, int pWidth, int pHeight) { LafWidgetSupport lafSupport = LafWidgetRepository.getRepository() .getLafSupport(); Rectangle relative = lafSupport.getTabRectangle(tabPane, tabIndex); if (relative == null) return null; Rectangle result = new Rectangle(pWidth, pHeight); boolean ltr = tabPane.getComponentOrientation().isLeftToRight(); if (ltr) { if (tabPane.getTabPlacement() != SwingConstants.BOTTOM) { result.setLocation(relative.x, relative.y + relative.height); } else { result.setLocation(relative.x, relative.y - pHeight); } } else { if (tabPane.getTabPlacement() != SwingConstants.BOTTOM) { result.setLocation(relative.x + relative.width - pWidth, relative.y + relative.height); } else { result.setLocation(relative.x + relative.width - pWidth, relative.y - pHeight); } } int dx = tabPane.getLocationOnScreen().x; int dy = tabPane.getLocationOnScreen().y; result.x += dx; result.y += dy; // Fix to make the tab preview window stay in screen bounds Rectangle virtualBounds = new Rectangle(); GraphicsEnvironment ge = GraphicsEnvironment .getLocalGraphicsEnvironment(); GraphicsDevice[] gds = ge.getScreenDevices(); for (int i = 0; i < gds.length; i++) { GraphicsDevice gd = gds[i]; GraphicsConfiguration gc = gd.getDefaultConfiguration(); virtualBounds = virtualBounds.union(gc.getBounds()); } if (result.x + result.width > (virtualBounds.width - 1)) { result.x -= (result.x + result.width - virtualBounds.width + 1); } if (result.y + result.height > (virtualBounds.height - 1)) { result.y -= (result.y + result.height - virtualBounds.height + 1); } if (result.x < virtualBounds.x) result.x = virtualBounds.x + 1; if (result.y < virtualBounds.y) result.y = virtualBounds.y + 1; return result; } /** * Cancels the currently pending preview request. */ public static synchronized void cancelPreviewRequest() { // System.err.println("Cancel"); currTabPreviewInfo = null; if ((currTabPreviewTimer != null) && currTabPreviewTimer.isRunning()) { currTabPreviewTimer.stop(); currTabPreviewTimer = null; } if (instance != null) instance.dispose();// setVisible(false); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tabbed/TabOverviewDialogWidget.java0000644000175000017500000001705411253704416031135 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tabbed; import java.awt.Insets; import java.awt.event.*; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import javax.swing.*; import org.jvnet.lafwidget.*; /** * Adds tab overview dialog to tabbed panes. * * @author Kirill Grouchnikov */ public class TabOverviewDialogWidget extends LafWidgetAdapter { /** * Tab overview button. */ protected TabOverviewButton overviewButton; /** * Listens on changes to relevant tabbed pane properties. */ protected PropertyChangeListener propertyListener; /** * Listens on tabs being added or removed. */ protected ContainerListener containerListener; /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installComponents() */ @Override public void installComponents() { this.overviewButton = new TabOverviewButton(this.jcomp); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installDefaults() */ @Override public void installDefaults() { TabPreviewPainter previewPainter = LafWidgetUtilities2 .getTabPreviewPainter(this.jcomp); if ((previewPainter != null) && previewPainter.hasOverviewDialog(this.jcomp)) { LafWidgetSupport lafSupport = LafWidgetRepository.getRepository() .getLafSupport(); Insets currTabAreaInsets = lafSupport.getTabAreaInsets(this.jcomp); if (currTabAreaInsets == null) currTabAreaInsets = UIManager .getInsets("TabbedPane.tabAreaInsets"); Insets tabAreaInsets = new Insets(currTabAreaInsets.top, LafWidgetRepository.getRepository().getLafSupport() .getLookupButtonSize() + 2 + currTabAreaInsets.left, currTabAreaInsets.bottom, currTabAreaInsets.right); lafSupport.setTabAreaInsets(this.jcomp, tabAreaInsets); this.jcomp.add(this.overviewButton); this.overviewButton.setVisible(true); this.jcomp.setComponentZOrder(this.overviewButton, 0); this.overviewButton.updateLocation(this.jcomp, tabAreaInsets); } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallComponents() */ @Override public void uninstallComponents() { if (this.overviewButton.getParent() == this.jcomp) this.jcomp.remove(this.overviewButton); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installListeners() */ @Override public void installListeners() { this.propertyListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { LafWidgetSupport lafSupport = LafWidgetRepository .getRepository().getLafSupport(); Insets lafInsets = lafSupport .getTabAreaInsets(TabOverviewDialogWidget.this.jcomp); final Insets currTabAreaInsets = (lafInsets == null) ? UIManager .getInsets("TabbedPane.tabAreaInsets") : lafInsets; if (LafWidget.TABBED_PANE_PREVIEW_PAINTER.equals(evt .getPropertyName())) { TabPreviewPainter previewPainter = LafWidgetUtilities2 .getTabPreviewPainter(TabOverviewDialogWidget.this.jcomp); if ((previewPainter != null) && previewPainter .hasOverviewDialog(TabOverviewDialogWidget.this.jcomp)) { Insets tabAreaInsets = new Insets( currTabAreaInsets.top, LafWidgetRepository .getRepository().getLafSupport() .getLookupButtonSize() + 2 + currTabAreaInsets.left, currTabAreaInsets.bottom, currTabAreaInsets.right); lafSupport.setTabAreaInsets( TabOverviewDialogWidget.this.jcomp, tabAreaInsets); TabOverviewDialogWidget.this.jcomp .add(TabOverviewDialogWidget.this.overviewButton); TabOverviewDialogWidget.this.overviewButton .setVisible(true); // jtp.setComponentZOrder(overviewButton, 0); TabOverviewDialogWidget.this.overviewButton .updateLocation( TabOverviewDialogWidget.this.jcomp, tabAreaInsets); } else { TabOverviewDialogWidget.this.jcomp .remove(TabOverviewDialogWidget.this.overviewButton); } } if ("tabPlacement".equals(evt.getPropertyName()) || "componentOrientation".equals(evt.getPropertyName()) || "tabAreaInsets".equals(evt.getPropertyName())) { SwingUtilities.invokeLater(new Runnable() { public void run() { if (TabOverviewDialogWidget.this.overviewButton .getParent() == TabOverviewDialogWidget.this.jcomp) TabOverviewDialogWidget.this.overviewButton .updateLocation( TabOverviewDialogWidget.this.jcomp, currTabAreaInsets); } }); } } }; this.jcomp.addPropertyChangeListener(this.propertyListener); this.containerListener = new ContainerAdapter() { @Override public void componentAdded(ContainerEvent e) { syncOverviewButtonVisibility(); } @Override public void componentRemoved(ContainerEvent e) { syncOverviewButtonVisibility(); } /** * Syncs the visibility of the tab overview button. */ private void syncOverviewButtonVisibility() { if (overviewButton.getParent() != jcomp) return; // fix for issue 12 - hide the overview button when // there are no tabs overviewButton.setVisible(jcomp.getTabCount() > 0); } }; this.jcomp.addContainerListener(this.containerListener); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { this.jcomp.removePropertyChangeListener(this.propertyListener); this.propertyListener = null; this.jcomp.removeContainerListener(this.containerListener); this.containerListener = null; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tabbed/TabPreviewControl.java0000644000175000017500000001405411036350356030021 0ustar drazzibdrazzibpackage org.jvnet.lafwidget.tabbed; import java.awt.*; import java.awt.image.BufferedImage; import javax.swing.*; import javax.swing.border.*; import org.jvnet.lafwidget.LafWidget; import org.jvnet.lafwidget.LafWidgetUtilities; import org.jvnet.lafwidget.animation.FadeKind; import org.jvnet.lafwidget.animation.FadeTracker; import org.jvnet.lafwidget.utils.ShadowPopupBorder; /** * Control to display the a single tab preview. * * @author Kirill Grouchnikov */ public class TabPreviewControl extends JPanel { /** * Label for the tab icon. */ protected JLabel iconLabel; /** * Label for the tab title. */ protected JLabel titleLabel; /** * Panel for the tab preview image. */ protected JPanel previewImagePanel; /** * The preview image itself. */ protected BufferedImage previewImage; /** * The associated tabbed pane. */ protected JTabbedPane tabPane; /** * Creates a tab preview control. * * @param tabPane * Tabbed pane. * @param tabIndex * Tab index. */ public TabPreviewControl(final JTabbedPane tabPane, final int tabIndex) { this.tabPane = tabPane; this.setLayout(new TabPreviewControlLayout()); this.iconLabel = new JLabel(tabPane.getIconAt(tabIndex)); this.titleLabel = new JLabel(tabPane.getTitleAt(tabIndex)); this.titleLabel .setFont(this.titleLabel.getFont().deriveFont(Font.BOLD)); // the panel with the preview image - perhaps use JLabel // instead? this.previewImagePanel = new JPanel() { public void paintComponent(Graphics g) { super.paintComponent(g); paintTabThumbnail(g); }; }; this.add(this.iconLabel); this.add(this.titleLabel); this.add(this.previewImagePanel); final boolean isSelected = (tabPane.getSelectedIndex() == tabIndex); Border innerBorder = isSelected ? new LineBorder(Color.black, 2) : new LineBorder(Color.black, 1); this .setBorder(new CompoundBorder(new ShadowPopupBorder(), innerBorder)); } /** * Paints the tab thumbnail on the specified graphics context. * * @param g * Graphics context. */ public synchronized void paintTabThumbnail(Graphics g) { if (TabPreviewControl.this.previewImage != null) { int pw = TabPreviewControl.this.previewImage.getWidth(); int ph = TabPreviewControl.this.previewImage.getHeight(); int w = this.previewImagePanel.getWidth(); int h = this.previewImagePanel.getHeight(); Graphics2D g2 = (Graphics2D) g.create(); FadeTracker fadeTracker = FadeTracker.getInstance(); // Check if in the middle of fade-in if (fadeTracker.isTracked(this, FadeKind.ENABLE)) { float fadeFactor = fadeTracker.getFade(this, FadeKind.ENABLE); g2.setComposite(AlphaComposite.SrcOver.derive(fadeFactor)); } // Check if in the middle of closing the tab pager window if (fadeTracker.isTracked(tabPane, TabPagerManager.HIDE_TAB_PAGER_FADE_KIND)) { float fadeFactor = fadeTracker.getFade(tabPane, TabPagerManager.HIDE_TAB_PAGER_FADE_KIND); g2.setComposite(AlphaComposite.SrcOver.derive(fadeFactor)); } int dx = (w - pw) / 2; int dy = (h - ph) / 2; g2.drawImage(TabPreviewControl.this.previewImage, dx, dy, null); g2.dispose(); } } /** * Stes the tab index. * * @param tabIndex * Tab index. */ public void setTabIndex(int tabIndex) { this.iconLabel.setIcon(this.tabPane.getIconAt(tabIndex)); this.titleLabel.setText(this.tabPane.getTitleAt(tabIndex)); final boolean isSelected = (this.tabPane.getSelectedIndex() == tabIndex); Border innerBorder = isSelected ? new LineBorder(Color.black, 2) : new LineBorder(Color.black, 1); this .setBorder(new CompoundBorder(new ShadowPopupBorder(), innerBorder)); } /** * Layout for the tab preview control. * * @author Kirill Grouchnikov */ protected class TabPreviewControlLayout implements LayoutManager { /* * (non-Javadoc) * * @see java.awt.LayoutManager#addLayoutComponent(java.lang.String, * java.awt.Component) */ public void addLayoutComponent(String name, Component comp) { } /* * (non-Javadoc) * * @see java.awt.LayoutManager#removeLayoutComponent(java.awt.Component) */ public void removeLayoutComponent(Component comp) { } /* * (non-Javadoc) * * @see java.awt.LayoutManager#layoutContainer(java.awt.Container) */ public void layoutContainer(Container parent) { int width = parent.getWidth(); int height = parent.getHeight(); Insets insets = TabPreviewControl.this.getInsets(); TabPreviewControl.this.iconLabel.setBounds(insets.left + 1, insets.top + 1, 16, 16); TabPreviewControl.this.titleLabel .setBounds(insets.left + 18, insets.top + 1, width - 18 - insets.left - insets.right, 16); TabPreviewControl.this.previewImagePanel.setBounds(insets.left + 1, insets.top + 17, width - insets.left - insets.right - 2, height - 17 - insets.top - insets.bottom); } /* * (non-Javadoc) * * @see java.awt.LayoutManager#minimumLayoutSize(java.awt.Container) */ public Dimension minimumLayoutSize(Container parent) { return parent.getSize(); } /* * (non-Javadoc) * * @see java.awt.LayoutManager#preferredLayoutSize(java.awt.Container) */ public Dimension preferredLayoutSize(Container parent) { return this.minimumLayoutSize(parent); } } /** * Sets the tab preview thumbnail. * * @param previewImage * Tab preview thumbnail. * @param toAnimate * if true, the image will be faded-in. */ public void setPreviewImage(BufferedImage previewImage, boolean toAnimate) { this.previewImage = previewImage; if (toAnimate) { this.previewImagePanel.putClientProperty(LafWidget.ANIMATION_KIND, LafWidgetUtilities.getAnimationKind(this.tabPane)); // Start fading in. FadeTracker.getInstance().trackFadeIn(FadeKind.ENABLE, this.previewImagePanel, false, null); } } }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tabbed/TabPagerWidget.java0000644000175000017500000001676111137001464027243 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tabbed; import java.awt.Component; import java.awt.event.*; import javax.swing.*; import org.jvnet.lafwidget.*; /** * Adds tab pager to tabbed panes. * * @author Kirill Grouchnikov */ public class TabPagerWidget extends LafWidgetAdapter implements Resettable { /** * Mouse wheel listener for Ctrl paging (from version 2.1). */ protected MouseWheelListener mouseWheelListener; /** * Mouse listener for Ctrl paging (from version 2.1). */ protected MouseListener mouseListener; /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installUI() */ @Override public void installUI() { super.installUI(); InputMap currMap = SwingUtilities.getUIInputMap(this.jcomp, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); InputMap newMap = new InputMap(); if (currMap != null) { KeyStroke[] kss = currMap.allKeys(); for (int i = 0; i < kss.length; i++) { KeyStroke stroke = kss[i]; Object val = currMap.get(stroke); newMap.put(stroke, val); } } newMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.CTRL_MASK), "tabSwitcherForward"); newMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.CTRL_MASK), "tabSwitcherBackward"); newMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_CONTROL, 0, true), "tabSwitcherClose"); newMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "tabSwitcherHide"); this.jcomp.getActionMap().put("tabSwitcherForward", new AbstractAction() { public void actionPerformed(ActionEvent e) { // fix for issue 323 in Substance - don't show pager on tabbed // panes with no preview painter TabPreviewPainter tpp = LafWidgetUtilities2 .getTabPreviewPainter(TabPagerWidget.this.jcomp); if (tpp == null) return; TabPagerManager te = TabPagerManager.getPager(); te.page(TabPagerWidget.this.jcomp, true); } }); this.jcomp.getActionMap().put("tabSwitcherBackward", new AbstractAction() { public void actionPerformed(ActionEvent e) { // fix for issue 323 in Substance - don't show pager on // tabbed panes with no preview painter TabPreviewPainter tpp = LafWidgetUtilities2 .getTabPreviewPainter(TabPagerWidget.this.jcomp); if (tpp == null) return; TabPagerManager te = TabPagerManager.getPager(); te.page(TabPagerWidget.this.jcomp, false); } }); this.jcomp.getActionMap().put("tabSwitcherClose", new AbstractAction() { public void actionPerformed(ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { // fix for issue 323 in Substance - don't show pager on // tabbed panes with no preview painter TabPreviewPainter tpp = LafWidgetUtilities2 .getTabPreviewPainter(TabPagerWidget.this.jcomp); if (tpp == null) return; TabPagerManager te = TabPagerManager.getPager(); int index = te.hide(); // fix for issue 177 in Substance (disallowing selection // of disabled tabs). if ((index >= 0) && tpp.isSensitiveToEvents( TabPagerWidget.this.jcomp, index)) { TabPagerWidget.this.jcomp.setSelectedIndex(index); } } }); } }); this.jcomp.getActionMap().put("tabSwitcherHide", new AbstractAction() { public void actionPerformed(ActionEvent e) { TabPagerManager te = TabPagerManager.getPager(); if (te.isVisible()) { te.hide(); } else { // fix for defect 233 on Substance - the ESCAPE event // is not dispatched when tab pager is not showing. Component comp = jcomp.getParent(); while (comp != null) { if (comp instanceof JComponent) { JComponent jc = (JComponent) comp; KeyStroke escapeKeyStroke = KeyStroke.getKeyStroke( KeyEvent.VK_ESCAPE, 0, false); ActionListener al = jc .getActionForKeyStroke(escapeKeyStroke); if (al != null) { al.actionPerformed(e); return; } } comp = comp.getParent(); } } } }); SwingUtilities.replaceUIInputMap(this.jcomp, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, newMap); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallUI() */ @Override public void uninstallUI() { super.uninstallUI(); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installListeners() */ @Override public void installListeners() { this.mouseWheelListener = new TabPagerMouseWheelListener(this.jcomp); this.jcomp.addMouseWheelListener(this.mouseWheelListener); this.mouseListener = new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if ((e.getModifiers() & InputEvent.CTRL_MASK) != 0) { SwingUtilities.invokeLater(new Runnable() { public void run() { TabPagerManager te = TabPagerManager.getPager(); int index = te.hide(); if (index >= 0) TabPagerWidget.this.jcomp .setSelectedIndex(index); } }); } } }; this.jcomp.addMouseListener(this.mouseListener); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { this.jcomp.removeMouseWheelListener(this.mouseWheelListener); this.mouseWheelListener = null; this.jcomp.removeMouseListener(this.mouseListener); this.mouseListener = null; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.Resettable#reset() */ public void reset() { TabPagerManager.reset(); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tabbed/TabOverviewButton.java0000644000175000017500000001200011137001464030021 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tabbed; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; import javax.swing.plaf.UIResource; import org.jvnet.lafwidget.*; /** * Button that activates the tab overview dialog. * * @author Kirill Grouchnikov */ public class TabOverviewButton extends JButton implements UIResource { /** * Client property name for locking undesired bound set. */ private static final String OWN_BOUNDS = "lafwidget.ownBounds"; /** * Creates a new tab overview button. * * @param tabPane * The owner tabbed pane. */ public TabOverviewButton(final JTabbedPane tabPane) { this.setFocusable(false); LafWidgetSupport support = LafWidgetRepository.getRepository() .getLafSupport(); if (support != null) { Icon searchIcon = support.getSearchIcon(LafWidgetRepository .getRepository().getLafSupport().getLookupIconSize(), tabPane.getComponentOrientation()); this.setIcon(searchIcon); support.markButtonAsFlat(this); } this.setToolTipText(LafWidgetUtilities.getResourceBundle(tabPane).getString( "TabbedPane.overviewButtonTooltip")); this.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { TabOverviewDialog.getOverviewDialog(tabPane).setVisible(true); } }); } /* * (non-Javadoc) * * @see java.awt.Component#setBounds(int, int, int, int) */ public void setBounds(int x, int y, int width, int height) { if (Boolean.TRUE.equals(this .getClientProperty(TabOverviewButton.OWN_BOUNDS))) super.setBounds(x, y, width, height); } /** * Updates the location of this tab overview button. * * @param tabbedPane * Tabbed pane. * @param tabAreaInsets * Tab area insets. */ public void updateLocation(JTabbedPane tabbedPane, Insets tabAreaInsets) { if (tabbedPane == null) return; // Lock the button for the bounds change this.putClientProperty(TabOverviewButton.OWN_BOUNDS, Boolean.TRUE); int buttonSize = LafWidgetRepository.getRepository().getLafSupport() .getLookupButtonSize(); switch (tabbedPane.getTabPlacement()) { case SwingConstants.TOP: if (tabbedPane.getComponentOrientation().isLeftToRight()) this.setBounds(2, tabAreaInsets.top, buttonSize, buttonSize); else this.setBounds(tabbedPane.getBounds().width - tabAreaInsets.right - buttonSize - 2, tabAreaInsets.top, buttonSize, buttonSize); break; case SwingConstants.BOTTOM: if (tabbedPane.getComponentOrientation().isLeftToRight()) this.setBounds(2, tabbedPane.getBounds().height - tabAreaInsets.bottom - buttonSize - 4, buttonSize, buttonSize); else this.setBounds(tabbedPane.getBounds().width - tabAreaInsets.right - buttonSize - 2, tabbedPane .getBounds().height - tabAreaInsets.bottom - buttonSize - 4, buttonSize, buttonSize); break; case SwingConstants.LEFT: this.setBounds(2, tabAreaInsets.top - 1, buttonSize, buttonSize); break; case SwingConstants.RIGHT: this.setBounds(tabbedPane.getBounds().width - tabAreaInsets.right - buttonSize - 2, tabAreaInsets.top - 1, buttonSize, buttonSize); break; } // Unlock the button for the bounds change this.putClientProperty(TabOverviewButton.OWN_BOUNDS, null); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tabbed/TabPreviewPainter.java0000644000175000017500000001775211137001464030006 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tabbed; import java.awt.*; import javax.swing.JFrame; import javax.swing.JTabbedPane; import org.jvnet.lafwidget.utils.LafConstants.TabOverviewKind; /** * Base class for tab preview painters. * * @author Kirill Grouchnikov */ public abstract class TabPreviewPainter { /** * Draws a tab preview on the specified graphics. * * @param tabPane * Tabbed pane. * @param tabIndex * tabIndex Tab index for the preview paint. * @param g * Graphics context. * @param x * X coordinate of the preview area. * @param y * Y coordinate of the preview area. * @param w * Width of the preview area. * @param h * Height of the preview area. */ public void previewTab(JTabbedPane tabPane, int tabIndex, Graphics g, int x, int y, int w, int h) { } /** * Checks whether the specified tab component is previewable. * * @param tabPane * Tabbed pane. * @param tabIndex * Tab index for the preview paint. * @return true if the specified tab component is * previewable, false otherwise. */ public boolean hasPreview(JTabbedPane tabPane, int tabIndex) { return false; } /** * Checks whether the specified tab component is sensitive to events. * Overriding implementation may decide that disabled tabs do not respond to * mouse and keyboard events, thus not allowing selecting the corresponding * tab. * * @param tabPane * Tabbed pane. * @param tabIndex * Tab index. * @return true if the specified tab component is sensitive * to events, false otherwise. */ public boolean isSensitiveToEvents(JTabbedPane tabPane, int tabIndex) { return false; } /** * Returns the screen bounds of the tab preview dialog window. * * @param tabPane * Tabbed pane. * @return Screen bounds of the preview dialog window of the specified * tabbed pane. */ public Rectangle getPreviewDialogScreenBounds(JTabbedPane tabPane) { Rectangle tabPaneBounds = tabPane.getBounds(); Point tabPaneScreenLoc = tabPane.getLocationOnScreen(); return new Rectangle(tabPaneScreenLoc.x, tabPaneScreenLoc.y, tabPaneBounds.width, tabPaneBounds.height); } /** * Returns the owner of the overview dialog of the specified tabbed pane. If * this function retuns a non-null value, the overview * dialog will be modal for the corresponding frame. * * @param tabPane * Tabbed pane. * @return If not null, the overview dialog for the * specified tabbed pane will be modal for the corresponding frame. */ public JFrame getModalOwner(JTabbedPane tabPane) { return null; } /** * Checks whether the specified tabbed pane has an overview dialog. * * @param tabPane * Tabbed pane. * @return true if the specified tabbed pane has an overview * dialog, false otherwise. */ public boolean hasOverviewDialog(JTabbedPane tabPane) { return false; } /** * Checks whether the specified tabbed pane has a preview window for the * specified tab. * * @param tabPane * Tabbed pane. * @param tabIndex * Tab index. * @return true if the specified tabbed pane has a preview * window for the specified tab, false otherwise. */ public boolean hasPreviewWindow(JTabbedPane tabPane, int tabIndex) { return false; } /** * Returns the dimension for the tab preview window. * * @param tabPane * Tabbed pane. * @param tabIndex * Tab index. * @return Dimension of the tab preview window for the specified tab in the * specified tabbed pane. */ public Dimension getPreviewWindowDimension(JTabbedPane tabPane, int tabIndex) { return new Dimension(300, 200); } /** * Returns extra delay (in milliseconds) for showing the tab preview window. * The base delay is 2000 milliseconds (2 seconds). This function must * return a non-negative value. * * @param tabPane * Tabbed pane. * @param tabIndex * Tab index. * @return Non-negative extra delay (in milliseconds) for showing the tab * preview window. */ public int getPreviewWindowExtraDelay(JTabbedPane tabPane, int tabIndex) { return 0; } /** * Returns indication whether the thumbnail preview should be updated * periodically. If the return value is true, then the * implementation of {@link #getUpdateCycle(JTabbedPane)} returns the * refresh cycle length in milliseconds. * * @param tabPane * Tabbed pane. * @return true if the thumbnail preview of the specified * tabbed pane should be updated periodically, false * otherwise. */ public boolean toUpdatePeriodically(JTabbedPane tabPane) { return false; } /** * If the result of {@link #toUpdatePeriodically(JTabbedPane)} is * true, returns the update cycle length in milliseconds. * * @param tabPane * Tabbed pane. * @return Update cycle length in milliseconds for the thumbnail preview of * the specified tabbed pane. */ public int getUpdateCycle(JTabbedPane tabPane) { return 10000; } /** * Returns the tab overview kind for the specified tabbed pane. Relevant if * {@link #hasOverviewDialog(JTabbedPane)} returns true for * the same tabbed pane. If {@link #hasOverviewDialog(JTabbedPane)} returns * true, the result should be not null. * * * @param tabPane * Tabbed pane. * @return Tab overview kind for the specified tabbed pane. * @since version 3.0 */ public TabOverviewKind getOverviewKind(JTabbedPane tabPane) { return TabOverviewKind.GRID; } /** * Returns indication whether the tab overview dialog should be * automatically disposed when it loses focus. * * @return if true, the tab overview dialog will be disposed * when it loses focus. */ public boolean toDisposeOverviewOnFocusLoss() { return true; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tabbed/TabPagerManager.java0000644000175000017500000004666311137001464027376 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tabbed; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.image.BufferedImage; import javax.swing.*; import org.jvnet.lafwidget.LafWidgetUtilities2; import org.jvnet.lafwidget.animation.*; import org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewCallback; import org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewInfo; /** * Tab pager manager. * * @author Kirill Grouchnikov */ public class TabPagerManager { /** * Fade kind for hiding the tab pager. */ public static final FadeKind HIDE_TAB_PAGER_FADE_KIND = new FadeKind( "lafwidget.tabbed.hideTabPagerFadeKind", true); /** * Singleton instance of the tab pager manager. */ protected static TabPagerManager instance; /** * The tabbed pane that is currently paged. */ protected JTabbedPane currTabbedPane; /** * Index of the central tab. */ protected int currTabIndex; /** * Index of the next tab. */ protected int nextTabIndex; /** * Index of the previous tab. */ protected int prevTabIndex; // protected Map smallPreviewMap; // // protected Map regularPreviewMap; // /** * Preview window for the left (previous) tab. */ protected JWindow prevTabWindow; /** * Preview window for the central (current) tab. */ protected JWindow currTabWindow; /** * Preview window for the right (next) tab. */ protected JWindow nextTabWindow; /** * Indicates whether the tab pager windows are visible. */ protected boolean isVisible; /** * Implementation of the tab preview callback for the tab pager. * * @author Kirill Grouchnikov. */ public class TabPagerPreviewCallback implements TabPreviewCallback { /** * The associated preview window. */ private JWindow previewWindow; /** * The associated tab preview control. */ private TabPreviewControl previewControl; /** * Creates a new tab preview callback for the tab pager. * * @param previewWindow * The associated preview window. * @param tabPane * The associated tab preview control. * @param tabIndex * Tab index. */ public TabPagerPreviewCallback(JWindow previewWindow, JTabbedPane tabPane, int tabIndex) { this.previewWindow = previewWindow; this.previewControl = new TabPreviewControl(tabPane, tabIndex); this.previewWindow.getContentPane().removeAll(); this.previewWindow.getContentPane().add(this.previewControl, BorderLayout.CENTER); this.previewWindow.getContentPane().doLayout(); this.previewControl.doLayout(); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewCallback#start(javax.swing.JTabbedPane, * int, org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewInfo) */ public void start(JTabbedPane tabPane, int tabCount, TabPreviewInfo tabPreviewInfo) { // Nothing to do since the callback was registered // for a specific tab. } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.tabbed.TabPreviewThread.TabPreviewCallback#offer(javax.swing.JTabbedPane, * int, java.awt.image.BufferedImage) */ public void offer(JTabbedPane tabPane, int tabIndex, BufferedImage componentSnap) { if (TabPagerManager.this.currTabbedPane != tabPane) { // has since been cancelled return; } if (!this.previewWindow.isVisible()) { // has since been hidden return; } this.previewControl.setPreviewImage(componentSnap, true); } } /** * Returns the tab pager instance. * * @return Tab pager instance. */ public static synchronized TabPagerManager getPager() { if (TabPagerManager.instance == null) TabPagerManager.instance = new TabPagerManager(); return TabPagerManager.instance; } /** * Constructs a new tab pager manager. Is made private to enforce single * instance. */ private TabPagerManager() { // this.smallPreviewMap = new HashMap(); // this.regularPreviewMap = new HashMap(); // Rectangle virtualBounds = new Rectangle(); // GraphicsEnvironment ge = GraphicsEnvironment // .getLocalGraphicsEnvironment(); // GraphicsDevice[] gds = ge.getScreenDevices(); // for (int i = 0; i < gds.length; i++) { // GraphicsDevice gd = gds[i]; // GraphicsConfiguration gc = gd.getDefaultConfiguration(); // virtualBounds = virtualBounds.union(gc.getBounds()); // } // // int screenWidth = virtualBounds.width; // int screenHeight = virtualBounds.height; this.currTabWindow = new JWindow(); this.currTabWindow.getContentPane().setLayout(new BorderLayout()); // int currWidth = screenWidth / 3; // int currHeight = screenHeight / 3; // this.currTabWindow.setSize(currWidth, currHeight); // // Fix for issue 178 on Substance (multiple screens) // this.currTabWindow.setLocation(currWidth + virtualBounds.x, // currHeight); this.currTabWindow.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { // fix for issue 177 in Substance (disallowing selection // of disabled tabs). TabPreviewPainter tpp = LafWidgetUtilities2 .getTabPreviewPainter(currTabbedPane); if (tpp.isSensitiveToEvents(currTabbedPane, currTabIndex)) { hide(); currTabbedPane.setSelectedIndex(currTabIndex); } } }); } }); this.currTabWindow .addMouseWheelListener(new TabPagerMouseWheelListener()); // int smallWidth = 2 * screenWidth / 9; // int smallHeight = 2 * screenHeight / 9; this.prevTabWindow = new JWindow(); this.prevTabWindow.getContentPane().setLayout(new BorderLayout()); // this.prevTabWindow.setSize(smallWidth, smallHeight); // // Fix for issue 178 on Substance (multiple screens) // this.prevTabWindow.setLocation((screenWidth / 18) + virtualBounds.x, // 7 * screenHeight / 18); this.prevTabWindow.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { // fix for issue 177 in Substance (disallowing selection // of disabled tabs). TabPreviewPainter tpp = LafWidgetUtilities2 .getTabPreviewPainter(currTabbedPane); if (tpp.isSensitiveToEvents(currTabbedPane, prevTabIndex)) { hide(); currTabbedPane.setSelectedIndex(prevTabIndex); } } }); } }); this.prevTabWindow .addMouseWheelListener(new TabPagerMouseWheelListener()); this.nextTabWindow = new JWindow(); // this.nextTabWindow.getContentPane().setLayout(new BorderLayout()); // this.nextTabWindow.setSize(smallWidth, smallHeight); // // Fix for issue 178 on Substance (multiple screens) // this.nextTabWindow.setLocation((13 * screenWidth / 18) // + virtualBounds.x, 7 * screenHeight / 18); this.nextTabWindow.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { // fix for issue 177 in Substance (disallowing selection // of disabled tabs). TabPreviewPainter tpp = LafWidgetUtilities2 .getTabPreviewPainter(currTabbedPane); if (tpp.isSensitiveToEvents(currTabbedPane, nextTabIndex)) { hide(); currTabbedPane.setSelectedIndex(nextTabIndex); } } }); } }); this.nextTabWindow .addMouseWheelListener(new TabPagerMouseWheelListener()); this.recomputeBounds(); this.isVisible = false; } /** * Recomputes the bounds of tab pager windows. */ private void recomputeBounds() { Rectangle virtualBounds = new Rectangle(); GraphicsEnvironment ge = GraphicsEnvironment .getLocalGraphicsEnvironment(); GraphicsDevice[] gds = ge.getScreenDevices(); for (int i = 0; i < gds.length; i++) { GraphicsDevice gd = gds[i]; GraphicsConfiguration gc = gd.getDefaultConfiguration(); virtualBounds = virtualBounds.union(gc.getBounds()); } int screenWidth = virtualBounds.width; int screenHeight = virtualBounds.height; int currWidth = screenWidth / 3; int currHeight = screenHeight / 3; this.currTabWindow.setSize(currWidth, currHeight); // Fix for issue 178 on Substance (multiple screens) this.currTabWindow.setLocation(currWidth + virtualBounds.x, currHeight); int smallWidth = 2 * screenWidth / 9; int smallHeight = 2 * screenHeight / 9; this.prevTabWindow.setSize(smallWidth, smallHeight); // Fix for issue 178 on Substance (multiple screens) this.prevTabWindow.setLocation((screenWidth / 18) + virtualBounds.x, 7 * screenHeight / 18); this.nextTabWindow.getContentPane().setLayout(new BorderLayout()); this.nextTabWindow.setSize(smallWidth, smallHeight); // Fix for issue 178 on Substance (multiple screens) this.nextTabWindow.setLocation((13 * screenWidth / 18) + virtualBounds.x, 7 * screenHeight / 18); } /** * Sets the tabbed pane on this tab pager manager. * * @param jtp * Tabbed pane to page. */ private void setTabbedPane(JTabbedPane jtp) { if (this.currTabbedPane == jtp) return; this.currTabbedPane = jtp; // this.smallPreviewMap.clear(); // this.regularPreviewMap.clear(); } /** * Flips the pages. * * @param tabbedPane * Tabbed pane. * @param isForward * if true, the tabs are flipped one page (tab) * forward, if false, the tabs are flipped one * page (tab) backward. */ public synchronized void page(JTabbedPane tabbedPane, boolean isForward) { this.setTabbedPane(tabbedPane); if (!this.isVisible) { this.recomputeBounds(); this.currTabWindow.setVisible(true); this.prevTabWindow.setVisible(true); this.nextTabWindow.setVisible(true); this.isVisible = true; this.currTabIndex = this.currTabbedPane.getSelectedIndex(); } int delta = isForward ? 1 : -1; this.currTabIndex += delta; if (this.currTabIndex == this.currTabbedPane.getTabCount()) this.currTabIndex = 0; if (this.currTabIndex == -1) this.currTabIndex = this.currTabbedPane.getTabCount() - 1; this.nextTabIndex = this.currTabIndex + 1; this.prevTabIndex = this.currTabIndex - 1; if (this.nextTabIndex == this.currTabbedPane.getTabCount()) this.nextTabIndex = 0; if (this.prevTabIndex == -1) this.prevTabIndex = this.currTabbedPane.getTabCount() - 1; TabPreviewThread.TabPreviewInfo currTabPreviewInfo = new TabPreviewThread.TabPreviewInfo(); currTabPreviewInfo.tabPane = this.currTabbedPane; currTabPreviewInfo.tabIndexToPreview = this.currTabIndex; currTabPreviewInfo.previewWidth = this.currTabWindow.getWidth() - 4; currTabPreviewInfo.previewHeight = this.currTabWindow.getHeight() - 20; currTabPreviewInfo.previewCallback = new TabPagerPreviewCallback( this.currTabWindow, this.currTabbedPane, this.currTabIndex); currTabPreviewInfo.initiator = this; TabPreviewPainter previewPainter = LafWidgetUtilities2 .getTabPreviewPainter(currTabPreviewInfo.tabPane); if ((previewPainter != null) && (previewPainter.hasPreviewWindow(this.currTabbedPane, this.currTabIndex))) { TabPreviewThread.getInstance().queueTabPreviewRequest( currTabPreviewInfo); } TabPreviewThread.TabPreviewInfo prevTabPreviewInfo = new TabPreviewThread.TabPreviewInfo(); prevTabPreviewInfo.tabPane = this.currTabbedPane; prevTabPreviewInfo.tabIndexToPreview = this.prevTabIndex; prevTabPreviewInfo.previewWidth = this.prevTabWindow.getWidth() - 4; prevTabPreviewInfo.previewHeight = this.prevTabWindow.getHeight() - 20; prevTabPreviewInfo.previewCallback = new TabPagerPreviewCallback( this.prevTabWindow, this.currTabbedPane, this.prevTabIndex); prevTabPreviewInfo.initiator = this; if ((previewPainter != null) && (previewPainter.hasPreviewWindow(this.currTabbedPane, this.prevTabIndex))) { TabPreviewThread.getInstance().queueTabPreviewRequest( prevTabPreviewInfo); } TabPreviewThread.TabPreviewInfo nextTabPreviewInfo = new TabPreviewThread.TabPreviewInfo(); nextTabPreviewInfo.tabPane = this.currTabbedPane; nextTabPreviewInfo.tabIndexToPreview = this.nextTabIndex; nextTabPreviewInfo.previewWidth = this.nextTabWindow.getWidth() - 4; nextTabPreviewInfo.previewHeight = this.nextTabWindow.getHeight() - 20; nextTabPreviewInfo.previewCallback = new TabPagerPreviewCallback( this.nextTabWindow, this.currTabbedPane, this.nextTabIndex); nextTabPreviewInfo.initiator = this; if ((previewPainter != null) && (previewPainter.hasPreviewWindow(this.currTabbedPane, this.nextTabIndex))) { TabPreviewThread.getInstance().queueTabPreviewRequest( nextTabPreviewInfo); } } /** * Flips the pages in the currently shown tabbed pane. * * @param isForward * if true, the tabs are flipped one page (tab) * forward, if false, the tabs are flipped one * page (tab) backward. */ public void page(boolean isForward) { if (this.currTabbedPane == null) return; this.page(this.currTabbedPane, isForward); } /** * Returns indication whether the tab pager windows are showing. * * @return true if the tab pager windows are visible, * false otherwise. */ public boolean isVisible() { return this.isVisible; } /** * Hides the tab pager windows. * * @return The index of the center (current) tab. */ public synchronized int hide() { int result = this.isVisible ? this.currTabIndex : -1; final Point currWindowLocation = this.currTabWindow.getLocation(); final Dimension currWindowSize = this.currTabWindow.getSize(); final Point nextWindowLocation = this.nextTabWindow.getLocation(); final Dimension nextWindowSize = this.nextTabWindow.getSize(); final Point prevWindowLocation = this.prevTabWindow.getLocation(); final Dimension prevWindowSize = this.prevTabWindow.getSize(); FadeTracker.getInstance().trackFadeOut(HIDE_TAB_PAGER_FADE_KIND, this.currTabbedPane, false, new UIThreadFadeTrackerAdapter() { @Override public void fadePerformed(FadeKind fadeKind, float fadeCycle) { int cx = currWindowLocation.x + currWindowSize.width / 2; int cy = currWindowLocation.y + currWindowSize.height / 2; int nWidth = (int) (currWindowSize.width * fadeCycle); int nHeight = (int) (currWindowSize.height * fadeCycle); currTabWindow.setBounds(cx - nWidth / 2, cy - nHeight / 2, nWidth, nHeight); cx = prevWindowLocation.x + prevWindowSize.width / 2; cy = prevWindowLocation.y + prevWindowSize.height / 2; nWidth = (int) (prevWindowSize.width * fadeCycle); nHeight = (int) (prevWindowSize.height * fadeCycle); prevTabWindow.setBounds(cx - nWidth / 2, cy - nHeight / 2, nWidth, nHeight); cx = nextWindowLocation.x + nextWindowSize.width / 2; cy = nextWindowLocation.y + nextWindowSize.height / 2; nWidth = (int) (nextWindowSize.width * fadeCycle); nHeight = (int) (nextWindowSize.height * fadeCycle); nextTabWindow.setBounds(cx - nWidth / 2, cy - nHeight / 2, nWidth, nHeight); currTabWindow.getRootPane().doLayout(); currTabWindow.repaint(); nextTabWindow.getRootPane().doLayout(); nextTabWindow.repaint(); prevTabWindow.getRootPane().doLayout(); prevTabWindow.repaint(); } @Override public void fadeEnded(FadeKind fadeKind) { currTabWindow.setVisible(false); currTabWindow.dispose(); prevTabWindow.setVisible(false); prevTabWindow.dispose(); nextTabWindow.setVisible(false); nextTabWindow.dispose(); } }); // FadeTracker.getInstance().trackFadeOut(HIDE_TAB_PAGER_FADE_KIND, // this.prevTabWindow, false, new FadeTrackerCallback() { // public void fadePerformed(FadeKind fadeKind, // float fadeCycle10) { // int cx = prevWindowLocation.x + prevWindowSize.width // / 2; // int cy = prevWindowLocation.y + prevWindowSize.height // / 2; // int nWidth = (int) (prevWindowSize.width * fadeCycle); // int nHeight = (int) (prevWindowSize.height // * fadeCycle); // prevTabWindow.setBounds(cx - nWidth / 2, cy - nHeight // / 2, nWidth, nHeight); // } // // public void fadeEnded(FadeKind fadeKind) { // prevTabWindow.setVisible(false); // prevTabWindow.dispose(); // } // }); // // FadeTracker.getInstance().trackFadeOut(HIDE_TAB_PAGER_FADE_KIND, // this.nextTabWindow, false, new FadeTrackerCallback() { // public void fadePerformed(FadeKind fadeKind, // float fadeCycle10) { // int cx = nextWindowLocation.x + nextWindowSize.width // / 2; // int cy = nextWindowLocation.y + nextWindowSize.height // / 2; // int nWidth = (int) (nextWindowSize.width * fadeCycle); // int nHeight = (int) (nextWindowSize.height // * fadeCycle); // nextTabWindow.setBounds(cx - nWidth / 2, cy - nHeight // / 2, nWidth, nHeight); // } // // public void fadeEnded(FadeKind fadeKind) { // nextTabWindow.setVisible(false); // nextTabWindow.dispose(); // } // }); // // this.prevTabWindow.setVisible(false); // this.prevTabWindow.dispose(); // this.nextTabWindow.setVisible(false); // this.nextTabWindow.dispose(); this.isVisible = false; return result; } /** * Resets the internal caches. */ public static void reset() { // TabPagerManager.instance.regularPreviewMap.clear(); // TabPagerManager.instance.smallPreviewMap.clear(); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tabbed/DefaultTabPreviewPainter.java0000644000175000017500000001127711137001464031307 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tabbed; import java.awt.*; import java.awt.image.BufferedImage; import javax.swing.JTabbedPane; import org.jvnet.lafwidget.LafWidgetUtilities; /** * Default implementation of the tab preview painter. The tab preview is a * scaled-down (as necessary) thumbnail of the relevant tab. * * @author Kirill Grouchnikov */ public class DefaultTabPreviewPainter extends TabPreviewPainter { /* * (non-Javadoc) * * @see org.jvnet.lafwidget.tabbed.TabPreviewPainter#hasPreview(javax.swing.JTabbedPane, * int) */ public boolean hasPreview(JTabbedPane tabPane, int tabIndex) { return (tabPane.getComponentAt(tabIndex) != null); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.tabbed.TabPreviewPainter#isSensitiveToEvents(javax.swing.JTabbedPane, * int) */ public boolean isSensitiveToEvents(JTabbedPane tabPane, int tabIndex) { return tabPane.isEnabledAt(tabIndex); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.tabbed.TabPreviewPainter#previewTab(javax.swing.JTabbedPane, * int, java.awt.Graphics, int, int, int, int) */ public void previewTab(JTabbedPane tabPane, int tabIndex, Graphics g, int x, int y, int w, int h) { Component tabComponent = tabPane.getComponentAt(tabIndex); if (tabComponent == null) return; // if (!tabComponent.isShowing()) // return; int compWidth = tabComponent.getWidth(); int compHeight = tabComponent.getHeight(); if ((compWidth > 0) && (compHeight > 0)) { // draw tab component BufferedImage tempCanvas = new BufferedImage(compWidth, compHeight, BufferedImage.TYPE_INT_ARGB); Graphics tempCanvasGraphics = tempCanvas.getGraphics(); tabComponent.paint(tempCanvasGraphics); // check if need to scale down double coef = Math.min((double) w / (double) compWidth, (double) h / (double) compHeight); // fix for issue 177 in Substance - disabled tabs painted in // 50% opacity. Graphics2D g2 = (Graphics2D) g.create(); if (!tabPane.isEnabledAt(tabIndex)) { g2.setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_OVER, 0.5f)); } if (coef < 1.0) { int sdWidth = (int) (coef * compWidth); int sdHeight = (int) (coef * compHeight); int dx = (w - sdWidth) / 2; int dy = (h - sdHeight) / 2; g2.drawImage(LafWidgetUtilities.createThumbnail(tempCanvas, sdWidth), dx, dy, null); } else { // System.out.println("Putting " + frame.hashCode() + " // -> " + snapshot.hashCode()); g2.drawImage(tempCanvas, 0, 0, null); } g2.dispose(); } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.tabbed.TabPreviewPainter#hasPreviewWindow(javax.swing.JTabbedPane, * int) */ public boolean hasPreviewWindow(JTabbedPane tabPane, int tabIndex) { return true; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.tabbed.TabPreviewPainter#hasOverviewDialog(javax.swing.JTabbedPane) */ public boolean hasOverviewDialog(JTabbedPane tabPane) { return true; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tabbed/TabPagerMouseWheelListener.java0000644000175000017500000000604411137001464031574 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tabbed; import java.awt.event.*; import javax.swing.JTabbedPane; /** * Mouse wheel listener for the {@link TabPagerWidget}. * * @author Kirill Grouchnikov */ public class TabPagerMouseWheelListener implements MouseWheelListener { /** * The associated tabbed pane (may be null). */ protected JTabbedPane tabbedPane; /** * Creates a new mouse wheel listener on the currently paged tabbed pane. */ public TabPagerMouseWheelListener() { this(null); } /** * Creates a new mouse wheel listener on the specified tabbed pane. * * @param tabbedPane * Tabbed pane. */ public TabPagerMouseWheelListener(JTabbedPane tabbedPane) { this.tabbedPane = tabbedPane; } /* * (non-Javadoc) * * @see java.awt.event.MouseWheelListener#mouseWheelMoved(java.awt.event.MouseWheelEvent) */ public void mouseWheelMoved(MouseWheelEvent e) { if (((e.getModifiers() & InputEvent.CTRL_MASK) != 0) && e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) { int amount = e.getWheelRotation(); TabPagerManager te = TabPagerManager.getPager(); if (amount > 0) { if (this.tabbedPane != null) te.page(this.tabbedPane, true); else te.page(true); } else { if (this.tabbedPane != null) te.page(this.tabbedPane, false); else te.page(false); } } } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/tabbed/TabPreviewThread.java0000644000175000017500000003526611137001464027613 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.tabbed; import java.awt.*; import java.awt.image.BufferedImage; import java.util.*; import java.util.List; import javax.swing.JTabbedPane; import javax.swing.SwingUtilities; import org.jvnet.lafwidget.LafWidgetUtilities; import org.jvnet.lafwidget.LafWidgetUtilities2; import org.jvnet.lafwidget.utils.DeltaQueue; import org.jvnet.lafwidget.utils.TrackableThread; import org.jvnet.lafwidget.utils.DeltaQueue.DeltaMatcher; import org.jvnet.lafwidget.utils.DeltaQueue.Deltable; /** * Thread for running the tab preview requests. * * @author Kirill Grouchnikov */ public class TabPreviewThread extends TrackableThread { /** * Indication whether a stop request has been issued on this * thread. */ private boolean stopRequested; /** * Queue of preview requests. Contains {@link TabPreviewInfo}s. */ protected DeltaQueue previewQueue; /** * Information for previewing a tabbed pane. * * @author Kirill Grouchnikov */ public static class TabPreviewInfo extends DeltaQueue.Deltable { /** * Tabbed pane. */ public JTabbedPane tabPane; /** * Callback for passing the preview thumbnail once it is computed. */ public TabPreviewThread.TabPreviewCallback previewCallback; /** * Width of the preview thumbnail. */ public int previewWidth; /** * Height of the preview thumbnail. */ public int previewHeight; /** * Indicates whether all tabs in the {@link #tabPane} should be * previewed. */ public boolean toPreviewAllTabs; /** * If {@link #toPreviewAllTabs} is false, contains the * index of the tab to be previewed. */ public int tabIndexToPreview; /** * Points to the preview initiator. */ public Object initiator; } /** * Interface for offering the tab preview image once it has been computed. * * @author Kirill Grouchnikov */ public static interface TabPreviewCallback { /** * Starts the current cycle of * {@link #offer(JTabbedPane, int, BufferedImage)} calls. This can be * used by the implementing class to revalidate itself in case the tab * count in the specified tabbed pane has changed since the previous * cycle of {@link #offer(JTabbedPane, int, BufferedImage)} call. * * @param tabPane * Tabbed pane. * @param tabCount * Tab count in the tabbed pane. * @param tabPreviewInfo * Tab preview info. Can be changed in the implementation * code. */ public void start(JTabbedPane tabPane, int tabCount, TabPreviewInfo tabPreviewInfo); /** * Offers the preview image (thumbnail) of a tab in the specified tabbed * pane. * * @param tabPane * Tabbed pane. * @param tabIndex * Tab index. * @param componentSnap * Tab preview image. */ public void offer(JTabbedPane tabPane, int tabIndex, BufferedImage componentSnap); } /** * Simple constructor. Defined private for singleton. * * @see #getInstance() */ private TabPreviewThread() { super(); this.setName("Laf-Widget tab preview"); this.stopRequested = false; this.previewQueue = new DeltaQueue(); } /* * (non-Javadoc) * * @see java.lang.Thread#run() */ @Override public void run() { while (!this.stopRequested) { try { // System.out.println(System.currentTimeMillis() + " Polling"); int delay = 500; List expired = this.dequeueTabPreviewRequest(delay); for (Deltable dExpired : expired) { final TabPreviewInfo nextPreviewInfo = (TabPreviewInfo) dExpired; final JTabbedPane jtp = nextPreviewInfo.tabPane; if (jtp == null) continue; final TabPreviewPainter previewPainter = LafWidgetUtilities2 .getTabPreviewPainter(jtp); final int tabCount = jtp.getTabCount(); // SwingUtilities.invokeLater(new Runnable() { // public void run() { // final TabPreviewInfo copyPreviewInfo = new // TabPreviewInfo(); // copyPreviewInfo.initiator = nextPreviewInfo.initiator; // copyPreviewInfo.previewCallback = // nextPreviewInfo.previewCallback; // copyPreviewInfo.previewHeight = // nextPreviewInfo.previewHeight; // copyPreviewInfo.previewWidth = // nextPreviewInfo.previewWidth; // copyPreviewInfo.tabIndexToPreview = // nextPreviewInfo.tabIndexToPreview; // copyPreviewInfo.tabPane = nextPreviewInfo.tabPane; // copyPreviewInfo.toPreviewAllTabs = // nextPreviewInfo.toPreviewAllTabs; if (nextPreviewInfo.toPreviewAllTabs) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { // The call to start() is only relevant for the // preview of all tabs. nextPreviewInfo.previewCallback.start(jtp, jtp .getTabCount(), nextPreviewInfo); } }); for (int i = 0; i < tabCount; i++) { final int index = i; SwingUtilities.invokeLater(new Runnable() { public void run() { getSingleTabPreviewImage(jtp, previewPainter, nextPreviewInfo, index); } }); } } else { SwingUtilities.invokeLater(new Runnable() { public void run() { getSingleTabPreviewImage(jtp, previewPainter, nextPreviewInfo, nextPreviewInfo.tabIndexToPreview); } }); } // } // }); if (previewPainter.toUpdatePeriodically(jtp)) { TabPreviewInfo cyclePreviewInfo = new TabPreviewInfo(); // copy all the fields from the currently processed // request cyclePreviewInfo.tabPane = nextPreviewInfo.tabPane; cyclePreviewInfo.tabIndexToPreview = nextPreviewInfo.tabIndexToPreview; cyclePreviewInfo.toPreviewAllTabs = nextPreviewInfo.toPreviewAllTabs; cyclePreviewInfo.previewCallback = nextPreviewInfo.previewCallback; cyclePreviewInfo.previewWidth = nextPreviewInfo.previewWidth; cyclePreviewInfo.previewHeight = nextPreviewInfo.previewHeight; cyclePreviewInfo.initiator = nextPreviewInfo.initiator; // schedule it to app-specific delay cyclePreviewInfo.setDelta(previewPainter .getUpdateCycle(cyclePreviewInfo.tabPane)); // queue the new request this.queueTabPreviewRequest(cyclePreviewInfo); } } Thread.sleep(delay); } catch (InterruptedException ie) { ie.printStackTrace(); } } // System.out.println("Tab preview finished"); } /** * Computes and offers the preview thumbnail for a single tab. * * @param tabPane * Tabbed pane. * @param previewPainter * Tab preview painter. * @param previewInfo * Preview info. * @param tabIndex * Index of the tab to preview. */ protected void getSingleTabPreviewImage(final JTabbedPane tabPane, final TabPreviewPainter previewPainter, final TabPreviewInfo previewInfo, final int tabIndex) { int pWidth = previewInfo.previewWidth; int pHeight = previewInfo.previewHeight; final BufferedImage previewImage = new BufferedImage(pWidth, pHeight, BufferedImage.TYPE_INT_ARGB); Graphics2D gr = previewImage.createGraphics(); Component comp = tabPane.getComponentAt(tabIndex); if (previewPainter.hasPreview(tabPane, tabIndex)) { Map dbSnapshot = new HashMap(); LafWidgetUtilities.makePreviewable(comp, dbSnapshot); previewPainter.previewTab(tabPane, tabIndex, gr, 0, 0, pWidth, pHeight); LafWidgetUtilities.restorePreviewable(comp, dbSnapshot); } else { gr.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); gr.setColor(Color.red); gr.setStroke(new BasicStroke(Math.max(5.0f, Math.min(pWidth, pHeight) / 10.0f))); gr.drawLine(0, 0, pWidth, pHeight); gr.drawLine(0, pHeight, pWidth, 0); } gr.dispose(); if (previewInfo.previewCallback != null) { SwingUtilities.invokeLater(new Runnable() { public void run() { previewInfo.previewCallback.offer(tabPane, tabIndex, previewImage); } }); } } /** * Queues the request to preview one or all tabs in the specified tabbed * pane. Once the request is queued, the thread will pick it up from the * queue (in at most 500 milliseconds in the current implementation) and * start processing it. For each tab (if all tabs were requested to be * previewed), the preview thumbnail will be offered to the relevant * callback. This allows to maintain the interactivity of the application * while generating the preview thumbnails for the tab overview dialog (see * {@link TabOverviewDialog}). * * @param previewInfo * Tab preview info. */ public void queueTabPreviewRequest(TabPreviewInfo previewInfo) { this.previewQueue.queue(previewInfo); } /** * Cancels all tab preview requests that were initiated by the specified * initiator. * * @param initiator * Initiator. */ public void cancelTabPreviewRequests(final Object initiator) { DeltaMatcher matcher = new DeltaMatcher() { public boolean matches(Deltable deltable) { TabPreviewInfo currInfo = (TabPreviewInfo) deltable; return (currInfo.initiator == initiator); } }; this.previewQueue.removeMatching(matcher); } /** * Removes the tab preview requests that have at most specified delay left. * * @param delay * Delay. * @return The list of all tab preview requests that have at most specified * delay left. */ private List dequeueTabPreviewRequest(int delay) { return this.previewQueue.dequeue(delay); } /* * (non-Javadoc) * * @see org.jvnet.substance.utils.SubstanceThread#requestStop() */ @Override protected void requestStop() { this.stopRequested = true; TabPreviewThread.tabPreviewThread = null; // System.err.println("Stopping "); // Thread.dumpStack(); } /** * The preview thread. */ private static TabPreviewThread tabPreviewThread; /** * Returns the singleton instance of the tab preview thread. * * @return The singleton instance of the tab preview thread. */ public static synchronized TabPreviewThread getInstance() { if (TabPreviewThread.tabPreviewThread == null) { // System.err.println("Allocating "); // Thread.dumpStack(); TabPreviewThread.tabPreviewThread = new TabPreviewThread(); TabPreviewThread.tabPreviewThread.start(); } return TabPreviewThread.tabPreviewThread; } /** * Returns indication whether tab preview thread is running. * * @return true if the tab preview thread is running, * false otherwise. */ public static synchronized boolean instanceRunning() { return (TabPreviewThread.tabPreviewThread != null); } // public void dump() { // System.out.println("Dump"); // for (int i = 0; i < this.previewRequests.size(); i++) { // TabPreviewInfo tpi = (TabPreviewInfo) this.previewRequests.get(i); // System.out.println("\t" + tpi.tabIndexToPreview + " -> " // + tpi.timeToExpire); // } // } // // public static void main(String[] args) { // TabPreviewThread tpt = new TabPreviewThread(); // TabPreviewInfo tpi11 = new TabPreviewInfo(); // tpi11.tabIndexToPreview = 11; // tpi11.timeToExpire = 100; // tpt.queueTabPreviewRequest(tpi11); // tpt.dump(); // // TabPreviewInfo tpi12 = new TabPreviewInfo(); // tpi12.tabIndexToPreview = 12; // tpi12.timeToExpire = 100; // tpt.queueTabPreviewRequest(tpi12); // tpt.dump(); // // TabPreviewInfo tpi21 = new TabPreviewInfo(); // tpi21.tabIndexToPreview = 21; // tpi21.timeToExpire = 200; // tpt.queueTabPreviewRequest(tpi21); // tpt.dump(); // // TabPreviewInfo tpi31 = new TabPreviewInfo(); // tpi31.tabIndexToPreview = 31; // tpi31.timeToExpire = 300; // tpt.queueTabPreviewRequest(tpi31); // tpt.dump(); // // TabPreviewInfo tpi13 = new TabPreviewInfo(); // tpi13.tabIndexToPreview = 13; // tpi13.timeToExpire = 100; // tpt.queueTabPreviewRequest(tpi13); // tpt.dump(); // // TabPreviewInfo tpi22 = new TabPreviewInfo(); // tpi22.tabIndexToPreview = 22; // tpi22.timeToExpire = 200; // tpt.queueTabPreviewRequest(tpi22); // tpt.dump(); // // TabPreviewInfo tpi25 = new TabPreviewInfo(); // tpi25.tabIndexToPreview = 25; // tpi25.timeToExpire = 250; // tpt.queueTabPreviewRequest(tpi25); // tpt.dump(); // // TabPreviewInfo tpi51 = new TabPreviewInfo(); // tpi51.tabIndexToPreview = 51; // tpi51.timeToExpire = 500; // tpt.queueTabPreviewRequest(tpi51); // tpt.dump(); // // List gr150 = tpt.dequeueTabPreviewRequest(2500); // System.out.println("Dump 150"); // for (int i = 0; i < gr150.size(); i++) { // TabPreviewInfo tpi = (TabPreviewInfo) gr150.get(i); // System.out.println("\t" + tpi.tabIndexToPreview); // } // tpt.dump(); // // TrackableThread.requestStopAllThreads(); // } }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/preview/0000755000175000017500000000000011253454710024001 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/preview/DefaultPreviewPainter.java0000644000175000017500000001100111137001462031077 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.preview; import java.awt.*; import java.awt.image.BufferedImage; import javax.swing.JViewport; import org.jvnet.lafwidget.LafWidgetUtilities; /** * Default implementation of the component preview painter. The component * preview is a scaled-down (as necessary) thumbnail of the relevant component. * * @author Kirill Grouchnikov */ public class DefaultPreviewPainter extends PreviewPainter { /* * (non-Javadoc) * * @see org.jvnet.lafwidget.PreviewPainter#hasPreview(java.awt.Container, * java.awt.Component, int) */ public boolean hasPreview(Container parent, Component component, int componentIndex) { return (component != null); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.preview.PreviewPainter#previewComponent(java.awt.Container, * java.awt.Component, int, java.awt.Graphics, int, int, int, int) */ public void previewComponent(Container parent, Component component, int componentIndex, Graphics g, int x, int y, int w, int h) { if (component == null) return; int compWidth = component.getWidth(); int compHeight = component.getHeight(); if ((compWidth > 0) && (compHeight > 0)) { // draw component BufferedImage tempCanvas = new BufferedImage(compWidth, compHeight, BufferedImage.TYPE_INT_ARGB); Graphics tempCanvasGraphics = tempCanvas.getGraphics(); component.paint(tempCanvasGraphics); // check if need to scale down double coef = Math.min((double) w / (double) compWidth, (double) h / (double) compHeight); if (coef < 1.0) { int sdWidth = (int) (coef * compWidth); int sdHeight = (int) (coef * compHeight); int dx = x + (w - sdWidth) / 2; int dy = y + (h - sdHeight) / 2; g.drawImage(LafWidgetUtilities.createThumbnail(tempCanvas, sdWidth), dx, dy, null); } else { g.drawImage(tempCanvas, x, y, null); } } } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.PreviewPainter#hasPreviewWindow(java.awt.Container, * java.awt.Component, int) */ public boolean hasPreviewWindow(Container parent, Component component, int componentIndex) { return true; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.preview.PreviewPainter#getPreviewWindowDimension(java.awt.Container, * java.awt.Component, int) */ public Dimension getPreviewWindowDimension(Container parent, Component component, int componentIndex) { Dimension superResult = super.getPreviewWindowDimension(parent, component, componentIndex); if (parent instanceof JViewport) { Rectangle viewportRect = ((JViewport) parent).getViewRect(); int width = Math.min(viewportRect.width / 3, superResult.width); int height = Math.min(viewportRect.height / 3, superResult.height); return new Dimension(width, height); } return superResult; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/preview/PreviewPainter.java0000644000175000017500000001466111137001462027611 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.preview; import java.awt.*; /** * Base class for component preview painters. * * @author Kirill Grouchnikov */ public abstract class PreviewPainter { /** * Draws a component preview on the specified graphics. * * @param parent * Component parent. May be null. * @param component * Component. May be null. * @param componentIndex * Component index in its parent. May be negative. * @param g * Graphics context. * @param x * X coordinate of the preview area. * @param y * Y coordinate of the preview area. * @param w * Width of the preview area. * @param h * Height of the preview area. */ public void previewComponent(Container parent, Component component, int componentIndex, Graphics g, int x, int y, int w, int h) { } /** * Checks whether the specified component is previewable. * * @param parent * Component parent. May be null. * @param component * Component. May be null. * @param componentIndex * Component index in its parent. May be negative. * @return true if the specified component is previewable, * false otherwise. */ public boolean hasPreview(Container parent, Component component, int componentIndex) { return false; } /** * Checks whether the specified component has a preview window. * * @param parent * Component parent. May be null. * @param component * Component. May be null. * @param componentIndex * Component index in its parent. May be negative. * @return true if the specified component has a preview * window, false otherwise. */ public boolean hasPreviewWindow(Container parent, Component component, int componentIndex) { return false; } /** * Returns the dimension for the component preview window. * * @param parent * Component parent. May be null. * @param component * Component. May be null. * @param componentIndex * Component index in its parent. May be negative. * @return Dimension of the component preview window. */ public Dimension getPreviewWindowDimension(Container parent, Component component, int componentIndex) { return new Dimension(300, 200); } /** * Returns extra delay (in milliseconds) for showing the component preview * window. The base delay is 2000 milliseconds (2 seconds). This function * must return a non-negative value. Note that this method may not be called * in some preview scenarios (that require immediate preview functionality). * * @param parent * Component parent. May be null. * @param component * Component. May be null. * @param componentIndex * Component index in its parent. May be negative. * @return Non-negative extra delay (in milliseconds) for showing the * component preview window. */ public int getPreviewWindowExtraDelay(Container parent, Component component, int componentIndex) { return 0; } /** * Returns indication whether the thumbnail preview should be updated * periodically. If the return value is true, then the * implementation of {@link #getUpdateCycle(Container, Component, int)} * returns the refresh cycle length in milliseconds. * * @param parent * Component parent. May be null. * @param component * Component. May be null. * @param componentIndex * Component index in its parent. May be negative. * @return true if the thumbnail preview of the specified * component should be updated periodically, false * otherwise. */ public boolean toUpdatePeriodically(Container parent, Component component, int componentIndex) { return false; } /** * If the result of {@link #toUpdatePeriodically(Container, Component, int)} * is true, returns the update cycle length in milliseconds. * * @param parent * Component parent. May be null. * @param component * Component. May be null. * @param componentIndex * Component index in its parent. May be negative. * @return Update cycle length in milliseconds for the thumbnail preview of * the specified component. */ public int getUpdateCycle(Container parent, Component component, int componentIndex) { return 10000; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/preview/InternalFramePreviewPainter.java0000644000175000017500000000671610530065022032261 0ustar drazzibdrazzibpackage org.jvnet.lafwidget.preview; import java.awt.*; import java.awt.image.BufferedImage; import java.util.WeakHashMap; import javax.swing.*; import javax.swing.border.Border; import javax.swing.plaf.basic.BasicInternalFrameUI; import org.jvnet.lafwidget.LafWidgetUtilities; public class InternalFramePreviewPainter extends DefaultPreviewPainter { /** * Snapshot map. */ private static WeakHashMap snapshots = new WeakHashMap(); public static void refreshSnaphost(JInternalFrame frame) { if (!frame.isShowing()) return; // Draw the current state of the internal frame to a // temp image (w/o border and decorations). It would be nice // to use Robot, but this frame may be partially obscured, // so we take our chances that the frame will be properly // drawn by the user code. int frameWidth = frame.getWidth(); int frameHeight = frame.getHeight(); int dx = 0; int dy = 0; // Now we need to remove the border and the title pane :) Border internalFrameBorder = UIManager .getBorder("InternalFrame.border"); Insets borderInsets = internalFrameBorder.getBorderInsets(frame); dx += borderInsets.left; dy += borderInsets.top; frameWidth -= (borderInsets.left + borderInsets.right); frameHeight -= (borderInsets.top + borderInsets.bottom); BasicInternalFrameUI frameUI = (BasicInternalFrameUI) frame.getUI(); JComponent frameTitlePane = frameUI.getNorthPane(); if (frameTitlePane != null) { dy += frameTitlePane.getHeight(); frameHeight -= frameTitlePane.getHeight(); } // fix for defect 112 - checking frame height and width if ((frameWidth > 0) && (frameHeight > 0)) { // draw frame (note the canvas translation) BufferedImage tempCanvas = new BufferedImage(frameWidth, frameHeight, BufferedImage.TYPE_INT_ARGB); Graphics tempCanvasGraphics = tempCanvas.getGraphics(); tempCanvasGraphics.translate(-dx, -dy); frame.paint(tempCanvasGraphics); int maxWidth = UIManager.getInt("DesktopIcon.width"); int maxHeight = maxWidth; // check if need to scale down double coef = Math.min((double) maxWidth / (double) frameWidth, (double) maxHeight / (double) frameHeight); if (coef < 1.0) { int sdWidth = (int) (coef * frameWidth); // int sdHeight = (int) (coef * frameHeight); // BufferedImage scaledDown = new BufferedImage(sdWidth, // sdHeight, // BufferedImage.TYPE_INT_ARGB); // Graphics g = scaledDown.getGraphics(); // g.drawImage(tempCanvas, 0, 0, sdWidth, sdHeight, 0, 0, // frameWidth, frameHeight, null); BufferedImage scaledDown = LafWidgetUtilities.createThumbnail( tempCanvas, sdWidth); // System.out.println("Putting " + frame.hashCode() + " // -> " + scaledDown.hashCode()); snapshots.put(frame, scaledDown); } else { // System.out.println("Putting " + frame.hashCode() + " // -> " + snapshot.hashCode()); snapshots.put(frame, tempCanvas); } } } public void previewComponent(Container parent, Component component, int componentIndex, Graphics g, int x, int y, int w, int h) { BufferedImage preview = (BufferedImage) snapshots.get(component); if (preview != null) { g.drawImage(preview, x, y, null); } } public Dimension getPreviewWindowDimension(Container parent, Component component, int componentIndex) { return new Dimension(UIManager.getInt("DesktopIcon.width"), UIManager .getInt("DesktopIcon.width")); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/0000755000175000017500000000000011253454712024301 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/FadeState.java0000644000175000017500000002247211137001460027000 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation; /** * Information on the state of the faded component. * * @author Kirill Grouchnikov */ public class FadeState { /** * Is used to create unique value for the {@link #id} field. */ protected static long counter; /** * Unique ID. */ protected long id; /** * Fade cycle. */ private float fadePosition; /** * Indication whether it's a fade-in or fade-out. */ private boolean isFadingIn; /** * Indication whether it's looping (infinite). */ private boolean isLooping; /** * Indication whether the looping fade starts fading out after reaching the * maximum value. Relevant only when {@link #isLooping} is true. */ private boolean isLoopingReverse; /** * Indication how many loop cycles are left. Relevant only when * {@link #isLooping} is true. Contains -1 for endless loop. */ private int loopCount; /** * Indication whether the looping fade should stop at reaching the end of * the fade-out cycle. Relevant only when {@link #isLooping} is * true. */ private boolean toStopAtCycleBreak; /** * Indication whether the component parent should be repainted on each fade * cycle. */ private boolean toRepaintParent; /** * The optional callback to be called on each fade cycle. */ private FadeTrackerCallback callback; /** * Fade animation step. */ public FadeStep fadeStep; /** * Fade animation kind. */ public FadeKind fadeKind; /** * Simple constructor. * * @param fadeKind * Fade animation kind. * @param fadePosition * Fade cycle. * @param isFadingIn * Indication whether it's a fade-in or fade-out. * @param toRepaintParent * Indication whether the component parent should be repainted on * each fade cycle. */ public FadeState(FadeKind fadeKind, float fadePosition, boolean isFadingIn, boolean toRepaintParent) { super(); this.fadeKind = fadeKind; this.fadePosition = fadePosition; this.isFadingIn = isFadingIn; this.toRepaintParent = toRepaintParent; this.id = FadeState.getId(); this.isLooping = false; this.toStopAtCycleBreak = false; this.loopCount = -1; } /** * Private constructor - to prevent creation from outer packages. */ private FadeState() { super(); } /** * Returns a copy. * * @return Fade state copy. */ public FadeState getCopy() { FadeState result = new FadeState(); result.fadeKind = fadeKind; result.fadePosition = fadePosition; result.isFadingIn = isFadingIn; result.toRepaintParent = toRepaintParent; result.id = this.id; result.isLooping = this.isLooping; result.isLoopingReverse = this.isLoopingReverse; result.toStopAtCycleBreak = this.toStopAtCycleBreak; result.fadeStep = this.fadeStep; result.callback = this.callback; result.loopCount = this.loopCount; return result; } /** * Sets indication that looping fade should stop at the end of the fade-out * cycle. */ public void toStopAtCycleBreak() { if (!this.isLooping) throw new IllegalArgumentException( "Supported only on looping fades"); this.toStopAtCycleBreak = true; } /** * Returns a unique ID. * * @return Unique ID. */ protected static synchronized long getId() { return counter++; } /** * Sets the callback. * * @param callback * Callback. */ public void setCallback(FadeTrackerCallback callback) { if (FadeTracker.DEBUG_MODE) { System.out.println("Setting callback of " + this.id + " to " + callback); } this.callback = callback; } /** * Returns the application callback. The result may be null. * * @return Possible null application callback. */ public FadeTrackerCallback getCallback() { return callback; } /** * Sets the current fade position. Valid range is 0.0-1.0. * * @param fadePosition * New fade position. */ public void setFadePosition(float fadePosition) { this.fadePosition = fadePosition; } /** * Returns the current fade position. * * @return The current fade position. */ public float getFadePosition() { return fadePosition; } /** * Sets fade-in / fade-out indication. * * @param isFadingIn * true if the current animation is fade-in, * false if the current animation is fade-out. */ public void setFadingIn(boolean isFadingIn) { this.isFadingIn = isFadingIn; } /** * Returns the fade-in / fade-out indication. * * @return true if the current animation is fade-in, * false if the current animation is fade-out. */ public boolean isFadingIn() { return isFadingIn; } /** * Sets the looping indication. * * @param isLooping * New value for the looping indication. */ public void setLooping(boolean isLooping) { this.isLooping = isLooping; } /** * Returns the looping indication. * * @return true if the animation is looping, * false otherwise. */ public boolean isLooping() { return isLooping; } /** * Sets indication whether the looping fade starts fading out after reaching * the maximum value. * * @param isLoopingReverse * true if the looping animation should start * fading out after reaching the maximum value, * false otherwise. */ public void setLoopingReverse(boolean isLoopingReverse) { this.isLoopingReverse = isLoopingReverse; } /** * Returns indication whether the looping fade starts fading out after * reaching the maximum value. * * @return true if the looping animation should start fading * out after reaching the maximum value, false * otherwise. */ public boolean isLoopingReverse() { return isLoopingReverse; } /** * Sets indication whether the looping fade should stop at reaching the end * of the fade-out cycle. * * @param toStopAtCycleBreak * true if the looping indication should stop at * the next fade-out cycle end, false otherwise. */ public void setToStopAtCycleBreak(boolean toStopAtCycleBreak) { this.toStopAtCycleBreak = toStopAtCycleBreak; } /** * Returns indication whether the looping fade should stop at reaching the * end of the fade-out cycle. * * @return true if the looping indication should stop at the * next fade-out cycle end, false otherwise. */ public boolean isToStopAtCycleBreak() { return toStopAtCycleBreak; } /** * Sets indication whether the component parent should be repainted on each * fade cycle. * * @param toRepaintParent * true if the component parent should be * repainted on each fade cycle, false otherwise. */ public void setToRepaintParent(boolean toRepaintParent) { this.toRepaintParent = toRepaintParent; } /** * Returns indication whether the component parent should be repainted on * each fade cycle. * * @return true if the component parent should be repainted * on each fade cycle, false otherwise. */ public boolean isToRepaintParent() { return toRepaintParent; } public int getLoopCount() { return loopCount; } public void setLoopCount(int loopCount) { this.loopCount = loopCount; } }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/FadeConfigurationManager.java0000644000175000017500000002454011137001460032020 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation; import java.awt.Component; import java.util.*; import org.jvnet.lafwidget.LafWidget; import org.jvnet.lafwidget.utils.LafConstants.AnimationKind; /** * Fade configuration manager. * * @author Kirill Grouchnikov * @since 2.1 */ public class FadeConfigurationManager { /** * Singleton instance. */ private static FadeConfigurationManager instance; /** * Contains {@link FadeKind} instances. */ private Set globalAllowed; /** * Key - {@link FadeKind}, value - set of {@link Class} instances. */ private Map>> classAllowed; /** * Key - {@link FadeKind}, value - set of {@link Class} instances. */ private Map>> classDisallowed; /** * Key - {@link FadeKind}, value - set of {@link Component} instances. */ private Map> instanceAllowed; /** * Key - {@link FadeKind}, value - set of {@link Component} instances. */ private Map> instanceDisallowed; /** * Returns the configuration manager instance. * * @return Configuration manager instance. */ public static synchronized FadeConfigurationManager getInstance() { if (instance == null) { instance = new FadeConfigurationManager(); } return instance; } /** * Creates a new instance. */ private FadeConfigurationManager() { this.globalAllowed = new HashSet(); this.classAllowed = new HashMap>>(); this.classDisallowed = new HashMap>>(); this.instanceAllowed = new HashMap>(); this.instanceDisallowed = new HashMap>(); } /** * Allows fade of the specified kind on all controls. * * @param fadeKind * Fade kind to allow. */ public synchronized void allowFades(FadeKind fadeKind) { this.globalAllowed.add(fadeKind); } /** * Allows fade of the specified kind on all controls of specified class. * * @param fadeKind * Fade kind to allow. * @param clazz * Control class for allowing the fade kind. */ public synchronized void allowFades(FadeKind fadeKind, Class clazz) { Set> existingAllowed = this.classAllowed.get(fadeKind); if (existingAllowed == null) { existingAllowed = new HashSet>(); this.classAllowed.put(fadeKind, existingAllowed); } existingAllowed.add(clazz); Set> existingDisallowed = this.classDisallowed.get(fadeKind); if (existingDisallowed != null) { existingDisallowed.remove(clazz); } } /** * Allows fade of the specified kind on all controls of specified classes. * * @param fadeKind * Fade kind to allow. * @param clazz * Control classes for allowing the fade kind. */ public synchronized void allowFades(FadeKind fadeKind, Class[] clazz) { for (int i = 0; i < clazz.length; i++) { allowFades(fadeKind, clazz[i]); } } /** * Allows fade of the specified kind on the specified control. * * @param fadeKind * Fade kind to allow. * @param comp * Control for allowing the fade kind. */ public synchronized void allowFades(FadeKind fadeKind, Component comp) { Set existingAllowed = this.instanceAllowed.get(fadeKind); if (existingAllowed == null) { existingAllowed = new HashSet(); this.instanceAllowed.put(fadeKind, existingAllowed); } existingAllowed.add(comp); Set existingDisallowed = this.instanceDisallowed .get(fadeKind); if (existingDisallowed != null) { existingDisallowed.remove(comp); } } /** * Disallows fade of the specified kind on all controls. * * @param fadeKind * Fade kind to disallow. */ public synchronized void disallowFades(FadeKind fadeKind) { this.globalAllowed.remove(fadeKind); } /** * Disallows fade of the specified kind on all controls of specified class. * * @param fadeKind * Fade kind to disallow. * @param clazz * Control class for disallowing the fade kind. */ public synchronized void disallowFades(FadeKind fadeKind, Class clazz) { Set> existingAllowed = this.classAllowed.get(fadeKind); if (existingAllowed != null) { existingAllowed.remove(clazz); if (existingAllowed.size() == 0) this.classAllowed.remove(fadeKind); } Set> existingDisallowed = this.classDisallowed.get(fadeKind); if (existingDisallowed == null) { existingDisallowed = new HashSet>(); this.classDisallowed.put(fadeKind, existingDisallowed); } existingDisallowed.add(clazz); } /** * Disallows fade of the specified kind on all controls of specified * classes. * * @param fadeKind * Fade kind to disallow. * @param clazz * Control classes for disallowing the fade kind. */ public synchronized void disallowFades(FadeKind fadeKind, Class[] clazz) { for (int i = 0; i < clazz.length; i++) { disallowFades(fadeKind, clazz[i]); } } /** * Disallows fade of the specified kind on the specified control. * * @param fadeKind * Fade kind to disallow. * @param comp * Control for disallowing the fade kind. */ public synchronized void disallowFades(FadeKind fadeKind, Component comp) { Set existingAllowed = this.instanceAllowed.get(fadeKind); if (existingAllowed != null) { existingAllowed.remove(comp); if (existingAllowed.size() == 0) this.instanceAllowed.remove(fadeKind); } Set existingDisallowed = this.instanceDisallowed .get(fadeKind); if (existingDisallowed == null) { existingDisallowed = new HashSet(); this.instanceDisallowed.put(fadeKind, existingDisallowed); } existingDisallowed.add(comp); } /** * Checks whether the specified fade kind is allowed on the specified * component. * * @param fadeKind * Fade kind. * @param comp * Component. Can be null. * @return true if the specified fade kind is allowed on the * specified component, false otherwise. */ public synchronized boolean fadeAllowed(FadeKind fadeKind, Component comp) { Set instanceDisallowed = this.instanceDisallowed .get(fadeKind); if (instanceDisallowed != null) { if (instanceDisallowed.contains(comp)) return false; } Set instanceAllowed = this.instanceAllowed.get(fadeKind); if (instanceAllowed != null) { if (instanceAllowed.contains(comp)) return true; } if (comp != null) { Class clazz = comp.getClass(); Set> classAllowed = this.classAllowed.get(fadeKind); Set> classDisallowed = this.classDisallowed.get(fadeKind); if (classDisallowed != null) { for (Class disallowed : classDisallowed) { if (disallowed.isAssignableFrom(clazz)) return false; } } if (classAllowed != null) { for (Class allowed : classAllowed) { if (allowed.isAssignableFrom(clazz)) return true; } } } if (this.globalAllowed.contains(fadeKind)) return true; return false; } /** * Registers the specified application callback for tracking core fade * events. This allows the applications to track different stages of * animation sequences. For example, the action listener on button press is * called immediately on mouse release. However, the sequence going from * pressed state to rollover state takes some time (depending on the current * animation speed setting controlled by {@link AnimationKind} and * {@link LafWidget#ANIMATION_KIND}). An application that wishes to take a * frame snapshot with the final (rollover) state of the button can register * a global fade tracker callback that will take the snapshot at the end of * the fade sequence. * * @param callback * Application callback for tracking core fade events. * @see #removeGlobalFadeTrackerCallback(GlobalFadeTrackerCallback) */ public static void addGlobalFadeTrackerCallback( GlobalFadeTrackerCallback callback) { FadeTracker.getInstance().addGlobalCallback(callback); } /** * Removes the specified application callback for tracking core fade events. * * @param callback * Application callback to remove. * @see #addGlobalFadeTrackerCallback(GlobalFadeTrackerCallback) */ public static void removeGlobalFadeTrackerCallback( GlobalFadeTrackerCallback callback) { FadeTracker.getInstance().removeGlobalCallback(callback); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/UIThreadFadeTrackerAdapter.java0000644000175000017500000000365411137001462032205 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation; /** * Empty implementation of {@link FadeTrackerCallback} that does nothing but is * marked to run on the EDT. * * @author Kirill Grouchnikov */ @RunOnUIThread public class UIThreadFadeTrackerAdapter extends FadeTrackerAdapter { } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/FadeDecelerationStep.java0000644000175000017500000000533511137001460031151 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation; /** * Implementation of {@link FadeStep} for decelerated fades. * * @author Kirill Grouchnikov */ public class FadeDecelerationStep implements FadeStep { /** * Delegate. */ protected FadeStep delegate; /** * The deceleration factor. */ protected float decelerationFactor; /** * Creates an decelerated implementation. * * @param delegate * Delegate. * @param decelerationFactor * Deceleration factor. */ public FadeDecelerationStep(FadeStep delegate, float decelerationFactor) { this.delegate = delegate; this.decelerationFactor = decelerationFactor; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.utils.FadeStep#getNextStep(org.jvnet.lafwidget.utils.FadeTracker.FadeKind, * float, boolean, boolean) */ public float getNextStep(FadeKind fadeKind, float currFadePosition, boolean isFadeIn, boolean isLooping) { return this.delegate.getNextStep(fadeKind, currFadePosition, isFadeIn, isLooping) / this.decelerationFactor; } }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/GlobalFadeTrackerCallback.java0000644000175000017500000001220211137001462032041 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation; import java.awt.Component; /** * Global callback for the fade tracker. Is used when the application wishes to * execute some code on the fade. * * @author Kirill Grouchnikov */ public interface GlobalFadeTrackerCallback { /** * Indicates that a single cycle of fade has been performed. * * @param comp * Component for the fade event. * @param subID * Optional ID of the subcomponent of the fade event. May be * null. Is non-null when fade events * can happen on different visual areas of the same top-level * component. For example, each tab in a tabbed pane has its own * fade sequence for rollovers. * @param fadeKind * Fade animation kind. * @param fadeCycle * The current fade cycle. Is guaranteed to be in 0.0-1.0 range. */ public void fadePerformed(Component comp, Comparable subID, FadeKind fadeKind, float fadeCycle); /** * Indicates that the fade sequence has started. * * @param comp * Component for the fade event. * @param subID * Optional ID of the subcomponent of the fade event. May be * null. Is non-null when fade events * can happen on different visual areas of the same top-level * component. For example, each tab in a tabbed pane has its own * fade sequence for rollovers. * @param fadeKind * Fade animation kind. * @param initialFadeCycle * The initial value for the fade cycle. Will be in 0.0-1.0 range. */ public void fadeStarted(Component comp, Comparable subID, FadeKind fadeKind, float initialFadeCycle); /** * Indicates that the fade sequence has ended. * * @param comp * Component for the fade event. * @param subID * Optional ID of the subcomponent of the fade event. May be * null. Is non-null when fade events * can happen on different visual areas of the same top-level * component. For example, each tab in a tabbed pane has its own * fade sequence for rollovers. * @param fadeKind * Fade animation kind. */ public void fadeEnded(Component comp, Comparable subID, FadeKind fadeKind); /** * Indicates that the fade sequence has been reversed. This can happen, for * example, when the user moves the mouse over a button (rollover fade) and * then quickly moves the mouse out. In this case, the fade sequence is * reverted halfway. * * * @param comp * Component for the fade event. * @param subID * Optional ID of the subcomponent of the fade event. May be * null. Is non-null when fade events * can happen on different visual areas of the same top-level * component. For example, each tab in a tabbed pane has its own * fade sequence for rollovers. * @param fadeKind * Fade animation kind. * @param isFadingIn * Indicates the new direction of fade. * @param fadeCycle * Indicates the new value of fade cycle. Will be in 0.0-1.0 * range. */ public void fadeReversed(Component comp, Comparable subID, FadeKind fadeKind, boolean isFadingIn, float fadeCycle); }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/FadeTrackerCallback.java0000644000175000017500000000611011137001462030721 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation; /** * Callback for the fade tracker. Is used when the application (some UI * delegate) wishes to execute some code on the fade. * * @author Kirill Grouchnikov */ public interface FadeTrackerCallback { /** * Indicates that a single cycle of fade has been performed. Can be used in * order to repaint specific portion of the component. * * @param fadeKind * Fade animation kind. * @param fadeCycle * The current fade cycle. Is guaranteed to be in 0.0-1.0 range. */ public void fadePerformed(FadeKind fadeKind, float fadeCycle); /** * Indicates that the fade sequence has ended. Can be used in order to * repaint specific portion of the component. * * @param fadeKind * Fade animation kind. */ public void fadeEnded(FadeKind fadeKind); /** * Indicates that the fade sequence has been reversed. This can happen, for * example, when the user moves the mouse over a button (rollover fade) and * then quickly moves the mouse out. In this case, the fade sequence is * reverted halfway. * * * @param fadeKind * Fade animation kind. * @param isFadingIn * Indicates the new direction of fade. * @param fadeCycle * Indicates the new value of fade cycle. */ public void fadeReversed(FadeKind fadeKind, boolean isFadingIn, float fadeCycle); }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/FadeKind.java0000644000175000017500000001341411137001460026601 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation; /** * Fade animation kind. * * @author Kirill Grouchnikov. */ public class FadeKind { /** * Fade kind ID. */ protected String id; protected boolean isCore; /** * Creates a new fade kind which is allowed by default. * * @param id * Fade kind ID. */ public FadeKind(String id) { this(id, true); } /** * Creates a new fade kind. * * @param id * Fade kind ID. * @param isDefaultAllowed * Indicates whether the newly create fade kind is allowed by * default. */ public FadeKind(String id, boolean isDefaultAllowed) { this(id, isDefaultAllowed, false); } /** * Creates a new fade kind. * * @param id * Fade kind ID. * @param isDefaultAllowed * Indicates whether the newly create fade kind is allowed by * default. * @param isCore * If true, this fade kind will be reported to the * listeners registered with * {@link FadeConfigurationManager#addGlobalFadeTrackerCallback(GlobalFadeTrackerCallback)} * . */ private FadeKind(String id, boolean isDefaultAllowed, boolean isCore) { this.id = id; if (isDefaultAllowed) { FadeConfigurationManager.getInstance().allowFades(this); } this.isCore = isCore; } /** * Arming a component. */ public static final FadeKind ARM = new FadeKind("lafwidgets.core.arm", true, true); /** * Pressing a component. */ public static final FadeKind PRESS = new FadeKind("lafwidgets.core.press", true, true); /** * Focusing a component. */ public static final FadeKind FOCUS = new FadeKind("lafwidgets.core.focus", true, true); /** *

* Fade kind for focus loop animation. Disabled by default, use * {@link FadeConfigurationManager#allowFades(FadeKind)} to enable. *

* * @since version 3.0 */ public static final FadeKind FOCUS_LOOP_ANIMATION = new FadeKind( "lafwidgets.core.focusLoopAnimation", false); /** * Enabling a component. */ public static final FadeKind ENABLE = new FadeKind("lafwidgets.core.enable", true, true); /** * Rollover a component. */ public static final FadeKind ROLLOVER = new FadeKind( "lafwidgets.core.rollover", true, true); /** * Selecting a component. */ public static final FadeKind SELECTION = new FadeKind( "lafwidgets.core.selection", true, true); /** * Fade kind that specifies the "ghosting image" effects on button icons * when the button is rolled-over. Disabled by default, use * {@link FadeConfigurationManager#allowFades(FadeKind)} to enable. */ public static final FadeKind GHOSTING_ICON_ROLLOVER = new FadeKind( "lafwidgets.core.ghosting.iconRollover", false); /** * Fade kind that specifies the "ghosting image" effects on buttons when the * button is pressed. Disabled by default, use * {@link FadeConfigurationManager#allowFades(FadeKind)} to enable. */ public static final FadeKind GHOSTING_BUTTON_PRESS = new FadeKind( "lafwidgets.core.ghosting.buttonPress", false); /** * Fade kind that specifies the "glow" effects on icons when the relevant * control is rolled over. Disabled by default, use * {@link FadeConfigurationManager#allowFades(FadeKind)} to enable. */ public static final FadeKind ICON_GLOW = new FadeKind( "lafwidgets.core.iconGlow", false); /* * (non-Javadoc) * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return this.id.hashCode(); } /* * (non-Javadoc) * * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (obj instanceof FadeKind) { return this.id.equals(((FadeKind) obj).id); } return false; } /* * (non-Javadoc) * * @see java.lang.Object#toString() */ @Override public String toString() { return this.id; } // /** // * Marking a component as modified. // */ // public static final FadeKind MARKED_MODIFIED = new FadeKind( // "lafwidgets.core.arm"); }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/FadeStateListener.java0000644000175000017500000002355411137001460030510 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation; import java.awt.Component; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.util.*; import javax.swing.ButtonModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.jvnet.lafwidget.LafWidgetUtilities; import org.jvnet.lafwidget.animation.FadeTracker.ComponentId; /** * Implements listener on model changes of some component. Once model changes * (select, arm, focus, ...), the listener notifies the {@link FadeTracker}. * * @author Kirill Grouchnikov */ public class FadeStateListener { /** * Optional application callback. */ protected FadeTrackerCallback callback; /** * The associated component. */ protected Component comp; /** * The associated model. */ protected ButtonModel buttonModel; protected Comparable extraKey; /** * Key - {@link FadeKind}, value - {@link Boolean} */ protected Map prevStateMap; /** * Listener on the model changes. */ protected ChangeListener modelListener; /** * Listener on the focus gain and loss. */ protected FocusListener focusListener; /** * Instance ID of focus loop animation. */ protected long focusLoopFadeInstanceId; /** * A set of fade kinds to ignore. */ protected Set toIgnore; /** * Creates a new listener on model changes that can cause fade animation * transitions. * * @param comp * Component. * @param buttonModel * Model for the component. * @param callback * Optional application callback. */ public FadeStateListener(Component comp, ButtonModel buttonModel, FadeTrackerCallback callback) { this(comp, null, buttonModel, callback, null); } /** * Creates a new listener on model changes that can cause fade animation * transitions. * * @param comp * Component. * @param buttonModel * Model for the component. * @param callback * Optional application callback. * @param toIgnore * Set of fade kinds to ignore. */ public FadeStateListener(Component comp, Comparable extraKey, ButtonModel buttonModel, FadeTrackerCallback callback, Set toIgnore) { this.comp = comp; this.extraKey = extraKey; this.buttonModel = buttonModel; this.callback = callback; this.prevStateMap = new HashMap(); if (buttonModel != null) { this.prevStateMap.put(FadeKind.SELECTION, buttonModel.isSelected()); this.prevStateMap.put(FadeKind.ARM, buttonModel.isArmed()); this.prevStateMap.put(FadeKind.ROLLOVER, buttonModel.isRollover()); this.prevStateMap.put(FadeKind.PRESS, buttonModel.isPressed()); this.prevStateMap.put(FadeKind.ENABLE, buttonModel.isEnabled()); } this.prevStateMap.put(FadeKind.FOCUS, comp.hasFocus()); this.focusLoopFadeInstanceId = -1; } /** * Tracks a single change to the model. * * @param fadeKind * Fade animation kind. * @param newValue * New value of the relevant attribute of the model. * @param toRepaintParent * If true, the component parent will be repainted * at every animation cycle. If false, the component * itself will be repainted at every animation cycle. */ protected void trackModelChange(FadeKind fadeKind, boolean newValue, boolean toRepaintParent) { // special handling of cell renderers and editors - no // animation there if (LafWidgetUtilities.toIgnoreAnimations(this.comp)) return; if ((this.toIgnore != null) && this.toIgnore.contains(fadeKind)) { if (this.callback != null) { this.callback.fadeEnded(fadeKind); } else { this.comp.repaint(); } return; } // Component currComp = this.comp; // while (currComp != null) { // for (Iterator it = FadeStateListener.ignoreAnimationsOn.iterator(); // it // .hasNext();) { // Class ignoreAnimationClazz = (Class) it.next(); // if (ignoreAnimationClazz.isAssignableFrom(currComp.getClass())) // return; // } // currComp = currComp.getParent(); // } try { if (this.prevStateMap.containsKey(fadeKind)) { boolean prevValue = this.prevStateMap.get(fadeKind); if (prevValue == newValue) return; } else { if (!newValue) { return; } else { if (fadeKind == FadeKind.SELECTION) { if (this.callback != null) this.callback.fadeEnded(FadeKind.SELECTION); return; } } } if (newValue) { FadeTracker.getInstance().trackFadeIn(fadeKind, this.comp, this.extraKey, toRepaintParent, this.callback); } else { FadeTracker.getInstance().trackFadeOut(fadeKind, this.comp, this.extraKey, toRepaintParent, this.callback); } // FadeTracker.getInstance().trackFade(this.comp, fadeKind, newValue // , // toRepaintParent, this.callback); } finally { this.prevStateMap.put(fadeKind, newValue); } } /** * Registers listeners on all model changes. */ public void registerListeners() { this.registerListeners(false); } /** * Registers listeners on all model changes. * * @param toRepaintParent * If true, the component parent will be repainted * at every animation cycle. If false, the component * itself will be repainted at every animation cycle. */ public void registerListeners(final boolean toRepaintParent) { this.modelListener = new ChangeListener() { public void stateChanged(ChangeEvent e) { if (FadeStateListener.this.buttonModel == null) return; LafWidgetUtilities .testComponentStateChangeThreadingViolation(comp); FadeStateListener.this.trackModelChange(FadeKind.SELECTION, FadeStateListener.this.buttonModel.isSelected(), toRepaintParent); FadeStateListener.this.trackModelChange(FadeKind.ARM, FadeStateListener.this.buttonModel.isArmed(), toRepaintParent); FadeStateListener.this.trackModelChange(FadeKind.ROLLOVER, FadeStateListener.this.buttonModel.isRollover(), toRepaintParent); FadeStateListener.this.trackModelChange(FadeKind.ENABLE, FadeStateListener.this.buttonModel.isEnabled(), toRepaintParent); FadeStateListener.this.trackModelChange(FadeKind.PRESS, FadeStateListener.this.buttonModel.isPressed(), toRepaintParent); } }; if (this.buttonModel != null) { this.buttonModel.addChangeListener(this.modelListener); } this.focusListener = new FocusListener() { public void focusGained(FocusEvent e) { FadeStateListener.this.trackModelChange(FadeKind.FOCUS, true, toRepaintParent); initiateFocusFadeLoop(); } public void focusLost(FocusEvent e) { FadeStateListener.this.trackModelChange(FadeKind.FOCUS, false, toRepaintParent); if (focusLoopFadeInstanceId >= 0) { FadeTracker.getInstance().cancelFadeInstance( focusLoopFadeInstanceId); } } }; this.comp.addFocusListener(this.focusListener); if (this.comp.hasFocus()) { this.initiateFocusFadeLoop(); } } /** * Initiates the looping animation on focus ring. */ protected void initiateFocusFadeLoop() { FadeTrackerCallback loopCallback = (callback != null) ? callback : new FadeTrackerAdapter() { @Override public void fadeEnded(FadeKind fadeKind) { comp.repaint(); } @Override public void fadePerformed(FadeKind fadeKind, float fadeCycle10) { comp.repaint(); } }; if (FadeConfigurationManager.getInstance().fadeAllowed( FadeKind.FOCUS_LOOP_ANIMATION, this.comp)) { focusLoopFadeInstanceId = FadeTracker.getInstance() .trackFadeLooping(FadeKind.FOCUS_LOOP_ANIMATION, LafWidgetUtilities.getAnimationKind(this.comp), this.comp, this.extraKey, false, loopCallback, -1, false); } } /** * Unregisters all listeners on model changes. */ public void unregisterListeners() { if (this.buttonModel != null) { this.buttonModel.removeChangeListener(this.modelListener); } this.comp.removeFocusListener(this.focusListener); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/FadeAccelerationStep.java0000644000175000017500000000533511137001460031144 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation; /** * Implementation of {@link FadeStep} for accelerated fades. * * @author Kirill Grouchnikov */ public class FadeAccelerationStep implements FadeStep { /** * Delegate. */ protected FadeStep delegate; /** * The acceleration factor. */ protected float accelerationFactor; /** * Creates an accelerated implementation. * * @param delegate * Delegate. * @param accelerationFactor * Acceleration factor. */ public FadeAccelerationStep(FadeStep delegate, float accelerationFactor) { this.delegate = delegate; this.accelerationFactor = accelerationFactor; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.utils.FadeStep#getNextStep(org.jvnet.lafwidget.utils.FadeTracker.FadeKind, * float, boolean, boolean) */ public float getNextStep(FadeKind fadeKind, float currFadePosition, boolean isFadeIn, boolean isLooping) { return this.delegate.getNextStep(fadeKind, currFadePosition, isFadeIn, isLooping) * this.accelerationFactor; } }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/FadeStep.java0000644000175000017500000000462111137001460026627 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation; /** * Interface for computing the step for a fade cycle. Implement this interface * to allow non-linear animations. * * @author Kirill Grouchnikov */ public interface FadeStep { /** * Returns the next fade cycle step. * * @param fadeKind * Fade kind. * @param currFadePosition * Current fade position - guaranteed to be in 0.0-1.0 range. * @param isFadeIn * If true, the current fade cycle is fading in. * @param isLooping * If true, the fade is looping. * @return The next fade cycle step. */ public float getNextStep(FadeKind fadeKind, float currFadePosition, boolean isFadeIn, boolean isLooping); }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/FadeTrackerAdapter.java0000644000175000017500000000506611137001460030614 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation; /** * Default implementation of {@link FadeTrackerCallback} that does nothing. * * @author Kirill Grouchnikov */ public class FadeTrackerAdapter implements FadeTrackerCallback { /* * (non-Javadoc) * * @see org.jvnet.lafwidget.animation.FadeTrackerCallback#fadeEnded(org.jvnet.lafwidget.animation.FadeKind) */ public void fadeEnded(FadeKind fadeKind) { } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.animation.FadeTrackerCallback#fadePerformed(org.jvnet.lafwidget.animation.FadeKind, * float) */ public void fadePerformed(FadeKind fadeKind, float fadeCycle) { } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.animation.FadeTrackerCallback#fadeReversed(org.jvnet.lafwidget.animation.FadeKind, * boolean, float) */ public void fadeReversed(FadeKind fadeKind, boolean isFadingIn, float fadeCycle) { } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/FadeConstantStep.java0000644000175000017500000000463011137001460030341 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation; /** * Default implementation of {@link FadeStep} for linear (constant-step) fades. * * @author Kirill Grouchnikov */ public class FadeConstantStep implements FadeStep { /** * The step value. */ protected float step; /** * Creates a default constant implementation. * * @param step * The step value. */ public FadeConstantStep(float step) { this.step = step; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.utils.FadeStep#getNextStep(org.jvnet.lafwidget.utils.FadeTracker.FadeKind, * float, boolean, boolean) */ public float getNextStep(FadeKind fadeKind, float currFadePosition, boolean isFadeIn, boolean isLooping) { return this.step; } }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/FadeTracker.java0000644000175000017500000014355211207253122027320 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation; import java.awt.Component; import java.awt.Container; import java.util.*; import javax.swing.SwingUtilities; import org.jvnet.lafwidget.LafWidgetUtilities; import org.jvnet.lafwidget.utils.TrackableThread; import org.jvnet.lafwidget.utils.LafConstants.AnimationKind; /** * Tracker class for fade animations. * * @author Kirill Grouchnikov */ public class FadeTracker { /** * Max value for fade cycle. */ public static final int END_VALUE = 1; /** * Debug mode indicator. Set to true to have trace messages on * console. */ public static boolean DEBUG_MODE = false; /** * Single instance of this class. */ private static FadeTracker instance; /** * All currently tracked components. Only components that are being animated * (fade-in or fade-out) are in this map. Key is * {@link FadeKind}, value is map from {@link ComponentId} to * {@link FadeState}. */ private Map> trackedComponents; /** * All currently executing fade instances. Key is {@link Long} (corresponds * to the {@link FadeState#id}, value is {@link FadeKind} - which is a key * in {@link #trackedComponents}. */ private Map fadeInstances; /** * ID of the current loop iteration. */ private long currLoopId; /** * List of global fade tracker callbacks. */ private List globalCallbackList; private boolean nothingTracked; /** * Information on a single component under fade. * * @author Kirill Grouchnikov */ protected static class ComponentId { /** * UI component itself. */ public Component component; /** * ID to distinguish between different sub-components of the UI * component. For example, the tabbed pane uses this field to make * tab-specific animations. */ @SuppressWarnings("unchecked") public Comparable subID; /** * Creates a new component ID. * * @param component * UI component itself. * @param subID * ID to distinguish between different sub-components of the * UI component. */ @SuppressWarnings("unchecked") public ComponentId(Component component, Comparable subID) { this.component = component; this.subID = subID; } /* * (non-Javadoc) * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { int result = this.component.hashCode(); if (this.subID != null) result &= (this.subID.hashCode()); return result; } /* * (non-Javadoc) * * @see java.lang.Object#equals(java.lang.Object) */ @Override @SuppressWarnings("unchecked") public boolean equals(Object obj) { if (obj instanceof ComponentId) { ComponentId cid = (ComponentId) obj; try { boolean result = (this.component == cid.component); if (this.subID == null) { result = result && (cid.subID == null); } else { result = result && (this.subID.compareTo(cid.subID) == 0); } return result; } catch (Exception exc) { return false; } } return false; } } /** * The fade thread. */ private FadeTrackerThread trackerThread; /** * The fade thread class. * * @author Kirill Grouchnikov */ private class FadeTrackerThread extends TrackableThread { /** * Fade thread delay. */ public static final int DELAY = 40; /** * Indication whether a stop request has been issued on * this thread. */ private boolean stopRequested; /** * Simple constructor. Defined private for singleton. * * @see #getInstance() */ public FadeTrackerThread() { super(); this.setName("Laf-Widget fade tracker"); this.stopRequested = false; } /* * (non-Javadoc) * * @see java.lang.Thread#run() */ @Override public void run() { while (!this.stopRequested) { try { Thread.sleep(FadeTrackerThread.DELAY); } catch (InterruptedException ie) { ie.printStackTrace(); } // SwingUtilities.invokeLater(new Runnable() { // public void run() { FadeTracker.this.updateComponents(); currLoopId++; // } // }); } } /* * (non-Javadoc) * * @see org.jvnet.substance.utils.SubstanceThread#requestStop() */ @Override protected void requestStop() { this.stopRequested = true; FadeTracker.this.trackerThread = null; } } /** * Simple constructor. Defined private for singleton. * * @see #getInstance() */ private FadeTracker() { this.trackerThread = this.getThread(); this.trackedComponents = new HashMap>(); this.fadeInstances = new HashMap(); this.currLoopId = 0; this.globalCallbackList = new ArrayList(); } /** * Gets singleton instance. * * @return Singleton instance. */ public synchronized static FadeTracker getInstance() { if (FadeTracker.instance == null) { FadeTracker.instance = new FadeTracker(); } return FadeTracker.instance; } /** * Updates all components that are currently registered with * this tracker. The update include repaint (based on the * {@link FadeState#toRepaintParent}) and optional call to the callback. */ private synchronized void updateComponents() { if (this.trackedComponents.size() == 0) return; // if (this.comp2int.size() > 0) // System.out.println("Periodic update"); Set parents = null; for (Iterator>> itComp = this.trackedComponents .entrySet().iterator(); itComp.hasNext();) { Map.Entry> entryComp = itComp .next(); // FadeKind fadeKind = entryComp.getKey(); Map mapComp = entryComp.getValue(); for (Iterator> itKind = mapComp .entrySet().iterator(); itKind.hasNext();) { Map.Entry entryKind = itKind.next(); ComponentId compId = entryKind.getKey(); FadeState state = entryKind.getValue(); boolean hasEnded = false; if (DEBUG_MODE) { System.out .println("Processing " + state.id + "[" + compId.component.getClass() .getSimpleName() + "] from " + state.getFadePosition() + ". Callback - " + (state.getCallback() == null ? "no" : "yes") + ". Displayable " + (compId.component.isDisplayable() ? "yes" : "no")); } // Component comp = entry.getKey(); if (state.isFadingIn()) { state.setFadePosition(state.getFadePosition() + state.fadeStep.getNextStep(state.fadeKind, state .getFadePosition(), state.isFadingIn(), state.isLooping())); if (DEBUG_MODE) { System.out.println("New cycle position is " + state.getFadePosition()); } if (state.getFadePosition() > FadeTracker.END_VALUE) { state.setFadePosition(FadeTracker.END_VALUE); if (state.isLooping()) { if (state.isLoopingReverse()) { state.setFadingIn(false); } else { if (state.isToStopAtCycleBreak()) { this.fadeInstances .remove(new Long(state.id)); hasEnded = true; if (state.getCallback() != null) callbackCallFadeEnded(state .getCallback(), state.fadeKind); this.globalCallbackCallFadeEnded( compId.component, compId.subID, state.fadeKind); itKind.remove(); } else { state.setFadePosition(0.0f); } } } else { this.fadeInstances.remove(new Long(state.id)); hasEnded = true; itKind.remove(); } } } else { state.setFadePosition(state.getFadePosition() - state.fadeStep.getNextStep(state.fadeKind, state .getFadePosition(), state.isFadingIn(), state.isLooping())); if (DEBUG_MODE) { System.out.println("New cycle position is " + state.getFadePosition()); } if (state.getFadePosition() < 0) { state.setFadePosition(0.0f); if (state.isLooping()) { boolean stopLoopingAnimation = state .isToStopAtCycleBreak(); int loopsToLive = state.getLoopCount(); if (loopsToLive > 0) { loopsToLive--; stopLoopingAnimation = stopLoopingAnimation || (loopsToLive == 0); state.setLoopCount(loopsToLive); } if (stopLoopingAnimation) { // end looping animation this.fadeInstances.remove(new Long(state.id)); hasEnded = true; itKind.remove(); } else { state.setFadingIn(true); } } else { this.fadeInstances.remove(new Long(state.id)); hasEnded = true; itKind.remove(); } } } if (compId.component.isDisplayable()) { if (state.getCallback() != null) { if (hasEnded) { if (DEBUG_MODE) { System.out.println("Ending " + state.id + " on " + state.fadeKind.toString()); } this.callbackCallFadeEnded(state.getCallback(), state.fadeKind); } else { if (DEBUG_MODE) { System.out.println("Calling " + state.id + " on " + state.fadeKind.toString() + " at " + state.getFadePosition()); } this.callbackCallFadePerformed(state.getCallback(), state.fadeKind, state.getFadePosition()); } // continue; } if (hasEnded) { this.globalCallbackCallFadeEnded(compId.component, compId.subID, state.fadeKind); } else { this.globalCallbackCallFadePerformed(compId.component, compId.subID, state.fadeKind, state .getFadePosition()); } // if we have an internal callback, go to the next component if (state.getCallback() != null) { continue; } if (state.isToRepaintParent()) { // Lazy creation for performance if (parents == null) parents = new HashSet(); parents.add(compId.component.getParent()); } else { compId.component.repaint(); } } else { if (state.fadeKind == FadeKind.GHOSTING_BUTTON_PRESS) { this.callbackCallFadeEnded(state.getCallback(), state.fadeKind); this.globalCallbackCallFadeEnded(compId.component, compId.subID, state.fadeKind); } } } // if (mapComp.size() == 0) // itComp.remove(); // System.out.println("\tState of " + comp.hashCode() + " is " // + state.fadePosition + " fading " // + (state.isFadingIn ? "in" : "out")); // long time0 = System.nanoTime(); // long time1 = System.nanoTime(); // if (entry.getKey() instanceof JButton) { // System.out.println(((JButton) entry.getKey()).getText() + " [" + // state.isFadingIn + "]: " // + (time1 - time0)); // } } if ((parents != null) && (parents.size() > 0)) { for (Iterator itParent = parents.iterator(); itParent .hasNext();) { Container parent = itParent.next(); parent.repaint(); } } this.nothingTracked = (this.fadeInstances.size() == 0); } private void callbackCallFadeEnded(final FadeTrackerCallback fadeCallback, final FadeKind fadeKind) { boolean shouldRunOnEDT = false; Class clazz = fadeCallback.getClass(); while ((clazz != null) && !shouldRunOnEDT) { shouldRunOnEDT = clazz.isAnnotationPresent(RunOnUIThread.class); clazz = clazz.getSuperclass(); } if (shouldRunOnEDT) { SwingUtilities.invokeLater(new Runnable() { public void run() { fadeCallback.fadeEnded(fadeKind); } }); } else { fadeCallback.fadeEnded(fadeKind); } } private void callbackCallFadeReversed( final FadeTrackerCallback fadeCallback, final FadeKind fadeKind, final boolean isFadingIn, final float fadeCycle10) { boolean shouldRunOnEDT = false; Class clazz = fadeCallback.getClass(); while ((clazz != null) && !shouldRunOnEDT) { shouldRunOnEDT = clazz.isAnnotationPresent(RunOnUIThread.class); clazz = clazz.getSuperclass(); } if (shouldRunOnEDT) { SwingUtilities.invokeLater(new Runnable() { public void run() { fadeCallback .fadeReversed(fadeKind, isFadingIn, fadeCycle10); } }); } else { fadeCallback.fadeReversed(fadeKind, isFadingIn, fadeCycle10); } } private void callbackCallFadePerformed( final FadeTrackerCallback fadeCallback, final FadeKind fadeKind, final float fadePosition) { boolean shouldRunOnEDT = false; Class clazz = fadeCallback.getClass(); while ((clazz != null) && !shouldRunOnEDT) { shouldRunOnEDT = clazz.isAnnotationPresent(RunOnUIThread.class); clazz = clazz.getSuperclass(); } if (shouldRunOnEDT) { SwingUtilities.invokeLater(new Runnable() { public void run() { fadeCallback.fadePerformed(fadeKind, fadePosition); } }); } else { fadeCallback.fadePerformed(fadeKind, fadePosition); } } private void globalCallbackCallFadeEnded(final Component comp, final Comparable subID, final FadeKind fadeKind) { if (this.globalCallbackList.size() == 0) return; if (!fadeKind.isCore) return; for (GlobalFadeTrackerCallback globalCallback : this.globalCallbackList) { globalCallback.fadeEnded(comp, subID, fadeKind); } } private void globalCallbackCallFadeStarted(final Component comp, final Comparable subID, final FadeKind fadeKind, float initialFadeCycle10) { if (this.globalCallbackList.size() == 0) return; if (!fadeKind.isCore) return; for (GlobalFadeTrackerCallback globalCallback : this.globalCallbackList) { globalCallback.fadeStarted(comp, subID, fadeKind, initialFadeCycle10); } } private void globalCallbackCallFadeReversed(final Component comp, final Comparable subID, final FadeKind fadeKind, final boolean isFadingIn, final float fadeCycle10) { if (this.globalCallbackList.size() == 0) return; if (!fadeKind.isCore) return; for (GlobalFadeTrackerCallback globalCallback : this.globalCallbackList) { globalCallback.fadeReversed(comp, subID, fadeKind, isFadingIn, fadeCycle10); } } private void globalCallbackCallFadePerformed(final Component comp, final Comparable subID, final FadeKind fadeKind, final float fadePosition) { if (this.globalCallbackList.size() == 0) return; if (!fadeKind.isCore) return; for (GlobalFadeTrackerCallback globalCallback : this.globalCallbackList) { globalCallback.fadePerformed(comp, subID, fadeKind, fadePosition); } } /** * Returns the state of the component under the specified fade kind. * * @param fadeKind * Fade kind. * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes * (where fade is performed on component "sub" parts). * @return Component state under the specified fade kind. */ private synchronized FadeState getState(FadeKind fadeKind, Component comp, Comparable componentId) { ComponentId cid = new ComponentId(comp, componentId); Map map = this.trackedComponents.get(fadeKind); if (map == null) { map = new HashMap(); this.trackedComponents.put(fadeKind, map); } return map.get(cid); } /** * Adds new fade state for the specified component. * * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes * (where fade is performed on component "sub" parts). * @param fadeKind * Fade kind. * @param fadeState * Fade state object. */ private synchronized void addState(Component comp, Comparable componentId, FadeKind fadeKind, FadeState fadeState) { ComponentId cid = new ComponentId(comp, componentId); Map map = this.trackedComponents.get(fadeKind); if (map == null) { map = new HashMap(); this.trackedComponents.put(fadeKind, map); } map.put(cid, fadeState); this.fadeInstances.put(fadeState.id, fadeKind); this.nothingTracked = false; if (DEBUG_MODE) { System.out.println("Added (" + fadeState.id + ") on " + comp.getClass().getSimpleName() + "[" + componentId + "]. Fade " + fadeKind.toString() + " and fading " + (fadeState.isFadingIn() ? "in" : "out") + ". Callback - " + (fadeState.getCallback() == null ? "no" : "yes")); } } /** * Requests start of fade-in tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance created * (this may happen when the specified component is not visible). */ public synchronized long trackFadeIn(FadeKind fadeKind, Component comp, boolean toRepaintParent, FadeTrackerCallback callback) { return this .trackFadeIn(fadeKind, comp, null, toRepaintParent, callback); } /** * Requests start of fade-in tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param componentId * Component id. Relevant for such components as tabbed panes * (where fade is performed on component "sub" parts). * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance created * (this may happen when the specified component is not visible). */ public synchronized long trackFadeIn(FadeKind fadeKind, Component comp, int componentId, boolean toRepaintParent, FadeTrackerCallback callback) { return this.trackFadeIn(fadeKind, comp, new Integer(componentId), toRepaintParent, callback); } /** * Requests start of fade-in tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance created * (this may happen when the specified component is not visible). */ public synchronized long trackFadeIn(FadeKind fadeKind, Component comp, Comparable componentId, boolean toRepaintParent, FadeTrackerCallback callback) { return this.trackFadeIn(fadeKind, comp, componentId, toRepaintParent, callback, LafWidgetUtilities.getAnimationKind(comp)); } /** * Requests start of fade-in tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @param aKind * Animation kind. Should not be null. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance created * (this may happen when the specified component is not visible). */ public synchronized long trackFadeIn(FadeKind fadeKind, Component comp, Comparable componentId, boolean toRepaintParent, FadeTrackerCallback callback, AnimationKind aKind) { // System.out.println(fadeKind.toString() + " on " // + comp.getClass().getName()); if (fadeKind == null) { throw new IllegalArgumentException("Can't pass null fadeKind"); } if ((comp == null) || (!comp.isDisplayable())) { if (callback != null) { this.callbackCallFadeEnded(callback, fadeKind); } this.globalCallbackCallFadeEnded(comp, componentId, fadeKind); return -1; } if (LafWidgetUtilities.hasNoFades(comp, fadeKind)) { if (callback != null) { this.callbackCallFadeEnded(callback, fadeKind); } else { if (toRepaintParent && comp.getParent() != null) comp.getParent().repaint(); else comp.repaint(); } this.globalCallbackCallFadeEnded(comp, componentId, fadeKind); return -1; } this.getThread(); // see if it's already tracked FadeState fadeState = this.getState(fadeKind, comp, componentId); if (fadeState == null) { fadeState = new FadeState(fadeKind, 0, true, toRepaintParent); fadeState.fadeStep = aKind.getStep(); if (fadeKind == FadeKind.SELECTION) { fadeState.fadeStep = new FadeAccelerationStep( fadeState.fadeStep, 2.0f); } fadeState.setCallback(callback); this.addState(comp, componentId, fadeKind, fadeState); this.globalCallbackCallFadeStarted(comp, componentId, fadeKind, fadeState.getFadePosition()); } else { if (!fadeState.isFadingIn()) { if (fadeState.getCallback() != null) { this.callbackCallFadeReversed(fadeState.getCallback(), fadeKind, true, fadeState.getFadePosition()); // fadeState.getCallback().fadeReversed(fadeKind, true, // fadeState.getFadePosition()); } this.globalCallbackCallFadeReversed(comp, componentId, fadeKind, true, fadeState.getFadePosition()); } fadeState.setFadingIn(true); fadeState.setCallback(callback); } return fadeState.id; // System.out.println(sdf.format(new Date()) // + " : starting tracking fade in on " // + comp.getClass().getName() + " [" + comp.hashCode() // + "] from " + fadeState.fadePosition); } /** * Requests start of fade-out tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance created * (this may happen when the specified component is not visible). */ public synchronized long trackFadeOut(FadeKind fadeKind, Component comp, boolean toRepaintParent, FadeTrackerCallback callback) { return this.trackFadeOut(fadeKind, comp, null, toRepaintParent, callback); } /** * Requests start of fade-out tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param componentId * Component id. Relevant for such components as tabbed panes * (where fade is performed on component "sub" parts). * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance created * (this may happen when the specified component is not visible). */ public synchronized long trackFadeOut(FadeKind fadeKind, Component comp, int componentId, boolean toRepaintParent, FadeTrackerCallback callback) { return this.trackFadeOut(fadeKind, comp, new Integer(componentId), toRepaintParent, callback); } /** * Requests start of fade-out tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance created * (this may happen when the specified component is not visible). */ public synchronized long trackFadeOut(FadeKind fadeKind, Component comp, Comparable componentId, boolean toRepaintParent, FadeTrackerCallback callback) { return this.trackFadeOut(fadeKind, comp, componentId, toRepaintParent, callback, LafWidgetUtilities.getAnimationKind(comp)); } /** * Requests start of fade-out tracking on the specified component. * * @param fadeKind * Fade kind. * @param comp * The component to track. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @param aKind * Animation kind. Should not be null. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance created * (this may happen when the specified component is not visible). */ public synchronized long trackFadeOut(FadeKind fadeKind, Component comp, Comparable componentId, boolean toRepaintParent, FadeTrackerCallback callback, AnimationKind aKind) { if (fadeKind == null) { throw new IllegalArgumentException("Can't pass null fadeKind"); } if ((comp == null) || (!comp.isDisplayable())) { if (callback != null) { callbackCallFadeEnded(callback, fadeKind); } this.globalCallbackCallFadeEnded(comp, componentId, fadeKind); return -1; } if (LafWidgetUtilities.hasNoFades(comp, fadeKind)) { if (callback != null) { callbackCallFadeEnded(callback, fadeKind); } else { if (toRepaintParent && comp.getParent() != null) comp.getParent().repaint(); else comp.repaint(); } this.globalCallbackCallFadeEnded(comp, componentId, fadeKind); return -1; } this.getThread(); // see if it's already tracked FadeState fadeState = this.getState(fadeKind, comp, componentId); if (fadeState == null) { fadeState = new FadeState(fadeKind, FadeTracker.END_VALUE, false, toRepaintParent); fadeState.fadeStep = aKind.getStep(); if (fadeKind == FadeKind.SELECTION) fadeState.fadeStep = new FadeAccelerationStep( fadeState.fadeStep, 2.0f); fadeState.setCallback(callback); this.addState(comp, componentId, fadeKind, fadeState); this.globalCallbackCallFadeStarted(comp, componentId, fadeKind, fadeState.getFadePosition()); } else { if (fadeState.isFadingIn()) { if (fadeState.getCallback() != null) { callbackCallFadeReversed(fadeState.getCallback(), fadeKind, false, fadeState.getFadePosition()); // fadeState.getCallback().fadeReversed(fadeKind, false, // fadeState.getFadePosition()); } this.globalCallbackCallFadeReversed(comp, componentId, fadeKind, false, fadeState.getFadePosition()); } fadeState.setFadingIn(false); fadeState.setCallback(callback); } return fadeState.id; // System.out.println(sdf.format(new Date()) // + " : starting tracking fade out on " // + comp.getClass().getName() + " [" + comp.hashCode() // + "] from " + fadeState.fadePosition); } /** * Requests start of fade tracking on the specified component. * * @param comp * The component to track. * @param fadeKind * Fade kind. * @param isFadeIn * Indication whether fade-in or fade-out should be commenced. * @param toRepaintParent * Indication whether the component parent should be repainted. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance created * (this may happen when the specified component is not visible). */ public synchronized long trackFade(Component comp, FadeKind fadeKind, boolean isFadeIn, boolean toRepaintParent) { return this.trackFade(comp, fadeKind, isFadeIn, toRepaintParent, null); } /** * Requests start of fade tracking on the specified component. * * @param comp * The component to track. * @param fadeKind * Fade kind. * @param isFadeIn * Indication whether fade-in or fade-out should be commenced. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance created * (this may happen when the specified component is not visible). */ public synchronized long trackFade(Component comp, FadeKind fadeKind, boolean isFadeIn, boolean toRepaintParent, FadeTrackerCallback callback) { if (isFadeIn) return this.trackFadeIn(fadeKind, comp, toRepaintParent, callback); else return this.trackFadeOut(fadeKind, comp, toRepaintParent, callback); } /** * Requests start of looping fade tracking on the specified component. * * @param fadeKind * Fade kind. * @param animationKind * Animation kind. * @param comp * The component to track. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param toRepaintParent * Indication whether the component parent should be repainted. * @param callback * Optional callback to be called on each fade cycle. * @param loopCount * Loop count. * @param isLoopingReverse * If true, when the fade value gets to the maximal * value, the fade cycle will begin fade-out. Otherwise the fade * cycle will begin from 0, continuing to fade-in. * @return ID of the fade instance. Guaranteed to be unique. Value * -1 signifies that there was no fade instance created * (this may happen when the specified component is not visible). */ public synchronized long trackFadeLooping(FadeKind fadeKind, AnimationKind animationKind, Component comp, Comparable componentId, boolean toRepaintParent, FadeTrackerCallback callback, int loopCount, boolean isLoopingReverse) { if (fadeKind == null) { throw new IllegalArgumentException("Can't pass null fadeKind"); } this.getThread(); if (LafWidgetUtilities.hasNoFades(comp, fadeKind)) { if (callback != null) { callbackCallFadeEnded(callback, fadeKind); } else { if (comp != null) { if (toRepaintParent && comp.getParent() != null) comp.getParent().repaint(); else comp.repaint(); } } this.globalCallbackCallFadeEnded(comp, componentId, fadeKind); return -1; } // see if it's already tracked FadeState fadeState = this.getState(fadeKind, comp, componentId); if (fadeState == null) { fadeState = new FadeState(fadeKind, 0, true, toRepaintParent); fadeState.fadeStep = animationKind.getStep(); fadeState.setLooping(true); fadeState.setLoopingReverse(isLoopingReverse); fadeState.setCallback(callback); fadeState.setLoopCount(loopCount); this.addState(comp, componentId, fadeKind, fadeState); this.globalCallbackCallFadeStarted(comp, componentId, fadeKind, fadeState.getFadePosition()); } else { fadeState.setLooping(true); fadeState.setLoopingReverse(isLoopingReverse); fadeState.setCallback(callback); fadeState.setToStopAtCycleBreak(false); fadeState.setLoopCount(loopCount); } return fadeState.id; } /** * Checks whether the specified component is being tracked by * this tracker. Effectively returns indication whether the * specified component is in fade-in or fade-out animation of the specified * kind. * * @param comp * Component. * @param fadeKind * Fade kind. * @return true if the specified component is being tracked by * this tracker, false otherwise. */ public boolean isTracked(Component comp, FadeKind fadeKind) { return this.isTracked(comp, null, fadeKind); } /** * Checks whether the specified component is being tracked by * this tracker. Effectively returns indication whether the * specified component is in fade-in or fade-out animation of the specified * kind. * * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes * (where fade is performed on component "sub" parts). * @param fadeKind * Fade kind. * @return true if the specified component is being tracked by * this tracker, false otherwise. */ public boolean isTracked(Component comp, int componentId, FadeKind fadeKind) { return this.isTracked(comp, new Integer(componentId), fadeKind); } /** * Checks whether the specified component is being tracked by * this tracker. Effectively returns indication whether the * specified component is in fade-in or fade-out animation of the specified * kind. * * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param fadeKind * Fade kind. * @return true if the specified component is being tracked by * this tracker, false otherwise. */ public boolean isTracked(Component comp, Comparable componentId, FadeKind fadeKind) { if (this.nothingTracked) return false; Map map = this.trackedComponents.get(fadeKind); if (map == null) return false; ComponentId cid = new ComponentId(comp, componentId); return map.containsKey(cid); } /** * Checks whether the specified component is being tracked by * this tracker. Effectively returns indication whether the * specified component is in the specified animation (fade-in / fade-out) of * the specified kind. * * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param fadeKind * Fade kind. May be null - not recommended. * @param checkFadeIn * Specifies whether the check should be done for fade-in state. * If true, the returned value will be * true only if the component is tracked and * it is in the fade-in state. * @return true if the specified component is being tracked by * this tracker, false otherwise. */ public boolean isTracked(Component comp, Comparable componentId, FadeKind fadeKind, boolean checkFadeIn) { if (fadeKind == null) { throw new IllegalArgumentException("Can't pass null fadeKind"); } if (this.nothingTracked) return false; Map map = this.trackedComponents.get(fadeKind); if (map == null) return false; ComponentId cid = new ComponentId(comp, componentId); FadeState fState = map.get(cid); if (fState == null) return false; return (fState.isFadingIn() == checkFadeIn); } /** * Returns the fade cycle for the specified component. The result will be in * 0.0-1.0 range. * * @param comp * Component. * @param fadeKind * Fade kind. * @return The fade cycle for the specified component. For components that * are not tracked (when * {@link #isTracked(Component, org.jvnet.lafwidget.animation.FadeTracker.FadeKind)} * returns false), value 0 (zero) is returned. */ public synchronized float getFade(Component comp, FadeKind fadeKind) { return this.getFade(comp, null, fadeKind); } /** * Returns the fade cycle for the specified component. The result will be in * 0.0-1.0 range. * * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes * (where fade is performed on component "sub" parts). * @param fadeKind * Fade kind. * @return The fade cycle for the specified component. For components that * are not tracked (when * {@link #isTracked(Component, org.jvnet.lafwidget.animation.FadeTracker.FadeKind)} * returns false), value 0 (zero) is returned. */ public synchronized float getFade(Component comp, int componentId, FadeKind fadeKind) { return this.getFade(comp, new Integer(componentId), fadeKind); } /** * Returns the fade cycle for the specified component. The result will be in * 0.0-1.0 range. * * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param fadeKind * Fade kind. * @return The fade cycle for the specified component. For components that * are not tracked (when * {@link #isTracked(Component, org.jvnet.lafwidget.animation.FadeTracker.FadeKind)} * returns false), value 0 (zero) is returned. */ public synchronized float getFade(Component comp, Comparable componentId, FadeKind fadeKind) { if (fadeKind == null) { throw new IllegalArgumentException("Can't pass null fadeKind"); } if (this.nothingTracked) return 0; Map map = this.trackedComponents.get(fadeKind); if ((map == null) || (map.size() == 0)) return 0; ComponentId cid = new ComponentId(comp, componentId); FadeState state = map.get(cid); if (state == null) return 0; return state.getFadePosition(); } // public synchronized boolean isFadeIn(Component comp, FadeKind fadeKind) { // return this.isFadeIn(comp, null, fadeKind); // } // // public synchronized boolean isFadeIn(Component comp, int componentId, // FadeKind fadeKind) { // return this.isFadeIn(comp, new Integer(componentId), fadeKind); // } // // public synchronized boolean isFadeIn(Component comp, // Comparable componentId, FadeKind fadeKind) { // if (fadeKind == null) { // throw new IllegalArgumentException("Can't pass null fadeKind"); // } // // ComponentId cid = new ComponentId(comp, componentId); // Map map = this.trackedComponents.get(fadeKind); // if ((map == null) || (map.size() == 0)) // return false; // // FadeState state = map.get(cid); // if (state == null) // return false; // return state.isFadingIn(); // } // /** * Returns the fade state of specified component if it's being tracked by * this tracker or null. * * @param comp * Component. * @param fadeKind * Fade kind. * @return Fade state of specified component if it's being tracked by * this tracker or null. */ public FadeState getFadeState(Component comp, FadeKind fadeKind) { return this.getFadeState(comp, null, fadeKind); } /** * Returns the fade state of specified component if it's being tracked by * this tracker or null. * * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes * (where fade is performed on component "sub" parts). * @param fadeKind * Fade kind. * @return Fade state of specified component if it's being tracked by * this tracker or null. */ public FadeState getFadeState(Component comp, int componentId, FadeKind fadeKind) { return this.getFadeState(comp, new Integer(componentId), fadeKind); } /** * Returns the fade state of specified component if it's being tracked by * this tracker or null. * * @param comp * Component. * @param componentId * Component id. Relevant for such components as tabbed panes, * lists, tables, trees and others (where fade is performed on * component "sub" parts). May be null. * @param fadeKind * Fade kind. * @return Fade state of specified component if it's being tracked by * this tracker or null. */ public synchronized FadeState getFadeState(Component comp, Comparable componentId, FadeKind fadeKind) { if (fadeKind == null) { throw new IllegalArgumentException("Can't pass null fadeKind"); } if (this.nothingTracked) return null; Map map = this.trackedComponents.get(fadeKind); if ((map == null) || (map.size() == 0)) return null; ComponentId cid = new ComponentId(comp, componentId); FadeState state = map.get(cid); if (state == null) return null; return state.getCopy(); } /** * Stops tracking of all components. Note that this function does not * stop the fade thread ({@link #trackerThread}). */ public synchronized void stopAllTimers() { for (Iterator>> itComp = this.trackedComponents .entrySet().iterator(); itComp.hasNext();) { Map.Entry> entryComp = itComp .next(); Map mapComp = entryComp.getValue(); for (Iterator> itKind = mapComp .entrySet().iterator(); itKind.hasNext();) { Map.Entry entryKind = itKind.next(); ComponentId compId = entryKind.getKey(); FadeState state = entryKind.getValue(); if (state.getCallback() != null) this.callbackCallFadeEnded(state.getCallback(), state.fadeKind); this.globalCallbackCallFadeEnded(compId.component, compId.subID, state.fadeKind); } } this.trackedComponents.clear(); this.fadeInstances.clear(); } /** * Returns an instance of the tracker thread. * * @return The tracker thread. */ private synchronized FadeTrackerThread getThread() { if (this.trackerThread == null) { this.trackerThread = new FadeTrackerThread(); this.trackerThread.start(); } return this.trackerThread; } /** * Cancels the specified fade instance. * * @param fadeInstanceId * Fade instance ID. */ public synchronized void cancelFadeInstance(long fadeInstanceId) { FadeKind fadeKind = this.fadeInstances.get(new Long(fadeInstanceId)); if (fadeKind != null) { Map compFades = this.trackedComponents .get(fadeKind); if (compFades != null) { for (Iterator> itKind = compFades .entrySet().iterator(); itKind.hasNext();) { Map.Entry entryKind = itKind.next(); ComponentId compId = entryKind.getKey(); FadeState state = entryKind.getValue(); if (fadeInstanceId == state.id) { itKind.remove(); if (state.getCallback() != null) { this.callbackCallFadeEnded(state.getCallback(), state.fadeKind); } else { if (state.isToRepaintParent()) { entryKind.getKey().component.getParent() .repaint(); } else { entryKind.getKey().component.repaint(); } } this.globalCallbackCallFadeEnded(compId.component, compId.subID, state.fadeKind); } } } // if (compFades.size() == 0) { // this.trackedComponents.remove(fadeKind); // } this.fadeInstances.remove(new Long(fadeInstanceId)); } } /** * Requests that the specified fade instance should stop at the end of the * fade-out. This method should be called only on looping fades. * * @param fadeInstanceId * Fade instance ID. */ public synchronized void requestStopOnCycleBreak(long fadeInstanceId) { FadeKind fadeKind = this.fadeInstances.get(fadeInstanceId); if (fadeKind != null) { Map compFades = this.trackedComponents .get(fadeKind); for (FadeState fadeState : compFades.values()) { if (fadeInstanceId == fadeState.id) { fadeState.toStopAtCycleBreak(); } } } } /** * Returns all components that are currently under the specified fade kind. * * @param fadeKind * Fade kind. * @return Non-null set of all components that are currently * under the specified fade kind. */ public synchronized Set getAllComponentsByFadeKind( FadeKind fadeKind) { Set result = new HashSet(); Map comps = this.trackedComponents .get(fadeKind); if (comps != null) { for (ComponentId cid : comps.keySet()) { result.add(cid.component); } } return result; } /** * Returns the ID of the current loop iteration. * * @return ID of the current loop iteration. */ public long getCurrLoopId() { return currLoopId; } /** * Registers the specified application callback for tracking core fade * events. * * @param callback * Application callback for tracking core fade events. * @see FadeConfigurationManager#addGlobalFadeTrackerCallback(GlobalFadeTrackerCallback) * @see #removeGlobalCallback(GlobalFadeTrackerCallback) */ public void addGlobalCallback(GlobalFadeTrackerCallback callback) { this.globalCallbackList.add(callback); } /** * Removes the specified application callback for tracking core fade events. * * @param callback * Application callback to remove. * @see #addGlobalFadeTrackerCallback(GlobalFadeTrackerCallback) */ public void removeGlobalCallback(GlobalFadeTrackerCallback callback) { this.globalCallbackList.remove(callback); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/effects/0000755000175000017500000000000011253454712025720 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/effects/GhostFadeWidget.java0000644000175000017500000001011111137001462031554 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation.effects; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import javax.swing.AbstractButton; import org.jvnet.lafwidget.LafWidgetAdapter; /** * Widget that tracks changes to the button for ghost effects. * * @author Kirill Grouchnikov */ public class GhostFadeWidget extends LafWidgetAdapter { /** * Model change listener for ghost image effects. */ private GhostingListener ghostModelChangeListener; /** * Property change listener. Listens on changes to the * {@link AbstractButton#MODEL_CHANGED_PROPERTY} property. */ protected PropertyChangeListener ghostPropertyListener; /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installDefaults() */ @Override public void installDefaults() { this.jcomp.setRolloverEnabled(true); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installListeners() */ @Override public void installListeners() { this.ghostPropertyListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (AbstractButton.MODEL_CHANGED_PROPERTY.equals(evt .getPropertyName())) { if (ghostModelChangeListener != null) ghostModelChangeListener.unregisterListeners(); ghostModelChangeListener = new GhostingListener(jcomp, jcomp.getModel()); ghostModelChangeListener.registerListeners(); } // if ("icon.bounds".equals(evt.getPropertyName())) { // try { // throw new IOException(evt.getNewValue().toString()); // } catch (Exception ie) { // ie.printStackTrace(); // } // } } }; jcomp.addPropertyChangeListener(this.ghostPropertyListener); this.ghostModelChangeListener = new GhostingListener(jcomp, jcomp .getModel()); this.ghostModelChangeListener.registerListeners(); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { jcomp.removePropertyChangeListener(this.ghostPropertyListener); this.ghostPropertyListener = null; this.ghostModelChangeListener.unregisterListeners(); this.ghostModelChangeListener = null; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/effects/GhostPaintingUtils.java0000644000175000017500000003551311210746070032363 0ustar drazzibdrazzib/* * Copyright (c) 2005-2007 Substance Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Substance Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation.effects; import java.awt.*; import java.awt.image.BufferedImage; import java.util.LinkedHashMap; import java.util.Set; import javax.swing.*; import org.jvnet.lafwidget.LafWidgetUtilities; import org.jvnet.lafwidget.animation.*; import org.jvnet.lafwidget.layout.TransitionLayout; /** * Utility class that implements the ghost effects. * * @author Kirill Grouchnikov */ public class GhostPaintingUtils { /** * Minimal starting opacity for icon ghosting. Change to a higher value for * debugging / demoing purposes. */ public static float MIN_ICON_GHOSTING_ALPHA = 0.15f; /** * Maximal starting opacity for icon ghosting. Change to a higher value for * debugging / demoing purposes. */ public static float MAX_ICON_GHOSTING_ALPHA = 0.5f; /** * Minimal starting opacity for press ghosting. Change to a higher value for * debugging / demoing purposes. */ public static float MIN_PRESS_GHOSTING_ALPHA = 0.15f; /** * Maximal starting opacity for press ghosting. Change to a higher value for * debugging / demoing purposes. */ public static float MAX_PRESS_GHOSTING_ALPHA = 0.3f; /** * Global decay factor. */ public static float DECAY_FACTOR = 1.0f; /** * Cache of component ghost images. Used to speed up the rendering of the * ghost effects. */ private static LinkedHashMap componentGhostCache = new LinkedHashMap() { @Override protected boolean removeEldestEntry( java.util.Map.Entry eldest) { return this.size() > 50; } }; /** * Cache of icon ghost images. Used to speed up the rendering of the ghost * effects. */ private static LinkedHashMap iconGhostCache = new LinkedHashMap() { @Override protected boolean removeEldestEntry( java.util.Map.Entry eldest) { return this.size() > 50; } }; /** * Returns a scaled ghost image of the specified component. * * @param comp * Component. * @param scaleFactor * Scale factor. * @return A scaled ghost image of the specified component. */ protected static synchronized BufferedImage getComponentGhostImage( Component comp, double scaleFactor) { FadeTracker ft = FadeTracker.getInstance(); String key = ft.getCurrLoopId() + ":" + comp.hashCode() + ":" + scaleFactor; BufferedImage result = componentGhostCache.get(key); if (result == null) { Rectangle bounds = comp.getBounds(); double iWidth = bounds.width * scaleFactor; double iHeight = bounds.height * scaleFactor; result = LafWidgetUtilities.getBlankImage((int) iWidth, (int) iHeight); Graphics2D iGraphics = result.createGraphics(); iGraphics.scale(scaleFactor, scaleFactor); comp.paint(iGraphics); iGraphics.dispose(); componentGhostCache.put(key, result); } return result; } /** * Returns a scaled ghost image of the specified icon. * * @param comp * Component. * @param icon * Icon. * @param scaleFactor * Scale factor. * @return A scaled ghost image of the specified icon. */ protected static synchronized BufferedImage getIconGhostImage( Component comp, Icon icon, double scaleFactor) { FadeTracker ft = FadeTracker.getInstance(); String key = ft.getCurrLoopId() + ":" + comp.hashCode() + ":" + icon.hashCode() + ":" + scaleFactor; BufferedImage result = iconGhostCache.get(key); if (result == null) { int oWidth = icon.getIconWidth(); int oHeight = icon.getIconHeight(); double iWidth = oWidth * scaleFactor; double iHeight = oHeight * scaleFactor; result = LafWidgetUtilities.getBlankImage((int) iWidth, (int) iHeight); Graphics2D iGraphics = result.createGraphics(); iGraphics.scale(scaleFactor, scaleFactor); icon.paintIcon(comp, iGraphics, 0, 0); iGraphics.dispose(); iconGhostCache.put(key, result); } return result; } /** * Paints ghost images on the specified component. * * @param mainComponent * Component. * @param g * Graphics context. */ public static void paintGhostImages(Component mainComponent, Graphics g) { if (!mainComponent.isShowing()) return; if (!mainComponent.isVisible()) return; // The following check is for offscreen rendering. The component // may be showing and visible, but have no peer (non displayable). if (!mainComponent.isDisplayable()) return; if (SwingUtilities.getWindowAncestor(mainComponent) == null) return; Graphics2D graphics = (Graphics2D) g.create(); Rectangle mainRect = mainComponent.getBounds(); mainRect.setLocation(mainComponent.getLocationOnScreen()); if (FadeConfigurationManager.getInstance().fadeAllowed( FadeKind.GHOSTING_BUTTON_PRESS, mainComponent)) { Set animComps = FadeTracker.getInstance() .getAllComponentsByFadeKind(FadeKind.GHOSTING_BUTTON_PRESS); for (Component comp : animComps) { if (comp == mainComponent) continue; if (!comp.isShowing()) continue; if (!comp.isVisible()) continue; // The following check is for offscreen rendering. The component // may be showing and visible, but have no peer (non // displayable). if (!comp.isDisplayable()) return; Rectangle compRect = comp.getBounds(); compRect.setLocation(comp.getLocationOnScreen()); int dx = compRect.x - mainRect.x; int dy = compRect.y - mainRect.y; compRect.x -= compRect.width / 2; compRect.y -= compRect.height / 2; compRect.width *= 2; compRect.height *= 2; if (mainRect.intersects(compRect)) { float fade = FadeTracker.getInstance().getFade(comp, null, FadeKind.GHOSTING_BUTTON_PRESS); // 0.0 --> 0.3 // 1.0 --> 0.0 double start = MAX_PRESS_GHOSTING_ALPHA - 0.0015 * compRect.getWidth(); float coef = Math.max((float) start, MIN_PRESS_GHOSTING_ALPHA); float opFactor = coef * (1.0f - DECAY_FACTOR * fade); double iFactor = 1.0 + fade; graphics.setComposite(TransitionLayout.getAlphaComposite( mainComponent, opFactor)); // Rectangle bounds = comp.getBounds(); // // double iWidth = bounds.width * iFactor; // double iHeight = bounds.height * iFactor; // BufferedImage iImage = SubstanceCoreUtilities // .getBlankImage((int) iWidth, (int) iHeight); // Graphics2D iGraphics = (Graphics2D) // iImage.createGraphics(); // iGraphics.scale(iFactor, iFactor); // comp.paint(iGraphics); // iGraphics.dispose(); // graphics.drawImage(iImage, dx, dy, null); BufferedImage ghost = getComponentGhostImage(comp, iFactor); dx -= ((ghost.getWidth() - bounds.width) / 2); dy -= ((ghost.getHeight() - bounds.height) / 2); graphics.drawImage(ghost, dx, dy, null); } } } if (FadeConfigurationManager.getInstance().fadeAllowed( FadeKind.GHOSTING_ICON_ROLLOVER, mainComponent)) { Set animComps = FadeTracker .getInstance() .getAllComponentsByFadeKind(FadeKind.GHOSTING_ICON_ROLLOVER); for (Component comp : animComps) { if (comp == mainComponent) continue; if (!(comp instanceof JComponent)) continue; JComponent jc = (JComponent) comp; if (!jc.isShowing()) continue; if (!jc.isVisible()) continue; Rectangle compRect = jc.getBounds(); compRect.setLocation(jc.getLocationOnScreen()); int dx = compRect.x - mainRect.x; int dy = compRect.y - mainRect.y; compRect.x -= compRect.width / 2; compRect.y -= compRect.height / 2; compRect.width *= 2; compRect.height *= 2; if (mainRect.intersects(compRect)) { float fade = FadeTracker.getInstance().getFade(jc, null, FadeKind.GHOSTING_ICON_ROLLOVER); // Rectangle bounds = comp.getBounds(); Icon icon = null; Rectangle iconRect = (Rectangle) jc .getClientProperty("icon.bounds"); if (iconRect != null) { if (jc instanceof AbstractButton) { icon = LafWidgetUtilities .getIcon((AbstractButton) jc); } else { icon = (Icon) jc.getClientProperty("icon"); } } if ((icon != null) && (iconRect != null)) { double iFactor = 1.0 + fade; // double iWidth = icon.getIconWidth() * iFactor; // double iHeight = icon.getIconHeight() * iFactor; // BufferedImage iImage = LafWidgetUtilities // .getBlankImage((int) iWidth, (int) iHeight); // Graphics2D iGraphics = (Graphics2D) iImage // .createGraphics(); // iGraphics.scale(iFactor, iFactor); // icon.paintIcon(comp, iGraphics, 0, 0); // iGraphics.dispose(); BufferedImage iImage = getIconGhostImage(comp, icon, iFactor); // System.out.println(iconRect); // BufferedImage bImage = SubstanceCoreUtilities.blur( // iImage, 2); int iWidth = iImage.getWidth(); int iHeight = iImage.getHeight(); dx -= ((iWidth - icon.getIconWidth()) / 2); dy -= ((iHeight - icon.getIconHeight()) / 2); double start = MAX_ICON_GHOSTING_ALPHA - (MAX_ICON_GHOSTING_ALPHA - MIN_ICON_GHOSTING_ALPHA) * (iWidth - 16) / 48; float coef = Math.max((float) start, MIN_ICON_GHOSTING_ALPHA); float opFactor = coef * (1.0f - DECAY_FACTOR * fade); graphics.setComposite(TransitionLayout .getAlphaComposite(mainComponent, opFactor)); graphics.drawImage(iImage, dx + iconRect.x, dy + iconRect.y, null); } } } } graphics.dispose(); } /** * Paints the ghost icon inside the bounds of the specified button. * * @param graphics * Graphics context. * @param b * Button. * @param icon * Icon to paint. */ public static void paintGhostIcon(Graphics2D graphics, AbstractButton b, Icon icon) { paintGhostIcon(graphics, b, icon, (Rectangle) b .getClientProperty("icon.bounds")); } /** * Paints the ghost icon inside the bounds of the specified button. * * @param graphics * Graphics context. * @param b * Button. * @param iconRectangle * Rectangle of the button icon. */ public static void paintGhostIcon(Graphics2D graphics, AbstractButton b, Rectangle iconRectangle) { paintGhostIcon(graphics, b, LafWidgetUtilities.getIcon(b), iconRectangle); } /** * Paints the ghost icon inside the bounds of the specified button. * * @param graphics * Graphics context. * @param b * Button. * @param icon * Icon to paint. * @param iconRectangle * Rectangle of the button icon. */ public static void paintGhostIcon(Graphics2D graphics, Component b, Icon icon, Rectangle iconRectangle) { // System.out.println(b.getText() + ":" + icon + ":" + iconRectangle); if (!FadeConfigurationManager.getInstance().fadeAllowed( FadeKind.GHOSTING_ICON_ROLLOVER, b)) { return; } if (FadeTracker.getInstance().isTracked(b, null, FadeKind.GHOSTING_ICON_ROLLOVER, true)) { float fade = FadeTracker.getInstance().getFade(b, FadeKind.GHOSTING_ICON_ROLLOVER); // System.out.println(" --> " + fade); // double start = 0.5 - 0.35 * (icon.getIconWidth() - 16) / 48; // float coef = Math.max((float) start, 0.15f); // float opFactor = coef * (1.0f - DECAY_FACTOR*fade); // graphics.setComposite(TransitionLayout.getAlphaComposite(b, // opFactor)); // System.out.println(opFactor); // Rectangle iconRect = (Rectangle) // b.getClientProperty("icon.bounds"); if ((icon != null) && (iconRectangle != null)) { double iFactor = 1.0 + fade; // double iWidth = icon.getIconWidth() * iFactor; // double iHeight = icon.getIconHeight() * iFactor; // BufferedImage iImage = LafWidgetUtilities.getBlankImage( // (int) iWidth, (int) iHeight); // Graphics2D iGraphics = (Graphics2D) iImage.createGraphics(); // iGraphics.scale(iFactor, iFactor); // icon.paintIcon(b, iGraphics, 0, 0); // iGraphics.dispose(); // int dx = (int) ((iWidth - icon.getIconWidth()) / 2); // int dy = (int) ((iHeight - icon.getIconHeight()) / 2); BufferedImage iImage = getIconGhostImage(b, icon, iFactor); // System.out.println(iconRect); // BufferedImage bImage = SubstanceCoreUtilities.blur( // iImage, 2); int iWidth = iImage.getWidth(); int iHeight = iImage.getHeight(); int dx = ((iWidth - icon.getIconWidth()) / 2); int dy = ((iHeight - icon.getIconHeight()) / 2); double start = MAX_ICON_GHOSTING_ALPHA - (MAX_ICON_GHOSTING_ALPHA - MIN_ICON_GHOSTING_ALPHA) * (iWidth - 16) / 48; float coef = Math.max((float) start, MIN_ICON_GHOSTING_ALPHA); float opFactor = coef * (1.0f - DECAY_FACTOR * fade); graphics.setComposite(TransitionLayout.getAlphaComposite(b, opFactor)); graphics.drawImage(iImage, iconRectangle.x - dx, iconRectangle.y - dy, null); } } } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/effects/IconGlowListener.java0000644000175000017500000001115211012611134031774 0ustar drazzibdrazzib/* * Copyright (c) 2005-2007 Substance Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Substance Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation.effects; import java.awt.Component; import java.util.HashMap; import java.util.Map; import javax.swing.ButtonModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.jvnet.lafwidget.LafWidgetUtilities; import org.jvnet.lafwidget.animation.*; /** * Listener for the "glow" effects on icons. * * @author Kirill Grouchnikov * @see FadeKind#ICON_GLOW */ public class IconGlowListener { /** * Listener on the model changes. */ protected ChangeListener modelListener; /** * The associated component. */ protected Component comp; /** * Animation ID of the glow icon loop. */ protected long glowLoopAnimationId; /** * The associated model. */ protected ButtonModel buttonModel; /** * Key - {@link FadeKind}, value - {@link Boolean} */ protected Map prevStateMap; /** * Creates a new listener on model changes that can cause fade animation * transitions. * * @param comp * Component. * @param buttonModel * Model for the component. * @param callback * Optional application callback. */ public IconGlowListener(Component comp, ButtonModel buttonModel) { this.comp = comp; this.buttonModel = buttonModel; this.prevStateMap = new HashMap(); this.prevStateMap.put(FadeKind.ICON_GLOW, buttonModel.isRollover()); } /** * Tracks a single change to the model. * * @param fadeKind * Fade animation kind. * @param newState * New value of the relevant attribute of the model. */ protected void trackModelChange(FadeKind fadeKind, boolean newState) { if (LafWidgetUtilities.toIgnoreAnimations(this.comp)) return; try { if (this.prevStateMap.containsKey(fadeKind)) { boolean prevState = this.prevStateMap.get(fadeKind); if (!prevState && newState) { this.glowLoopAnimationId = FadeTracker.getInstance() .trackFadeLooping( fadeKind, LafWidgetUtilities.getAnimationKind(comp) .derive(0.1f), comp, null, false, null, -1, true); } else if (prevState && !newState) { FadeTracker.getInstance().requestStopOnCycleBreak( this.glowLoopAnimationId); } } } finally { this.prevStateMap.put(fadeKind, Boolean.valueOf(newState)); } } /** * Registers listeners on the relevant model changes. */ public void registerListeners() { this.modelListener = new ChangeListener() { public void stateChanged(ChangeEvent e) { if (FadeConfigurationManager.getInstance().fadeAllowed( FadeKind.ICON_GLOW, comp)) { trackModelChange(FadeKind.ICON_GLOW, buttonModel .isRollover()); } } }; this.buttonModel.addChangeListener(this.modelListener); } /** * Unregisters all listeners on model changes. */ public void unregisterListeners() { this.buttonModel.removeChangeListener(this.modelListener); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/effects/IconGlowWidget.java0000644000175000017500000001004411137001462031436 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation.effects; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import javax.swing.AbstractButton; import org.jvnet.lafwidget.LafWidgetAdapter; /** * Widget that provides glow effects on icons. * * @author Kirill Grouchnikov */ public class IconGlowWidget extends LafWidgetAdapter { /** * Model change listener for glow effects. */ private IconGlowListener glowModelChangeListener; /** * Property change listener. Listens on changes to the * {@link AbstractButton#MODEL_CHANGED_PROPERTY} property. */ protected PropertyChangeListener glowPropertyListener; /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#requiresCustomLafSupport() */ public boolean requiresCustomLafSupport() { return false; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installDefaults() */ @Override public void installDefaults() { this.jcomp.setRolloverEnabled(true); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#installListeners() */ @Override public void installListeners() { this.glowPropertyListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (AbstractButton.MODEL_CHANGED_PROPERTY.equals(evt .getPropertyName())) { if (glowModelChangeListener != null) glowModelChangeListener.unregisterListeners(); glowModelChangeListener = new IconGlowListener(jcomp, jcomp .getModel()); glowModelChangeListener.registerListeners(); } // if ("icon.bounds".equals(evt.getPropertyName())) { // try { // throw new IOException(evt.getNewValue().toString()); // } catch (Exception ie) { // ie.printStackTrace(); // } // } } }; jcomp.addPropertyChangeListener(this.glowPropertyListener); this.glowModelChangeListener = new IconGlowListener(jcomp, jcomp .getModel()); this.glowModelChangeListener.registerListeners(); } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidgetAdapter#uninstallListeners() */ @Override public void uninstallListeners() { jcomp.removePropertyChangeListener(this.glowPropertyListener); this.glowPropertyListener = null; this.glowModelChangeListener.unregisterListeners(); this.glowModelChangeListener = null; } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/effects/GhostingListener.java0000644000175000017500000002253111207253602032050 0ustar drazzibdrazzib/* * Copyright (c) 2005-2007 Substance Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Substance Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation.effects; import java.awt.*; import java.util.HashMap; import java.util.Map; import javax.swing.ButtonModel; import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.jvnet.lafwidget.LafWidgetUtilities; import org.jvnet.lafwidget.animation.*; /** * Listener for the "ghosting image" effects on buttons. * * @author Kirill Grouchnikov * @see FadeKind#GHOSTING_BUTTON_PRESS * @see FadeKind#GHOSTING_ICON_ROLLOVER */ public class GhostingListener { /** * Listener on the model changes. */ protected ChangeListener modelListener; /** * The associated component. */ protected Component comp; /** * The associated model. */ protected ButtonModel buttonModel; /** * Key - {@link FadeKind}, value - {@link Boolean} */ protected Map prevStateMap; /** * Creates a new listener on model changes that can cause fade animation * transitions. * * @param comp * Component. * @param buttonModel * Model for the component. */ public GhostingListener(Component comp, ButtonModel buttonModel) { this.comp = comp; this.buttonModel = buttonModel; this.prevStateMap = new HashMap(); this.prevStateMap.put(FadeKind.GHOSTING_ICON_ROLLOVER, buttonModel .isRollover()); this.prevStateMap.put(FadeKind.GHOSTING_BUTTON_PRESS, buttonModel .isPressed()); } /** * Tracks a single change to the model. * * @param fadeKind * Fade animation kind. * @param newState * New value of the relevant attribute of the model. */ protected void trackModelChange(FadeKind fadeKind, boolean newState) { if (LafWidgetUtilities.toIgnoreAnimations(this.comp)) return; try { if (this.prevStateMap.containsKey(fadeKind)) { boolean prevState = this.prevStateMap.get(fadeKind); if (!prevState && newState) { FadeTracker.getInstance().trackFadeIn(fadeKind, this.comp, null, false, new UIThreadFadeTrackerAdapter() { private boolean wasShowing = true; protected void repaintTopLevelWindows( float fadeCycle) { if (comp == null) return; boolean isShowing = comp.isShowing(); if (isShowing) { Window compWindow = SwingUtilities .getWindowAncestor(comp); if (!compWindow.isDisplayable() || !compWindow.isShowing() || !compWindow.isVisible()) { isShowing = false; } } if (!isShowing) { if (wasShowing) { // need to repaint all other windows // once - otherwise we will see // painting artifacts from // a pressed button that was made // invisible for (Window w : Window.getWindows()) { if (w.isDisplayable() && w.isVisible() && w.isShowing()) { w.repaint(); } } } wasShowing = false; return; } Component root = SwingUtilities .getRoot(comp); Rectangle compRect = comp.getBounds(); compRect.setLocation(comp .getLocationOnScreen()); compRect.x -= compRect.width / 2; compRect.y -= compRect.height / 2; compRect.width *= 2; compRect.height *= 2; int rootRepaintX = compRect.x - root.getLocationOnScreen().x; int rootRepaintY = compRect.y - root.getLocationOnScreen().y; // String rootTitle = (root instanceof Frame // ) ? ((Frame) root) // .getTitle() // : (root instanceof Dialog) ? ((Dialog) // root) // .getTitle() // : null; // System.out.println("Repainting " // + fadeCycle10 + ":" + rootTitle // + "[self] at " + rootRepaintX + ":" // + rootRepaintY + ":" // + compRect.width + ":" // + compRect.height); root.repaint(rootRepaintX, rootRepaintY, compRect.width, compRect.height); // fix for issue 363 on Substance - repaint // all top-level windows that intersect // with this rectangle for (Window w : Window.getWindows()) { if (w == root) continue; String title = (w instanceof Frame) ? ((Frame) w) .getTitle() : (w instanceof Dialog) ? ((Dialog) w) .getTitle() : null; // System.out.println(title + ":" // + w.isDisplayable() + ":" // + w.isVisible()); if (w.isDisplayable() && w.isVisible() && w.isShowing()) { // System.out.println(w.getBounds() // .intersects(compRect) // + ":" // + w.getBounds() // + ":" // + compRect); if (w.getBounds().intersects( compRect)) { int winRepaintX = compRect.x - w .getLocationOnScreen().x; int winRepaintY = compRect.y - w .getLocationOnScreen().y; // System.out // .println("Repainting " // + fadeCycle // + ":" // + title // + " at " // + winRepaintX // + ":" // + winRepaintY // + ":" // + compRect.width // + ":" // + compRect.height); w.repaint(winRepaintX, winRepaintY, compRect.width, compRect.height); } } } } @Override public void fadeEnded(FadeKind fadeKind) { // Rectangle bounds = comp.getBounds(); // double iWidth = bounds.width * 2; // double iHeight = bounds.height * 2; // int dx = (int) ((iWidth - bounds.width) / // 2); // int dy = (int) ((iHeight - bounds.height) // / 2); this.repaintTopLevelWindows(1.0f); } @Override public void fadePerformed(FadeKind fadeKind, float fadeCycle) { // Rectangle bounds = comp.getBounds(); // double iFactor = 1.0 + fadeCycle // ; // double iWidth = bounds.width * iFactor; // double iHeight = bounds.height * iFactor; // int dx = (int) ((iWidth - bounds.width) / // 2); // int dy = (int) ((iHeight - bounds.height) // / 2); this.repaintTopLevelWindows(fadeCycle); } }, LafWidgetUtilities.getAnimationKind(comp)); } } } finally { this.prevStateMap.put(fadeKind, Boolean.valueOf(newState)); } } /** * Registers listeners on the relevant model changes. */ public void registerListeners() { this.modelListener = new ChangeListener() { public void stateChanged(ChangeEvent e) { if (FadeConfigurationManager.getInstance().fadeAllowed( FadeKind.GHOSTING_ICON_ROLLOVER, comp)) { trackModelChange(FadeKind.GHOSTING_ICON_ROLLOVER, buttonModel.isRollover()); } if (FadeConfigurationManager.getInstance().fadeAllowed( FadeKind.GHOSTING_BUTTON_PRESS, comp)) { trackModelChange(FadeKind.GHOSTING_BUTTON_PRESS, buttonModel.isPressed()); } } }; this.buttonModel.addChangeListener(this.modelListener); } /** * Unregisters all listeners on model changes. */ public void unregisterListeners() { this.buttonModel.removeChangeListener(this.modelListener); } } liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/animation/RunOnUIThread.java0000644000175000017500000000364411137001462027571 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget.animation; import java.lang.annotation.*; /** * Annotation to mark code that should run on UI thread. * * @author Kirill Grouchnikov */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface RunOnUIThread { }liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/Looks.license0000644000175000017500000000306510633351240024752 0ustar drazzibdrazzibCopyright (c) 2001-2005 JGoodies Karsten Lentzsch and contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the JGoodies Karsten Lentzsch and contributors nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.liblaf-widget-java-4.3.orig/src/org/jvnet/lafwidget/LafWidgetAdapter.java0000644000175000017500000000626611137001460026333 0ustar drazzibdrazzib/* * Copyright (c) 2005-2009 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jvnet.lafwidget; import javax.swing.JComponent; /** * Base implementation of {@link LafWidget} interface. * * @author Kirill Grouchnikov */ public abstract class LafWidgetAdapter implements LafWidget { /** * Associated component. */ protected T jcomp; /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#setComponent(javax.swing.JComponent) */ public void setComponent(T jcomp) { this.jcomp = jcomp; } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#installUI() */ public void installUI() { } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#installComponents() */ public void installComponents() { } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#installDefaults() */ public void installDefaults() { } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#installListeners() */ public void installListeners() { } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#uninstallUI() */ public void uninstallUI() { } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#uninstallComponents() */ public void uninstallComponents() { } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#uninstallDefaults() */ public void uninstallDefaults() { } /* * (non-Javadoc) * * @see org.jvnet.lafwidget.LafWidget#uninstallListeners() */ public void uninstallListeners() { } } liblaf-widget-java-4.3.orig/src/test/0000755000175000017500000000000011253454704017417 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/test/check/0000755000175000017500000000000011253454704020474 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/test/check/MyPasswordStrengthChecker.java0000644000175000017500000000500710736233702026453 0ustar drazzibdrazzib/* * Copyright (c) 2005-2008 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Substance Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package test.check; import org.jvnet.lafwidget.text.PasswordStrengthChecker; import org.jvnet.lafwidget.utils.LafConstants.PasswordStrength; public class MyPasswordStrengthChecker implements PasswordStrengthChecker { public PasswordStrength getStrength(char[] password) { if (password == null) return PasswordStrength.WEAK; int length = password.length; if (length < 3) return PasswordStrength.WEAK; if (length < 6) return PasswordStrength.MEDIUM; return PasswordStrength.STRONG; } public String getDescription(PasswordStrength strength) { if (strength == PasswordStrength.WEAK) return "This password is way too weak"; if (strength == PasswordStrength.MEDIUM) return "Come on, you can do
a little better than that"; if (strength == PasswordStrength.STRONG) return "OK"; return null; } }liblaf-widget-java-4.3.orig/src/test/check/layout/0000755000175000017500000000000011253454704022011 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/test/check/layout/SampleFrame.java0000644000175000017500000001102010736233704025042 0ustar drazzibdrazzib/* * Copyright (c) 2005-2008 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package test.check.layout; import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; import org.jvnet.lafwidget.LafWidget; import org.jvnet.lafwidget.layout.TransitionLayoutManager; import org.jvnet.lafwidget.utils.LafConstants.AnimationKind; public class SampleFrame extends JFrame { JButton b1, b2, b3; public SampleFrame() { super("Transition test"); this.getContentPane().setLayout(new BorderLayout()); JPanel buttons = new JPanel(); buttons.setLayout(new FlowLayout()); this.getContentPane().add(buttons, BorderLayout.SOUTH); // for the first movie, change the following line to // use the BorderLayout final JPanel mainPanel = new JPanel(new BorderLayout()); // bring the magic in one single line TransitionLayoutManager.getInstance().track(mainPanel, true); this.b1 = new JButton("1"); this.b2 = new JButton("2"); this.b3 = new JButton("3"); final JButton add = new JButton("add"); add.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { mainPanel.add(b1, BorderLayout.WEST); mainPanel.add(b2, BorderLayout.CENTER); mainPanel.add(b3, BorderLayout.EAST); mainPanel.revalidate(); add.setEnabled(false); } }); } }); buttons.add(add); this.getContentPane().add(mainPanel, BorderLayout.CENTER); final JCheckBox cb1 = new JCheckBox("1"); cb1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { b1.setVisible(!b1.isVisible()); mainPanel.revalidate(); } }); buttons.add(cb1); final JCheckBox cb2 = new JCheckBox("2"); cb2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { b2.setVisible(!b2.isVisible()); mainPanel.revalidate(); } }); buttons.add(cb2); final JCheckBox cb3 = new JCheckBox("3"); cb3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { b3.setVisible(!b3.isVisible()); mainPanel.revalidate(); } }); buttons.add(cb3); final JCheckBox cb13 = new JCheckBox("13"); cb13.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { b1.setVisible(!b1.isVisible()); b3.setVisible(!b3.isVisible()); mainPanel.revalidate(); } }); buttons.add(cb13); this.setSize(300, 100); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); mainPanel.putClientProperty(LafWidget.ANIMATION_KIND, AnimationKind.SLOW); } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { new SampleFrame().setVisible(true); } }); } } liblaf-widget-java-4.3.orig/src/test/check/layout/SampleFrame2.java0000644000175000017500000001343510736233704025140 0ustar drazzibdrazzib/* * Copyright (c) 2005-2008 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package test.check.layout; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; import org.jvnet.lafwidget.LafWidget; import org.jvnet.lafwidget.layout.TransitionLayoutManager; import org.jvnet.lafwidget.utils.LafConstants.AnimationKind; public class SampleFrame2 extends JFrame { JButton b1, b2, b3; JButton b4, b5, b6; public SampleFrame2() { super("Transition test"); this.getContentPane().setLayout(new BorderLayout()); JPanel buttons = new JPanel(new FlowLayout()); this.getContentPane().add(buttons, BorderLayout.SOUTH); // for the first movie, change the following line to // use the BorderLayout final JPanel mainPanel = new JPanel(new FlowLayout()); final JPanel mainPanel2 = new JPanel(new FlowLayout()); final JPanel centerPanel = new JPanel(new GridLayout(2, 1)); centerPanel.add(mainPanel); centerPanel.add(mainPanel2); // bring the magic in one single line TransitionLayoutManager.getInstance().track(mainPanel, true); TransitionLayoutManager.getInstance().track(mainPanel2, true); this.b1 = new JButton("1"); this.b2 = new JButton("2"); this.b3 = new JButton("3"); this.b4 = new JButton("4"); this.b5 = new JButton("5"); this.b6 = new JButton("6"); final JButton add = new JButton("add"); add.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { mainPanel.add(b1, BorderLayout.WEST); mainPanel.add(b2, BorderLayout.CENTER); mainPanel.add(b3, BorderLayout.EAST); mainPanel.revalidate(); mainPanel2.add(b4, BorderLayout.WEST); mainPanel2.add(b5, BorderLayout.CENTER); mainPanel2.add(b6, BorderLayout.EAST); mainPanel2.revalidate(); add.setEnabled(false); } }); } }); buttons.add(add); final JCheckBox cb = new JCheckBox("border layout"); cb.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { TransitionLayoutManager.getInstance().untrack(mainPanel); TransitionLayoutManager.getInstance().untrack(mainPanel2); if (cb.isSelected()) { mainPanel.setLayout(new BorderLayout()); mainPanel2.setLayout(new BorderLayout()); } else { mainPanel.setLayout(new FlowLayout()); mainPanel2.setLayout(new FlowLayout()); } TransitionLayoutManager.getInstance().track(mainPanel, true); TransitionLayoutManager.getInstance().track(mainPanel2, true); mainPanel.revalidate(); mainPanel.doLayout(); mainPanel.repaint(); mainPanel2.revalidate(); } }); // buttons.add(cb); this.getContentPane().add(centerPanel, BorderLayout.CENTER); final JCheckBox cb1 = new JCheckBox("1"); cb1.setSelected(true); final JCheckBox cb2 = new JCheckBox("2"); cb2.setSelected(true); final JCheckBox cb3 = new JCheckBox("3"); cb3.setSelected(true); final JCheckBox cb4 = new JCheckBox("4"); cb4.setSelected(true); final JCheckBox cb5 = new JCheckBox("5"); cb5.setSelected(true); final JCheckBox cb6 = new JCheckBox("6"); cb6.setSelected(true); buttons.add(cb1); buttons.add(cb2); buttons.add(cb3); buttons.add(cb4); buttons.add(cb5); buttons.add(cb6); JButton showHide = new JButton("Toggle"); showHide.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { b1.setVisible(cb1.isSelected()); b2.setVisible(cb2.isSelected()); b3.setVisible(cb3.isSelected()); b4.setVisible(cb4.isSelected()); b5.setVisible(cb5.isSelected()); b6.setVisible(cb6.isSelected()); mainPanel.doLayout(); mainPanel2.doLayout(); } }); buttons.add(showHide); this.setSize(400, 200); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); mainPanel.putClientProperty(LafWidget.ANIMATION_KIND, AnimationKind.SLOW); } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { new SampleFrame2().setVisible(true); } }); } } liblaf-widget-java-4.3.orig/src/test/check/SampleFrame.java0000644000175000017500000003250011003321672023521 0ustar drazzibdrazzib/* * Copyright (c) 2005-2006 Substance Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Substance Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package test.check; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; import javax.swing.*; import javax.swing.border.EmptyBorder; import javax.swing.tree.DefaultMutableTreeNode; import org.jvnet.lafwidget.LafWidget; import org.jvnet.lafwidget.layout.TransitionLayoutManager; import org.jvnet.lafwidget.tabbed.DefaultTabPreviewPainter; import org.jvnet.lafwidget.tabbed.TabOverviewDialog; import org.jvnet.lafwidget.text.PasswordStrengthChecker; import org.jvnet.lafwidget.utils.LafConstants.*; public class SampleFrame extends JFrame { protected JButton prev; private static class MyListModel extends AbstractListModel { protected List model; public MyListModel() { super(); this.model = new ArrayList(); this.model.add("Ohio State [Buckeyes]"); this.model.add("Auburn [Tigers]"); this.model.add("University of South California [Trojans]"); this.model.add("West Virginia [Mountaineers]"); this.model.add("Florida [Gators]"); this.model.add("Michigan [Wolverines]"); this.model.add("Texas [Longhorns]"); this.model.add("Louisville [Cardinals]"); this.model.add("Louisiana State University [Tigers]"); this.model.add("Georgia [Bulldogs]"); this.model.add("Virginia Tech [Hokies]"); this.model.add("Notre Dame [Fighting Irish]"); this.model.add("Iowa [Hawkeyes]"); this.model.add("Oregon [Ducks]"); this.model.add("Tennessee [Volunteers]"); this.model.add("Oklahoma [Sooners]"); this.model.add("Texas Christian University [Horned Frogs]"); } public Object getElementAt(int index) { return this.model.get(index); } public int getSize() { return this.model.size(); } } public SampleFrame() { super("Test application"); this.setLayout(new BorderLayout()); final JTabbedPane tabbed = new JTabbedPane(); TransitionLayoutManager.getInstance().track(tabbed, true); this.add(tabbed, BorderLayout.CENTER); tabbed.putClientProperty(LafWidget.TABBED_PANE_PREVIEW_PAINTER, new DefaultTabPreviewPainter() { @Override public TabOverviewKind getOverviewKind(JTabbedPane tabPane) { return TabOverviewKind.ROUND_CAROUSEL; } }); JPanel transPanel = new JPanel(); transPanel.setLayout(new BorderLayout()); JPanel buttons = new JPanel(new FlowLayout(FlowLayout.CENTER, 1, 1)); transPanel.add(buttons, BorderLayout.SOUTH); // for the first movie, change the following line to // use the BorderLayout final JPanel mainPanel = new JPanel(new FlowLayout()); final JPanel mainPanel2 = new JPanel(new FlowLayout()); final JPanel centerPanel = new JPanel(new GridLayout(2, 1)); centerPanel.add(mainPanel); centerPanel.add(mainPanel2); // bring the magic in one single line TransitionLayoutManager.getInstance().track(mainPanel, true); TransitionLayoutManager.getInstance().track(mainPanel2, true); final JButton b1 = new JButton("button 1"); final JButton b2 = new JButton("button 2"); final JButton b3 = new JButton("button 3"); final JButton b4 = new JButton("button 4"); final JButton b5 = new JButton("button 5"); final JButton b6 = new JButton("button 6"); final JButton add1 = new JButton("add"); final JButton add2 = new JButton("add"); add1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { mainPanel.add(b1); mainPanel.add(b2); mainPanel.add(b3); mainPanel.revalidate(); add1.setVisible(false); } }); } }); add2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { mainPanel2.add(b4); mainPanel2.add(b5); mainPanel2.add(b6); mainPanel2.revalidate(); add2.setVisible(false); } }); } }); mainPanel.add(add1); mainPanel2.add(add2); final JCheckBox cb = new JCheckBox("border layout"); cb.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { TransitionLayoutManager.getInstance().untrack(mainPanel); TransitionLayoutManager.getInstance().untrack(mainPanel2); if (cb.isSelected()) { mainPanel.setLayout(new BorderLayout()); mainPanel2.setLayout(new BorderLayout()); } else { mainPanel.setLayout(new FlowLayout()); mainPanel2.setLayout(new FlowLayout()); } TransitionLayoutManager.getInstance().track(mainPanel, true); TransitionLayoutManager.getInstance().track(mainPanel2, true); mainPanel.revalidate(); mainPanel.doLayout(); mainPanel.repaint(); mainPanel2.revalidate(); } }); // buttons.add(cb); transPanel.add(centerPanel, BorderLayout.CENTER); final JCheckBox cb1 = new JCheckBox("1"); cb1.setSelected(true); final JCheckBox cb2 = new JCheckBox("2"); cb2.setSelected(true); final JCheckBox cb3 = new JCheckBox("3"); cb3.setSelected(true); final JCheckBox cb4 = new JCheckBox("4"); cb4.setSelected(true); final JCheckBox cb5 = new JCheckBox("5"); cb5.setSelected(true); final JCheckBox cb6 = new JCheckBox("6"); cb6.setSelected(true); buttons.add(cb1); buttons.add(cb2); buttons.add(cb3); buttons.add(cb4); buttons.add(cb5); buttons.add(cb6); JButton showHide = new JButton("Toggle"); showHide.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { b1.setVisible(cb1.isSelected()); b2.setVisible(cb2.isSelected()); b3.setVisible(cb3.isSelected()); b4.setVisible(cb4.isSelected()); b5.setVisible(cb5.isSelected()); b6.setVisible(cb6.isSelected()); mainPanel.doLayout(); mainPanel2.doLayout(); } }); buttons.add(showHide); tabbed.addTab("Regular", transPanel); JPanel samplePanel = new JPanel(new BorderLayout()); TwoColumnPanel stuff = new TwoColumnPanel(); stuff.setVerticalSpacing(4); stuff.setHorizontalSpacing(2); JCheckBox cbes = new JCheckBox("Check box"); cbes.setSelected(true); JPasswordField pf1 = new JPasswordField("aa"); JRadioButton rb1 = new JRadioButton("Radio button"); rb1.setSelected(true); JPasswordField pf2 = new JPasswordField("aaaaaaaaa"); PasswordStrengthChecker psc = new PasswordStrengthChecker() { public PasswordStrength getStrength(char[] password) { if (password == null) return PasswordStrength.WEAK; int length = password.length; if (length < 3) return PasswordStrength.WEAK; if (length < 6) return PasswordStrength.MEDIUM; return PasswordStrength.STRONG; } public String getDescription(PasswordStrength strength) { if (strength == PasswordStrength.WEAK) return "This password is way too weak"; if (strength == PasswordStrength.MEDIUM) return "Come on, you can do
a little better than that"; if (strength == PasswordStrength.STRONG) return "OK"; return null; } }; pf1.putClientProperty(LafWidget.PASSWORD_STRENGTH_CHECKER, psc); pf2.putClientProperty(LafWidget.PASSWORD_STRENGTH_CHECKER, psc); stuff.addRow(cbes, rb1); stuff.addRow(pf1, pf2); JComboBox combo = new JComboBox(new Object[] { "item1" }); combo.setSelectedIndex(0); combo.setEditable(true); JTextField text = new JTextField("Text field"); text.setEditable(false); text.putClientProperty(LafWidget.ANIMATION_KIND, AnimationKind.SLOW); stuff.addRow(combo, text); stuff.setPreferredSize(new Dimension(stuff.getPreferredSize().width, stuff.getPreferredSize().height + 100)); stuff.setBorder(null); stuff.setOpaque(false); JScrollPane scroll = new JScrollPane(stuff, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scroll.setBorder(new EmptyBorder(0, 0, 0, 0)); scroll.setOpaque(false); scroll.getViewport().setOpaque(false); samplePanel.add(scroll, BorderLayout.CENTER); JPanel buttons2 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); prev = new JButton("prev"); JButton cancel = new JButton("cancel"); cancel.setEnabled(false); JButton ok = new JButton("OK"); ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { TabOverviewDialog.getOverviewDialog(tabbed).setVisible(true); } }); buttons2.add(prev); buttons2.add(cancel); buttons2.add(ok); samplePanel.add(buttons2, BorderLayout.SOUTH); tabbed.addTab("Sample", samplePanel); JPanel samplePanel2 = new JPanel(new BorderLayout()); DefaultMutableTreeNode root = new DefaultMutableTreeNode("root"); DefaultMutableTreeNode son1 = new DefaultMutableTreeNode("son1"); DefaultMutableTreeNode son2 = new DefaultMutableTreeNode("son2"); DefaultMutableTreeNode son3 = new DefaultMutableTreeNode("son3"); DefaultMutableTreeNode gson11 = new DefaultMutableTreeNode("gson11"); DefaultMutableTreeNode gson12 = new DefaultMutableTreeNode("gson12"); DefaultMutableTreeNode gson21 = new DefaultMutableTreeNode("gson21"); DefaultMutableTreeNode gson22 = new DefaultMutableTreeNode("gson22"); DefaultMutableTreeNode gson31 = new DefaultMutableTreeNode("gson31"); DefaultMutableTreeNode gson32 = new DefaultMutableTreeNode("gson32"); DefaultMutableTreeNode ggson111 = new DefaultMutableTreeNode("ggson111"); DefaultMutableTreeNode ggson112 = new DefaultMutableTreeNode("ggson112"); DefaultMutableTreeNode ggson113 = new DefaultMutableTreeNode("ggson113"); gson11.add(ggson111); gson11.add(ggson112); gson11.add(ggson113); son1.add(gson11); son1.add(gson12); son2.add(gson21); son2.add(gson22); son3.add(gson31); son3.add(gson32); root.add(son1); root.add(son2); root.add(son3); JTree tree = new JTree(root); tree.setBorder(new EmptyBorder(0, 0, 0, 0)); JScrollPane jspTree = new JScrollPane(tree); // TransitionLayoutManager.getInstance().track(jspTree, true); // jspTree.setBorder(new EmptyBorder(0, 0, 0, 0)); JList list = new JList(new MyListModel()); list.setBorder(new EmptyBorder(0, 0, 0, 0)); list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); JScrollPane jspList = new JScrollPane(list); // jspList.setBorder(new EmptyBorder(0, 0, 0, 0)); JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jspTree, jspList); split.setDividerLocation(130); samplePanel2.add(split, BorderLayout.CENTER); tabbed.add("Renderers", samplePanel2); tabbed.setSelectedComponent(samplePanel); tabbed.setOpaque(false); tabbed.setBorder(new EmptyBorder(0, 3, 3, 3)); this.setResizable(true); this.getRootPane().setDefaultButton(ok); JMenuBar jmb = new JMenuBar(); JMenu menu = new JMenu("menu"); menu.add(new JMenuItem("test item 1")); menu.add(new JCheckBoxMenuItem("test item 2")); menu.add(new JRadioButtonMenuItem("test item 3")); menu.addSeparator(); menu.add(new JMenuItem("test menu item 4")); menu.add(new JCheckBoxMenuItem("test menu item 5")); menu.add(new JRadioButtonMenuItem("test menu item 6")); jmb.add(menu); JMenu menu2 = new JMenu("big"); for (int i = 0; i < 35; i++) menu2.add(new JMenuItem("menu item " + i)); jmb.add(menu2); this.setJMenuBar(jmb); } public static void main(String[] args) throws Exception { UIManager.put(LafWidget.ANIMATION_KIND, AnimationKind.SLOW); JFrame.setDefaultLookAndFeelDecorated(true); SampleFrame sf = new SampleFrame(); sf.setSize(300, 200); sf.setLocationRelativeTo(null); sf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); sf.setVisible(true); // h(sf, 0); } } liblaf-widget-java-4.3.orig/src/test/check/treednd/0000755000175000017500000000000011253454704022121 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/test/check/treednd/TreeModelBuilder.java0000644000175000017500000000230510532142560026144 0ustar drazzibdrazzib/* * $Id: TreeModelBuilder.java,v 1.6 2006/11/28 03:36:31 kirillcool Exp $ * Read the "license.txt" file for licensing information. * (C) Antonio Vieiro. All rights reserved. */ package test.check.treednd; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; /** * TreeModelBuilder builds tree models for the sample. * * @author Antonio Vieiro (antonio@antonioshome.net), $Author: kirillcool $ * @version $Revision: 1.6 $ */ final class TreeModelBuilder { static DefaultTreeModel createModel() { DefaultMutableTreeNode root = new DefaultMutableTreeNode("sample-tree"); DefaultTreeModel model = new DefaultTreeModel(root); DefaultMutableTreeNode oranges = new DefaultMutableTreeNode("oranges"); model.insertNodeInto(oranges, root, 0); for (int i = 0; i < 5; i++) model .insertNodeInto(new DefaultMutableTreeNode("orange " + (i + 1)), oranges, i); DefaultMutableTreeNode apples = new DefaultMutableTreeNode("apples"); model.insertNodeInto(apples, root, 1); for (int i = 0; i < 3; i++) model.insertNodeInto( new DefaultMutableTreeNode("apple " + (i + 1)), apples, i); return model; } } liblaf-widget-java-4.3.orig/src/test/check/treednd/apple.png0000644000175000017500000000025310432606332023722 0ustar drazzibdrazzibPNG  IHDRarIDAT8R[ +^l]O>#Y?@^BB@yő. 8P$n4:67tbNyEZ+!VJxoK?z:IENDB`liblaf-widget-java-4.3.orig/src/test/check/treednd/orange.png0000644000175000017500000000026110432606332024073 0ustar drazzibdrazzibPNG  IHDRaxIDAT8R ,,&Y7C \y=J!Zlq$]hDӞ6+6b#6BS¼|62U"g4m͏F2}pR&p)IENDB`liblaf-widget-java-4.3.orig/src/test/check/treednd/MyCustomCellRendererer.java0000644000175000017500000000252210532142556027361 0ustar drazzibdrazzib/* * $Id: MyCustomCellRendererer.java,v 1.6 2006/11/28 03:36:30 kirillcool Exp $ * Read the "license.txt" file for licensing information. * (C) Antonio Vieiro. All rights reserved. */ package test.check.treednd; import java.awt.Component; import javax.swing.ImageIcon; import javax.swing.JTree; import javax.swing.tree.DefaultTreeCellRenderer; /** * MyCustomCellRendererer is a cell renderer that shows some (ugly, sorry) icons * * @author Antonio Vieiro (antonio@antonioshome.net), $Author: kirillcool $ * @version $Revision: 1.6 $ */ class MyCustomCellRendererer extends DefaultTreeCellRenderer { ImageIcon orangeIcon; ImageIcon appleIcon; public MyCustomCellRendererer() { this.orangeIcon = new ImageIcon(this.getClass().getResource( "orange.png")); this.appleIcon = new ImageIcon(this.getClass().getResource("apple.png")); } public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); if (value.toString().startsWith("orange")) this.setIcon(this.orangeIcon); else if (value.toString().startsWith("apple")) this.setIcon(this.appleIcon); else this.setIcon(null); return this; } } liblaf-widget-java-4.3.orig/src/test/check/asm/0000755000175000017500000000000011253454704021254 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/test/check/asm/TestContainerGhostingBeforeUI.java0000644000175000017500000000417610736233702027773 0ustar drazzibdrazzib/* * Copyright (c) 2005-2008 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package test.check.asm; import java.awt.Graphics; import javax.swing.JComponent; import javax.swing.plaf.basic.BasicButtonUI; import org.jvnet.lafwidget.animation.effects.GhostPaintingUtils; public class TestContainerGhostingBeforeUI extends BasicButtonUI { public void __container_update(Graphics g, JComponent c) { super.update(g, c); } public void update(Graphics g, JComponent c) { GhostPaintingUtils.paintGhostImages(c, g); this.__container_update(g, c); } } liblaf-widget-java-4.3.orig/src/test/check/asm/TestContainerGhostingAfterUI.java0000644000175000017500000000421310736233702027622 0ustar drazzibdrazzib/* * Copyright (c) 2005-2008 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package test.check.asm; import java.awt.Graphics; import javax.swing.JComponent; import javax.swing.plaf.basic.BasicButtonUI; import org.jvnet.lafwidget.animation.effects.GhostPaintingUtils; public class TestContainerGhostingAfterUI extends BasicButtonUI { // public void __container_update(Graphics g, JComponent c) { // super.update(g, c); // } // public void update(Graphics g, JComponent c) { // this.__container_update(g, c); // GhostPaintingUtils.paintGhostImages(c, g); // } } liblaf-widget-java-4.3.orig/src/test/check/asm/TestGhostListenerUI.java0000644000175000017500000000356210626514510026010 0ustar drazzibdrazzibpackage test.check.asm; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import javax.swing.AbstractButton; import javax.swing.plaf.basic.BasicButtonUI; import org.jvnet.lafwidget.animation.effects.GhostingListener; public class TestGhostListenerUI extends BasicButtonUI { /** * Model change listener for ghost image effects. */ private GhostingListener ghostModelChangeListener; /** * Property change listener. Listens on changes to the * {@link AbstractButton#MODEL_CHANGED_PROPERTY} property. */ protected PropertyChangeListener ghostPropertyListener; protected void __icon__installListeners(AbstractButton b) { super.installListeners(b); } protected void installListeners(final AbstractButton b) { this.__icon__installListeners(b); this.ghostPropertyListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (AbstractButton.MODEL_CHANGED_PROPERTY.equals(evt .getPropertyName())) { if (ghostModelChangeListener != null) ghostModelChangeListener.unregisterListeners(); ghostModelChangeListener = new GhostingListener(b, b .getModel()); ghostModelChangeListener.registerListeners(); } } }; b.addPropertyChangeListener(this.ghostPropertyListener); this.ghostModelChangeListener = new GhostingListener(b, b .getModel()); this.ghostModelChangeListener.registerListeners(); } protected void __icon__uninstallListeners(AbstractButton b) { super.uninstallListeners(b); } @Override protected void uninstallListeners(AbstractButton b) { b.removePropertyChangeListener(this.ghostPropertyListener); this.ghostPropertyListener = null; this.ghostModelChangeListener.unregisterListeners(); this.ghostModelChangeListener = null; this.__icon__uninstallListeners(b); } } liblaf-widget-java-4.3.orig/src/test/check/asm/TestUI.java0000644000175000017500000000556611015344560023302 0ustar drazzibdrazzib/* * Copyright (c) 2005-2008 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package test.check.asm; import java.awt.*; import java.util.Map; import javax.swing.JComponent; import javax.swing.plaf.basic.BasicButtonUI; import org.jvnet.lafwidget.layout.TransitionLayout; import org.jvnet.lafwidget.utils.RenderingUtils; public class TestUI extends BasicButtonUI { public void __update(Graphics g, JComponent c) { super.update(g, c); } public void update(Graphics g, JComponent c) { Graphics2D graphics = (Graphics2D) g; Composite old = graphics.getComposite(); float oldAlpha = 1.0f; if (old instanceof AlphaComposite) { AlphaComposite ac = (AlphaComposite) old; if (ac.getRule() == AlphaComposite.SRC_OVER) oldAlpha = ac.getAlpha(); } graphics.setComposite(TransitionLayout.getAlphaComposite(c, oldAlpha)); // Object alpha = c.getClientProperty(TransitionLayout.ALPHA); // if (alpha instanceof Float) { // graphics.setComposite(AlphaComposite.getInstance( // AlphaComposite.SRC_OVER, ((Float) alpha).floatValue())); // } Map oldRenderingHints = RenderingUtils.installDesktopHints(graphics, c); this.__update(graphics, c); graphics.setComposite(old); if (oldRenderingHints != null) { graphics.addRenderingHints(oldRenderingHints); } } } liblaf-widget-java-4.3.orig/src/test/check/asm/TestLookAndFeel.java0000644000175000017500000000155410603134252025076 0ustar drazzibdrazzibpackage test.check.asm; import javax.swing.UIDefaults; import javax.swing.plaf.basic.BasicLookAndFeel; public class TestLookAndFeel extends BasicLookAndFeel { @Override public String getDescription() { return null; } @Override public String getID() { return null; } @Override public String getName() { return null; } @Override public boolean isNativeLookAndFeel() { return false; } @Override public boolean isSupportedLookAndFeel() { return false; } @Override protected void initClassDefaults(UIDefaults table) { super.initClassDefaults(table); // // table.put("ButtonUI", "my.pack.ButtonUI"); // table.put("CheckboxUI", "my.pack.CheckboxUI"); // table.put("ToolbarUI", "my.pack.ToolbarUI"); // table.put("PanelUI", "my.pack.PanelUI"); // table.put("MenuBarUI", "my.pack.MenuBarUI"); } } liblaf-widget-java-4.3.orig/src/test/check/asm/TestIconGhostingUI.java0000644000175000017500000000474710736233704025624 0ustar drazzibdrazzib/* * Copyright (c) 2005-2008 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package test.check.asm; import java.awt.*; import javax.swing.AbstractButton; import javax.swing.JComponent; import javax.swing.plaf.basic.BasicButtonUI; import org.jvnet.lafwidget.animation.effects.GhostPaintingUtils; public class TestIconGhostingUI extends BasicButtonUI { private boolean iconGhostingMarker; protected void __test__check__asm__TestIconGhostingUI__paintIcon( Graphics g, JComponent c, Rectangle iconRect) { super.paintIcon(g, c, iconRect); } protected void paintIcon(Graphics g, JComponent c, Rectangle iconRect) { c.putClientProperty("icon.bounds", new Rectangle(iconRect)); Graphics2D graphics = (Graphics2D) g.create(); GhostPaintingUtils.paintGhostIcon(graphics, (AbstractButton) c, iconRect); graphics.dispose(); __test__check__asm__TestIconGhostingUI__paintIcon(g, c, iconRect); } } liblaf-widget-java-4.3.orig/src/test/check/asm/TestIconGhostingUI2.java0000644000175000017500000000467310736233704025704 0ustar drazzibdrazzib/* * Copyright (c) 2005-2008 Laf-Widget Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Laf-Widget Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package test.check.asm; import java.awt.*; import javax.swing.AbstractButton; import javax.swing.JComponent; import javax.swing.plaf.basic.BasicButtonUI; import org.jvnet.lafwidget.animation.effects.GhostPaintingUtils; public class TestIconGhostingUI2 extends BasicButtonUI { // private boolean iconGhostingMarker; // // protected void __test__check__asm__TestIconGhostingUI__paintIcon(Graphics g, // AbstractButton c, Rectangle iconRect) { // super.paintIcon(g, c, iconRect); // } // protected void paintIcon(Graphics g, AbstractButton c, Rectangle iconRect) { // Graphics2D graphics = (Graphics2D) g.create(); // GhostPaintingUtils.paintGhostIcon(graphics, (AbstractButton) c); // graphics.dispose(); // __test__check__asm__TestIconGhostingUI__paintIcon(g, c, iconRect); } } liblaf-widget-java-4.3.orig/src/test/check/SampleFrameAdapter.java0000644000175000017500000003253411161440336025035 0ustar drazzibdrazzib/* * Copyright (c) 2005-2006 Substance Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Substance Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package test.check; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; import javax.swing.*; import javax.swing.border.EmptyBorder; import javax.swing.tree.DefaultMutableTreeNode; import org.jvnet.lafwidget.LafWidget; import org.jvnet.lafwidget.layout.TransitionLayoutManager; import org.jvnet.lafwidget.tabbed.DefaultTabPreviewPainter; import org.jvnet.lafwidget.tabbed.TabOverviewDialog; import org.jvnet.lafwidget.text.PasswordStrengthChecker; import org.jvnet.lafwidget.utils.LafConstants.*; public class SampleFrameAdapter extends JFrame { protected JButton prev; private static class MyListModel extends AbstractListModel { protected List model; public MyListModel() { super(); this.model = new ArrayList(); this.model.add("Ohio State [Buckeyes]"); this.model.add("Auburn [Tigers]"); this.model.add("University of South California [Trojans]"); this.model.add("West Virginia [Mountaineers]"); this.model.add("Florida [Gators]"); this.model.add("Michigan [Wolverines]"); this.model.add("Texas [Longhorns]"); this.model.add("Louisville [Cardinals]"); this.model.add("Louisiana State University [Tigers]"); this.model.add("Georgia [Bulldogs]"); this.model.add("Virginia Tech [Hokies]"); this.model.add("Notre Dame [Fighting Irish]"); this.model.add("Iowa [Hawkeyes]"); this.model.add("Oregon [Ducks]"); this.model.add("Tennessee [Volunteers]"); this.model.add("Oklahoma [Sooners]"); this.model.add("Texas Christian University [Horned Frogs]"); } public Object getElementAt(int index) { return this.model.get(index); } public int getSize() { return this.model.size(); } } public SampleFrameAdapter() { super("Test application"); this.setLayout(new BorderLayout()); final JTabbedPane tabbed = new JTabbedPane(); TransitionLayoutManager.getInstance().track(tabbed, true); this.add(tabbed, BorderLayout.CENTER); tabbed.putClientProperty(LafWidget.TABBED_PANE_PREVIEW_PAINTER, new DefaultTabPreviewPainter() { @Override public TabOverviewKind getOverviewKind(JTabbedPane tabPane) { return TabOverviewKind.ROUND_CAROUSEL; } }); JPanel transPanel = new JPanel(); transPanel.setLayout(new BorderLayout()); JPanel buttons = new JPanel(new FlowLayout(FlowLayout.CENTER, 1, 1)); transPanel.add(buttons, BorderLayout.SOUTH); // for the first movie, change the following line to // use the BorderLayout final JPanel mainPanel = new JPanel(new FlowLayout()); final JPanel mainPanel2 = new JPanel(new FlowLayout()); final JPanel centerPanel = new JPanel(new GridLayout(2, 1)); centerPanel.add(mainPanel); centerPanel.add(mainPanel2); // bring the magic in one single line TransitionLayoutManager.getInstance().track(mainPanel, true); TransitionLayoutManager.getInstance().track(mainPanel2, true); final JButton b1 = new JButton("button 1"); final JButton b2 = new JButton("button 2"); final JButton b3 = new JButton("button 3"); final JButton b4 = new JButton("button 4"); final JButton b5 = new JButton("button 5"); final JButton b6 = new JButton("button 6"); final JButton add1 = new JButton("add"); final JButton add2 = new JButton("add"); add1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { mainPanel.add(b1); mainPanel.add(b2); mainPanel.add(b3); mainPanel.revalidate(); add1.setVisible(false); } }); } }); add2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { mainPanel2.add(b4); mainPanel2.add(b5); mainPanel2.add(b6); mainPanel2.revalidate(); add2.setVisible(false); } }); } }); mainPanel.add(add1); mainPanel2.add(add2); final JCheckBox cb = new JCheckBox("border layout"); cb.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { TransitionLayoutManager.getInstance().untrack(mainPanel); TransitionLayoutManager.getInstance().untrack(mainPanel2); if (cb.isSelected()) { mainPanel.setLayout(new BorderLayout()); mainPanel2.setLayout(new BorderLayout()); } else { mainPanel.setLayout(new FlowLayout()); mainPanel2.setLayout(new FlowLayout()); } TransitionLayoutManager.getInstance().track(mainPanel, true); TransitionLayoutManager.getInstance().track(mainPanel2, true); mainPanel.revalidate(); mainPanel.doLayout(); mainPanel.repaint(); mainPanel2.revalidate(); } }); // buttons.add(cb); transPanel.add(centerPanel, BorderLayout.CENTER); final JCheckBox cb1 = new JCheckBox("1"); cb1.setSelected(true); final JCheckBox cb2 = new JCheckBox("2"); cb2.setSelected(true); final JCheckBox cb3 = new JCheckBox("3"); cb3.setSelected(true); final JCheckBox cb4 = new JCheckBox("4"); cb4.setSelected(true); final JCheckBox cb5 = new JCheckBox("5"); cb5.setSelected(true); final JCheckBox cb6 = new JCheckBox("6"); cb6.setSelected(true); buttons.add(cb1); buttons.add(cb2); buttons.add(cb3); buttons.add(cb4); buttons.add(cb5); buttons.add(cb6); JButton showHide = new JButton("Toggle"); showHide.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { b1.setVisible(cb1.isSelected()); b2.setVisible(cb2.isSelected()); b3.setVisible(cb3.isSelected()); b4.setVisible(cb4.isSelected()); b5.setVisible(cb5.isSelected()); b6.setVisible(cb6.isSelected()); mainPanel.doLayout(); mainPanel2.doLayout(); } }); buttons.add(showHide); tabbed.addTab("Regular", transPanel); JPanel samplePanel = new JPanel(new BorderLayout()); TwoColumnPanel stuff = new TwoColumnPanel(); stuff.setVerticalSpacing(4); stuff.setHorizontalSpacing(2); JCheckBox cbes = new JCheckBox("Check box"); cbes.setSelected(true); JPasswordField pf1 = new JPasswordField("aa"); JRadioButton rb1 = new JRadioButton("Radio button"); rb1.setSelected(true); JPasswordField pf2 = new JPasswordField("aaaaaaaaa"); PasswordStrengthChecker psc = new PasswordStrengthChecker() { public PasswordStrength getStrength(char[] password) { if (password == null) return PasswordStrength.WEAK; int length = password.length; if (length < 3) return PasswordStrength.WEAK; if (length < 6) return PasswordStrength.MEDIUM; return PasswordStrength.STRONG; } public String getDescription(PasswordStrength strength) { if (strength == PasswordStrength.WEAK) return "This password is way too weak"; if (strength == PasswordStrength.MEDIUM) return "Come on, you can do
a little better than that"; if (strength == PasswordStrength.STRONG) return "OK"; return null; } }; pf1.putClientProperty(LafWidget.PASSWORD_STRENGTH_CHECKER, psc); pf2.putClientProperty(LafWidget.PASSWORD_STRENGTH_CHECKER, psc); stuff.addRow(cbes, rb1); stuff.addRow(pf1, pf2); JComboBox combo = new JComboBox(new Object[] { "item1" }); combo.setSelectedIndex(0); combo.setEditable(true); JTextField text = new JTextField("Text field"); text.setEditable(false); text.putClientProperty(LafWidget.ANIMATION_KIND, AnimationKind.SLOW); stuff.addRow(combo, text); stuff.setPreferredSize(new Dimension(stuff.getPreferredSize().width, stuff.getPreferredSize().height + 100)); stuff.setBorder(null); stuff.setOpaque(false); JScrollPane scroll = new JScrollPane(stuff, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scroll.setBorder(new EmptyBorder(0, 0, 0, 0)); scroll.setOpaque(false); scroll.getViewport().setOpaque(false); samplePanel.add(scroll, BorderLayout.CENTER); JPanel buttons2 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); prev = new JButton("prev"); JButton cancel = new JButton("cancel"); cancel.setEnabled(false); JButton ok = new JButton("OK"); ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { TabOverviewDialog.getOverviewDialog(tabbed).setVisible(true); } }); buttons2.add(prev); buttons2.add(cancel); buttons2.add(ok); samplePanel.add(buttons2, BorderLayout.SOUTH); tabbed.addTab("Sample", samplePanel); JPanel samplePanel2 = new JPanel(new BorderLayout()); DefaultMutableTreeNode root = new DefaultMutableTreeNode("root"); DefaultMutableTreeNode son1 = new DefaultMutableTreeNode("son1"); DefaultMutableTreeNode son2 = new DefaultMutableTreeNode("son2"); DefaultMutableTreeNode son3 = new DefaultMutableTreeNode("son3"); DefaultMutableTreeNode gson11 = new DefaultMutableTreeNode("gson11"); DefaultMutableTreeNode gson12 = new DefaultMutableTreeNode("gson12"); DefaultMutableTreeNode gson21 = new DefaultMutableTreeNode("gson21"); DefaultMutableTreeNode gson22 = new DefaultMutableTreeNode("gson22"); DefaultMutableTreeNode gson31 = new DefaultMutableTreeNode("gson31"); DefaultMutableTreeNode gson32 = new DefaultMutableTreeNode("gson32"); DefaultMutableTreeNode ggson111 = new DefaultMutableTreeNode("ggson111"); DefaultMutableTreeNode ggson112 = new DefaultMutableTreeNode("ggson112"); DefaultMutableTreeNode ggson113 = new DefaultMutableTreeNode("ggson113"); gson11.add(ggson111); gson11.add(ggson112); gson11.add(ggson113); son1.add(gson11); son1.add(gson12); son2.add(gson21); son2.add(gson22); son3.add(gson31); son3.add(gson32); root.add(son1); root.add(son2); root.add(son3); JTree tree = new JTree(root); tree.setBorder(new EmptyBorder(0, 0, 0, 0)); JScrollPane jspTree = new JScrollPane(tree); // TransitionLayoutManager.getInstance().track(jspTree, true); // jspTree.setBorder(new EmptyBorder(0, 0, 0, 0)); JList list = new JList(new MyListModel()); list.setBorder(new EmptyBorder(0, 0, 0, 0)); list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); JScrollPane jspList = new JScrollPane(list); // jspList.setBorder(new EmptyBorder(0, 0, 0, 0)); JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jspTree, jspList); split.setDividerLocation(130); samplePanel2.add(split, BorderLayout.CENTER); tabbed.add("Renderers", samplePanel2); tabbed.setSelectedComponent(samplePanel); tabbed.setOpaque(false); tabbed.setBorder(new EmptyBorder(0, 3, 3, 3)); this.setResizable(true); this.getRootPane().setDefaultButton(ok); JMenuBar jmb = new JMenuBar(); JMenu menu = new JMenu("menu"); menu.add(new JMenuItem("test item 1")); menu.add(new JCheckBoxMenuItem("test item 2")); menu.add(new JRadioButtonMenuItem("test item 3")); menu.addSeparator(); menu.add(new JMenuItem("test menu item 4")); menu.add(new JCheckBoxMenuItem("test menu item 5")); menu.add(new JRadioButtonMenuItem("test menu item 6")); jmb.add(menu); JMenu menu2 = new JMenu("big"); for (int i = 0; i < 35; i++) menu2.add(new JMenuItem("menu item " + i)); jmb.add(menu2); this.setJMenuBar(jmb); } public static void main(String[] args) throws Exception { UIManager.put(LafWidget.ANIMATION_KIND, AnimationKind.SLOW); JFrame.setDefaultLookAndFeelDecorated(true); SampleFrameAdapter sf = new SampleFrameAdapter(); sf.setSize(300, 200); sf.setLocationRelativeTo(null); sf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); sf.setVisible(true); // h(sf, 0); } } liblaf-widget-java-4.3.orig/src/test/check/LafChanger.java0000644000175000017500000000653310530065024023326 0ustar drazzibdrazzib/* * Copyright (c) 2005-2006 Substance Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Substance Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package test.check; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class LafChanger implements ActionListener { private JFrame frame; private String lafClassName; public static JMenuItem getMenuItem(JFrame frame, String lafName, String lafClassName) { JMenuItem result = new JMenuItem(lafName); result.addActionListener(new LafChanger(frame, lafClassName)); return result; } public LafChanger(JFrame frame, String lafClassName) { super(); this.frame = frame; this.lafClassName = lafClassName; } public void actionPerformed(ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { boolean was_wm_decorated = !frame.isUndecorated(); try { UIManager.setLookAndFeel(lafClassName); SwingUtilities.updateComponentTreeUI(frame); } catch (ClassNotFoundException cnfe) { out("LAF main class '" + lafClassName + "' not found"); } catch (Exception exc) { exc.printStackTrace(); } if (System.getProperty("substancelaf.useDecorations") != null) { boolean is_wm_decorated = !UIManager.getLookAndFeel() .getSupportsWindowDecorations(); if (is_wm_decorated != was_wm_decorated) { out("Changing decoration policy\n"); frame.setVisible(false); frame.dispose(); frame.setUndecorated(!is_wm_decorated); frame.pack(); frame.setVisible(true); was_wm_decorated = !frame.isUndecorated(); } } } }); } public static void out(Object obj) { try { System.out.println(obj); } catch (Exception exc) { // ignore - is thrown on Mac in WebStart (security access) } } }liblaf-widget-java-4.3.orig/src/test/check/TwoColumnPanel.java0000644000175000017500000002020210530065024024230 0ustar drazzibdrazzib/* * Copyright (c) 2005-2006 Substance Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * o Neither the name of Substance Kirill Grouchnikov nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package test.check; import java.awt.*; import java.util.ArrayList; import java.util.Iterator; import javax.swing.*; import javax.swing.border.TitledBorder; public class TwoColumnPanel extends JPanel { private static class ComponentRow { public Component left; public Component right; public ComponentRow(Component left, Component right) { this.left = left; this.right = right; } } private ArrayList rows; private TwoColumnLayout layout; public TwoColumnPanel() { super(); this.rows = new ArrayList(); this.layout = new TwoColumnLayout(); this.setLayout(this.layout); } public void addRow(Component left, Component right) { if ((left == null) && (right == null)) return; ComponentRow newRow = new ComponentRow(left, right); if (left != null) this.add(left); if (right != null) this.add(right); this.rows.add(newRow); } private class TwoColumnLayout implements LayoutManager { private int verticalSpacing; private int horizontalSpacing; private int minimumLeftWidth; private int minimumRightWidth; public int getHorizontalSpacing() { return this.horizontalSpacing; } public void setHorizontalSpacing(int horizontalSpacing) { this.horizontalSpacing = horizontalSpacing; } public int getMinimumLeftWidth() { return this.minimumLeftWidth; } public void setMinimumLeftWidth(int minimumLeftWidth) { this.minimumLeftWidth = minimumLeftWidth; } public int getMinimumRightWidth() { return this.minimumRightWidth; } public void setMinimumRightWidth(int minimumRightWidth) { this.minimumRightWidth = minimumRightWidth; } public int getVerticalSpacing() { return this.verticalSpacing; } public void setVerticalSpacing(int verticalSpacing) { this.verticalSpacing = verticalSpacing; } public TwoColumnLayout() { this.horizontalSpacing = 3; this.verticalSpacing = 3; this.minimumLeftWidth = 0; this.minimumRightWidth = 0; } public void addLayoutComponent(String name, Component comp) { } public void layoutContainer(Container parent) { Insets insets = parent.getInsets(); int y = this.horizontalSpacing + insets.top; int leftPref = this.getPreferredLeftWidth(); int rightPref = this.getPreferredRightWidth(); double coef = (double) (parent.getWidth() - insets.left - insets.right - 3 * this.verticalSpacing) / (double) (leftPref + rightPref); int leftFinal = (int) (coef * leftPref); int rightFinal = (int) (coef * rightPref); int leftStart = insets.left + this.verticalSpacing; int rightStart = leftStart + leftFinal + this.verticalSpacing; for (Iterator it = TwoColumnPanel.this.rows.iterator(); it .hasNext();) { ComponentRow row = (ComponentRow) it.next(); Component left = row.left; int hLeft = (row.left == null) ? 0 : left.getPreferredSize().height; Component right = row.right; int hRight = (row.right == null) ? 0 : right.getPreferredSize().height; int h = Math.max(hLeft, hRight); if (left != null) { left.setBounds(leftStart, y + (h - hLeft) / 2, leftFinal, hLeft); } if (right != null) { right.setBounds(rightStart, y + (h - hRight) / 2, rightFinal, hRight); } y += (this.horizontalSpacing + Math.max(hLeft, hRight)); } } public Dimension minimumLayoutSize(Container parent) { return this.preferredLayoutSize(parent); } public Dimension preferredLayoutSize(Container parent) { int width = 3 * this.verticalSpacing + this.getPreferredLeftWidth() + this.getPreferredRightWidth(); int height = this.horizontalSpacing; for (Iterator it = TwoColumnPanel.this.rows.iterator(); it .hasNext();) { ComponentRow row = (ComponentRow) it.next(); int hLeft = (row.left == null) ? 0 : row.left .getPreferredSize().height; int hRight = (row.right == null) ? 0 : row.right .getPreferredSize().height; height += (this.horizontalSpacing + Math.max(hLeft, hRight)); } return new Dimension(width, height); } public void removeLayoutComponent(Component comp) { } private int getPreferredLeftWidth() { int maxPreferredWidth = 0; for (Iterator it = TwoColumnPanel.this.rows.iterator(); it .hasNext();) { ComponentRow row = (ComponentRow) it.next(); if (row.left == null) continue; maxPreferredWidth = Math.max(maxPreferredWidth, row.left .getPreferredSize().width); } return Math.max(maxPreferredWidth, this.minimumLeftWidth); } private int getPreferredRightWidth() { int maxPreferredWidth = 0; for (Iterator it = TwoColumnPanel.this.rows.iterator(); it .hasNext();) { ComponentRow row = (ComponentRow) it.next(); if (row.right == null) continue; maxPreferredWidth = Math.max(maxPreferredWidth, row.right .getPreferredSize().width); } return Math.max(maxPreferredWidth, this.minimumRightWidth); } } public void setHorizontalSpacing(int horizontalSpacing) { this.layout.setHorizontalSpacing(horizontalSpacing); } public void setMinimumLeftWidth(int minimumLeftWidth) { this.layout.setMinimumLeftWidth(minimumLeftWidth); } public void setMinimumRightWidth(int minimumRightWidth) { this.layout.setMinimumRightWidth(minimumRightWidth); } public void setVerticalSpacing(int verticalSpacing) { this.layout.setVerticalSpacing(verticalSpacing); } public static void main(String[] args) { TwoColumnPanel panel = new TwoColumnPanel(); JPasswordField jpf1 = new JPasswordField("password", 10); panel.addRow(new JLabel("Enabled"), jpf1); JPasswordField jpf2 = new JPasswordField("password", 10); jpf2.setEditable(false); panel.addRow(new JLabel("Non-editable"), jpf2); JPasswordField jpf3 = new JPasswordField("password", 10); jpf3.setEnabled(false); panel.addRow(new JLabel("Disabled"), jpf3); JPasswordField jpf4 = new JPasswordField("password", 10); jpf4.setEchoChar((char) 0); panel.addRow(new JLabel("Echo char 0"), jpf4); JPasswordField jpf5 = new JPasswordField("password", 10); panel.addRow(new JLabel("With strength check"), jpf5); panel.setBorder(new TitledBorder("Password field")); JFrame frame = new JFrame(); frame.setLayout(new BorderLayout()); frame.add(panel, BorderLayout.CENTER); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(400, 300); frame.setLocation(300, 300); frame.setVisible(true); } } liblaf-widget-java-4.3.orig/src/test/ButtonRolloverDemo.java0000644000175000017500000000672610626533352024102 0ustar drazzibdrazzibpackage test; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; import org.jvnet.lafwidget.LafWidget; import org.jvnet.lafwidget.LafWidgetUtilities; import org.jvnet.lafwidget.animation.FadeConfigurationManager; import org.jvnet.lafwidget.animation.FadeKind; import org.jvnet.lafwidget.animation.effects.GhostPaintingUtils; import org.jvnet.lafwidget.utils.LafConstants.AnimationKind; public class ButtonRolloverDemo extends JFrame { public ButtonRolloverDemo() { super("Button Rollover Demo"); this.setLayout(new BorderLayout()); final JPanel buttons = new JPanel(new FlowLayout()); buttons.add(new JButton("Cut", new ImageIcon(ButtonRolloverDemo.class .getResource("/test/icons/edit-cut.png")))); // buttons.add(new JButton("Copy", new ImageIcon(ButtonRolloverDemo.class // .getResource("/test/icons/edit-copy.png")))); buttons.add(new JButton("Paste", new ImageIcon(ButtonRolloverDemo.class .getResource("/test/icons/edit-paste.png")))); // buttons.add(new JButton("Delete", new ImageIcon( // ButtonRolloverDemo.class // .getResource("/test/icons/edit-delete.png")))); // buttons.add(new JButton("Select All", new ImageIcon( // ButtonRolloverDemo.class // .getResource("/test/icons/edit-select-all.png")))); this.add(buttons, BorderLayout.CENTER); JPanel controls = new JPanel(new FlowLayout(FlowLayout.RIGHT)); controls.setBackground(new Color(255, 240, 150)); final JComboBox animKindCombo = new JComboBox(new Object[] { AnimationKind.NONE, AnimationKind.FAST, AnimationKind.REGULAR, AnimationKind.SLOW }); animKindCombo.setRenderer(new DefaultListCellRenderer() { @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { AnimationKind ak = (AnimationKind) value; return super.getListCellRendererComponent(list, ak.getName(), index, isSelected, cellHasFocus); } }); animKindCombo.setSelectedItem(LafWidgetUtilities .getAnimationKind(buttons)); controls.add(animKindCombo); animKindCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { buttons.putClientProperty(LafWidget.ANIMATION_KIND, animKindCombo.getSelectedItem()); } }); this.add(controls, BorderLayout.SOUTH); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setSize(300, 120); this.setLocationRelativeTo(null); } public static void main(String[] args) throws Exception { if ((args.length == 1) && ("-contrast".equals(args[0]))) { GhostPaintingUtils.MAX_ICON_GHOSTING_ALPHA = 0.8f; GhostPaintingUtils.MIN_ICON_GHOSTING_ALPHA = 0.6f; } if ((args.length == 1) && ("-highcontrast".equals(args[0]))) { GhostPaintingUtils.MAX_ICON_GHOSTING_ALPHA = 0.8f; GhostPaintingUtils.MIN_ICON_GHOSTING_ALPHA = 0.6f; GhostPaintingUtils.MAX_PRESS_GHOSTING_ALPHA = 0.7f; GhostPaintingUtils.MIN_PRESS_GHOSTING_ALPHA = 0.5f; } JFrame.setDefaultLookAndFeelDecorated(true); FadeConfigurationManager.getInstance().allowFades( FadeKind.GHOSTING_ICON_ROLLOVER); FadeConfigurationManager.getInstance().allowFades( FadeKind.GHOSTING_BUTTON_PRESS); UIManager.put(LafWidget.ANIMATION_KIND, AnimationKind.SLOW); SwingUtilities.invokeLater(new Runnable() { public void run() { new ButtonRolloverDemo().setVisible(true); } }); } } liblaf-widget-java-4.3.orig/src/test/icons/0000755000175000017500000000000011253454704020532 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/test/icons/edit-select-all.png0000644000175000017500000000116710573136034024212 0ustar drazzibdrazzibPNG  IHDR szzsBIT|d.IDATXŗn@*R- %qP)ox$@SBzhUd6㈹L7+s_m׽ipmmlg`p LMwcu2l 7* @c."s@`SDdnd:qym^VEi8>(wV.•8%]` Ǭ#E-ً/ x\-HխIENDB`liblaf-widget-java-4.3.orig/src/test/icons/edit-delete.png0000644000175000017500000000400110573136034023415 0ustar drazzibdrazzibPNG  IHDR szzsBIT|dtEXtSoftwarewww.inkscape.org<IDATXW[]Wuۗ9sfN3$M&Ѧ R-xy*} R+} ->ւh*AHiSۦA3Ld.͙9s}u߇ 3әPeֿBmx(C"Rʙo;;o#PJFU`l?z0"fF3_Ms "h`fcŶ&{{ z\ Q k-fggeٶ"yFFF+O;gxZ<=6&8w=}m ODӹ:Nf_wn?8F[crC6^g]f.v3ϝnx:[ND@s։{vt>'_..1sFM(X9!7=|= 3;rFIENDB`liblaf-widget-java-4.3.orig/src/test/icons/edit-copy.png0000644000175000017500000000132310573136034023131 0ustar drazzibdrazzibPNG  IHDR szzsBIT|dIDATX͗MkAxI~dA=-F'KтxWR-ţjU!I٤K^f<,;􁐙<8h1˅MY54fByv3/j(ES|>O=t%ʩDF5ոaPV%{˫ p`iiIy "%" a0Y"*Y!"OXqBT*AeIe tС( Dsev`px(@&,T),+ L]LjH BSU(HR璂~9BxHZ_H"D0n~$?T), DM c'a)iƘia IbJ{"~{b`{ fPi&"<|iLp4D>.k*q`n9We7;{7  I*c@O{a=?\I ڵJXup1 `6}9Y.W& TD"i҇1!}3?NP]zo.'[F񩤰nߵ1v0擕յiט{VT MIENDB`liblaf-widget-java-4.3.orig/src/test/icons/edit-paste.png0000644000175000017500000000200310573136034023267 0ustar drazzibdrazzibPNG  IHDR szzsBIT|dIDATX݋UǦhx$WJ .^BEb- "( EPVA*zK,٦$s^/3LI9Μ91eNxSӌgN :wit] TJ~Q`#Cp4P\nUK4\_8U6gYY9a Cml;] k"SԐio|XU_Z0.{h 2LHMӘCgdSzy'W??X"Yy* oLK4Y,9O[C7 orjiD=!@V0 _}۶xgmT8/<ի[(5Cuh죔K>?Nj>dsuueV"4u2naa۶Τ!"!Y9uEqۏ$\*B2STJ,>j` 8X4(X(<( 7ZMG3-s8-J ރbvЩ-f&/ً `!B;!@2  oсlۦP(D`gSoD`Xbó6 /ޡe zH*/l&^*@G.BK6hMO> R8]g6@)5fa LϽ :NI >+8g/^۫qh5[RV \W!Nv6砃;Fۙn (fgN5zxڽt7mTe~~Ev$ˀdvBOuIYX6;Xnw D?y|M@)CP `Ht_{#Q{M0u<:,G<@ oUEIENDB`liblaf-widget-java-4.3.orig/src/test/icons/edit-cut.png0000644000175000017500000000404710573136034022760 0ustar drazzibdrazzibPNG  IHDR szzsBIT|dIDATX{lǿ3;ww;M b40U$-U*"l7D@CMTJ64QԪ"`@0X6=vwf9dvl?]ff &ٵ0b/Gæ&v֛c9M6EƋ5fr7<^SI^S\V'w,TW\mwY8RJڝ{/}ʯJN55;Tۂ3.;lۓ]dP!$JKK5'SkJeeNW8R"7ap83%߹sg tWn0!Dzz&RL @?oHHiZXUҥĜƜ g6E8'P8@O8BJ CCAA]5SkRBSss٥) oJ-uRuuu?-`S˖L GunZ'*q~ƆÇtUR0Ŧ-$Ph25-5!!|͊S[V/DŽP hjjB %E=nOA]]:۞ʥ-w)%laD&BENi2cR"aE*7e~9XZH5ѯnթDMUU/ PUU.sıp|*=HR@uKrsX|o ! ݾ~SHt{wOg0 ,¼B,(uE"H)ii-^EEQӲk%3^xS0ݓPXgkXp9k}_ ndBL'*e +S\N'] B5?!Mѧ[7n#TQ,WФC(CDzRS^ @ڻHtFavCKw{_R !h z@nS!@ @EiHN~dNAsi $H{9@ngmmlGҎ`3@t[lRr} cÙ99ߜSͺŹv7`Yo% YV̟5K&{zA]Wcb…yӆ$`lE07Pz:1P@H.lC`$WSؖef:|>@OokkͲh`}Z12P7{Nw2SNɌ=3 gL۰r .LIJ1W~>>2bL]?K?{4HWIENDB`liblaf-widget-java-4.3.orig/src/contrib/0000755000175000017500000000000011253454712020077 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/contrib/com/0000755000175000017500000000000011253454712020655 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/0000755000175000017500000000000011253454714022625 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/0000755000175000017500000000000011253454714023754 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/components/0000755000175000017500000000000011253454714026141 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/components/ReflectedImageLabel.java0000644000175000017500000003243410603372300032576 0ustar drazzibdrazzib/* * ReflectedImageLabel.java * * Created on November 22, 2006, 11:34 PM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.swing.components; import java.awt.*; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import javax.imageio.ImageIO; import javax.swing.JLabel; import contrib.com.blogofbug.utility.ImageUtilities; /** * A RichComponent which takes the supplied image, adds on 50% to the height of the image * and draws a graduated alpha-blended reflection below the top aligned original image. The * text (set by setRichText()) is drawn dynamically over the reflection, below the original image. * @author nigel */ public class ReflectedImageLabel extends JLabel implements RichComponent{ /** * The richtext associated with this component */ private String text = ""; /** * The image with reflection */ private BufferedImage bufferedImage = null; /** * A font used for reference purposes when evaluating the size of the rendered component */ private static final Font reference = new Font("Arial",Font.BOLD,14); /** * The desired alpha composite */ private AlphaComposite alphaComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER,1.0f); /** * Creates a new instance from the supplied image object * @param image The Image object * @param width The prefered width of the image when rendered by a rich container * @param height The prefered heightof the image when rendered by a rich container * @deprecated This function will be removed, use setNeutralWidth() on JCarousel instead. */ public ReflectedImageLabel(Image image, int width, int height) { setRichImage(image); } /** * Creates a new instance of a reflected label for the supplied image, also setting the text * to be associated with the image. * @param image The image * @param text The text label * @param width The prefered width of the image when rendered by a rich container * @param height The prefered height of the image when rendered by a rich container * @deprecated This function will be removed, use setNeutralWidth() on JCarousel instead. */ public ReflectedImageLabel(Image image, String text, int width, int height) { setRichImage(image); setRichText(text); } /** * Creates a new instance of a reflected label using the supplied image and text * @param image The image to be used * @param text The text to be displayed */ public ReflectedImageLabel(Image image, String text) { this(image, text, image.getWidth(null), image.getHeight(null)); } /** * See constructor for image label, this version of the constructor takes an image URL instead * of the image object (the URL can be in string format). * @param imageURL A URL (in string form) of the image. */ public ReflectedImageLabel(String imageURL){ try { setRichImage(new URL(imageURL)); } catch (MalformedURLException ex) { ex.printStackTrace(); } } /** * Creates a new instance, setting the width and the height that may be used by the RichContainer * @param imageURL The URL of the image (String form) * @param width The prefered width of the image when rendered by a rich container * @param height The prefered height of the image when rendered by a rich container * @deprecated This function will be removed, use setNeutralWidth() on JCarousel instead. */ public ReflectedImageLabel(String imageURL, int width, int height){ try { setRichImage(new URL(imageURL)); } catch (MalformedURLException ex) { ex.printStackTrace(); } } /** * Creates a new instance, using the image specified in the URL string, the prefered dimensions and sets the Rich text as well * @param imageURL The URL of the image in text form * @param text The RichText to be displayed * @param width The prefered width of the image when rendered by a rich container * @param height The prefered height of the image when rendered by a rich container * @deprecated This function will be removed, use setNeutralWidth() on JCarousel instead. */ public ReflectedImageLabel(String imageURL, String text, int width, int height){ this(imageURL,width,height); this.text=text; } /** * Depricated. * @deprecated Use setRichText() instead * @param text The rich text */ public void setLabel(String text){ this.text = text; } /** * Will accept a string URL for loading the image before calling the normal setupImage function after loading it. * @param imageURL The URL of the image (in a string) */ private void setupImage(String imageURL) { Image image = null; try { image = ImageIO.read(new URL(imageURL)); } catch (MalformedURLException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } this.setupImage(image); } /** * Adds a reflection to the supplied image * @param image The image object to use to pre-render the reflection */ protected void setupImage(Image image){ if (image == null) { return; } //Create a buffered image which is the right (translucent) format for the current graphics device, this //should ensure the fastest possible performance. Adding on some extra height to make room for the reflection BufferedImage originalImage = ImageUtilities.createCompatibleImage(image.getWidth(null),(int)((double)image.getHeight(null)*1.5)); //Blit the loaded image onto the optimized surface by creating a graphics context for the new image Graphics2D g = originalImage.createGraphics(); //Draw the original image g.drawImage(image, 0, 0, null); g.dispose(); BufferedImage reflection = ImageUtilities.createCompatibleImage(image.getWidth(null),image.getHeight(null)); g = reflection.createGraphics(); int drawHeight = image.getHeight(null); AffineTransform tranform = AffineTransform.getScaleInstance(1.0, -1.0); tranform.translate(0, -drawHeight); // draw the flipped image AffineTransform oldTransform = g.getTransform(); g.setTransform(tranform); g.drawImage(image, 0,0,image.getWidth(null),drawHeight,0,0,image.getWidth(null),image.getHeight(null),null); g.setTransform(oldTransform); GradientPaint painter = new GradientPaint(0.0f, 0.0f, new Color(0.0f, 0.0f, 0.0f, 0.5f), 0.0f, drawHeight / 2.0f, new Color(0.0f, 0.0f, 0.0f, 1.0f)); // this use : Ar = Ad*(1-As) and Cr = Cd*(1-As) g.setComposite(AlphaComposite.DstOut); g.setPaint(painter); // this will make our image transluent ... g.fill(new Rectangle2D.Double(0, 0, image.getWidth(null), drawHeight)); g.dispose(); //Now blit back the reflection... g = originalImage.createGraphics(); g.drawImage(reflection,0,drawHeight,null); g.dispose(); //First hack, just sets the bufferedIMage to the one loaded, don't cache any rendering bufferedImage = originalImage; setPreferredSize(new Dimension(image.getWidth(null), image.getHeight(null))); } /** * Sets the transparency of the component * @param alphaLevel The alpha level of the object * @see RichComponent */ public void setAlpha(float alphaLevel){ alphaComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER,alphaLevel); } /** * Deprecated * @param image An image object to use (reflection will be added) * @see RichComponent * @deprecated Please use setRichImage() instead from the RichComponent interface */ public void setImage(Image image) { this.setupImage(image); } /** * Overrides the default getPreferedSize() which has been controlled by the created image and adds 50% onto the height to allow for the reflection. * @return The prefered dimensions of the component */ public Dimension getPreferredSize() { Dimension d = super.getPreferredSize(); d.height = (int) ((double) d.height * 1.5); return d; } /** * Paints the component * * @param graphics The graphics context */ public void paintComponent(Graphics graphics) { // Don't paint if I'm off screen if ((getX() + getWidth() < 0) && (getY() + getHeight() < 0)) { return; } Graphics2D g = (Graphics2D) graphics; Image image = bufferedImage; int drawHeight = (int) ((double) getHeight() / 1.5); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); // SiAlphaCompositemple scale only Composite oldAc = g.getComposite(); g.setComposite(alphaComposite); g.drawImage(image, 0, 0, getWidth(), getHeight(), 0, 0, image .getWidth(null), image.getHeight(null), null); // Draw text if there is any... if ((text != null) && (text.length() > 0)) { Graphics2D g2d = (Graphics2D) graphics; Rectangle2D bounds = reference.getStringBounds(text, g2d .getFontRenderContext()); double scaleFactor = (double) getWidth() / image.getWidth(null); double scaleFactor2 = (double) getWidth() / bounds.getWidth(); int fontSize = (int) Math.min(25.0 * scaleFactor, 14.0 * scaleFactor2); Font font = new Font("Arial", Font.BOLD, fontSize); g2d.setFont(font); int dx = (getWidth() - (int) font.getStringBounds(text, g2d.getFontRenderContext()).getWidth()) / 2; int dy = drawHeight + 2 * (int) (bounds.getHeight() * scaleFactor); Color background = this.getBackground(); int red = background.getRed(); int green = background.getRed(); int blue = background.getRed(); graphics.setColor(new Color(red,green,blue,96)); FontMetrics fm = g2d.getFontMetrics(); Rectangle2D rect = fm.getStringBounds(text,graphics); graphics.fillRoundRect(dx-(int)rect.getHeight()/2, dy - (int) g2d.getFontMetrics().getAscent(), (int)rect.getWidth()+((int)rect.getHeight()), fm.getAscent() + fm.getDescent(),(int)rect.getHeight(),(int)rect.getHeight()); graphics.setColor(this.getForeground()); graphics.drawString(text, dx, dy); } g.setComposite(oldAc); } /** * Assigns an image to the component, the width and height taken from the supplied image * * @param image The URL of the image */ public void setRichImage(URL image) { setRichImage(ImageUtilities.loadCompatibleImage(image.toString())); } /** * See interface definition * @param image See interface definition * @see RichComponent */ public void setRichImage(File image) { try { setRichImage(image.toURL()); } catch (MalformedURLException ex) { ex.printStackTrace(); } } /** * See interface definition * @param image See interface definition * @see RichComponent */ public void setRichImage(Image image) { setImage(image); } /** * See interface definition * @see RichComponent */ public void prePaintImage() { //I do all my pre-rendering earlier... } /** * See interface definition * @param text See interface definition * @see RichComponent */ public void setRichText(String text) { setLabel(text); } /** * See interface definition * @return See interface definition * @see RichComponent */ public String getRichText() { return this.text; } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootliblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/components/AbstractCarouselMenuAction.javaliblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/components/AbstractCarouselMenuAction.ja0000644000175000017500000000305310603372022033667 0ustar drazzibdrazzib/* * AbstractCarouselMenuAction.java * * Created on January 14, 2007, 11:49 AM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.swing.components; import java.net.URL; import javax.swing.AbstractAction; import javax.swing.Action; /** * An action for the CarouselMenuAction. May be later refactored into a more useful set of fields or removed completely. * @author nigel */ public abstract class AbstractCarouselMenuAction extends AbstractAction{ /** * A very high resolution (recommend at leat 128x128) image to associate with the action */ public static final String ACTION_IMAGE_URL = "actionImageURL"; /** * Creates a new instance of AbstractCarouselMenuAction * @param image The image * @param label The text */ public AbstractCarouselMenuAction(URL image, String label) { super(); this.putValue(ACTION_IMAGE_URL,image); this.putValue(Action.SHORT_DESCRIPTION,label); } } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/components/JCarosel.java0000644000175000017500000003035610603372456030515 0ustar drazzibdrazzib/* * JCarosel.java * * Created on November 22, 2006, 7:27 PM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.swing.components; import java.awt.*; import java.awt.event.*; import contrib.com.blogofbug.swing.SwingBugUtilities; import contrib.com.blogofbug.swing.layout.CaroselLayout; import contrib.com.blogofbug.utility.ImageUtilities; /** * A carousel component which lays out components around a carousel, moving each * to the front as it is clicked on. Double clicking will fire the action * associated with the compnent if it has one, or give it the focus if it does * not. * * Note this will be changed to only allow RichComponents in the future. * * @author bug */ public class JCarosel extends GradientPanel implements MouseListener, MouseWheelListener { /** * Set to true if the performance should be measured. Debugging purposes * only */ private static final boolean MEASURE_PERFORMANCE = true; /** * The property that is set when a new component comes to the front. To use * it add a property change listener for it, useful for keeping animations * synchronized. */ public static final String FRONT_COMPONENT_CHANGE = "frontComponentChanged"; /** * The layout being used for the carousel */ protected CaroselLayout layout; /** * The last component the wheel selected. Used to ensure we don't move too * far around why they are wheeling and they turn back on themselves * creating a nasty oscilation in the animation (everything works fine, it's * just not purty) */ protected Component lastWheeledTo = null; /** * The prefered width of the components in the container, everything will be * scaled to this width for neutral scaling (1.0) */ protected int DEFAULT_CONTENT_WIDTH = 64; /** * Delay in milliseconds from the first click to the start of the spin, this * gives implementors using a double click anywhere to fire an event a * chance for their users to get the double click message before the * component spins around. */ protected int spinStartDelay = 200; /** * Creates a new instance of JCarosel */ public JCarosel() { layout = new CaroselLayout(this); this.setLayout(layout); this.addMouseWheelListener(this); setContentWidth(DEFAULT_CONTENT_WIDTH); } /** * Creates a new Carousel specifying the prefered width up front * * @param contentWidth * The prefered width of component at neutral scale (3 or 9 * o'clock) */ public JCarosel(int contentWidth) { this(); setContentWidth(contentWidth); } /** * Sets the prefered width of the components inside the carousel, this is * the neutral width that will change as the component is scaled, but at 9 * and 6 o'clock where the scale is one they will be this width. * * @param contentWidth * The prefered width. */ public void setContentWidth(int contentWidth) { layout.setNeutralContentWidth(contentWidth); } /** * If set to true the carousel will fade out components as they move away * from the front of the carousel (6 o'clock) * * @param useDepthBased * True to fade components as they move to the back, false to not * do it */ public void setDepthBasedAlpha(boolean useDepthBased) { layout.setDepthBasedAlpha(useDepthBased); } /** * Specifies which type of CarouselLayout to be used to lay the component * out around the carousel Any looping layout can be used. Mobius strip * layout anyone? * * @param layout * The carousel layout to use */ public void setLayout(CaroselLayout layout) { this.layout = layout; super.setLayout(layout); } /** * Adds a component to the carousel * * @param component * The component to add to the carousel * @return The component */ public Component add(Component component) { add("", component); component.setForeground(Color.WHITE); component.setBackground(Color.BLACK); bringToFront(getComponent(0)); validate(); return component; } /** * Adds an image to the carousel * * @param image * The image to add * @param text * The text label * @return The component created, normally a reflected image label */ public Component add(Image image, String text) { ReflectedImageLabel component = new ReflectedImageLabel(image, text); component.addMouseListener(this); return add(component); } /** * Removes the component from the carousel * * @param component * The component to remove */ public void remove(Component component) { super.remove(component); if (getComponentCount() > 0) { bringToFront(getComponent(0)); } invalidate(); validate(); } /** * The image to add and it's width and height * * @param imageURL * The URL * @param width * The desired rendering width * @param height * The desired rendering height * @return The component created * @deprecated This function will be removed, use add(String imageURL) * instead. */ public Component add(String imageURL, int width, int height) { ReflectedImageLabel component = new ReflectedImageLabel(imageURL, width, height); component.addMouseListener(this); return add(component); } /** * Add the image, and it's label to the carousel * * @param imageURL * The image URL * @param text * The text label * @param width * The width * @param height * The height * @return The component created to hold the image * @deprecated This function will be removed, use setNeutralWidth() on * JCarousel instead. */ public Component add(String imageURL, String text, int width, int height) { ReflectedImageLabel component = new ReflectedImageLabel(imageURL, text, width, height); component.addMouseListener(this); return add(component); } /** * Brings the specified component to the front of the carousel * * @param component * The component to bring to the front */ public void bringToFront(Component component) { firePropertyChange(FRONT_COMPONENT_CHANGE, getComponent(0), component); layout.setFrontMostComponent(component); } /** * Which component is at the front * * @return The component at the front (by default 6 o'clock) */ public Component getFrontmost() { return getComponent(0); } /** * Bring the "clicked" component to the front. Delays by 200ms to allow for * a double click * * @param mouseEvent * Brings the component clicked on by the mouse to the front */ public void mouseClicked(final MouseEvent mouseEvent) { if (mouseEvent.getClickCount() == 1) { SwingBugUtilities.invokeAfter(new Runnable() { public void run() { bringToFront((Component) mouseEvent.getSource()); } }, spinStartDelay); } } /** * Sets the delay between clicking on a component in the carousel, and the * spin starting to move that component to the front. The longer it is, the * easier it is to double click on a non-front component * * @param spinStartDelay */ public void setSpinStartDelay(int spinStartDelay) { this.spinStartDelay = spinStartDelay; } /** * Returns the spin start delay * * @return The delay in ms between the click and the spin */ public int getSpinStartDelay() { return spinStartDelay; } /** * Inserts a component at the specified index * * @param i * The index * @param comp * The component */ public void insertComponentAt(int i, Component comp) { add(comp); layout.moveComponentTo(i, comp); } /** * Inserts a new object at a specific location * * @param i * The position on the carousel * @param imageURL * The URL of the image * @param width * The width of the image * @param height * The height of the image * @return The component created to show the image (usually a * ReflectedImageLabel but this may change) */ public Component insertAt(int i, String imageURL, int width, int height) { Component comp = add(imageURL, width, height); layout.moveComponentTo(i, comp); return comp; } /** * Inserts a new object at a specific location * * @param i * The position on the carousel * @param imageURL * The URL of the image * @param text * The text label * @param width * The prefered width of the image * @param height * The prefered height of the image * @return The component created to represent the image, currently reflected * image label but may change */ public Component insertAt(int i, String imageURL, String text, int width, int height) { Component comp = add(imageURL, text, width, height); layout.moveComponentTo(i, comp); return comp; } /** * Moves everything to their final positions * */ public void finalizeLayoutImmediately() { layout.layoutContainer(this); layout.finalizeLayoutImmediately(); repaint(); } /** * Not interested * * @param mouseEvent * Ignored */ public void mousePressed(MouseEvent mouseEvent) { } /** * Not interested * * @param mouseEvent * Ignored */ public void mouseReleased(MouseEvent mouseEvent) { } /** * Not interested * * @param mouseEvent * Ignored */ public void mouseEntered(MouseEvent mouseEvent) { } /** * Not interested * * @param mouseEvent * Ignored */ public void mouseExited(MouseEvent mouseEvent) { } /** * When event received will spin the carousel to select the next object. * Because the wheel can be spun quicker than the carousel animates it keeps * track of the target (so the user may have selected something three * components away, althought the animation has not yet finished moving past * the first comopnent) * * @param mouseWheelEvent * The event object */ public void mouseWheelMoved(MouseWheelEvent mouseWheelEvent) { if (mouseWheelEvent.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) { int amount = mouseWheelEvent.getWheelRotation(); if (lastWheeledTo == null) { lastWheeledTo = getFrontmost(); } int lastPosition = layout.getComponentIndex(lastWheeledTo); int frontMostPosition = layout.getComponentIndex(getComponent(0)); // Don't over spin if (Math.abs(lastPosition - frontMostPosition) > layout .getComponentCount() / 4) { return; } if (amount > 0) { lastWheeledTo = layout.getPreviousComponent(lastWheeledTo); } else { lastWheeledTo = layout.getNextComponent(lastWheeledTo); } bringToFront(lastWheeledTo); } } /** * Adds a new image to the carousel * * @param imageURL * The image * @return The component created */ public Component add(String imageURL) { ReflectedImageLabel component = new ReflectedImageLabel(imageURL); component.addMouseListener(this); return add(component); } /** * Adds a new image to the carousel * * @param imageURL * The image * @param textLabel * The label * @return The component created */ public Component add(String imageURL, String textLabel) { ReflectedImageLabel component = new ReflectedImageLabel(ImageUtilities .loadCompatibleImage(imageURL), textLabel); component.addMouseListener(this); return add(component); } } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/components/RichComponent.java0000644000175000017500000000512710603372132031550 0ustar drazzibdrazzib/* * RichComponent.java * * Created on March 16, 2007, 3:58 PM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.swing.components; import java.awt.Image; import java.io.File; import java.net.URL; /** * A component that can be part of the a rich user interface * @author nigel */ public interface RichComponent { /** * Assigns an image to the component, the width and height taken from the supplied image * * @param image The URL of the image */ public void setRichImage(URL image); /** * Assigns an image to the component, the width and height taken from the supplied image * * @param image A file referencing the image */ public void setRichImage(File image); /** * Assisgns an image to the component, the width and height taken from the supplied image * * @param image An image object containing the image */ public void setRichImage(Image image); /** * Allows a RichContainer to request that the component pre-renders anything * that might provide peak performance. It is expected that most implementations will * do this automatically after the image has been specified */ public void prePaintImage(); /** * Specifies text that should be displayed by the rich component when * getRichText() is called. * @param text The text to be displayed. This may be different to that of the component * being enriched. */ public void setRichText(String text); /** * Gets the text to be displayed by the RichContainer for the component. May * be extracted from elsewhere * * @return The text to be displayed */ public String getRichText(); /** * Assisgns a uniform alpha to the component * * @param alpha A value from 0.0 to 1.0 where 1.0 is fully visible, and 0.0 * is completely invisible. */ public void setAlpha(float alpha); } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/components/ImageLabel.java0000644000175000017500000000524510603372070030764 0ustar drazzibdrazzib/* * ImageLabel.java * * Created on November 22, 2006, 9:53 AM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.swing.components; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.RenderingHints; import java.awt.image.ImageObserver; import javax.swing.ImageIcon; import javax.swing.JLabel; /** * A simple component that scales an image to fit inside the size of the component. * @author nigel */ public class ImageLabel extends JLabel{ /** * The image that ends up getting scaled */ protected ImageIcon imageIcon = null; /** * Creates a new instance of ImageLabel. The prefered width and height will * be set to the dimensions of the image * * @param icon The image to display */ public ImageLabel(ImageIcon icon) { super(icon); this.imageIcon = icon; setPreferredSize(new Dimension(icon.getIconWidth(), icon.getIconHeight())); } /** * Creates a new instance of ImageLabel, setting the preferred rendering size to * the supplied dimensions * * @param icon The image to place on the label * @param width The prefered width * @param height The prefered height */ public ImageLabel(ImageIcon icon, int width, int height){ this(icon); setPreferredSize(new Dimension(width,height)); } /** * Paints the label scaling the image to the appropriate size * @param graphics The graphics context */ public void paintComponent(Graphics graphics) { Image image = this.imageIcon.getImage(); ImageObserver observer = imageIcon.getImageObserver(); ((Graphics2D)graphics).setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); ((Graphics2D)graphics).setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); graphics.drawImage(image, 0,0,getWidth(),getHeight(),0,0,image.getWidth(observer),image.getHeight(observer),observer); } } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/components/JCarouselMenu.java0000644000175000017500000006371010603374034031521 0ustar drazzibdrazzib/* * JCarouselMenu.java * * Created on January 13, 2007, 12:42 PM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.swing.components; import java.awt.*; import java.awt.event.*; import java.net.URL; import java.security.InvalidParameterException; import java.util.*; import javax.swing.*; import javax.swing.event.*; import contrib.com.blogofbug.swing.borders.ImageBorder; import contrib.com.blogofbug.swing.layout.OffsetCaroselLayout; /** * Shows a carousel offset to the left with a menu of actions on the right. * @author nigel */ public class JCarouselMenu extends GradientPanel implements ListSelectionListener,MouseListener,KeyListener, ChangeListener, MouseWheelListener{ /** * The carousel used and drawn on the left. */ private JCarosel carousel; /** * A JList with the menu items in */ private JList menu; /** * The scroll pane the menu is in */ private JScrollPane menuScroll; /** * The model for the action menu */ private DefaultListModel menuModel=new DefaultListModel(); /** * Linked list of the items in the menu */ private LinkedList menuItems=new LinkedList(); /** * A hashtable connecting the actions to the components in the carousel */ private Map menuMap = new HashMap(); /** * The last item selected */ private int lastSelection = -1; /** * The button that is drawn when it is possible to scroll up */ private UpDownButton upButton = new UpDownButton("Up"); /** * The button shown when you can scroll down */ private UpDownButton downButton = new UpDownButton("Down"); /** * Creates a new instance of JCarouselMenu * @param border The border to use to draw items in the menu */ public JCarouselMenu(ImageBorder border) { carousel = new JCarosel(); carousel.setLayout(new OffsetCaroselLayout(carousel)); carousel.setBackground(null); carousel.setOpaque(false); carousel.setContentWidth(256); super.setLayout(new GridLayout(1,2)); super.add(carousel); upButton.setForeground(Color.WHITE); downButton.setForeground(Color.WHITE); JPanel menuPanel = new JPanel(); menuPanel.setBackground(null); menuPanel.setOpaque(false); menuPanel.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); menu = new JList(); menuScroll = new JScrollPane(menu, JScrollPane.VERTICAL_SCROLLBAR_NEVER, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); menuScroll.getViewport().setOpaque(false); menuScroll.setBorder(null); menuScroll.getViewport().addChangeListener(this); menu.setModel(menuModel); menu.setCellRenderer(new CarouselListCellRenderer(border)); menu.setBackground(null); menu.setOpaque(false); menu.addListSelectionListener(this); menuScroll.setOpaque(true); menuScroll.setBackground(Color.BLACK); menuScroll.setBorder(BorderFactory.createEmptyBorder()); gbc.weightx=0.0; gbc.weighty=0.0; gbc.gridy=0; gbc.fill=GridBagConstraints.HORIZONTAL; menuPanel.add(upButton,gbc); gbc.weighty=1.0; gbc.weightx=1.0; gbc.gridy++; gbc.fill=GridBagConstraints.BOTH; menuPanel.add(menuScroll,gbc); gbc.weighty=0.0; gbc.weightx=0.0; gbc.gridy++; gbc.fill=GridBagConstraints.HORIZONTAL; menuPanel.add(downButton,gbc); menu.addMouseListener(this); menu.addKeyListener(this); //Don't want it to listen to itself... carousel.removeMouseWheelListener(carousel); carousel.addMouseWheelListener(this); menu.addMouseWheelListener(this); menuScroll.addMouseWheelListener(this); menuPanel.addMouseWheelListener(this); super.add(menuPanel); } /** * Creates a new instance */ public JCarouselMenu(){ this(new ImageBorder(JCarouselMenu.class.getResource("/com/blogofbug/swing/borders/images/menu_highlight.png"),new Insets(10,12,16,12))); } /** * Sets the color the up and down buttons are drawn * @param color The desired color */ public void setUpDownColor(Color color){ upButton.setForeground(color); downButton.setForeground(color); } /** * Returns the list part of the carousel menu * * @return The JList object */ public JList getList(){ return this.menu; } /** * Sets the selected item in the menu * @param i The index of the item to select */ public void setSelectedIndex(int i){ menu.setSelectedIndex(i); } /** * Adds a component to the carousel menu that will be brought into view when the user clicks * on the associated item * @param component The component * @param label The text to appear in the menu * @return The created component */ public Component add(Component component,String label){ carousel.add(label,component); MenuItem item = new MenuItem(component,label,null); menuItems.addLast(item); menuModel.addElement(item); menuMap.put(component, item); component.removeMouseListener(carousel); return component; } /** * Removes a component from the menu * @param component The component to remove */ public void remove(Component component) { carousel.remove(component); MenuItem menuItem = menuMap.remove(component); if (menuItem != null) { menuItems.remove(menuItem); menuModel.removeElement(menuItem); } } /** * Adds an image to the menu. * @deprecated Use add(Image, String) instead * @param image The image * @param label The text * @param width Prefered width * @param height Prefered height * @return The created component */ public Component add(Image image, String label, int width, int height) { Component comp = carousel.add(image, null); MenuItem item = new MenuItem(comp, label, null); menuItems.addLast(item); menuModel.addElement(item); comp.removeMouseListener(carousel); menuMap.put(comp, item); return comp; } /** * Adds an image (with a label) and returns the component created to represent them * @param image The image to display * @param label The label to show * @return The component created */ public Component add(Image image, String label) { Component comp = carousel.add(image, null); MenuItem item = new MenuItem(comp, label, null); menuItems.addLast(item); menuModel.addElement(item); comp.removeMouseListener(carousel); menuMap.put(comp, item); return comp; } /** * Adds an action to the menu * @deprecated Use add(imageURL) instead * @param action The action to add * @param width The width * @param height The height * @return The created component */ public Component add(Action action, int width, int height){ URL url = (URL) action.getValue(AbstractCarouselMenuAction.ACTION_IMAGE_URL); if (url==null){ throw new InvalidParameterException("Supplied action does not have Image URL key (AbstractCarouselMenuAction.ACTION_IMAGE_URL)" ); } Component comp = carousel.add(url.toString()); MenuItem item = new MenuItem(comp,(String) action.getValue(Action.SHORT_DESCRIPTION),action); menuItems.addLast(item); menuMap.put(comp, item); menuModel.addElement(item); comp.removeMouseListener(carousel); return comp; } /** * Adds an action to the list, creating a menu item and a carousel entry * @param action The action to add * @return The resultant component */ public Component add(Action action){ URL url = (URL) action.getValue(AbstractCarouselMenuAction.ACTION_IMAGE_URL); if (url==null){ throw new InvalidParameterException("Supplied action does not have Image URL key (AbstractCarouselMenuAction.ACTION_IMAGE_URL)" ); } Component comp = carousel.add(url.toString()); MenuItem item = new MenuItem(comp,(String) action.getValue(Action.SHORT_DESCRIPTION),action); menuItems.addLast(item); menuMap.put(comp, item); menuModel.addElement(item); comp.removeMouseListener(carousel); return comp; } /** * Adds an image (through a URL) to the menu * @deprecated Use add(imageURL, label) instead * @param imageURL URL of the image * @param label Text message * @param width width * @param height height * @return The created component */ public Component add(String imageURL, String label, int width, int height){ Component comp = carousel.add(imageURL); MenuItem item = new MenuItem(comp,label,null); menuMap.put(comp, item); menuItems.addLast(item); menuModel.addElement(item); comp.removeMouseListener(carousel); return comp; } /** * Adds an image based on the imageURL and a text label, returning the component that is created as a result * @param imageURL The URL of the image * @param label Text label to be shown in the menu * @return The created component */ public Component add(String imageURL, String label){ Component comp = carousel.add(imageURL); MenuItem item = new MenuItem(comp,label,null); menuMap.put(comp, item); menuItems.addLast(item); menuModel.addElement(item); comp.removeMouseListener(carousel); return comp; } /** * Return the preferred size of the component * @return The prefered dimensions of the component */ public Dimension getPreferredSize() { Dimension size = super.getPreferredSize(); size.width /= 2; return size; } /** * Detect when the list selection changes, and respond by updating the state * of the two "arrow" buttons. Contributed by Sebastian Charpentier. * @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent) * @param e The state changed event */ public void stateChanged(ChangeEvent e) { // Check if the scroll bar is at the top or at the bottom // Note: It's a trick, I don't know if this is the best/correct way to handle that // We show the "go up" arrow if were not at the beginning JViewport viewport = menuScroll.getViewport(); int yPos = (int)viewport.getViewPosition().getY(); upButton.setDoPaint(yPos > 0); // We show the "go down" arrow if were not at the end (having the view as down as we could) downButton.setDoPaint((yPos + viewport.getExtentSize().getHeight()) != menu.getHeight()); } /** * Detect when the list selection changes, and respond by rotating the carousel to show * that item * @param listSelectionEvent The list selection change event */ public void valueChanged(ListSelectionEvent listSelectionEvent) { MenuItem item = (MenuItem) menu.getSelectedValue(); if (item==null){ return; } carousel.bringToFront(item.carouselComponent); } /** * Launch the action associated with the currently selected list item * */ protected void processAction(){ MenuItem item = (MenuItem) menu.getSelectedValue(); if (item==null){ return; } if (item.action==null){ return; } item.action.actionPerformed(new ActionEvent(this,ActionEvent.ACTION_PERFORMED,item.label)); } /** * Look to see if an item in the list is double clicked, and launch the action if it is * @param mouseEvent The mouse event */ public void mouseClicked(MouseEvent mouseEvent) { if (mouseEvent.getClickCount()==2){ processAction(); } } /** * Don't Care * * @param mouseEvent The mouse event */ public void mousePressed(MouseEvent mouseEvent) { } /** * Don't Care * * @param mouseEvent The mouse event */ public void mouseReleased(MouseEvent mouseEvent) {} /** * Don't Care * * @param mouseEvent The mouse event */ public void mouseEntered(MouseEvent mouseEvent) {} /** * Don't Care * * @param mouseEvent The mouse event */ public void mouseExited(MouseEvent mouseEvent) {} /** * Don't Care * * @param keyEvent The key event */ public void keyTyped(KeyEvent keyEvent) { } /** * Listen for key events, when we see one that looks like it should wrap, set up the lastSelection variable to * trigger a change on release of the key * @param keyEvent The key event */ public void keyPressed(KeyEvent keyEvent) { switch (keyEvent.getKeyCode()){ case KeyEvent.VK_ENTER: processAction(); break; case KeyEvent.VK_UP: if (menu.getSelectedIndex()==0){ this.lastSelection = menuModel.size()-1; } else { this.lastSelection = -1; } break; case KeyEvent.VK_DOWN: if (menu.getSelectedIndex()==menuModel.size()-1){ this.lastSelection = 0; } else { this.lastSelection = -1; } break; } } /** * Sets the image border used to draw around the items in the menu * @param imageBorder The desired image border */ public void setCellImageBorder(ImageBorder imageBorder){ CarouselListCellRenderer renderer = (CarouselListCellRenderer) menu.getCellRenderer(); renderer.setImageBorder(imageBorder); } /** * Specifies the list cell renderer used to draw the items in the menu * @param cellRenderer The list cell renderer */ public void setCellRenderer(ListCellRenderer cellRenderer){ menu.setCellRenderer(cellRenderer); } /** * If the wrap-around has detected the need to wrap, sets the selection to the value * calculated when the key was first pressed. * @param keyEvent The key event */ public void keyReleased(KeyEvent keyEvent) { if (lastSelection!=-1){ menu.setSelectedIndex(lastSelection); menu.ensureIndexIsVisible(lastSelection); lastSelection=-1; } } /** * Moves the selected menu up or down when the mouse wheel scrolls * @param mouseWheelEvent The mouse wheel event */ public void mouseWheelMoved(MouseWheelEvent mouseWheelEvent) { if (mouseWheelEvent.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) { int amount = mouseWheelEvent.getWheelRotation(); int lastSelection; if (amount < 0) { if (menu.getSelectedIndex()==0){ lastSelection = menuModel.size()-1; } else { lastSelection = menu.getSelectedIndex()-1; } } else { if (menu.getSelectedIndex()==menuModel.size()-1){ lastSelection = 0; } else { lastSelection = menu.getSelectedIndex()+1; } } final int indexToSelect = lastSelection; SwingUtilities.invokeLater(new Runnable() { public void run() { menu.setSelectedIndex(indexToSelect); menu.ensureIndexIsVisible(indexToSelect); menu.repaint(); } }); } } /** * Sets icons to use to show the up and down buttons * @param upIcon The icon to use for up * @param downIcon The icon to use for down */ public void setUpDownIcons(Icon upIcon, Icon downIcon) { upButton.setIcon(upIcon); downButton.setIcon(downIcon); } /** * Allows the background color to the menu (left side) to be set * @param color Sets the background color to the menu */ public void setMenuScrollColor(Color color) { this.menuScroll.setBackground(color); } /** * ListCellRenderer for the Carousel uses an image border to draw a nice border around the menu item when it is selected * */ protected class CarouselListCellRenderer extends JLabel implements ListCellRenderer{ ImageBorder imageBorder; /** * Creates a new list cell renderer for the menu with the specified image border * @param border The border to use */ public CarouselListCellRenderer(ImageBorder border){ imageBorder = border; setBorder(imageBorder); } /** * Allows the setting of the image border * @param border The border to use */ public void setImageBorder(ImageBorder border){ imageBorder = border; setBorder(imageBorder); } /** * Sets up the component for stamping * @param jList The list * @param object The object being drawn * @param i The index of the object * @param isSelected If the object is selected * @param cellHasFocus Does the cell have the focus * @return The object to use to stamp the list item */ public Component getListCellRendererComponent(JList jList, Object object, int i, boolean isSelected, boolean cellHasFocus) { MenuItem item = (MenuItem) object; setText(item.label); if (!isSelected){ setBackground(null); imageBorder.setPaintBorder(false); setOpaque(false); } else { imageBorder.setPaintBorder(false); setOpaque(false); } setForeground(Color.WHITE); return this; } /** * Our image border can paint a center as well as a surround. Call paint center if we want it to do this. * @param g The graphcis context */ public void paintComponent(Graphics g){ imageBorder.paintCenter((Graphics2D)g,this); super.paintComponent(g); } /** * I want it to be wider than it needs to be * @return The desired width of the cell */ public Dimension getPreferredSize() { Dimension d = super.getPreferredSize(); d.width+=20; return d; } } /** * A menu item inside the carousel */ public class MenuItem{ /** * The component inside the caroulse */ protected Component carouselComponent; /** * The text label */ protected String label; /** * An associated action */ protected Action action; /** * Creates a new instance of the menu item * @param component The component to use * @param label The text label * @param action The associated action */ public MenuItem(Component component, String label,Action action){ this.label = label; carouselComponent = component; this.action = action; } /** * Retreives the label associated with the entry * @return The label */ public String getLabel() { return label; } /** * Gets the action associated with the entry * @return The action associated with the entry */ public Action getAction() { return action; } /** * Gets the component in the carousel associated with the entry * @return The component */ public Component getCarouselComponent() { return carouselComponent; } } /** * This class represents the up and down buttons that allow the scrolling through the menu when it is too big to fit in the avaiable space */ private class UpDownButton extends JLabel implements MouseListener{ /** * True if they should be painted */ private boolean doPaint = true; /** * Creates the up down button * @param text Test, ignored */ public UpDownButton(String text){ super(text); addMouseListener(this); setBorder(BorderFactory.createEmptyBorder(4,4,4,4)); } /** * Controls if the button should paint itself or not * @param shouldPaint True if it should, false if it shouldn't */ public void setDoPaint(boolean shouldPaint){ doPaint = shouldPaint; repaint(); } /** * Paint the component * @param g The graphics context */ public void paintComponent(Graphics g){ if (doPaint) { Icon icon = this.getIcon(); if (icon != null) { int centerX = getWidth() - (getInsets().left + getInsets().right); centerX = getInsets().left + centerX / 2; int centerY = getHeight() - (getInsets().top + getInsets().bottom); centerY = getInsets().top + centerY / 2; icon.paintIcon(this, g, centerX - icon.getIconWidth() / 2, centerY - icon.getIconHeight() / 2); } else { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); g.setColor(getForeground()); int centerX = getWidth()-(getInsets().left+getInsets().right); centerX = getInsets().left + centerX/2; int height = getHeight()-(getInsets().top+getInsets().bottom); int width = height*2; if ("Up".equals(getText())){ g.fillPolygon(new int[]{centerX-width,centerX,centerX+width},new int[]{height,getInsets().top,height},3); } else { g.fillPolygon(new int[]{centerX-width,centerX,centerX+width},new int[]{getInsets().top,height,getInsets().top},3); } } } } /** * Listens for a mouse click and scroll up or down in the menu when it gets one * @param mouseEvent The mouse event */ public void mouseClicked(MouseEvent mouseEvent) { if (!doPaint){ return; } if (mouseEvent.getClickCount()==1){ int height = menu.getCellBounds(menu.getSelectedIndex(),menu.getSelectedIndex()).height; if (getText().equals("Up")) { setSelectedIndex(menu.getSelectedIndex()-1); Point pos = menuScroll.getViewport().getViewPosition(); pos.y-=height; menuScroll.getViewport().setViewPosition(pos); } else if (getText().equals("Down")) { setSelectedIndex(menu.getSelectedIndex()+1); Point pos = menuScroll.getViewport().getViewPosition(); pos.y+=height; menuScroll.getViewport().setViewPosition(pos); } } } /** * Don't care * @param mouseEvent The mouse event */ public void mousePressed(MouseEvent mouseEvent) { } /** * Don't care * @param mouseEvent The mouse event */ public void mouseReleased(MouseEvent mouseEvent) { } /** * Don't care * @param mouseEvent The mouse event */ public void mouseEntered(MouseEvent mouseEvent) { } /** * Don't care * @param mouseEvent The mouse event */ public void mouseExited(MouseEvent mouseEvent) { } } } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/components/GradientPanel.java0000644000175000017500000001060310603372064031514 0ustar drazzibdrazzib/* * GradientPanel.java * * Created on November 22, 2006, 10:11 AM * * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.swing.components; import java.awt.Color; import java.awt.GradientPaint; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.TexturePaint; import java.awt.event.ComponentEvent; import java.awt.event.ComponentListener; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import javax.swing.JPanel; /** * Container that draws (in an optimized way) a gradient in the background * @author bug * * Really trivial panel to draw the nice graduated background. */ public class GradientPanel extends JPanel implements ComponentListener{ /** * Gradient start colour */ protected Color start; /** * Gradient end color */ protected Color end; /** * Gradient painter */ protected GradientPaint gp = null; /** * A pre-rendered gradient in an image */ protected BufferedImage cache = null; /** * Set the background to a single color * @param color The color for a solid background */ public void setBackground(Color color){ this.start = color; this.end = color; super.setBackground(color); } /** * Sets two background colors for a gradient * @param start Top (first) color * @param end Bottom (final) color */ public void setBackground(Color start, Color end){ this.start = start; this.end = end; makeGradient(); } /** * paints the gradient. * @param graphics The graphics context */ public void paintComponent(Graphics graphics) { if (start == end){ super.paintComponent(graphics); return; } Graphics2D g2 = (Graphics2D) graphics; /* //Thanks Romain Guy if (cache == null || cache.getHeight() != getHeight()) { cache = new BufferedImage(2, getHeight(), BufferedImage.TYPE_INT_RGB); Graphics2D g2d = cache.createGraphics(); GradientPaint paint = new GradientPaint(0, 0, start, 0, getHeight(), end); g2d.setPaint(paint); g2d.fillRect(0, 0, 2, getHeight()); g2d.dispose(); } g2.setPaint(new TexturePaint(cache, new Rectangle(0, 0, 1, getHeight()))); g2.fillRect(0, 0, getWidth(), getHeight()); //g2.drawImage(cache, 0, 0, getWidth(), getHeight(), null); */ gp = new GradientPaint((float)(getWidth()/2), (float) getY(), start, (float) (getWidth()/2), (float) getHeight(), end, false); g2.setPaint(gp); g2.fillRect(0,0,getWidth(),getHeight()); super.paintChildren(graphics); } /** * Pre-renders the gradient */ private void makeGradient(){ gp = new GradientPaint((float)(getWidth()/2), (float) getY(), start, (float) (getWidth()/2), (float) getHeight(), end, false); } /** * Recalculates the gradient when it's resized * @param componentEvent The event object */ public void componentResized(ComponentEvent componentEvent) { makeGradient(); } /** * Ignored * @param componentEvent The component event */ public void componentShown(ComponentEvent componentEvent) { makeGradient(); } /** * Not used * * @param componentEvent The event */ public void componentMoved(ComponentEvent componentEvent){} /** * Not used * * @param componentEvent The event */ public void componentHidden(ComponentEvent componentEvent){} } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/SwingBugUtilities.java0000644000175000017500000000326410603372422030236 0ustar drazzibdrazzib/* * SwingBugUtilities.java * * Created on March 30, 2007, 12:27 AM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.swing; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Timer; /** * Contains some utility methods applicable to any swing application. * * @author nigel */ public class SwingBugUtilities { /** Creates a new instance of SwingBugUtilities */ private SwingBugUtilities() { } /** * Runs the supplied class after a certain period of time, the thread * will be executed in the EDT. * * @param execute The runnable object whose method will be called after the * specified delay * @param after The delay in ms before the event will be called */ public static void invokeAfter(final Runnable execute, int after){ Timer timer = new Timer(after,new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { execute.run(); } }); timer.setRepeats(false); timer.start(); } } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/layout/0000755000175000017500000000000011253454712025267 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/layout/OffsetCaroselLayout.java0000644000175000017500000001030710603372152032063 0ustar drazzibdrazzib/* * OffsetCaroselLayout.java * * Created on January 12, 2007, 6:11 AM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.swing.layout; import java.awt.*; import contrib.com.blogofbug.swing.components.RichComponent; /** * Offsets a normal carousel layout be a fixed amount allowing it be "moved" around the screen. * @author nigel */ public class OffsetCaroselLayout extends CaroselLayout{ /** * Creates a new instance of OffsetCaroselLayout * @param forContainer The container to associate the layout with. */ public OffsetCaroselLayout(Container forContainer) { super(forContainer); } //Checks to see if the component should be hidden /** * Overrides the normal layout method to determine if the object is offscreen and can therefore * be ignored (giving a performance gain). In addition, it will adjust the alpha of the component * based on its distance from 3'oclock (or 15:00 if you use a 24-hour compass) * @param comp The component to consider * @param angle Its position on the carousel. * @param scale The scale (applied to size) of the image, that is, how far from the observer is it * @return True if it should be hidden, false if it should not */ protected boolean shouldHide(Component comp, double angle, double scale){ //Quick test where it's visible double cos = Math.cos(angle); double sin = Math.sin(angle); if ((sin>-0.5) && (sin<1) && (cos< 0.3)){ //We are not going to hide it, but we will set the alpha if (scale>1.00){ scale = Math.abs(scale-1.0); scale *= 3.0; scale = 1.0-scale; } else { scale = 1.0; } if (comp instanceof RichComponent){ ((RichComponent) comp).setAlpha((float)scale); } return false; } return true; } /** * Determines how "wide" the carousel should be drawn based on the side of the container the layout is laying out * @param target The container the radius should be calculated for * @param insets Any insets of the container * @param width The width of the container * @param height The height of the container * @param widestComponent The widest component * @return The size (in a bounding box) of the carousel */ protected Dimension getCarouselRadius(Container target, Insets insets, int width, int height, int widestComponent){ width = target.getSize().width - (insets.left + insets.right+(widestComponent/2));; height = (int) (height/2.5); return new Dimension(width,height); } /** * Determines the center of the carousel based on the dimensions of the container * @param insets The container insets * @param width Width of the container * @param height The height of the container * @param widest width of the container * @return A point representing the new center */ protected Point calculateCenter(Insets insets, int width, int height, int widest) { return new Point(0,((height-insets.bottom)/2)+widest/3); } /** * Over-rides the normal setFrontMostComponent to move the selected component to 3 o'clock instead of 6 o'clock * @param component The component to move to the 'front' */ public void setFrontMostComponent(Component component) { setTarget(-getPosition(component).getTargetAngle()+ (Math.PI /2)); } } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/layout/CaroselLayout.java0000644000175000017500000005532310603377706030735 0ustar drazzibdrazzib/* * CaroselLayout.java * * Created on November 21, 2006, 11:48 AM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.swing.layout; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.*; import javax.swing.Timer; import contrib.com.blogofbug.swing.components.RichComponent; /** * Layout engine for JCarousel components (although would work for any container). * It does have a closer than usual relationship with the container, sometimes causing the container to repaint. * @author bug */ public class CaroselLayout implements LayoutManager,ActionListener{ /** * Number of items in the carousel (that are visible) */ protected int numberOfItems = 0; /** * List of components being laid out */ protected LinkedList components = new LinkedList(); /** * List of additional information held on components in the carousel */ protected Hashtable additionalData = new Hashtable(); /** * The current degree of rotation of the carousel */ protected double rotationalOffset = 0.0; /** * The desired rotational offset, which will be moved to by a timer animating the carousel */ protected double targetOffset = 0.0; /** * Time for driving animations */ private Timer animationTimer = null; /** * The container the layout is... laying out */ private Container container = null; /** * Should items furtehr away from the observer be faded out? */ private boolean depthBasedAlpha = true; /** * The width of a component when the scale is 1.0 */ private int neutralContentWidth = 64; /** * Creates a new instance of the layout engine, tied to the specified container. * @param forContainer The container the layout will layout */ public CaroselLayout(Container forContainer){ animationTimer = new Timer(0,this); container = forContainer; } /** * Specify the neutral content width of any laid out component. * @param neutralContentWidth The neutral width of components */ public void setNeutralContentWidth(int neutralContentWidth) { this.neutralContentWidth = neutralContentWidth; } /** * Moves a layout component at a particular location in the * carousel * * @param i The location at which to insert * @param comp The component to insert * */ public void moveComponentTo(int i, Component comp){ components.remove(comp); components.add(i,comp); recalculateCarosel(); } /** * Name is ignored * @param name The name of the component, ignored. * @param comp The component being added */ public void addLayoutComponent(String name, Component comp) { components.addLast(comp); recalculateCarosel(); } /** * Remove the component * @param comp The component being removed */ public void removeLayoutComponent(Component comp) { components.remove(comp); recalculateCarosel(); } /** * Gets the additional data stored by the layout manager for a given component * * @param comp The component you wish retreive the data for * @return A position, which is added if it does not already exist. Never null unless * you run out of memory! */ protected CaroselPosition getPosition(Component comp){ CaroselPosition cpos = (CaroselPosition) additionalData.get(comp); if (cpos==null){ cpos = new CaroselPosition(comp); additionalData.put(comp,cpos); } return cpos; } /** * Determines how many of the items being laid out are currently visible. * @return How many of the items in the carousel are currently visible. */ protected int recalculateVisibleItems(){ int visibleItems=0; try{ for (Component comp : components){ if (comp.isVisible()){ visibleItems++; } } } catch (ConcurrentModificationException ex){ return recalculateVisibleItems(); } return visibleItems; } /** * Updates all of the positions of the carousel. Does not do a repaint, just does the math ready for the next one. */ protected void recalculateCarosel(){ //Need to count visible, not just how many in the list //Again dealing with out-of-EDT modification numberOfItems = recalculateVisibleItems(); //Trap and re-calc on concurrent modification (might as well be up-to-date) try{ boolean animate=false; double itemCount = 0; for (Component comp : components){ CaroselPosition position = getPosition(comp); if (comp.isVisible()){ double localAngle = itemCount * (Math.PI * 2.0 / (double) numberOfItems); position.setAngle(localAngle); } if (position.isAnimating()){ animate=true; } itemCount+=1.0; } //If we do need to animate, get it started if (animate){ animationTimer.start(); } } catch (ConcurrentModificationException ex){ recalculateCarosel(); return; } } /** * Cheats and bases it's size on the prefered sizes of each component * @param parent The container interested in the layout size * @return The minimum size of the layout. See above. */ public Dimension minimumLayoutSize(Container parent) { return preferredLayoutSize(parent); } /** * Determine the widest and tallest dimensions, then return the height as 1.5 * the highest, and 3 * the widest * @param parent The container for the layout * @return The prefered size of the layout */ public Dimension preferredLayoutSize(Container parent) { Dimension dim = new Dimension(0, 0); // get widest preferred width for left && right // get highest preferred height for left && right // add preferred width of middle int widestWidth = 0; int highestHeight = 0; Iterator i = components.iterator(); while (i.hasNext()){ Component comp = (Component) i.next(); if (comp.isVisible()){ widestWidth = Math.max(widestWidth, comp.getPreferredSize().width); highestHeight = Math.max(highestHeight, comp.getPreferredSize().height); } } dim.width = widestWidth * 3; dim.height = highestHeight * 2; Insets insets = parent.getInsets(); dim.width += insets.left + insets.right; dim.height += insets.top + insets.bottom; return dim; } /** * Determines the center of the carousel * @param insets The insets of the container * @param width The width of the container * * @param height The height of the container * @param widest The widest component * @return A point at the center of the carousel */ protected Point calculateCenter(Insets insets, int width, int height, int widest){ return new Point((insets.left+widest/2) + width/2, insets.top + height/2); } /** * Controls if items should fade as they move to the back of the carousel * @param depthBasedAlpha True if they should fade, false if they shouldn't */ public void setDepthBasedAlpha(boolean depthBasedAlpha) { this.depthBasedAlpha = depthBasedAlpha; } /** * Can be over-ridden to restrict the range of angles where the child component * is shown * @return false if the component should not be shown * @param comp Controls if components are hidden or not, in the case of this layout it always returns false * @param angle The angle of the component under consideration * @param s The scale of the component under consideration */ protected boolean shouldHide(Component comp, double angle, double s){ if (depthBasedAlpha){ if (comp instanceof RichComponent){ s = Math.min(1.0f,Math.max(0.0f,s/1.2f)); ((RichComponent) comp).setAlpha((float)s); } } return false; } /** * Determines the correct size of the carousel for the container * @param target The target container * @param insets Insets into the target container * @param width Width of the target container * @param height Height of the target container * @param widestComponent The widest component in the container * @return The */ protected Dimension getCarouselRadius(Container target, Insets insets, int width, int height, int widestComponent){ return null; } /** * Determines the scale to be applied to the component. The default calculation * divides the y co-ordinate by the y-cordinate of the centre. Other implimentations * may use some of the other parameters * * @param angle The angle of the component * @param x The x-position of the component * @param y The y-position of the component * @param carouselX The x centre of the carousel * @param carouselY The y centre of the carousel * @return A double which will be used to scale x and y co-ordinates */ protected double getScale(double angle, double x, double y, double carouselX, double carouselY){ return (y / carouselY); } /** * Lays out all of the components on the carosel. Using the preferred width and height to base * scaling on * @param target The container currently being laid out */ public void layoutContainer(Container target) { //Let's make a local copy of components to avoid concurrent modification //which could happen if someone adds something to the layout outside //of the EDT. This is faster than do any synchronization or brute force //exception catching LinkedList components = (LinkedList) this.components.clone(); int numberOfItems = this.numberOfItems; recalculateCarosel(); // these variables hold the position where we can draw components // taking into account insets Insets insets = target.getInsets(); int width = target.getSize().width - (insets.left + insets.right); int height = target.getSize().height - (insets.top + insets.bottom); //No longer calculate the width based on prefered sizes, we're going to control //it by the component not the content' int widestWidth = neutralContentWidth; int highestHeight = 0; width -= widestWidth; int radiusX = width /2; int radiusY = radiusX/3; Dimension radius = getCarouselRadius(target,insets,width,height,widestWidth); if (radius!=null){ radiusX = radius.width; radiusY = radius.height; } Point center = calculateCenter(insets,width,height,widestWidth); int centerX = center.x; int centerY = center.y; //Go through each visible component and set the scale and z-order, and eventually the bounds //Need to protected against other things adding components at the same time Iterator i = components.iterator(); int p = 0; CaroselPosition z_order[] = new CaroselPosition[numberOfItems]; while (i.hasNext()){ Component comp = (Component) i.next(); CaroselPosition position = getPosition(comp); double finalAngle = position.getAngle()+this.rotationalOffset; double x = (Math.sin(finalAngle) * (double) radiusX)+(double) centerX; double y = (Math.cos(finalAngle) * (double) radiusY)+(double) centerY; double initialWidth = (double) comp.getPreferredSize().width; double initialHeight = ((double) comp.getPreferredSize().height) * (initialWidth / (double) comp.getPreferredSize().width); double s = getScale(finalAngle, x,y,(double) centerX, (double) centerY);//(y / (double) centerY); double boundsWidth = initialWidth * s; double boundsHeight = initialHeight * s; if (!shouldHide(comp, finalAngle,s)){ //Even scaling only to avoid windows jitter... int finalWidth = (int)boundsWidth / 1; int finalHeight = (int)boundsHeight / 1; finalWidth = (int) finalWidth & 0xFFFFFFFE; finalHeight = (int) finalHeight & 0xFFFFFFFE; comp.setBounds((int)x - ((int)boundsWidth/2),(int) y - ((int)boundsHeight /2),finalWidth, finalHeight); } else { comp.setBounds(-100,-100,32,32); } position.setZ(s); z_order[p++] = position; } //Now sort out the z, we may need to cache the dimensions, do the z and then reset the bounds, see what happens on redraw first //bubble sort is actually very fast for a small number of items, and this layout shouldn't be used for loads. boolean swaps = true; int limit = numberOfItems-1; while (swaps){ swaps = false; for (int j=0;j Math.PI){ if (target=components.size()){ return components.get(0); } else { return components.get(i); } } /** * The number of components being laid out. Does not included hidden ones * @return The number of components */ public int getComponentCount(){ return components.size(); } /** * Gets the index of the supplied component * @param comp The component * @return The index */ public int getComponentIndex(Component comp) { return components.indexOf(comp); } /** * The size of comopnents a neutral width * @return The size of components at neutral width (scale 1.0) */ public int getNeutralContentWidth() { return neutralContentWidth; } class CaroselPosition{ protected double angle; protected double scale; protected double z; protected Component component; protected boolean firstSet = false; protected double targetAngle = 0.0; public CaroselPosition(Component component){ angle = 0.0; scale = 0.0; z = 0.0; this.component = component; } public Component getComponent(){ return component; } public double getZ(){ return z; } public void setZ(double z){ this.z = z; } public double getTargetAngle(){ return targetAngle; } public double getAngle(){ return angle; } public double getScale(){ return scale; } public boolean isAnimating(){ if ((Math.abs(angle - targetAngle) < 0.001)){ return false; } return true; } public void moveToTarget(){ angle=targetAngle; } public void updateAngle(){ if ((Math.abs(angle - targetAngle) < 0.001)){ angle = targetAngle; } else { angle += Math.min((targetAngle - angle) / 6.0,0.10); } } public void setAngle(double angle){ if (firstSet){ this.angle = angle; this.targetAngle = angle; firstSet = false; } else { this.targetAngle = angle; } } public void setScale(double scale){ this.scale = scale; } } } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/borders/0000755000175000017500000000000011253454714025414 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/borders/AbstractImageBorder.java0000644000175000017500000001362710603373306032127 0ustar drazzibdrazzib/* * AbstractImageBorder.java * * Created on March 27, 2007, 9:19 AM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.swing.borders; import java.awt.*; import java.awt.image.BufferedImage; import java.net.URL; import contrib.com.blogofbug.utility.ImageUtilities; /** * * @author nigel */ public class AbstractImageBorder { /** * Creates a new ImageBofder loading the image from the supplied URL * @param imageURL The location of the image to use * @param imageInsets The insets around the edge of the image that allow the cookie-cut-and-stretch of the image * around the edge of the border */ public AbstractImageBorder(URL imageURL, Insets imageInsets){ this.imageInsets = imageInsets; borderImage = ImageUtilities.loadCompatibleImage(imageURL.toString()); } /** * Creates a new ImageBorder using the supplied image and the insets * * @param borderImage The image to be used as the border * @param imageInsets The insets around the edge of the image that allow the cookie-cut-and-stretch of the image * around the edge of the border */ public AbstractImageBorder(BufferedImage borderImage, Insets imageInsets) { this.borderImage = borderImage; this.imageInsets = imageInsets; } protected BufferedImage borderImage; protected Insets imageInsets; /** * Paints the border around the specified component * * @param c The component to paint the border on * @param g The graphics context * @param x The x offset * @param y The y offset * @param width The width * @param height The height */ public void paintBorder(int compWidth, int compHeight, Graphics g, int x, int y, int width, int height) { Graphics2D g2 = (Graphics2D) g; int imageWidth = borderImage.getWidth(); int imageHeight = borderImage.getHeight(); //Top-left corner drawSlice(g2,0,0,imageInsets.left,imageInsets.top,0,0); //Top-right corner drawSlice(g2,imageWidth-imageInsets.right,0,imageInsets.right,imageInsets.bottom, compWidth-imageInsets.right,0); //Bottom-left corner drawSlice(g2,0,imageHeight-imageInsets.bottom,imageInsets.left,imageInsets.bottom,0,compHeight-imageInsets.bottom); //Bottom-right corner drawSlice(g2,imageWidth-imageInsets.right,imageHeight-imageInsets.bottom,imageInsets.left,imageInsets.bottom,compWidth-imageInsets.right,compHeight-imageInsets.bottom); //Draw left side g2.drawImage(borderImage,0,imageInsets.top,imageInsets.left,compHeight-imageInsets.bottom, 0,imageInsets.top,imageInsets.left,imageHeight-imageInsets.bottom,null); //Draw right side g2.drawImage(borderImage,compWidth-imageInsets.right ,imageInsets.top+6,compWidth,compHeight-imageInsets.bottom, imageWidth-imageInsets.right,imageInsets.top,imageWidth,imageHeight-imageInsets.bottom,null); //Draw top side g2.drawImage(borderImage,imageInsets.left ,0,compWidth-imageInsets.left,imageInsets.top, imageInsets.left,0,imageWidth-imageInsets.right,imageInsets.top,null); //Draw bottom side g2.drawImage(borderImage,imageInsets.left ,compHeight-imageInsets.bottom,compWidth-imageInsets.left,compHeight, imageInsets.left,imageHeight-imageInsets.bottom,imageWidth-imageInsets.right,imageHeight,null); } /** * Sets the insets around the edge of the image to be used to cookie cut the image into a border * * @param insets The edges of the image */ public void setInsets(Insets insets){ this.imageInsets = insets; } public Insets getImageInsets(){ return (Insets) imageInsets.clone(); } /** * Paints a stretched version of the center of the image (as the border is drawn * first, then the component paints itself) so that the component can use it in * its own paint if the border lends itself to having a centre area over-painted * * @param g2 The graphics context * @param c The component */ public void paintCenter(Graphics2D g2, int compWidth,int compHeight){ int imageWidth = borderImage.getWidth(); int imageHeight = borderImage.getHeight(); //draw center g2.drawImage(borderImage, imageInsets.left,imageInsets.top,compWidth-imageInsets.right,compHeight-imageInsets.bottom, imageInsets.left,imageInsets.top,imageWidth-imageInsets.right,imageHeight-imageInsets.bottom,null); } /** * Draws a slicde from the specified image onto the graphics area * * @param g2 The graphics context to draw into * @param sliceX The x-cordinate of the slice * @param sliceY The y-cordinate of the slice * @param sliceWidth The width of the slice * @param sliceHeight The height of the slice * @param destX The target location of the drawn slice * @param destY The target location of the drawn slice */ private void drawSlice(Graphics2D g2,int sliceX, int sliceY, int sliceWidth, int sliceHeight, int destX, int destY){ g2.drawImage(borderImage,destX,destY,destX+sliceWidth,destY+sliceHeight, sliceX,sliceY,sliceX+sliceWidth,sliceY+sliceHeight,null); } } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/swing/borders/ImageBorder.java0000644000175000017500000000766210603373302030441 0ustar drazzibdrazzib/* * ImageBorder.java * * Created on January 15, 2007, 6:54 AM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.swing.borders; import java.awt.*; import java.awt.image.BufferedImage; import java.net.URL; import javax.swing.border.AbstractBorder; /** * ImageBorder takes an image and breaks out the corners and the top, left, right, and bottom * borders stretching them to fill the space around which the border is drawn * @author nigel */ public class ImageBorder extends AbstractBorder{ protected AbstractImageBorder borderRenderer; boolean paintBorder = true; /** * Creates a new ImageBorder using the supplied image and the insets * * @param borderImage The image to be used as the border * @param imageInsets The insets around the edge of the image that allow the cookie-cut-and-stretch of the image * around the edge of the border */ public ImageBorder(BufferedImage borderImage, Insets imageInsets) { borderRenderer= new AbstractImageBorder(borderImage, imageInsets); } /** * Creates a new ImageBofder loading the image from the supplied URL * @param imageURL The location of the image to use * @param imageInsets The insets around the edge of the image that allow the cookie-cut-and-stretch of the image * around the edge of the border */ public ImageBorder(URL imageURL, Insets imageInsets){ borderRenderer = new AbstractImageBorder(imageURL,imageInsets); } /** * Paints the border around the specified component * * @param c The component to paint the border on * @param g The graphics context * @param x The x offset * @param y The y offset * @param width The width * @param height The height */ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { if (!paintBorder){ return; } borderRenderer.paintBorder(c.getWidth(),c.getHeight(),g,x,y,width,height); } /** * Controls wether or not the border is actually painted or not. * * @param paintBorder If false then will not draw the border. Useful if the border is being used to show a selected item */ public void setPaintBorder(boolean paintBorder){ this.paintBorder = paintBorder; } /** * Gets the insets of the image back (subtracting from the component size would give you the renderable * area * * @param c The component to which the border will be applied * @return The insets of the border */ public Insets getBorderInsets(Component c) { return borderRenderer.getImageInsets(); } /** * Gets the insets of the image and returns in the in the supplied Insets instance * * @param c The component to which the border will be applied * @param i A pre-created insets object * @return The insets of the border */ public Insets getBorderInsets(Component c, Insets i){ Insets imageInsets = borderRenderer.getImageInsets(); i.top = imageInsets.top; i.bottom = imageInsets.bottom; i.left = imageInsets.left; i.right = imageInsets.right; return i; } public void paintCenter(Graphics2D g2, Component c) { if (paintBorder){ borderRenderer.paintCenter(g2,c.getWidth(),c.getHeight()); } } } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/utility/0000755000175000017500000000000011253454712024326 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/utility/ImageUtilities.java0000644000175000017500000002232210603372252030104 0ustar drazzibdrazzib/* * ImageUtilities.java * * Created on March 16, 2007, 4:34 PM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.utility; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GraphicsConfiguration; import java.awt.GraphicsEnvironment; import java.awt.Image; import java.awt.RenderingHints; import java.awt.Transparency; import java.awt.font.FontRenderContext; import java.awt.font.LineBreakMeasurer; import java.awt.font.TextAttribute; import java.awt.font.TextLayout; import java.awt.image.BufferedImage; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.text.AttributedCharacterIterator; import java.text.AttributedString; import java.util.Hashtable; import java.util.LinkedList; import javax.imageio.ImageIO; import javax.swing.JComponent; /** * Static class with utility methods for images * * @author nigel */ public class ImageUtilities { /** * Creates an image compatible with the current display * * @return A BufferedImage with the appropriate color model */ public static BufferedImage createCompatibleImage(int width, int height){ GraphicsConfiguration configuration = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration(); //Create a buffered image which is the right (translucent) format for the current graphics device, this //should ensure the fastest possible performance. Adding on some extra height to make room for the reflection return configuration.createCompatibleImage(width,height, Transparency.TRANSLUCENT); } /** * Loads an image in a format compatible with the current display * * * @return A BufferedImage with the appropriate color model */ public static BufferedImage loadCompatibleImage(String imageURL){ Image image = null; try { image = ImageIO.read(new URL(imageURL)); } catch (MalformedURLException ex) { ex.printStackTrace(); return null; } catch (IOException ex) { ex.printStackTrace(); return null; } if (image==null){ return null; } GraphicsConfiguration configuration = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration(); //Create a buffered image which is the right (translucent) format for the current graphics device, this //should ensure the fastest possible performance. Adding on some extra height to make room for the reflection BufferedImage originalImage = configuration.createCompatibleImage(image.getWidth(null),image.getHeight(null), Transparency.TRANSLUCENT); //Blit the loaded image onto the optimized surface by creating a graphics context for the new image Graphics2D g = originalImage.createGraphics(); //Draw the original image g.drawImage(image, 0, 0, null); g.dispose(); return originalImage; } /** * Produces a resized image that is of the given dimensions * * @param image The original image * @param width The desired width * @param height The desired height * @return The new BufferedImage */ public static BufferedImage scaledImage(BufferedImage image, int width, int height){ BufferedImage newImage = createCompatibleImage(width,height); Graphics graphics = newImage.createGraphics(); graphics.drawImage(image,0,0,width,height,null); graphics.dispose(); return newImage; } /** * Produces a copy of the supplied image * * @param image The original image * @return The new BufferedImage */ public static BufferedImage copyImage(BufferedImage image){ return scaledImage(image,image.getWidth(),image.getHeight()); } /** * Renders a paragraph of text (line breaks ignored) to an image (created and returned). * * @param font The font to use * @param textColor The color of the text * @param text The message * @param width The width the text should be limited to * @return An image with the text rendered into it */ public static BufferedImage renderTextToImage(Font font, Color textColor, String text, int width){ Hashtable map = new Hashtable(); map.put(TextAttribute.FONT, font); AttributedString attributedString = new AttributedString(text,map); AttributedCharacterIterator paragraph = attributedString.getIterator(); FontRenderContext frc = new FontRenderContext(null, false, false); int paragraphStart = paragraph.getBeginIndex(); int paragraphEnd = paragraph.getEndIndex(); LineBreakMeasurer lineMeasurer = new LineBreakMeasurer(paragraph, frc); float drawPosY=0; //First time around, just determine the height while (lineMeasurer.getPosition() < paragraphEnd) { TextLayout layout = lineMeasurer.nextLayout(width); // Move it down drawPosY += layout.getAscent() + layout.getDescent() + layout.getLeading(); } BufferedImage image = ImageUtilities.createCompatibleImage(width,(int) drawPosY); Graphics2D graphics = (Graphics2D) image.getGraphics(); graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); drawPosY=0; lineMeasurer.setPosition(paragraphStart); while (lineMeasurer.getPosition() < paragraphEnd) { TextLayout layout = lineMeasurer.nextLayout(width); // Move y-coordinate by the ascent of the layout. drawPosY += layout.getAscent(); /* Compute pen x position. If the paragraph is right-to-left, we want to align the TextLayouts to the right edge of the panel. */ float drawPosX; if (layout.isLeftToRight()) { drawPosX = 0; } else { drawPosX = width - layout.getAdvance(); } // Draw the TextLayout at (drawPosX, drawPosY). layout.draw(graphics, drawPosX, drawPosY); // Move y-coordinate in preparation for next layout. drawPosY += layout.getDescent() + layout.getLeading(); } graphics.dispose(); return image; } /** * Renders multiple paragraphs of text in an array to an image (created and returned). * * @param font The font to use * @param textColor The color of the text * @param text The message in an array of strings (one paragraph in each * @param width The width the text should be limited to * @return An image with the text rendered into it */ public static BufferedImage renderTextToImage(Font font, Color textColor, String text[], int width){ LinkedList images = new LinkedList(); int totalHeight = 0; for (String paragraph : text){ BufferedImage paraImage = renderTextToImage(font,textColor,paragraph,width); totalHeight+=paraImage.getHeight(); images.add(paraImage); } BufferedImage image = createCompatibleImage(width,totalHeight); Graphics2D graphics = (Graphics2D) image.createGraphics(); int y=0; for (BufferedImage paraImage : images){ graphics.drawImage(paraImage,0,y,null); y+=paraImage.getHeight(); } graphics.dispose(); return image; } /** * Renders a component into an image, which is useful for playing with the component's * resultant image in special effects or transitions * * @param component The component to render * @return A buffered image with the rendered component. */ public static BufferedImage renderComponentToImage(JComponent component){ //Create the image BufferedImage image = createCompatibleImage(component.getWidth(),component.getHeight()); //Render the component onto the image Graphics graphics = image.createGraphics(); component.paint(graphics); graphics.dispose(); return image; } } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/0000755000175000017500000000000011253454714024443 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/DockFinalDemo.form0000644000175000017500000002111010553717520027761 0ustar drazzibdrazzib
liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/CarouselMenu.java0000644000175000017500000001110110566564332027706 0ustar drazzibdrazzib/* * CarouselMenu.java * * Created on January 12, 2007, 6:13 AM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.examples; import java.awt.*; import java.awt.event.ActionEvent; import java.net.URL; import javax.swing.JOptionPane; import contrib.com.blogofbug.swing.components.AbstractCarouselMenuAction; import contrib.com.blogofbug.swing.components.JCarouselMenu; /** * * @author nigel */ public class CarouselMenu extends javax.swing.JFrame { /** Creates new form CarouselMenu */ public CarouselMenu() { initComponents(); this.setResizable(false); JCarouselMenu carousel = new JCarouselMenu(); carousel.setBackground(Color.BLACK,new Color(0,0,1 )); this.getContentPane().setLayout(new BorderLayout()); carousel.setPreferredSize(new Dimension(400,400)); carousel.add(new ActionCarouselLayout(CaroselFinal.class.getResource("/contrib/com/blogofbug/examples/images/Carousel Layout.png"),"Carousel Layout"),256,256); carousel.add(new ActionCarouselComponent(CaroselFinal.class.getResource("/contrib/com/blogofbug/examples/images/Carousel Component.png"),"Carousel Component"),256,256); carousel.add(new ActionCarouselFinal(CaroselFinal.class.getResource("/contrib/com/blogofbug/examples/images/Full Carousel.png"),"Full Carousel Demo"),256,256); carousel.add(new ActionQuit(CaroselFinal.class.getResource("/contrib/com/blogofbug/examples/images/Quit.png"),"Quit"),256,256); carousel.setSelectedIndex(0); this.getContentPane().add(carousel,BorderLayout.CENTER); this.setSize(600,400); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // //GEN-BEGIN:initComponents private void initComponents() { getContentPane().setLayout(new java.awt.GridBagLayout()); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("BlogOfBug Demo Library"); pack(); }// //GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new CarouselMenu().setVisible(true); } }); } public class ActionCarouselLayout extends AbstractCarouselMenuAction{ public ActionCarouselLayout(URL image, String label){ super(image,label); } public void actionPerformed(ActionEvent actionEvent) { new CaroselLayoutManager().setVisible(true); } } public class ActionCarouselComponent extends AbstractCarouselMenuAction{ public ActionCarouselComponent(URL image, String label){ super(image,label); } public void actionPerformed(ActionEvent actionEvent) { new CaroselComponentExample().setVisible(true); } } public class ActionCarouselFinal extends AbstractCarouselMenuAction{ public ActionCarouselFinal(URL image, String label){ super(image,label); } public void actionPerformed(ActionEvent actionEvent) { new CaroselFinal().setVisible(true); } } public class ActionQuit extends AbstractCarouselMenuAction{ public ActionQuit(URL image, String label){ super(image,label); } public void actionPerformed(ActionEvent actionEvent) { if (JOptionPane.showConfirmDialog(null,"Are you sure you want to quit?","BlogOfBug",JOptionPane.QUESTION_MESSAGE,JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){ System.exit(0); } } } // Variables declaration - do not modify//GEN-BEGIN:variables // End of variables declaration//GEN-END:variables } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/CaroselComponentExample.java0000644000175000017500000000422310562621362032073 0ustar drazzibdrazzib/* * CaroselLayoutManager.java * * Created on December 29, 2006, 12:04 PM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.examples; import contrib.com.blogofbug.swing.components.JCarosel; import contrib.com.blogofbug.swing.layout.CaroselLayout; import java.awt.BorderLayout; import java.awt.Color; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; /** * * @author bug */ public class CaroselComponentExample extends JFrame{ /** Creates a new instance of CaroselLayoutManager */ public CaroselComponentExample() { super("Carosel Component"); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setSize(600,400); getContentPane().setLayout(new BorderLayout()); JCarosel carosel = new JCarosel(); carosel.setBackground(Color.BLACK,Color.DARK_GRAY); getContentPane().add(carosel); carosel.add("Label Example",new JLabel("Example with text")); carosel.add("Button Example", new JButton("Oh, and a button too!")); carosel.add("Text Field", new JTextField("Edit me!")); carosel.add("Image example",new JLabel(new ImageIcon(CaroselLayoutManager.class.getResource("/com/blogofbug/examples/images/Acknowledgements.png")))); } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new CaroselLayoutManager().setVisible(true); } }); } } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/carosel/0000755000175000017500000000000011253454714026073 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/DockLayeredPane.form0000644000175000017500000002111010557140530030307 0ustar drazzibdrazzib
liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/CaroselFinal.form0000644000175000017500000000237210562463574027704 0ustar drazzibdrazzib
liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/CaroselFinal.java0000644000175000017500000000655310562621532027655 0ustar drazzibdrazzib/* * CaroselFinal.java * * Created on December 29, 2006, 10:57 AM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.examples; import contrib.com.blogofbug.swing.components.ImageLabel; import contrib.com.blogofbug.swing.components.JCarosel; import java.awt.BorderLayout; import java.awt.Color; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JLabel; /** * * @author nigel */ public class CaroselFinal extends javax.swing.JFrame { /** Creates new form CaroselFinal */ public CaroselFinal() { initComponents(); JCarosel carosel = new JCarosel(); carosel.setBackground(Color.BLACK,Color.DARK_GRAY); getContentPane().add(carosel, BorderLayout.CENTER); setSize(600,400); carosel.add(CaroselFinal.class.getResource("/contrib/com/blogofbug/examples/images/Acknowledgements.png").toString(),"You Rock",128,128); carosel.add(CaroselFinal.class.getResource("/contrib/com/blogofbug/examples/images/Dock.png").toString(),"Docks Rock",128,128); carosel.add(CaroselFinal.class.getResource("/contrib/com/blogofbug/examples/images/Cascade.png").toString(),"Cascade Icon",128,128); carosel.add(CaroselFinal.class.getResource("/contrib/com/blogofbug/examples/images/Quit.png").toString(),"Quit Bugging",128,128); carosel.add(CaroselFinal.class.getResource("/contrib/com/blogofbug/examples/images/Acknowledgements.png").toString(),"You Rock",128,128); carosel.add(CaroselFinal.class.getResource("/contrib/com/blogofbug/examples/images/Dock.png").toString(),"Docks Rock",128,128); carosel.add(CaroselFinal.class.getResource("/contrib/com/blogofbug/examples/images/Cascade.png").toString(),"Cascade Icon",128,128); carosel.add(CaroselFinal.class.getResource("/contrib/com/blogofbug/examples/images/Quit.png").toString(),"Quit Bugging",128,128); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // //GEN-BEGIN:initComponents private void initComponents() { setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("JCarosel Final Demo"); pack(); }// //GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new CaroselFinal().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables // End of variables declaration//GEN-END:variables } liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/images/0000755000175000017500000000000011253454714025710 5ustar drazzibdrazzibliblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/images/menu_highlight.png0000644000175000017500000000257110552326734031417 0ustar drazzibdrazzibPNG  IHDR6etEXtSoftwareAdobe ImageReadyqe<IDATxnTϞ]gVT\\}^ @Q_xנ"FĎWrigz[@m,VBHg?'O"WRECYC&VK #sNV\1|\G @ nE>9nL:B"MHƕr:Qp"VxK.E8) -њp^WZ"U3;qce<0[X93v# [pXRb)q Og;-ál՚ aK$i_w_^@HG'TtrEI\)Aֱ<3FAƫ{ϟG/]j@O'c8ͻk^YBFh^ Ù㸪,yE 3؋eFJ{)\[ZU+J~~㷮\xXpVnYR|+eII$BPAt)KJB& ecBKW22멫Ĉ^Ia,Jǒ ,zn"౼dII$ᰌJA(yf8B&ލW@f8B&3Y8GȇBcMB(!K@ }}zʫC>~ WW c8B(\Eq"\(>!M;K;g+ G$:g5VRIXX p,ܮ^/%!ɕ;⒙t pL.W7뺅,) Ɛn4gڔpw}t%%בs3!ˢ3U^v%eT[3] k;ibݡuK[ dF܄s M+z]'\dVцs@8JjWst)+)q>3Z&!de%KK 'LTK@4OUK-& ЭS*)c:2HA(Uwy<7&P=anL4 Fxe{֝joIENDB`liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/images/bug256x256.png0000644000175000017500000006244510553273676030100 0ustar drazzibdrazzibPNG  IHDR?1tEXtSoftwareAdobe ImageReadyqe<dIDATx]`Źٽ*ɖ,ɖ-K7)bS 5K%x %:$PCO .wE,Y\ݝ73;[Nčcu:}~b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b+b/,-CH asOE$!&}CަϊZ-11 @}0d &Qr3`E6 1 @Ϟ adkТ0| 1@LzF|F l=~dԬ  &=rC5v?9V b2>TE=о\v$t% !pLW~+ЯĻ tGG`*<"^kQ}Q?$ypJMȥ}(a?L& !ԽH NĈU G&w C36%G,nm#$*o=e͸gR{JSu0k__aQv&5+vHQK,8Kƴi$I@->RC\He{/X б|Sz>~Sfbz8OVWmٿrSHU;CBj {35؃sؙ[XpcA`xWKzuU0bW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&0ۍj~}T%|;u+v쵆qŲJ44N"ºGaP q?J8/oi$Qk]`5JCL}늪 O2[}7yD7Mm֦ >t| &sEwd3n)&2ZAMyI[jQ#`혷H'n\#\񃾌s8S5M@Z} Μ]ێl1.=m V{*?tHտ@;UOIҡkþ@>eyaݭW,q \l <%rGRGc 2?ߺpHrSC55mwhG$H-` ?kYן}C/.v޹ס*2pVvs |vlNizzZLg1}X> &J'io'2OqQFH=$CχPֹ@cͯOOpyϛ=fNzĄ$pl 4ז+Yw}k: GRAL"d}05~;J\0{26<\ }X#7oZ 9my A!I-%AK0T̪ؽ*'y !bz۪W$x'%$Q| N\J/!Ӏ&zZWD-] &K>|Fg}C&׃ sye9mA qES&IP>dx]}R`bؽ "~Akd@qRd@$)C D7~ٰ/t,}V^]{\X: +AzCJR%eIOJ2`pg]ArN2<ƵFD6NUe,VA+'!QZ!CƐP% qYI٣UĀFUD(p%6Y6 2lHH%hϓict3+ $,=Űq68GA&#^f!2fGQ/;c"С,d6: JbWNKTѯ֓ QvS Ń'E$q {%06DцElhΐrX.>S̹^1y%tB4hA-Ra̓+yL$D  |;ox#*Q-A m(j5lY7қڋc P+Dܖw>m5:2RRg-$-m{!~( ۨ ~EVyA b$ҕ$vHTrqFZbWBZ#󦴙K\婽 W)2ZVJZ"@a„%A26[7^N d[_HPEIST~"\ (^T՛"dGm1N#mlsĀǽMT}F> V{镪Gp(GƯ-ΟIDgX~@[h ̈́W@ 6@BaӉϱ3mFnY6~ &, z vEe 4(tnf5 z;a(:?.6=wդ&sAX܄l_wYr/c<0Ay?fxVt<YQ [&\IENDB`liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/images/Acknowledgements.png0000644000175000017500000010107210552016174031704 0ustar drazzibdrazzibPNG  IHDR\rftEXtSoftwareAdobe ImageReadyqe<IDATx$Gu.\ՓgnN{7'mT*P@(B&c@1c6?F6< JUڠݻwݛ]{TuܰUktsw B²,,X ²eaYP ²,(eaYX^ ,,%p ^ ل[sWz dA,,s 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$ItG)cwiuI/+ pn%]Fz?IENDB`liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/images/bug64x64.png0000644000175000017500000000774210553273644027724 0ustar drazzibdrazzibPNG  IHDR@@% tEXtSoftwareAdobe ImageReadyqe<IDATxZ tו_^Āpf;IΉ!1p&9cOfgE F ԴEյݒZ;3g\NW׻{?E}s|sЁn&k' !D>iFiF>5km=ȉE1͊F9JEG }dU5M_Z^7s4ild<#cb)K4gמ_` iވ3ꚕ7H-&pspj=&|_ZdZ9,( />WRxbxma8}͖)A"BUQ-WHH؁3cX+^[qKt-ܾw{"ځ)1&~=y]oao6=Hvcq˒͛(@}211lGJd?f` Rw6. |Yeݳ&7ε'+OaV< 8%U"`H Щe+9a,ɢ(9%k#nͽ6 CT8p11f06hDeZ IB$:dbF>KcVX5s~gCx&hbvd뿧sNU۪Qf &" OZ}FKyΞ=Ҝj3J!$ajPsfNOzt[1?VDuGuOopIIqqzT)2=:e}vP!zaƔvtgTHwlN_*=\%Bt.yd7>@`H!ɼyOi8pNJDʐ,=/JK!p,Ȑc~دo%n&Tw ($ߒ:lndxA4bNKxhJ8 8PΚIFN3%%1$>=3\C$2$ki千zW[Snv|n;w8:>ȳL3k, N49:$_fzjNrD 2`-8-DHDƩi  \RYo k/OK,S^Κӭbnar^SzjFU">_}j"ZXko_kdInI **Onì1j`*N\lr"*"#~4c\z(/ҝh>jJwdKees%0𤼪FlbVDAz0,R)i3N&-b17s{QMSW\Wͼ/ؗQp aϟ]:ڬm hz)\iror4>tJ#gՊd+4@Knp'%({o"":$`YAuAyc9TTT|oGi6.CTʔp6.xxJ=#*c[Y?`^~!(by#"4r.=R[zj ҐtFcf.lyAau &1Vzi^6əYriFuWjCQ }}螳3b1bEs m-u.dYh4$#l`$NZ8w #C"lr4”ozg~ y b(ζZjmuK"Yqzf]wڛd,%zu" pnkxE:Unv >)HCU(7h {t7T6{U|W:(|ꎋ4 CCR(X)o#/Y/] _Iӆo a!8;]w˪/!>ڞNT6#p Q[bor5y5BjQg+@ 6]ʯ8Tr2Iڝ˧6Hjf A]/|RҥH='J:鯻W(ν;PM(y \jїSIH4Ar>TAa{lauA\h\X|~-O9Z| H 0fV2Jcӟ\㳟X0q yOZ` sa猟O c*P$_KBD b65%#[aQUp|t_y4.ox/F-'6,3̐``B@#h@ F)N~?&E^JWL[?}NR%Iza[nF"ӃS4W$Z3cΘ1׎YswHzZuuۚmbD(BuVnR>LNL+bo)m wm{҃lW[ E>,]!/;<O J6o/~_C5hSto=Wѽ5؉qOzU%BAi\QEQgOglX1[B=i2--~ J11cŒa`Vbz1vc!邇ާvP-OvĢcƾĎpn5>6DuEjH C)n4W"<::-Xj** -kJ~ iJW}e/ÍQh.M%BVk+i{m0u)E()V*J+?f4UU {Xd&f 1Q7%tMJ*l%n_5P O%^<ER-PDI2@,(6kۤ):N\m/ߛ(Q|꧛NUzdt sVj?PsF@Zzřؕo7<["GF(mZ&%ǜ?[;e(pXf -,,1pB,"'j;:1Fla] nCC{6ETʯ_Km:盟Wݔ߸j' h(t&L_=pʷR=LKGMIENDB`liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/images/Cascade.png0000644000175000017500000032026710552341200027735 0ustar drazzibdrazzibPNG  IHDR\rftEXtSoftwareAdobe ImageReadyqe<YIDATxidu5}X\@R(j(RuĄcbf1?4pXe#E@Ѝnt-3+;7zAKYDHdWU˗;s0 Yd|]"@dE9",rEY",DYd,"YdE "@dE9",rEY",DYd,"YdE "@dE9",rEY",DYd,"YdE "@dE9",rEY",DYd,"YdE "@dE9",rEY",rEY",DYd,"YdL)ruiBve%te B߃:8,2+(`Zq{k[m\ֱgR^xVWdm:z??5`!nG&ap4݁}#3#%wSC~p\_G4/Z\9D&D hvz~1F&F/wڸs=x194nُGs6z]ȨCx=xXae]roͻvMA;..=.kbp.BΘ+͊{j/!mRxx]B:EBwP1V{ki'9S@:!;jrZHpi_y{ฉc|>o{7kyas DԿ)}9<}'@dES-^CA$ IA_$Glހ^3\-#M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P<l](\K4PA z (I}Т\u3+ye̚1hex}TE{iH(V*}{)*\vpE饳F(.w,;z~77ql2T+]@d2e!Rx ?|>аw'͝]ԔŸ/pӇgx_;I=\e;Dc1|w#GyyyRJ〝^{߄cdYEW_ /?d ЬLw!G$hަjb߯qA~{׬a 7&*t ت^O7p{qA5{LR$ba8>$Cn.>ids];%lڴC \^Vv}|cDoχ8ǰw<}Op?d|>*k`kNgJ4Hb X/ H$i~ɮiY`H$RPT(b+5N ~D r M|!^s@~ A0&>WZYYY^EE$`=ѽ˾tשDCwuՀ%`?d>۶`۶uĶVН˾w? ]%L$ iZw8NcPpub+z}w B?Q {s3_A/n(JSReB(`n4] /Rq@RJ|>=8SM&I-\4MBPAox[*Ry''I)[u]_ \4 PP zT @nLpE{A/QA >˞(m1@JDqch_tLiKh@A<2vлpE)D^ ww^ J[D| y}gX[d+CӾA6ݭ_/m i?Hnt}-qJۯDCW`_[n%uϝNs/BOT^%uA{߷V ؏EO*ZN%zGgp{$qSw?I0<=큽Ъyoi]'B;@߹ 7f>n(Q~7D~JTC})-㦹-=@D+NGq[{?[KD%:M\I/T?7঵r;JD%:蹂%@8KT@ǜW9R=D%D%*D%*Q %*QJ/QJTJT `aaYpIENDB`liblaf-widget-java-4.3.orig/src/contrib/com/blogofbug/examples/images/Dock.png0000644000175000017500000016236710552330256027310 0ustar drazzibdrazzibPNG  IHDR> pHYs  ciCCPPhotoshop ICC profilexڭWWT۳_:"EZMj齋@H(ЋJ9@A"4PQPr "łxABCu=uDIr 4TijYDyYR_9*j]_,rE*oO=5ko4X98zk斖֫w.=vٝRcg]|{<^|,YY^Y*,< JUUڽ ou#(YKfC0,ܬll8>qpsw4VHr&ꊩKIJ୤MeeUToW ((*UT}Ԩ)|r&gKzYMtLՙ-#YoX؍8h8; 5y ^G|hn j'm(!CWը#?Dǖ^<%&;N}6q琉oY:͙ß+'\>aE!>EG)G#-)>z&̧Un9*Jk/^,{Exh5 |7or7boq5qmƵ oS֮aiw׃E?2,x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ug/examples/CaroselLayoutManager.java0000644000175000017500000000371110562621362031366 0ustar drazzibdrazzib/* * CaroselLayoutManager.java * * Created on December 29, 2006, 12:04 PM * * Copyright 2006-2007 Nigel Hughes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at http://www.apache.org/ * licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package contrib.com.blogofbug.examples; import contrib.com.blogofbug.swing.layout.CaroselLayout; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; /** * * @author bug */ public class CaroselLayoutManager extends JFrame{ /** Creates a new instance of CaroselLayoutManager */ public CaroselLayoutManager() { super("Carosel Layout Manager"); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setSize(600,400); getContentPane().setLayout(new CaroselLayout(getContentPane())); getContentPane().add("Label Example",new JLabel("Example with text")); getContentPane().add("Button Example", new JButton("Oh, and a button too!")); getContentPane().add("Text Field", new JTextField("Edit me!")); getContentPane().add("Image example",new JLabel(new ImageIcon(CaroselLayoutManager.class.getResource("/com/blogofbug/examples/images/Acknowledgements.png")))); } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new CaroselLayoutManager().setVisible(true); } }); } }