com.explodingpixels.macwidgets
Class MacWidgetFactory
java.lang.Object
com.explodingpixels.macwidgets.MacWidgetFactory
public class MacWidgetFactory
- extends Object
A factory for creating various types of Mac style widgets. See each method's javadoc for detailed
descriptions of the components, as well as screen shots and links to specific sections in Apples
Human Interface Guidelines.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MacWidgetFactory
public MacWidgetFactory()
createITunesTable
public static JTable createITunesTable(TableModel tableModel)
wrapITunesTableInJScrollPane
public static JScrollPane wrapITunesTableInJScrollPane(JTable table)
createUnifiedToolBar
public static TriAreaComponent createUnifiedToolBar()
- Creates a Mac style Unified Tool Bar. For a full description of what a Unified Tool Bar is,
see the Toolbars
section of Apple's Human Interface Guidelines. Here's an example of the what this method
creates:
Here's a simple example that creates a Unified Tool Bar:
TriAreaComponent toolBar = MacWidgetFactory.createUnifiedToolBar();
JButton button = new JButton("My Button");
button.putClientProperty("JButton.buttonType", "textured");
toolBar.addComponentToLeft(button);
- Returns:
- a
TriAreaComponent configured as a Unified Tool Bar.
createUnifiedPreferencesTabBar
public static PreferencesTabBar createUnifiedPreferencesTabBar()
createComponentStatusBar
public static ComponentBottomBar createComponentStatusBar()
createBottomBar
public static TriAreaComponent createBottomBar(BottomBarSize size)
- Creates a Mac style Bottom Bar. For a full descrption of what a Bottom Bar is, see the
Bottom Bars
section of Apple's Human Interface Guidelines. Here's an example of what this method cretes:
Here's a simple example that creates a Bottom Bar:
TriAreaComponent bottomBar = MacWidgetFactory.createBottomBar(BottomBarSize.LARGE);
bottomBar.addComponentToCenter(MacWidgetFactory.createEmphasizedLabel("My Label"));
- Parameters:
size - the size of the Bottom Bar.
- Returns:
- a
TriAreaComponent configured as a Bottom Bar.
createSpacer
public static JComponent createSpacer(int width,
int height)
- Creates a transparent spacer of the given width and height. If you don't care about a
particular dimension, that is, you only want a horiztonal spacer, than simply provide zero
for the value your not interested in.
- Parameters:
width - the width of the spacer - zero if the width doesn't matter.height - the height of the spacer - zero if the height doesn't matter.
- Returns:
- a transparent spacer of the given size.
createEmphasizedLabel
public static JLabel createEmphasizedLabel(String text)
makeEmphasizedLabel
public static JLabel makeEmphasizedLabel(JLabel label)
makeEmphasizedLabel
public static JLabel makeEmphasizedLabel(JLabel label,
Color focusedColor,
Color unfocusedColor,
Color emphasisColor)
createSplitPaneForSourceList
public static JSplitPane createSplitPaneForSourceList(SourceList sourceList,
JComponent component)
createSourceList
public static JTree createSourceList(TreeModel model)
makeSourceList
public static JTree makeSourceList(JTree tree)
createSourceListScrollPane
public static JScrollPane createSourceListScrollPane(JComponent content)
makeSourceListScrollPane
public static JScrollPane makeSourceListScrollPane(JScrollPane scrollPane)
createTexturedWindowWorkaroundPainter
public static Painter<Component> createTexturedWindowWorkaroundPainter()