📄 readme.html
字号:
<html> <head> <title>PgsLookAndFeel - An introduction</title> <style type="text/css"> h1, h2, h3 { font-size: 16px; background: #0098FF; border-bottom: 1px solid #006BB3; color: #FFF; padding: 4px; } h1 { font-size: 18px; background: #FFBB00; padding: 5px; } h2 { margin: 5px; } h3 { font-size: 14px; background: #D97B00; padding: 3px; margin: 10px; } p { margin: 10px; font-size: 12px; font-family: Tahoma, Veranda, sans-serif; } body { font-size: 10px; } pre { background: #EFEFEF; border: 1px dotted #B36500; padding: 5px; margin: 10px; } </style> </head> <body> <h1>PgsLookAndFeel - An introduction</h1> <h2>Abstract</h2> <p>The PgsLookAndFeel aims to provide a free Cross-Platform LookAndFeel for Swing.</p> <p>This means, that the PgsLookAndFeel tries to fit equally well into Windows-, Gnome- and KDE-desktops.</p> <h2>Version</h2> <p>This is version 1.0.1 of PgsLookAndFeel.</p> <h2>License</h2> <p>The PgsLookAndFeel is licensed under terms of Apache Software License 2. The most important thing for you should be this: You may use it for commercial and free software products without having to pay anything for it.</p> <h2>Usage</h2> <p>Using the PgsLookAndFeel is as easy as switching your shorts.</p> <pre><code>PlafOptions.setAsLookAndFeel();</code></pre> <p>There are lots of options you may set, but they're all optional.</p> <p>If you need to update your GUI because you switched the LookAndFeel at runtime (<em>Note: We strongly discourage this</em>), then we provide a Utility as well:</p> <pre><code>PlafOptions.updateAllUIs();</code></pre> <p>By now you should've noticed that all interaction with PgsLookAndFeel is done through the PlafOptions class. It's a utility class with all-static functions.</p> <p>We'll go through each of its methods later.</p> <h2>Screenshots</h2> <p>I'd expect you've already seen some screenshots, but anyway. A - more or less current - collection of screenshots can be found on our <a href="https://pgslookandfeel.dev.java.net/screenshots.html">project site</a></p> <h2>Options</h2> <h3>Icon size</h3> <p>If your application uses a menu with icons in it, then you'll want to call the <code>PlafOptions.setDefaultMenuItemIconSize(Dimension)</code> method. Most likely you'll want to pass <code>new Dimension(16, 16)</code> to it. You must call this manually.</p> <p>Later versions of the PgsLookAndFeel might render this method obsolete, though.</p> <h3>Antialiasing</h3> <p>You might want to enable antialiasing. This can be done easily with <code>PlafOptions.setAntialiasingEnabled(boolean)</code>, but we discourage this.</p> <p>If your user is using Mustang, he'll automatically benefit from Subpixel-Rendering, the AA before that version was rather ugly and might result in a worse look.</p> <h3>Clear border</h3> <p>By default, PgsLookAndFeel will use a round border. If you enable "ClearBorder" you'll get a rectangular border that is rendered without AA. To use ClearBorder, call <code>PlafOptions.setClearBorderEnabled(true);</code></p> <p><img src="doc/clearborder.png" alt="ClearBorder example" /></p> <h3>HTML Display Fix</h3> <p>This setting is one of my favorite ones. JEditorPane uses a really ugly font for rendering HTML content and PgsLookAndFeel is able to fix it on the fly. Do not disable this setting if you don't have a good reason for it!</p> <p>To disable the HTML-Fix, call <code>PlafOptions.setFixHtmlDisplayEnabled(false);</code></p> <h3>Wheel Tab</h3> <p>Another of my favorites. If enabled (<em>this is the default behaviour</em>), this will allow the user to switch the tabs of a JTabbedPane by using his mouse wheel.</p> <p>This is a common feature on Gnome and KDE, so it's propably a good idea to have it enabled. In case you don't want it, you can disable it with <code>PlafOptions.setWheelTabbedPaneEnabled(false);</code></p> <h3>Other TabbedPane addons</h3> <p>Please do not enable the other fixes. They're in alpha-stage and do not work properly in most cases.</p> <h3>Office Scrollbar</h3> <p>When I saw the screenshots of the new Office Version (I believe it was called 2007), I decided that I wanted that look in my LookAndFeel as well, so here it is.</p> <p>The difference between the default painting and Office-painting is, that the gradient is painted vertical instead of horizontal for vertical scrollbars (switch the direction for horizontal bars). Enable it with <code>PlafOptions.setOfficeScrollBarEnabled(true);</code></p> <p><img src="doc/officescrollbar.png" alt="Office scrollbar" /></p> <h3>Jide-Enhancement</h3> <p>Jidesoft was kind enough to provide us with a license for their products. We use this license to speedup gradient painting. That one is not that much of an issue, but those of you how'd like to have the best possible speed might appreciate it. If you want to use it, make sure you're having a version of Jidesofts jide-common.jar in your classpath or be using the PgsLookAndFeel-jide.jar file.</p> <p>To enable fast gradient painting just use PgsLookAndFeel-jide.jar or have jide-common.jar in your classpath. Once you call <code>PlafOption.setAsLookAndFeel()</code>, we'll look for Jide-support and enable fast gradient painting. We won't license Jide if you already have licensed it in your product.</p> <p>Please note that you're not allowed to use the Jidesoft license in your own code. It's specific to PgsLookAndFeel. Thanks.</p> <h3>Styles</h3> <p>You might as well play around with the <code>PlafOptions.setStyle()</code> method.</p> <p>Basicly they enable you to choose between painting a gradient and using a single color to fill components.</p> <h3>pgs.properties</h3> <p>PgsLookAndFeel will look for a file called "pgs.properties" in your classpath. If it finds one it'll load it and let it do the setup.</p> <p>There are lots of settings you can specify there. See below for a complete list (<em>italic text means default</em>):</p> <pre><code>pgs.shadowBorder ::= true | <em>false</em>swing.boldMetal ::= true | <em>false</em>pgs.boldMenuFonts ::= true | <em>false</em>pgs.extraMargin ::= <em>true</em> | falsepgs.useDisabledIcon ::= <em>true</em> | falsepgs.useToolBarIcon ::= <em>true</em> | falsepgs.aaEnabled ::= true | <em>false</em>pgs.clearBorderEnabled ::= true | <em>false</em>pgs.fixHtmlDisplayEnabled ::= <em>true</em> | falsepgs.wheelTabEnabled ::= <em>true</em> | falsepgs.tabbedPaneRightClickSelectionEnabled ::= true | <em>false</em>pgs.tabReorderingEnabled ::= true | <em>false</em>pgs.paintRolloverButtonBorder ::= <em>true</em> | falsepgs.officeScrollBarEnabled ::= true | <em>false</em>pgs.vistaStyle ::= true | <em>false</em>pgs.style.menuBar ::= <em>flat</em> | gradientpgs.style.menuitem ::= <em>flat</em> | gradientpgs.style.menuBarMenu ::= <em>flat</em> | gradientpgs.style.toolBar ::= flat | <em>gradient</em>pgs.style.toolBarButton ::= flat | <em>gradient</em>pgs.style.button ::= flat | <em>gradient</em></code></pre> <p>And this is, where things start to get a little bit more complicated. There is another property that you may specify. This property is called "<code>theme</code>". It may have different values, though.</p> <pre><code># Load theme by nametheme = silver# Load theme by classname (must be a PgsTheme)theme = com.pagosoft.plaf.themes.VistaTheme# Create theme from a resource filetheme = res:pgs_theme.properties# Create a theme directly (below theme equals ThemeFactory.GRAYtheme = colors:7997D1, ABABAB, 000000</code></pre> <p>If this property is not present, we'll try to create a theme from pgs.properties file. The properties that'll be used are equal to those that'd be used if you loaded it from another properties file (<code>theme = res:</code>...).</p> <pre><code>name = Some Theme <em>(Optional)</em>primary1 = 6080ACprimary2 = FFCF31primary3 = F9E089secondary1 = 666554secondary2 = DCDBCBsecondary3 = F1F0E3black = 000000 <em>(Optional)</em>white = FFFFFF <em>(Optional)</em></code></pre> <p>A complete example might look like this:</p> <pre><code>pgs.style.menuBar = gradientpgs.style.menuBarMenu = gradienttheme = silverpgs.officeScrollBarEnabled = true</code></pre> <h2>Themes</h2> <p>The PgsLookAndFeel comes with a set of predefined themes and a ThemeFactory. The last one enables you to create a complete theme from just <em>one</em> color.</p> <p>The result, however, isn't as good as a human generated theme.</p> <p>PgsLookAndFeel is fully compatible with any MetalTheme, thus you should be able to use themes from JGoodies Plastic LookAndFeel or the standard JRE - like Steel and even Ocean - PgsLookAndFeel looks great using Ocean theme!</p> <h2>Thanks</h2> <p>Of course this file cannot live without having a section where I thank for the great work of others. ;)</p> <p>I'd like to thank <a href="http://www.jetbrains.com">JetBrains</a> for providing me a free license of their beautiful IntelliJ IDEA. I'd also like to thank those who have provided me with feedback and kind words and I'd like to thank Jidesoft for their great cooperation.</p> <p>Thanks too, to Karsten Lentzsch whos code I've borrowed at some places and to David Vignoni, whose iconset (Nuvola) we're using.</p> <h2>Other Pagosoft products</h2> <p>I've written a couple of other libaries that you might be interested in.</p> <h3>PgsAction</h3> <p>This is a framework for working with Swings Action-system. It really shines when it comes to dynamic menus and applications with a Plugin system, but it also helps to create applications that are easier to maintain and write.</p> <p><a href="http://www.pagosoft.com/actions.html">Product website</a></p> <h3>PgsBindings</h3> <p>This is a very simple and easy to use Binding and validation libary for swing components.</p> <p><a href="http://www.pagosoft.com/bindings.html">Product website</a></p> <h3>SimpleEdit</h3> <p>This application is the reason why I'm not working to often on PgsLookAndFeel. It aims at becoming the worlds best PHP-IDE.</p> <p><a href="http://www.simpleedit.org/">Project website</a></p> <h2>Last words</h2> <p>Thanks for taking the time to read this document and for downloading and trying the PgsLookAndFeel.</p> <p>I hope you like it, but in case you don't: Drop me a mail and I'll see what I can do.</p> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -