Package com.luciad.lucy.gui
Class TLcyCommonWidgetFactory
java.lang.Object
com.luciad.lucy.gui.TLcyCommonWidgetFactory
Factory to create some common user interface widgets. Use getSharedInstance()
to retrieve an instance of this factory, for example like this:
Component panel = TLcyCommonWidgetFactory.getSharedInstance().createTitledPanel(
"MyTitle", new JScrollPane( new JTree() ), new Insets( 10, 10, 10, 10 ) );
By making an extension of this factory, GUI widgets can be replaced application wide.
Those methods that are intended to replace or change widgets explicitly state in their
comments they can be overridden. Settings your custom extension can be done using the
setSharedInstance(TLcyCommonWidgetFactory)
method.
TLcyCommonWidgetFactory customExtension = ...;
TLcyCommonWidgetFactory.setSharedInstance( customExtension );
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a newTLcyCommonWidgetFactory
. -
Method Summary
Modifier and TypeMethodDescriptioncreateTitledPanel
(String aTitle, Component aContent) Creates a new titled panel, with a left margin of 5 pixels and no outer spacing.createTitledPanel
(String aTitle, Component aContent, int aLeftMargin) Creates a new titled panel without outer spacing.createTitledPanel
(String aTitle, Component aContent, int aLeftMargin, Insets aOuterSpacer) Creates a new titled panel.createTitledPanel
(String aTitle, Component aContent, Insets aOuterSpacer) Creates a new titled panel with a left margin of 5 pixels.createTitledSeparator
(String aTitle) Creates a horizontal separator with the given title.static TLcyCommonWidgetFactory
Returns the sharedTLcyCommonWidgetFactory
instance that can be used to create some common GUI widgets.static void
setSharedInstance
(TLcyCommonWidgetFactory aSharedInstance) Sets the sharedTLcyCommonWidgetFactory
instance.
-
Constructor Details
-
TLcyCommonWidgetFactory
protected TLcyCommonWidgetFactory()Creates a newTLcyCommonWidgetFactory
. Only extensions of this class need to use this constructor, others should usegetSharedInstance()
to retrieve an instance.
-
-
Method Details
-
createTitledPanel
Creates a new titled panel, with a left margin of 5 pixels and no outer spacing.- Parameters:
aTitle
- The title for the titled panel.aContent
- The content for the panel- Returns:
- The created titled panel.
- See Also:
-
createTitledPanel
Creates a new titled panel without outer spacing.- Parameters:
aTitle
- The title for the titled panel.aContent
- The content for the panelaLeftMargin
- The left margin in pixels, used to have a horizontal shift between the left edge of the title and the left edge of the component.- Returns:
- The created titled panel.
- See Also:
-
createTitledPanel
Creates a new titled panel with a left margin of 5 pixels.- Parameters:
aTitle
- The title for the titled panel.aContent
- The content for the panelaOuterSpacer
- The empty space added around the titled panel.- Returns:
- The created titled panel.
- See Also:
-
createTitledPanel
public Component createTitledPanel(String aTitle, Component aContent, int aLeftMargin, Insets aOuterSpacer) Creates a new titled panel. It is composed of a title and seperator above the the givenComponent
. It looks like this:
The shift betweenaTitle ---------------- aContent
aTitle
andaContent
is specified byaLeftMargin
. The spacing around the whole titled panel is specified byaOuterSpacer
. Override this method to create a different look for titled panels.- Parameters:
aTitle
- The title for the titled panel.aContent
- The content for the panelaLeftMargin
- The left margin in pixels, used to have a horizontal shift between the left edge of the title and the left edge of the component.aOuterSpacer
- The empty space added around the titled panel.- Returns:
- The created titled panel.
-
createTitledSeparator
Creates a horizontal separator with the given title. Override this method to create a different look for titled separators.- Parameters:
aTitle
- The title to put on the separator.- Returns:
- The created horizontal titled separator.