Class ValidationNotifications


  • public class ValidationNotifications
    extends java.lang.Object
    Utilities for displaying Validation Messages.
    This file is part of JMRI.

    JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

    JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int parseBinDecHexByte​(java.lang.String s, int limit, boolean decimal, java.lang.String errMsg, javax.swing.JPanel comp)
      Parse a string for binary, decimal or hex byte value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • parseBinDecHexByte

        public static final int parseBinDecHexByte​(java.lang.String s,
                                                   int limit,
                                                   boolean decimal,
                                                   java.lang.String errMsg,
                                                   javax.swing.JPanel comp)
        Parse a string for binary, decimal or hex byte value. Displays error message Dialog if unable to parse.

        0b, 0d or 0x prefix will force parsing of binary, decimal or hex, respectively. Entries with no prefix are parsed as decimal if decimal flag is true, otherwise hex.

        Parameters:
        s - string to be parsed
        limit - upper bound of value to be parsed
        decimal - flag for decimal or hex default
        comp - Parent component
        errMsg - Message to be displayed if Number FormatException encountered
        Returns:
        the byte value, -1 indicates failure