public class SwingBorderAdapter extends AbstractStateAdapter
Constructor and Description |
---|
SwingBorderAdapter(Border pDisabledBorder)
Create a new adapter with no state associated.
|
SwingBorderAdapter(State pState)
Create a new adapter with a state and a default disabled border.
|
SwingBorderAdapter(State pState,
Border pDisabledBorder)
Create a new adapter.
|
Modifier and Type | Method and Description |
---|---|
protected void |
adjustInitialState(Object pTarget,
boolean pEnabled)
We store the original border of the component, and call processStateChange()
afterwards.
|
protected void |
processStateChange(Object pTarget,
boolean pEnabled)
We map the pEnabled boolean to the setting/re-setting of a Border
on a JComponent.
|
void |
setBorder(Border pDisabledBorder)
Sets the disabled border, the new border will be shown at the next
state change.
|
add, add, addInvert, getConsistencyCategory, getName, remove, setName, setState, stateChanged
public SwingBorderAdapter(State pState)
pState
- the state we adaptpublic SwingBorderAdapter(Border pDisabledBorder)
pDisabledBorder
- the border for the disabled state, must not be nullIllegalArgumentException
- if pDisabledBorder is nullpublic SwingBorderAdapter(State pState, Border pDisabledBorder)
pState
- the state we adaptpDisabledBorder
- the border for the disabled state, must not be nullIllegalArgumentException
- if pDisabledBorder is nullpublic void setBorder(Border pDisabledBorder)
pDisabledBorder
- the border for the disabled state, must not be nullprotected void adjustInitialState(Object pTarget, boolean pEnabled)
adjustInitialState
in class AbstractStateAdapter
pTarget
- the target we should adjustpEnabled
- the state for the targetprotected void processStateChange(Object pTarget, boolean pEnabled)
processStateChange
in class AbstractStateAdapter
pTarget
- target object, must be a JComponentpEnabled
- true if the target object should get "enabled"IllegalStateException
- if pTarget is not a JComponentCopyright © 2017 Jürgen Zeller (privat). All rights reserved.