Class AbstractPomPanel<M extends ProgCommandAwareBeanModel>
- java.lang.Object
-
- org.bidib.wizard.mvc.pom.view.panel.AbstractPomPanel<M>
-
- All Implemented Interfaces:
PomResultListener
- Direct Known Subclasses:
AddressPanel,DirectAccessPanel,RailcomPanel,ResetDecoderPanel
public abstract class AbstractPomPanel<M extends ProgCommandAwareBeanModel> extends Object implements PomResultListener
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanactiveTabprotected CurrentAddressBeanModelcurrentAddressBeanModelprotected JLabelcurrentOperationLabelprotected com.jgoodies.binding.value.ValueModelcurrentOperationModelprotected PomProgrammerModelcvProgrammerModelstatic intDEFAULT_SUSI_READ_FIRST_TIMEOUTstatic intDEFAULT_TIMEOUTprotected org.slf4j.LoggerLOGGERprotected PomResultProxyModelpomResultProxyModelprotected ImageIconprogOperationUnknownIconprotected JButtonreadButtonprotected com.jgoodies.binding.value.ValueModelreadButtonEnabledprotected JButtonwriteButtonprotected com.jgoodies.binding.value.ValueModelwriteButtonEnabled
-
Constructor Summary
Constructors Constructor Description AbstractPomPanel(PomProgrammerModel cvProgrammerModel, CurrentAddressBeanModel currentAddressBeanModel)Creates a new instance of the AbstractPomPanel.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddLogText(String logLine, Object... args)Add a new line to the logger area.voidaddPomRequestListener(PomRequestListener l)voidclearLogArea()JPanelcreatePanel(PomValidationResultModel parentValidationModel)protected abstract voidcreateWorkerPanel(com.jgoodies.forms.builder.FormBuilder builder, int[] rowHolder, PomValidationResultModel parentValidationModel)protected voiddisableInputElements()protected voiddoBindButtons()protected voidenableInputElements()protected voidfireNextCommand()protected abstract ObjectgetCurrentOperation()protected List<PomRequestListener>getPomRequestListeners()ProgCommandAwareBeanModelgetProgCommandAwareBeanModel()protected com.jgoodies.validation.ValidationResultModelgetValidationResultModel()booleanisActive()protected voidpostConstruct()Post construct operations.protected voidsendRequest(org.bidib.jbidibc.messages.PomAddressData decoderAddress, org.bidib.jbidibc.messages.enums.PomOperation operation, int cvNumber, int cvValue)voidsetActive(boolean active)Sets the listener active or inactive.voidsetProgCommandAwareBeanModel(M progCommandAwareBeanModel)voidsignalPomProgStateChanged(org.bidib.jbidibc.messages.enums.PomProgState pomProgState)Signals that the POM prog state has changed.protected voidstartTimeoutControl(int timeout)protected voidstopTimeoutControl()protected abstract voidtriggerValidation()
-
-
-
Field Detail
-
LOGGER
protected final org.slf4j.Logger LOGGER
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_SUSI_READ_FIRST_TIMEOUT
public static final int DEFAULT_SUSI_READ_FIRST_TIMEOUT
- See Also:
- Constant Field Values
-
cvProgrammerModel
protected final PomProgrammerModel cvProgrammerModel
-
pomResultProxyModel
protected final PomResultProxyModel pomResultProxyModel
-
readButton
protected final JButton readButton
-
writeButton
protected final JButton writeButton
-
readButtonEnabled
protected com.jgoodies.binding.value.ValueModel readButtonEnabled
-
writeButtonEnabled
protected com.jgoodies.binding.value.ValueModel writeButtonEnabled
-
currentOperationModel
protected com.jgoodies.binding.value.ValueModel currentOperationModel
-
currentOperationLabel
protected JLabel currentOperationLabel
-
progOperationUnknownIcon
protected ImageIcon progOperationUnknownIcon
-
activeTab
protected boolean activeTab
-
currentAddressBeanModel
protected CurrentAddressBeanModel currentAddressBeanModel
-
-
Constructor Detail
-
AbstractPomPanel
public AbstractPomPanel(PomProgrammerModel cvProgrammerModel, CurrentAddressBeanModel currentAddressBeanModel)
Creates a new instance of the AbstractPomPanel.- Parameters:
cvProgrammerModel- the POM programmer modelcurrentAddressBeanModel- the address bean model
-
-
Method Detail
-
postConstruct
protected void postConstruct()
Post construct operations. This method is called after the panel is build.
-
getProgCommandAwareBeanModel
public ProgCommandAwareBeanModel getProgCommandAwareBeanModel()
- Returns:
- the progCommandAwareBeanModel
-
setProgCommandAwareBeanModel
public void setProgCommandAwareBeanModel(M progCommandAwareBeanModel)
- Parameters:
progCommandAwareBeanModel- the progCommandAwareBeanModel
-
addPomRequestListener
public void addPomRequestListener(PomRequestListener l)
-
getPomRequestListeners
protected List<PomRequestListener> getPomRequestListeners()
-
setActive
public void setActive(boolean active)
Description copied from interface:PomResultListenerSets the listener active or inactive.- Specified by:
setActivein interfacePomResultListener- Parameters:
active- the active flag
-
isActive
public boolean isActive()
- Specified by:
isActivein interfacePomResultListener- Returns:
- listener is active
-
createWorkerPanel
protected abstract void createWorkerPanel(com.jgoodies.forms.builder.FormBuilder builder, int[] rowHolder, PomValidationResultModel parentValidationModel)
-
createPanel
public JPanel createPanel(PomValidationResultModel parentValidationModel)
-
doBindButtons
protected void doBindButtons()
-
triggerValidation
protected abstract void triggerValidation()
-
getValidationResultModel
protected com.jgoodies.validation.ValidationResultModel getValidationResultModel()
-
addLogText
public void addLogText(String logLine, Object... args)
Description copied from interface:PomResultListenerAdd a new line to the logger area.- Specified by:
addLogTextin interfacePomResultListener- Parameters:
logLine- the message to log. Use {} as placeholders for args.args- the args
-
clearLogArea
public void clearLogArea()
-
getCurrentOperation
protected abstract Object getCurrentOperation()
-
signalPomProgStateChanged
public void signalPomProgStateChanged(org.bidib.jbidibc.messages.enums.PomProgState pomProgState)
Description copied from interface:PomResultListenerSignals that the POM prog state has changed.- Specified by:
signalPomProgStateChangedin interfacePomResultListener- Parameters:
pomProgState- the new POM prog state
-
sendRequest
protected void sendRequest(org.bidib.jbidibc.messages.PomAddressData decoderAddress, org.bidib.jbidibc.messages.enums.PomOperation operation, int cvNumber, int cvValue)
-
disableInputElements
protected void disableInputElements()
-
enableInputElements
protected void enableInputElements()
-
fireNextCommand
protected void fireNextCommand()
-
startTimeoutControl
protected void startTimeoutControl(int timeout)
-
stopTimeoutControl
protected void stopTimeoutControl()
-
-