org.pietschy.command
Class DefaultToolbarFactory
java.lang.Objectorg.pietschy.command.DefaultToolbarFactory
- ButtonFactory, ToolbarFactory
public class DefaultToolbarFactory
extends java.lang.Object
Provides the default implementation of
ToolbarFactory. In its default configuration
this factory creates toolbars for which
JToolBar.isFloatable is
false and
buttons for which
JButton.isRolloverEnabled is
true. All buttons are created
with a margin of 1 pixel.
DefaultToolbarFactory()- Creates a new factory that creates non-floatable toolbars and rollover enabled buttons.
|
DefaultToolbarFactory(Insets insets, boolean floatable, boolean rolloverEnabled)- Creates a new factory.
|
JButton | createButton()- Creates a new
JButton.
|
JCheckBox | createCheckBox()- Creates a new
JCheckBox.
|
JRadioButton | createRadioButton()- Creates a new
JRadioButton.
|
AbstractButton | createToggleButton()- Creates a new
JToggleButton.
|
JToolBar | createToolbar()- Creates a new
JToolBar.
|
Insets | getInsets()- Gets the
Insets this factory is applying to the buttons it creates.
|
boolean | isFloatable()- Checks if this factory is creating floatable toolbars.
|
boolean | isFocusable()- Checks if the factory is building focusable toolbars.
|
boolean | isRolloverEnabled()- Checks if this factory is creating rollover enabled buttons.
|
void | setFloatable(boolean floatable)- Configures if this factory is creating floatable toolbars.
|
void | setFocusable(boolean focusable)- Configure the factory to create focusable toolbars.
|
void | setInsets(Insets insets)- Sets the
Insets this factory will apply to the buttons it creates.
|
void | setRolloverEnabled(boolean rolloverEnabled)- Configures if this factory is creating rollover enabled buttons.
|
DefaultToolbarFactory
public DefaultToolbarFactory()
Creates a new factory that creates non-floatable toolbars and rollover enabled buttons.
DefaultToolbarFactory
public DefaultToolbarFactory(Insets insets,
boolean floatable,
boolean rolloverEnabled) Creates a new factory.
insets - the insets to use for all buttons.floatable - true if the toolbars created are to be
floatable, false otherwise.rolloverEnabled - true if buttons created are to be rollover enabled,
false otherwise.
getInsets
public Insets getInsets()
Gets the Insets this factory is applying to the buttons it creates.
- the
Insets this factory is applying to the buttons it creates.
isFloatable
public boolean isFloatable()
Checks if this factory is creating floatable toolbars.
- true if this factory is setting
floatable
to true, false otherwise.
isFocusable
public boolean isFocusable()
Checks if the factory is building focusable toolbars. The default is false.
true if the factory is building focusable toolbars, false otherwise.
isRolloverEnabled
public boolean isRolloverEnabled()
Checks if this factory is creating rollover enabled buttons.
- true if this factory is setting
rollover enabled
to true, false otherwise.
setFloatable
public void setFloatable(boolean floatable)
Configures if this factory is creating floatable toolbars.
floatable - true to make this factory set floateable
to true, false otherwise.
setFocusable
public void setFocusable(boolean focusable)
Configure the factory to create focusable toolbars. The default is false.
focusable - true to create focusable toolbars, false otherwise.
setInsets
public void setInsets(Insets insets)
Sets the Insets this factory will apply to the buttons it creates.
insets - the Insets to use.
setRolloverEnabled
public void setRolloverEnabled(boolean rolloverEnabled)
Configures if this factory is creating rollover enabled buttons.
rolloverEnabled - true to make this factory set rollover enabled
to true, false otherwise.