Re-adds blink functions.
@@ -5,6 +5,7 @@ import com.valkryst.VTerminal.AsciiString;
import com.valkryst.VTerminal.Panel;
import com.valkryst.VTerminal.builder.component.ButtonBuilder;
import com.valkryst.VTerminal.font.Font;
+import com.valkryst.VTerminal.misc.IntRange;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
@@ -232,6 +233,34 @@ public class Button extends Component {
}
}
+ /**
+ * Enables the blink effect on the button's text, but not on the starting and
+ * ending characters.
+ *
+ * @param millsBetweenBlinks
+ * The amount of time, in milliseconds, before the blink effect can
+ * occur.
+ */
+ public void enableBlinkEffect(final short millsBetweenBlinks) {
+ final int beginIndex = 1;
+ final int endIndex = super.getString(0).getCharacters().length - 1;
+ final IntRange range = new IntRange(beginIndex, endIndex);
+
+ super.getString(0).enableBlinkEffect(millsBetweenBlinks, getRadio(), range);
+ }
+
+ /**
+ * Disables the blink effect on the button's text, but not on the starting
+ * and ending characters.
+ */
+ public void disableBlinkEffect() {
+ final int beginIndex = 1;
+ final int endIndex = super.getString(0).getCharacters().length - 1;
+ final IntRange range = new IntRange(beginIndex, endIndex);
+
+ super.getString(0).disableBlinkEffect(range);
+ }
+
/**
* Sets the normal background color.
*
