Class UniformStyleCollection
- java.lang.Object
-
- net.sourceforge.pmd.util.fxdesigner.util.codearea.UniformStyleCollection
-
public class UniformStyleCollection extends java.lang.Object
Collection of nodes that share the same style. In case of overlap, the nested ones gain css classes like depth-0, depth-1, etc. A collection can be overlaid into a single span in one pass usingtoSpans()
.- Since:
- 6.5.0
- Author:
- Clément Fournier
-
-
Constructor Summary
Constructors Constructor Description UniformStyleCollection(java.util.Set<java.lang.String> style, java.util.Collection<net.sourceforge.pmd.util.fxdesigner.util.codearea.NodeStyleSpan> ns)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.fxmisc.richtext.model.StyleSpans<java.util.Collection<java.lang.String>>
buildSpans()
static UniformStyleCollection
empty()
Returns an empty style collection.java.util.Set<java.lang.String>
getStyle()
boolean
isEmpty()
UniformStyleCollection
merge(UniformStyleCollection collection)
org.fxmisc.richtext.model.StyleSpans<java.util.Collection<java.lang.String>>
toSpans()
Overlays all the nodes in this collection into a single StyleSpans.
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
-
getStyle
public java.util.Set<java.lang.String> getStyle()
-
merge
public UniformStyleCollection merge(UniformStyleCollection collection)
-
toSpans
public org.fxmisc.richtext.model.StyleSpans<java.util.Collection<java.lang.String>> toSpans()
Overlays all the nodes in this collection into a single StyleSpans. This algorithm makes the strong assumption that the nodes can be ordered as a tree, that is, given two nodes n and m, then one of the following holds true: - m and n are disjoint - m is entirely contained within n, or the reverse is true E.g. [ m ] but not [ m ] [ n ] [ n' ] [ n ]
-
buildSpans
public org.fxmisc.richtext.model.StyleSpans<java.util.Collection<java.lang.String>> buildSpans()
-
empty
public static UniformStyleCollection empty()
Returns an empty style collection.
-
-