public final class SwingUtil extends Object
Modifier and Type | Field and Description |
---|---|
static ImageIcon |
MADKIT_LOGO
The MaDKit's logo
|
static ImageIcon |
MADKIT_LOGO_SMALL
The MaDKit's logo with a size of 14x14 pixels
|
Constructor and Description |
---|
SwingUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addBooleanActionTo(Container menuOrToolBar,
Action action)
Creates a
JCheckBoxMenuItem for a menu or JToggleButton
for a tool bar |
static void |
addMaDKitActionsTo(Container menuOrToolBar,
AbstractAgent agent)
Adds to a menu or toolbar the following actions:
KernelAction.EXIT
KernelAction.COPY
KernelAction.RESTART
KernelAction.LAUNCH_NETWORK
KernelAction.STOP_NETWORK
GUIManagerAction.CONNECT_TO_IP
GlobalAction.JCONSOLE
KernelAction.CONSOLE
GlobalAction.DEBUG
GlobalAction.LOAD_LOCAL_DEMOS
GlobalAction.LOAD_JAR_FILE
GUIManagerAction.ICONIFY_ALL
GUIManagerAction.DEICONIFY_ALL
GUIManagerAction.KILL_AGENTS
|
static JSlider |
createJSlider(BoundedRangeModel model)
Creates a JSlider built
using a
DefaultBoundedRangeModel and
containing a MouseWheelListener
and some usual default settings |
static JPanel |
createSliderPanel(BoundedRangeModel model,
String label)
Creates a labeled panel containing a slider built
using an existing
DefaultBoundedRangeModel |
static JPanel |
createSliderPanel(JSlider slider,
String label)
Creates a labeled panel containing a slider with default size.
|
static JPanel |
createSliderPanel(JSlider slider,
String label,
int width)
Creates a labeled panel containing a slider and considering
a particular width
|
static void |
scaleAllAbstractButtonIconsOf(Container container,
int size)
Resizes the icons of all the abstract buttons which are contained in
a container.
|
public static final ImageIcon MADKIT_LOGO
public static final ImageIcon MADKIT_LOGO_SMALL
public static JPanel createSliderPanel(JSlider slider, String label)
slider
- label
- public static JPanel createSliderPanel(JSlider slider, String label, int width)
slider
- label
- public static JPanel createSliderPanel(BoundedRangeModel model, String label)
DefaultBoundedRangeModel
model
- label
- public static JSlider createJSlider(BoundedRangeModel model)
DefaultBoundedRangeModel
and
containing a MouseWheelListener
and some usual default settingsmodel
- JSlider
public static void addMaDKitActionsTo(Container menuOrToolBar, AbstractAgent agent)
KernelAction.EXIT
KernelAction.COPY
KernelAction.RESTART
KernelAction.LAUNCH_NETWORK
KernelAction.STOP_NETWORK
GUIManagerAction.CONNECT_TO_IP
GlobalAction.JCONSOLE
KernelAction.CONSOLE
GlobalAction.DEBUG
GlobalAction.LOAD_LOCAL_DEMOS
GlobalAction.LOAD_JAR_FILE
GUIManagerAction.ICONIFY_ALL
GUIManagerAction.DEICONIFY_ALL
GUIManagerAction.KILL_AGENTS
agent
- the agent for which this menu
will be built.public static void addBooleanActionTo(Container menuOrToolBar, Action action)
JCheckBoxMenuItem
for a menu or JToggleButton
for a tool barmenuOrToolBar
- action
- NoSuchMethodException
IllegalAccessException
InvocationTargetException
public static void scaleAllAbstractButtonIconsOf(Container container, int size)
container
- a container containing abstract buttonssize
- the size which should be used for the icons
Fabien Michel, Olivier Gutknecht, Jacques Ferber - February 12 2016