Class OlcbStringIO

    • Method Detail

      • finishLoad

        void finishLoad()
        Helper function that will be invoked after construction once the properties have been loaded. Used specifically for preventing double initialization when loading StringIO from XML.
      • getEventName

        public java.lang.String getEventName​(boolean isActive)
        Computes the display name of a given event to be entered into the Event Table.
        Parameters:
        isActive - left over from interface for Turnout and Sensor, this is ignored
        Returns:
        user-visible string to represent this event.
      • getRecommendedToolTip

        @CheckReturnValue
        @Nonnull
        public java.lang.String getRecommendedToolTip()
        Description copied from interface: NamedBean
        Get a recommended text for a tooltip when displaying the NamedBean, e.g. in a list or table. By default, this is the comment from the NamedBean, on the theory that the system name and/or user name are being displayed directly. Specific system implementations may override that.
      • requestUpdateFromLayout

        public void requestUpdateFromLayout()
        Request an update on status by sending an OpenLCB message.
      • 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.

        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
      • 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 class AbstractStringIO
        Returns:
        true if long strings should be cut