Package jmri.jmrix.loconet
Class LnThrottleStringIO
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.implementation.AbstractStringIO
-
- jmri.jmrix.loconet.LnThrottleStringIO
-
- All Implemented Interfaces:
java.lang.Comparable<NamedBean>
,PropertyChangeProvider
,NamedBean
,StringIO
public class LnThrottleStringIO extends AbstractStringIO
Send a message to the LocoNet throttles.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
-
Field Summary
-
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, register
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description LnThrottleStringIO(LocoNetSystemConnectionMemo scm)
Create a LnThrottleStringIO object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
cutLongStrings()
Cut long strings instead of throwing an exception?int
getMaximumLength()
Get the maximum length of string that this StringIO can handle.protected void
sendStringToLayout(java.lang.String value)
Sends the string to the layout.-
Methods inherited from class jmri.implementation.AbstractStringIO
compareSystemNameSuffix, getBeanType, getCommandedStringValue, getKnownStringValue, getState, setCommandedStringValue, setState, setString
-
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, describeState, dispose, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRef, vetoableChange
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareTo, describeState, dispose, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef, vetoableChange
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface jmri.StringIO
requestUpdateFromLayout
-
-
-
-
Constructor Detail
-
LnThrottleStringIO
public LnThrottleStringIO(LocoNetSystemConnectionMemo scm)
Create a LnThrottleStringIO object- Parameters:
scm
- connection memo
-
-
Method Detail
-
sendStringToLayout
protected void sendStringToLayout(java.lang.String value) throws JmriException
Sends the string to the layout. The string [u]must not[/u] be longer than the value of getMaximumLength() unless that value is zero. Some microcomputers have little memory and it's very important that this method is never called with too long strings.- Specified by:
sendStringToLayout
in classAbstractStringIO
- Parameters:
value
- the desired string value- Throws:
JmriException
- general error when setting the value fails
-
getMaximumLength
public int getMaximumLength()
Get the maximum length of string that this StringIO can handle.- Returns:
- the maximum length or 0 if arbitrary lengths are accepted.
-
cutLongStrings
protected boolean cutLongStrings()
Cut long strings instead of throwing an exception? For example, if the StringIO is a display, it could be desired to accept too long strings. On the other hand, if the StringIO is used to send a command, a too long string is an error.- Specified by:
cutLongStrings
in classAbstractStringIO
- Returns:
- true if long strings should be cut
-
-