Class DefaultStringIO

    • Method Detail

      • sendStringToLayout

        protected void sendStringToLayout​(@Nonnull
                                          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.

        For systems that don't provide another form of feedback, this call is responsible for setting the known state to the new commanded state, and firing all listeners.

        Specified by:
        sendStringToLayout in class AbstractStringIO
        Parameters:
        value - the desired string value
        Throws:
        JmriException - general error when setting the value fails
      • 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 class AbstractStringIO
        Returns:
        true if long strings should be cut