Class AbstractPtPanel<M extends ProgCommandAwareBeanModel>
- java.lang.Object
-
- org.bidib.wizard.mvc.pt.view.panel.AbstractPtPanel<M>
-
- All Implemented Interfaces:
PtResultListener
- Direct Known Subclasses:
AddressPanel,DirectAccessPanel,RailcomPanel
public abstract class AbstractPtPanel<M extends ProgCommandAwareBeanModel> extends Object implements PtResultListener
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanactiveTabprotected JLabelcurrentOperationLabelprotected com.jgoodies.binding.value.ValueModelcurrentOperationModelprotected PtProgrammerModelcvProgrammerModelprotected org.slf4j.LoggerLOGGERprotected ImageIconprogOperationEmptyIconprotected ImageIconprogOperationUnknownIconprotected PtResultProxyModelptResultProxyModelprotected JButtonreadButtonprotected com.jgoodies.binding.value.ValueModelreadButtonEnabledprotected JButtonwriteButtonprotected com.jgoodies.binding.value.ValueModelwriteButtonEnabled
-
Constructor Summary
Constructors Constructor Description AbstractPtPanel(PtProgrammerModel cvProgrammerModel)
-
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.voidaddPtRequestListener(PtRequestListener l)JPanelcreatePanel()protected abstract voidcreateWorkerPanel(com.jgoodies.forms.builder.FormBuilder builder, int[] rowHolder)protected voiddisableInputElements()protected voiddoBindButtons()protected voidenableInputElements()protected voidfireNextCommand()protected abstract ObjectgetCurrentOperation()ProgCommandAwareBeanModelgetProgCommandAwareBeanModel()protected List<PtRequestListener>getPtRequestListeners()protected com.jgoodies.validation.ValidationResultModelgetValidationResultModel()booleanisActive()protected voidsendRequest(org.bidib.jbidibc.messages.enums.PtOperation operation, int cvNumber, int cvValue)voidsetActive(boolean active)Sets the listener active or inactive.voidsetProgCommandAwareBeanModel(M progCommandAwareBeanModel)voidsignalCommandStationProgStateChanged(org.bidib.jbidibc.messages.enums.CommandStationProgState commandStationProgState)Signals that the command station prog state has changed.protected voidtriggerValidation()
-
-
-
Field Detail
-
LOGGER
protected final org.slf4j.Logger LOGGER
-
cvProgrammerModel
protected final PtProgrammerModel cvProgrammerModel
-
ptResultProxyModel
protected final PtResultProxyModel ptResultProxyModel
-
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
-
progOperationEmptyIcon
protected ImageIcon progOperationEmptyIcon
-
activeTab
protected boolean activeTab
-
-
Constructor Detail
-
AbstractPtPanel
public AbstractPtPanel(PtProgrammerModel cvProgrammerModel)
-
-
Method Detail
-
getProgCommandAwareBeanModel
public ProgCommandAwareBeanModel getProgCommandAwareBeanModel()
- Returns:
- the progCommandAwareBeanModel
-
setProgCommandAwareBeanModel
public void setProgCommandAwareBeanModel(M progCommandAwareBeanModel)
- Parameters:
progCommandAwareBeanModel- the progCommandAwareBeanModel
-
addPtRequestListener
public void addPtRequestListener(PtRequestListener l)
-
getPtRequestListeners
protected List<PtRequestListener> getPtRequestListeners()
-
setActive
public void setActive(boolean active)
Description copied from interface:PtResultListenerSets the listener active or inactive.- Specified by:
setActivein interfacePtResultListener- Parameters:
active- the active flag
-
isActive
public boolean isActive()
- Specified by:
isActivein interfacePtResultListener- Returns:
- listener is active
-
createWorkerPanel
protected abstract void createWorkerPanel(com.jgoodies.forms.builder.FormBuilder builder, int[] rowHolder)
-
createPanel
public JPanel createPanel()
-
doBindButtons
protected void doBindButtons()
-
triggerValidation
protected void triggerValidation()
-
getValidationResultModel
protected com.jgoodies.validation.ValidationResultModel getValidationResultModel()
-
addLogText
public void addLogText(String logLine, Object... args)
Description copied from interface:PtResultListenerAdd a new line to the logger area.- Specified by:
addLogTextin interfacePtResultListener- Parameters:
logLine- the message to log. Use {} as placeholders for args.args- the args
-
getCurrentOperation
protected abstract Object getCurrentOperation()
-
signalCommandStationProgStateChanged
public void signalCommandStationProgStateChanged(org.bidib.jbidibc.messages.enums.CommandStationProgState commandStationProgState)
Description copied from interface:PtResultListenerSignals that the command station prog state has changed.- Specified by:
signalCommandStationProgStateChangedin interfacePtResultListener- Parameters:
commandStationProgState- the new command station prog state
-
sendRequest
protected void sendRequest(org.bidib.jbidibc.messages.enums.PtOperation operation, int cvNumber, int cvValue)
-
disableInputElements
protected void disableInputElements()
-
enableInputElements
protected void enableInputElements()
-
fireNextCommand
protected void fireNextCommand()
-
-