Class JComponentFactory
- java.lang.Object
-
- de.alpharogroup.swing.components.factories.JComponentFactory
-
public class JComponentFactory extends java.lang.Object
The classJComponentFactory
provides factory methods for create swing Component objects
-
-
Constructor Summary
Constructors Constructor Description JComponentFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.Frame
newFrame(java.lang.String title)
static javax.help.HelpSet
newHelpSet(java.lang.String directoryPath, java.lang.String filename)
Factory method for create newHelpSet
object.static javax.swing.JInternalFrame
newInternalFrame(java.lang.String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)
Factory method for create aJInternalFrame
object.static javax.swing.JButton
newJButton(java.lang.String text)
static javax.swing.JEditorPane
newJEditorPane(java.lang.String contentType, boolean editable)
static javax.swing.JMenuItem
newJMenuItem(@NonNull java.lang.String text, int mnemonic, char accelerator)
Factory method for create aJMenuItem
.static javax.swing.JPopupMenu
newJPopupMenu()
Factory method for create aJPopupMenu
.static javax.swing.JPopupMenu
newJPopupMenu(java.awt.Component component, javax.swing.JMenuItem... items)
Factory method for create aJPopupMenu
that will be add aMouseListener
to the givenComponent
and an array ofJMenuItem
that will be added to the popup.static javax.swing.JPopupMenu
newJPopupMenu(java.lang.String label)
Factory method for create aJPopupMenu
with the specified title.static javax.swing.JPopupMenu
newJPopupMenu(java.lang.String label, java.awt.Component component, javax.swing.JMenuItem... items)
Factory method for create aJPopupMenu
that will be add aMouseListener
to the givenComponent
and an array ofJMenuItem
that will be added to the popup.static javax.swing.JSplitPane
newJSplitPane(int newOrientation, boolean newContinuousLayout, java.awt.Component newLeftComponent, java.awt.Component newRightComponent)
Factory method for create newJSplitPane
objectstatic javax.swing.JSplitPane
newJSplitPane(int newOrientation, java.awt.Component newLeftComponent, java.awt.Component newRightComponent)
Factory method for create newJSplitPane
objectstatic javax.swing.JSplitPane
newJSplitPane(java.awt.Component newLeftComponent, java.awt.Component newRightComponent)
Factory method for create newJSplitPane
objectstatic javax.swing.JToolBar
newJToolBar()
Factory method for create aJToolBar
object.static java.awt.PopupMenu
newPopupMenu(java.util.List<MenuItemBean> menuItemBeans)
Factory method for create aPopupMenu
object.static SplashScreen
newSplashScreen(java.lang.String image, java.lang.String text)
Factory method for create aSplashScreen
.static java.awt.TrayIcon
newTrayIcon(java.lang.String imgFilename, java.lang.String appName, java.awt.PopupMenu systemTrayPopupMenu, java.util.Map<java.lang.String,java.awt.event.ActionListener> actionListeners)
Factory method for create aTrayIcon
object.
-
-
-
Method Detail
-
newFrame
public static java.awt.Frame newFrame(java.lang.String title)
-
newJEditorPane
public static javax.swing.JEditorPane newJEditorPane(java.lang.String contentType, boolean editable)
-
newJButton
public static javax.swing.JButton newJButton(java.lang.String text)
-
newJSplitPane
public static javax.swing.JSplitPane newJSplitPane(java.awt.Component newLeftComponent, java.awt.Component newRightComponent)
Factory method for create newJSplitPane
object- Parameters:
newLeftComponent
- theComponent
that will appear on the left of a horizontally-split pane, or at the top of a vertically-split panenewRightComponent
- theComponent
that will appear on the right of a horizontally-split pane, or at the bottom of a vertically-split pane- Returns:
- the new
JSplitPane
object
-
newJSplitPane
public static javax.swing.JSplitPane newJSplitPane(int newOrientation, java.awt.Component newLeftComponent, java.awt.Component newRightComponent)
Factory method for create newJSplitPane
object- Parameters:
newOrientation
-JSplitPane.HORIZONTAL_SPLIT
orJSplitPane.VERTICAL_SPLIT
newLeftComponent
- theComponent
that will appear on the left of a horizontally-split pane, or at the top of a vertically-split panenewRightComponent
- theComponent
that will appear on the right of a horizontally-split pane, or at the bottom of a vertically-split pane- Returns:
- the new
JSplitPane
object
-
newJSplitPane
public static javax.swing.JSplitPane newJSplitPane(int newOrientation, boolean newContinuousLayout, java.awt.Component newLeftComponent, java.awt.Component newRightComponent)
Factory method for create newJSplitPane
object- Parameters:
newOrientation
-JSplitPane.HORIZONTAL_SPLIT
orJSplitPane.VERTICAL_SPLIT
newContinuousLayout
- a boolean, true for the components to redraw continuously as the divider changes position, false to wait until the divider position stops changing to redrawnewLeftComponent
- theComponent
that will appear on the left of a horizontally-split pane, or at the top of a vertically-split panenewRightComponent
- theComponent
that will appear on the right of a horizontally-split pane, or at the bottom of a vertically-split pane- Returns:
- the new
JSplitPane
object
-
newHelpSet
public static javax.help.HelpSet newHelpSet(java.lang.String directoryPath, java.lang.String filename) throws javax.help.HelpSetException
Factory method for create newHelpSet
object.- Parameters:
directoryPath
- the directory pathfilename
- the filename- Returns:
- the new
HelpSet
object - Throws:
javax.help.HelpSetException
- is thrown if there are problems parsing theHelpSet
object.
-
newInternalFrame
public static javax.swing.JInternalFrame newInternalFrame(java.lang.String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)
Factory method for create aJInternalFrame
object.- Parameters:
title
- the titleresizable
- the resizableclosable
- the closablemaximizable
- the maximizableiconifiable
- the iconifiable- Returns:
- the new
JInternalFrame
.
-
newJMenuItem
public static javax.swing.JMenuItem newJMenuItem(@NonNull @NonNull java.lang.String text, int mnemonic, char accelerator)
Factory method for create aJMenuItem
.- Parameters:
text
- the text of theJMenuItem
mnemonic
- the keyboard mnemonic for theJMenuItem
accelerator
- The character that have to push together with the CTRL.- Returns:
- the new
JMenuItem
-
newJPopupMenu
public static javax.swing.JPopupMenu newJPopupMenu()
Factory method for create aJPopupMenu
.- Returns:
- the new
JPopupMenu
.
-
newJPopupMenu
public static javax.swing.JPopupMenu newJPopupMenu(java.awt.Component component, javax.swing.JMenuItem... items)
Factory method for create aJPopupMenu
that will be add aMouseListener
to the givenComponent
and an array ofJMenuItem
that will be added to the popup.- Parameters:
component
- the componentitems
- theJMenuItem
s- Returns:
- the new
JPopupMenu
.
-
newJPopupMenu
public static javax.swing.JPopupMenu newJPopupMenu(java.lang.String label)
Factory method for create aJPopupMenu
with the specified title.- Parameters:
label
- the string that a UI may use to display as a title for the popup menu.- Returns:
- the new
JPopupMenu
.
-
newJPopupMenu
public static javax.swing.JPopupMenu newJPopupMenu(java.lang.String label, java.awt.Component component, javax.swing.JMenuItem... items)
Factory method for create aJPopupMenu
that will be add aMouseListener
to the givenComponent
and an array ofJMenuItem
that will be added to the popup.- Parameters:
label
- the labelcomponent
- the componentitems
- theJMenuItem
s- Returns:
- the new
JPopupMenu
.
-
newJToolBar
public static javax.swing.JToolBar newJToolBar()
Factory method for create aJToolBar
object.- Returns:
- the j tool bar
-
newPopupMenu
public static java.awt.PopupMenu newPopupMenu(java.util.List<MenuItemBean> menuItemBeans)
Factory method for create aPopupMenu
object.- Parameters:
menuItemBeans
- the menu item beans- Returns:
- the new
PopupMenu
.
-
newSplashScreen
public static SplashScreen newSplashScreen(java.lang.String image, java.lang.String text)
Factory method for create aSplashScreen
.- Parameters:
image
- the imagetext
- the text- Returns:
- the new
SplashScreen
.
-
newTrayIcon
public static java.awt.TrayIcon newTrayIcon(java.lang.String imgFilename, java.lang.String appName, java.awt.PopupMenu systemTrayPopupMenu, java.util.Map<java.lang.String,java.awt.event.ActionListener> actionListeners)
Factory method for create aTrayIcon
object.- Parameters:
imgFilename
- the img filenameappName
- the app namesystemTrayPopupMenu
- the system tray popup menuactionListeners
- the action listeners- Returns:
- the new
TrayIcon
.
-
-