Package madkit.gui
Class SwingUtil
java.lang.Object
madkit.gui.SwingUtil
This class provides some utilities for building swing components.
- Since:
- MaDKit 5.0.0.16
- Version:
- 0.9
- Author:
- Fabien Michel
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractButtonaddBooleanActionTo(Container menuOrToolBar, BooleanAction action) Creates aJCheckBoxMenuItemfor a menu orJToggleButtonfor a tool barstatic voidaddMaDKitActionsTo(Container menuOrToolBar, AbstractAgent agent) Adds to a menu or toolbar the following actions:KernelAction.EXITKernelAction.COPYKernelAction.RESTARTKernelAction.LAUNCH_NETWORKKernelAction.STOP_NETWORKGUIManagerAction.CONNECT_TO_IPGlobalAction.JCONSOLEKernelAction.CONSOLEGlobalAction.DEBUGGlobalAction.LOAD_LOCAL_DEMOSGlobalAction.LOAD_JAR_FILEGUIManagerAction.ICONIFY_ALLGUIManagerAction.DEICONIFY_ALLGUIManagerAction.KILL_AGENTSstatic JSlidercreateJSlider(BoundedRangeModel model) Creates a JSlider built using aDefaultBoundedRangeModeland containing aMouseWheelListenerand some usual default settingsstatic JPanelcreateSliderPanel(BoundedRangeModel model, String label) Creates a labeled panel containing a slider built using an existingDefaultBoundedRangeModelstatic JPanelcreateSliderPanel(JSlider slider, String label) Creates a labeled panel containing a slider with default size.static JPanelcreateSliderPanel(JSlider slider, String label, int width) Creates a labeled panel containing a slider and considering a particular widthstatic voidscaleAllAbstractButtonIconsOf(Container container, int size) Resizes the icons of all the abstract buttons which are contained in a container.
-
Field Details
-
MADKIT_LOGO
The MaDKit's logo -
MADKIT_LOGO_SMALL
The MaDKit's logo with a size of 14x14 pixels
-
-
Method Details
-
createSliderPanel
Creates a labeled panel containing a slider with default size.- Parameters:
slider-label-- Returns:
- a panel for the slider
-
createSliderPanel
Creates a labeled panel containing a slider and considering a particular width- Parameters:
slider-label-- Returns:
- a panel for the slider
-
createSliderPanel
Creates a labeled panel containing a slider built using an existingDefaultBoundedRangeModel- Parameters:
model-label-- Returns:
- a panel for this model
-
createJSlider
Creates a JSlider built using aDefaultBoundedRangeModeland containing aMouseWheelListenerand some usual default settings- Parameters:
model-- Returns:
- the corresponding
JSlider
-
addMaDKitActionsTo
Adds to a menu or toolbar the following actions:KernelAction.EXITKernelAction.COPYKernelAction.RESTARTKernelAction.LAUNCH_NETWORKKernelAction.STOP_NETWORKGUIManagerAction.CONNECT_TO_IPGlobalAction.JCONSOLEKernelAction.CONSOLEGlobalAction.DEBUGGlobalAction.LOAD_LOCAL_DEMOSGlobalAction.LOAD_JAR_FILEGUIManagerAction.ICONIFY_ALLGUIManagerAction.DEICONIFY_ALLGUIManagerAction.KILL_AGENTS
- Parameters:
agent- the agent for which this menu will be built.
-
addBooleanActionTo
Creates aJCheckBoxMenuItemfor a menu orJToggleButtonfor a tool bar- Parameters:
menuOrToolBar-action-- Returns:
- the newly created button: Either a
JToggleButtonor aJCheckBoxMenuItem - Throws:
NoSuchMethodExceptionIllegalAccessExceptionInvocationTargetException
-
scaleAllAbstractButtonIconsOf
Resizes the icons of all the abstract buttons which are contained in a container.- Parameters:
container- a container containing abstract buttonssize- the size which should be used for the icons
-