Class TranscriptStyleContext
java.lang.Object
javax.swing.text.StyleContext
ca.phon.app.session.editor.view.transcript.TranscriptStyleContext
- All Implemented Interfaces:
Serializable
,AbstractDocument.AttributeContext
A collection of named styles for TranscriptDocument
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.text.StyleContext
StyleContext.NamedStyle, StyleContext.SmallAttributeSet
-
Field Summary
FieldsFields inherited from class javax.swing.text.StyleContext
DEFAULT_STYLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBlindTranscriptionAttributes
(Tier<?> tier, String transcriber) Gets the attributes for the blind transcription of a given transcriber in a given tiergetBorderedParagraphAttributes
(Border border) Return paragraph attributes with given bordergetCommentAttributes
(Comment comment) Gets the attributes for a given commentgetCommentLabelAttributes
(Comment comment) Gets the attributes for the label of a given comment line.getGemAttributes
(Gem gem) Gets the attributes for a given gemgetGemLabelAttributes
(Gem gem) Gets the attributes for the label of a given gem line.Gets the attributes for an IPA pauseGets the attributes for an IPA wordGets the attributes for the label of a line that isn't a tier, record header / separator, comment or gemGets the attributes corresponding to the monospace fontGets the attributes for the participants headergetRecordAttributes
(Record record) Gets the attributes for a given recordGets the starting paragraph attributes for a recordgetSegmentDashAttributes
(MediaSegment segment) Gets the attributes for the dash in a given segmentgetSegmentTimeAttributes
(MediaSegment segment) Gets the attributes for the times in a given segmentgetTierAttributes
(Tier<?> tier) Gets the attributes for a given tiergetTierAttributes
(Tier<?> tier, TierViewItem item) Gets the attributes for a given tierGets the attributes for aTierComment
in someTierData
Gets the attributes forTierInternalMedia
in someTierData
getTierLabelAttributes
(Tier<?> tier) Gets the attributes for the label of a given tier line.Gets the attributes for the tiers headerGets the attributes for aTierString
in someTierData
getTrailingAttributes
(List<DefaultStyledDocument.ElementSpec> elementSpecs) Gets the attributes of the lastDefaultStyledDocument.ElementSpec
in a provided listgetTranscriptionSelectorAttributes
(Record record, Tier<?> tier, String transcriptionText, Session session, EditorEventManager eventManager, SessionEditUndoSupport undoSupport) Gets an attribute set containing a reference to the transcript selector component factory.static MutableAttributeSet
stripStyle
(AttributeSet attrs) Methods inherited from class javax.swing.text.StyleContext
addAttribute, addAttributes, addChangeListener, addStyle, createLargeAttributeSet, createSmallAttributeSet, getBackground, getChangeListeners, getCompressionThreshold, getDefaultStyleContext, getEmptySet, getFont, getFont, getFontMetrics, getForeground, getStaticAttribute, getStaticAttributeKey, getStyle, getStyleNames, readAttributes, readAttributeSet, reclaim, registerStaticAttributeKey, removeAttribute, removeAttributes, removeAttributes, removeChangeListener, removeStyle, toString, writeAttributes, writeAttributeSet
-
Field Details
-
DEFAULT
- See Also:
-
GHOST_TEXT
- See Also:
-
-
Constructor Details
-
TranscriptStyleContext
public TranscriptStyleContext()
-
-
Method Details
-
stripStyle
-
getRecordStartAttributes
Gets the starting paragraph attributes for a record -
getBorderedParagraphAttributes
Return paragraph attributes with given border- Parameters:
border
-- Returns:
-
getRecordAttributes
Gets the attributes for a given record- Parameters:
record
- the record to get the attributes of- Returns:
- a mutable attribute set containing all the necessary attributes for the given record
-
getTierAttributes
Gets the attributes for a given tier- Parameters:
tier
- a reference to the tier to get the attributes of- Returns:
- a mutable attribute set containing all the necessary attributes for the given tier
-
getTierAttributes
Gets the attributes for a given tier- Parameters:
tier
- a reference to the tier to get the attributes ofitem
- aTierViewItem
whose font data will be used if provided- Returns:
- a mutable attribute set containing all the necessary attributes for the given tier
-
getTranscriptionSelectorAttributes
public SimpleAttributeSet getTranscriptionSelectorAttributes(Record record, Tier<?> tier, String transcriptionText, Session session, EditorEventManager eventManager, SessionEditUndoSupport undoSupport) Gets an attribute set containing a reference to the transcript selector component factory. Adding the contents of this attribute set to the attributes some text will replace the text with a button for selecting the specified blind transcription- Parameters:
record
- the record containing the blind tier that the transcription will be selected fromtier
- the tier that the blind transcription will be selected fromtranscriptionText
- the text of the transcription that will be selected if the button is clicked- Returns:
- an attribute set containing a reference to the transcript selector component factory
-
getIPAWordAttributes
Gets the attributes for an IPA word- Parameters:
tier
- the tier that will be referenced in the attributes with theTranscriptStyleConstants.ATTR_KEY_TIER
key- Returns:
- a mutable attribute set containing the attributes for an IPA word
-
getIPAPauseAttributes
Gets the attributes for an IPA pause- Parameters:
tier
- the tier that will be referenced in the attributes with theTranscriptStyleConstants.ATTR_KEY_TIER
key- Returns:
- a mutable attribute set containing the attributes for an IPA pause
-
getTierLabelAttributes
Gets the attributes for the label of a given tier line.- Parameters:
tier
- the tier whose label these attributes will be for- Returns:
- a mutable attribute set containing all the necessary attributes for the label of the tier
-
getBlindTranscriptionAttributes
Gets the attributes for the blind transcription of a given transcriber in a given tier- Parameters:
tier
- the tier that contains the transcriptionstranscriber
- the name/ID of the transcriber who transcribed the transcription that these attributes will be added to- Returns:
- a mutable attribute set containing the necessary attributes for the specified blind transcription
-
getTiersHeaderAttributes
Gets the attributes for the tiers header- Returns:
- the attributes for the tiers header
-
getParticipantsHeaderAttributes
Gets the attributes for the participants header- Returns:
- the attributes for the participants header
-
getSegmentTimeAttributes
Gets the attributes for the times in a given segment- Parameters:
segment
- the segment that will be referenced in the attributes with theTranscriptStyleConstants.ATTR_KEY_MEDIA_SEGMENT
key- Returns:
- a mutable attribute set containing the attributes for the times in a given segment
-
getSegmentDashAttributes
Gets the attributes for the dash in a given segment- Parameters:
segment
- the segment that will be referenced in the attributes with theTranscriptStyleConstants.ATTR_KEY_MEDIA_SEGMENT
key- Returns:
- a mutable attribute set containing the attributes for the dash in a given segment
-
getTierStringAttributes
Gets the attributes for aTierString
in someTierData
- Returns:
- the attributes for a
TierString
in someTierData
-
getTierCommentAttributes
Gets the attributes for aTierComment
in someTierData
- Returns:
- the attributes for a
TierComment
in someTierData
-
getTierInternalMediaAttributes
Gets the attributes forTierInternalMedia
in someTierData
- Returns:
- the attributes for
TierInternalMedia
in someTierData
-
getTierLinkAttributes
-
getMonospaceFontAttributes
Gets the attributes corresponding to the monospace font- Returns:
- a mutable attribute set containing the attributes corresponding to the monospace font
-
getGemAttributes
Gets the attributes for a given gem- Parameters:
gem
- the gem that the attributes will be for- Returns:
- the attributes for the given gem
-
getCommentAttributes
Gets the attributes for a given comment- Parameters:
comment
- the comment that the attributes will be for- Returns:
- the attributes for the given comment
-
getCommentLabelAttributes
Gets the attributes for the label of a given comment line.- Parameters:
comment
- the comment whose label these attributes will be for- Returns:
- a mutable attribute set containing all the necessary attributes for the label of the comment
-
getGemLabelAttributes
Gets the attributes for the label of a given gem line.- Parameters:
gem
- the gem whose label these attributes will be for- Returns:
- a mutable attribute set containing all the necessary attributes for the label of the gem
-
getLabelAttributes
Gets the attributes for the label of a line that isn't a tier, record header / separator, comment or gem- Returns:
- a mutable attribute set containing the necessary attributes for a label
-
getTrailingAttributes
Gets the attributes of the lastDefaultStyledDocument.ElementSpec
in a provided list- Parameters:
elementSpecs
- the list of elementspecs- Returns:
- the attributes of the last elementspec
-