Class JComponentFactory
- java.lang.Object
-
- de.alpharogroup.swing.components.factories.JComponentFactory
-
public class JComponentFactory extends java.lang.ObjectThe classJComponentFactoryprovides 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 javax.help.HelpSetnewHelpSet(java.lang.String directoryPath, java.lang.String filename)Factory method for create newHelpSetobject.static javax.swing.JInternalFramenewInternalFrame(java.lang.String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)Factory method for create aJInternalFrameobject.static javax.swing.JEditorPanenewJEditorPane(java.lang.String contentType, boolean editable)static javax.swing.JMenuItemnewJMenuItem(@NonNull java.lang.String text, int mnemonic, char accelerator)Factory method for create aJMenuItem.static javax.swing.JPopupMenunewJPopupMenu()Factory method for create aJPopupMenu.static javax.swing.JPopupMenunewJPopupMenu(java.awt.Component component, javax.swing.JMenuItem... items)Factory method for create aJPopupMenuthat will be add aMouseListenerto the givenComponentand an array ofJMenuItemthat will be added to the popup.static javax.swing.JPopupMenunewJPopupMenu(java.lang.String label)Factory method for create aJPopupMenuwith the specified title.static javax.swing.JPopupMenunewJPopupMenu(java.lang.String label, java.awt.Component component, javax.swing.JMenuItem... items)Factory method for create aJPopupMenuthat will be add aMouseListenerto the givenComponentand an array ofJMenuItemthat will be added to the popup.static javax.swing.JSplitPanenewJSplitPane(int newOrientation, boolean newContinuousLayout, java.awt.Component newLeftComponent, java.awt.Component newRightComponent)Factory method for create newJSplitPaneobjectstatic javax.swing.JSplitPanenewJSplitPane(int newOrientation, java.awt.Component newLeftComponent, java.awt.Component newRightComponent)Factory method for create newJSplitPaneobjectstatic javax.swing.JSplitPanenewJSplitPane(java.awt.Component newLeftComponent, java.awt.Component newRightComponent)Factory method for create newJSplitPaneobjectstatic javax.swing.JToolBarnewJToolBar()Factory method for create aJToolBarobject.static java.awt.PopupMenunewPopupMenu(java.util.List<MenuItemBean> menuItemBeans)Factory method for create aPopupMenuobject.static SplashScreennewSplashScreen(java.lang.String image, java.lang.String text)Factory method for create aSplashScreen.static java.awt.TrayIconnewTrayIcon(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 aTrayIconobject.
-
-
-
Method Detail
-
newJEditorPane
public static javax.swing.JEditorPane newJEditorPane(java.lang.String contentType, boolean editable)
-
newJSplitPane
public static javax.swing.JSplitPane newJSplitPane(java.awt.Component newLeftComponent, java.awt.Component newRightComponent)Factory method for create newJSplitPaneobject- Parameters:
newLeftComponent- theComponentthat will appear on the left of a horizontally-split pane, or at the top of a vertically-split panenewRightComponent- theComponentthat will appear on the right of a horizontally-split pane, or at the bottom of a vertically-split pane- Returns:
- the new
JSplitPaneobject
-
newJSplitPane
public static javax.swing.JSplitPane newJSplitPane(int newOrientation, java.awt.Component newLeftComponent, java.awt.Component newRightComponent)Factory method for create newJSplitPaneobject- Parameters:
newOrientation-JSplitPane.HORIZONTAL_SPLITorJSplitPane.VERTICAL_SPLITnewLeftComponent- theComponentthat will appear on the left of a horizontally-split pane, or at the top of a vertically-split panenewRightComponent- theComponentthat will appear on the right of a horizontally-split pane, or at the bottom of a vertically-split pane- Returns:
- the new
JSplitPaneobject
-
newJSplitPane
public static javax.swing.JSplitPane newJSplitPane(int newOrientation, boolean newContinuousLayout, java.awt.Component newLeftComponent, java.awt.Component newRightComponent)Factory method for create newJSplitPaneobject- Parameters:
newOrientation-JSplitPane.HORIZONTAL_SPLITorJSplitPane.VERTICAL_SPLITnewContinuousLayout- 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- theComponentthat will appear on the left of a horizontally-split pane, or at the top of a vertically-split panenewRightComponent- theComponentthat will appear on the right of a horizontally-split pane, or at the bottom of a vertically-split pane- Returns:
- the new
JSplitPaneobject
-
newHelpSet
public static javax.help.HelpSet newHelpSet(java.lang.String directoryPath, java.lang.String filename) throws javax.help.HelpSetExceptionFactory method for create newHelpSetobject.- Parameters:
directoryPath- the directory pathfilename- the filename- Returns:
- the new
HelpSetobject - Throws:
javax.help.HelpSetException- is thrown if there are problems parsing theHelpSetobject.
-
newInternalFrame
public static javax.swing.JInternalFrame newInternalFrame(java.lang.String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)Factory method for create aJInternalFrameobject.- 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 theJMenuItemmnemonic- the keyboard mnemonic for theJMenuItemaccelerator- 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 aJPopupMenuthat will be add aMouseListenerto the givenComponentand an array ofJMenuItemthat will be added to the popup.- Parameters:
component- the componentitems- theJMenuItems- Returns:
- the new
JPopupMenu.
-
newJPopupMenu
public static javax.swing.JPopupMenu newJPopupMenu(java.lang.String label)
Factory method for create aJPopupMenuwith 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 aJPopupMenuthat will be add aMouseListenerto the givenComponentand an array ofJMenuItemthat will be added to the popup.- Parameters:
label- the labelcomponent- the componentitems- theJMenuItems- Returns:
- the new
JPopupMenu.
-
newJToolBar
public static javax.swing.JToolBar newJToolBar()
Factory method for create aJToolBarobject.- Returns:
- the j tool bar
-
newPopupMenu
public static java.awt.PopupMenu newPopupMenu(java.util.List<MenuItemBean> menuItemBeans)
Factory method for create aPopupMenuobject.- 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 aTrayIconobject.- Parameters:
imgFilename- the img filenameappName- the app namesystemTrayPopupMenu- the system tray popup menuactionListeners- the action listeners- Returns:
- the new
TrayIcon.
-
-