| | 71 | * the underline color of the style |
|---|
| | 72 | * |
|---|
| | 73 | * @since 3.4 |
|---|
| | 74 | */ |
|---|
| | 75 | public Color underlineColor; |
|---|
| | 76 | |
|---|
| | 77 | /** |
|---|
| | 78 | * the underline style. This style is ignored when |
|---|
| | 79 | * <code>underline</code> is false. |
|---|
| | 80 | * <p> |
|---|
| | 81 | * This value should be one of <code>DWT.UNDERLINE_SINGLE</code>, |
|---|
| | 82 | * <code>DWT.UNDERLINE_DOUBLE</code>, <code>DWT.UNDERLINE_ERROR</code>, |
|---|
| | 83 | * or <code>DWT.UNDERLINE_SQUIGGLE</code>. |
|---|
| | 84 | * </p> |
|---|
| | 85 | * |
|---|
| | 86 | * @see DWT#UNDERLINE_SINGLE |
|---|
| | 87 | * @see DWT#UNDERLINE_DOUBLE |
|---|
| | 88 | * @see DWT#UNDERLINE_ERROR |
|---|
| | 89 | * @see DWT#UNDERLINE_SQUIGGLE |
|---|
| | 90 | * |
|---|
| | 91 | * @since 3.4 |
|---|
| | 92 | */ |
|---|
| | 93 | public int underlineStyle; |
|---|
| | 94 | |
|---|
| | 95 | /** |
|---|
| | 170 | } |
|---|
| | 171 | |
|---|
| | 172 | |
|---|
| | 173 | /** |
|---|
| | 174 | * Create a new text style from an existing text style. |
|---|
| | 175 | * |
|---|
| | 176 | *@param style the style to copy |
|---|
| | 177 | * |
|---|
| | 178 | * @since 3.4 |
|---|
| | 179 | */ |
|---|
| | 180 | public this (TextStyle style) { |
|---|
| | 181 | if (style is null) DWT.error (DWT.ERROR_INVALID_ARGUMENT); |
|---|
| | 182 | font = style.font; |
|---|
| | 183 | foreground = style.foreground; |
|---|
| | 184 | background = style.background; |
|---|
| | 185 | underline = style.underline; |
|---|
| | 186 | underlineColor = style.underlineColor; |
|---|
| | 187 | underlineStyle = style.underlineStyle; |
|---|
| | 188 | strikeout = style.strikeout; |
|---|
| | 189 | strikeoutColor = style.strikeoutColor; |
|---|
| | 190 | borderStyle = style.borderStyle; |
|---|
| | 191 | borderColor = style.borderColor; |
|---|
| | 192 | metrics = style.metrics; |
|---|
| | 193 | rise = style.rise; |
|---|
| | 226 | if (underlineColor !is null) { |
|---|
| | 227 | if (!underlineColor.equals(style.underlineColor)) return false; |
|---|
| | 228 | } else if (style.underlineColor !is null) return false; |
|---|
| | 229 | if (strikeoutColor !is null) { |
|---|
| | 230 | if (!strikeoutColor.equals(style.strikeoutColor)) return false; |
|---|
| | 231 | } else if (style.strikeoutColor !is null) return false; |
|---|
| | 232 | if (underlineStyle !is style.underlineStyle) return false; |
|---|
| | 233 | if (borderColor !is null) { |
|---|
| | 234 | if (!borderColor.equals(style.borderColor)) return false; |
|---|
| | 235 | } else if (style.borderColor !is null) return false; |
|---|
| | 263 | } |
|---|
| | 264 | |
|---|
| | 265 | bool isAdherentBorder(TextStyle style) { |
|---|
| | 266 | if (this is style) return true; |
|---|
| | 267 | if (style is null) return false; |
|---|
| | 268 | if (borderStyle !is style.borderStyle) return false; |
|---|
| | 269 | if (borderColor !is null) { |
|---|
| | 270 | if (!borderColor.equals(style.borderColor)) return false; |
|---|
| | 271 | } else if (style.borderColor !is null) return false; |
|---|
| | 272 | return true; |
|---|
| | 273 | } |
|---|
| | 274 | |
|---|
| | 275 | bool isAdherentUnderline(TextStyle style) { |
|---|
| | 276 | if (this is style) return true; |
|---|
| | 277 | if (style is null) return false; |
|---|
| | 278 | if (underline !is style.underline) return false; |
|---|
| | 279 | if (underlineStyle !is style.underlineStyle) return false; |
|---|
| | 280 | if (underlineColor !is null) { |
|---|
| | 281 | if (!underlineColor.equals(style.underlineColor)) return false; |
|---|
| | 282 | } else if (style.underlineColor !is null) return false; |
|---|
| | 283 | return true; |
|---|
| | 284 | } |
|---|
| | 285 | |
|---|
| | 286 | bool isAdherentStrikeout(TextStyle style) { |
|---|
| | 287 | if (this is style) return true; |
|---|
| | 288 | if (style is null) return false; |
|---|
| | 289 | if (strikeout !is style.strikeout) return false; |
|---|
| | 290 | if (strikeoutColor !is null) { |
|---|
| | 291 | if (!strikeoutColor.equals(style.strikeoutColor)) return false; |
|---|
| | 292 | } else if (style.strikeoutColor !is null) return false; |
|---|
| | 293 | return true; |
|---|