Class TranscriptStyleContext

java.lang.Object
javax.swing.text.StyleContext
ca.phon.app.session.editor.view.transcript.TranscriptStyleContext
All Implemented Interfaces:
Serializable, AbstractDocument.AttributeContext

public class TranscriptStyleContext extends StyleContext
A collection of named styles for TranscriptDocument
See Also:
  • Field Details

  • Constructor Details

    • TranscriptStyleContext

      public TranscriptStyleContext()
  • Method Details

    • stripStyle

      public static MutableAttributeSet stripStyle(AttributeSet attrs)
    • getRecordStartAttributes

      public SimpleAttributeSet getRecordStartAttributes()
      Gets the starting paragraph attributes for a record
    • getBorderedParagraphAttributes

      public SimpleAttributeSet getBorderedParagraphAttributes(Border border)
      Return paragraph attributes with given border
      Parameters:
      border -
      Returns:
    • getRecordAttributes

      public SimpleAttributeSet getRecordAttributes(Record record)
      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

      public SimpleAttributeSet getTierAttributes(Tier<?> tier)
      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

      public SimpleAttributeSet getTierAttributes(Tier<?> tier, TierViewItem item)
      Gets the attributes for a given tier
      Parameters:
      tier - a reference to the tier to get the attributes of
      item - a TierViewItem 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 from
      tier - the tier that the blind transcription will be selected from
      transcriptionText - 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

      public SimpleAttributeSet getIPAWordAttributes(Tier<IPATranscript> tier)
      Gets the attributes for an IPA word
      Parameters:
      tier - the tier that will be referenced in the attributes with the TranscriptStyleConstants.ATTR_KEY_TIER key
      Returns:
      a mutable attribute set containing the attributes for an IPA word
    • getIPAPauseAttributes

      public SimpleAttributeSet getIPAPauseAttributes(Tier<IPATranscript> tier)
      Gets the attributes for an IPA pause
      Parameters:
      tier - the tier that will be referenced in the attributes with the TranscriptStyleConstants.ATTR_KEY_TIER key
      Returns:
      a mutable attribute set containing the attributes for an IPA pause
    • getTierLabelAttributes

      public SimpleAttributeSet getTierLabelAttributes(Tier<?> tier)
      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

      public SimpleAttributeSet getBlindTranscriptionAttributes(Tier<?> tier, String transcriber)
      Gets the attributes for the blind transcription of a given transcriber in a given tier
      Parameters:
      tier - the tier that contains the transcriptions
      transcriber - 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

      public SimpleAttributeSet getTiersHeaderAttributes()
      Gets the attributes for the tiers header
      Returns:
      the attributes for the tiers header
    • getParticipantsHeaderAttributes

      public SimpleAttributeSet getParticipantsHeaderAttributes()
      Gets the attributes for the participants header
      Returns:
      the attributes for the participants header
    • getSegmentTimeAttributes

      public SimpleAttributeSet getSegmentTimeAttributes(MediaSegment segment)
      Gets the attributes for the times in a given segment
      Parameters:
      segment - the segment that will be referenced in the attributes with the TranscriptStyleConstants.ATTR_KEY_MEDIA_SEGMENT key
      Returns:
      a mutable attribute set containing the attributes for the times in a given segment
    • getSegmentDashAttributes

      public SimpleAttributeSet getSegmentDashAttributes(MediaSegment segment)
      Gets the attributes for the dash in a given segment
      Parameters:
      segment - the segment that will be referenced in the attributes with the TranscriptStyleConstants.ATTR_KEY_MEDIA_SEGMENT key
      Returns:
      a mutable attribute set containing the attributes for the dash in a given segment
    • getTierStringAttributes

      public SimpleAttributeSet getTierStringAttributes()
      Gets the attributes for a TierString in some TierData
      Returns:
      the attributes for a TierString in some TierData
    • getTierCommentAttributes

      public SimpleAttributeSet getTierCommentAttributes()
      Gets the attributes for a TierComment in some TierData
      Returns:
      the attributes for a TierComment in some TierData
    • getTierInternalMediaAttributes

      public SimpleAttributeSet getTierInternalMediaAttributes()
      Gets the attributes for TierInternalMedia in some TierData
      Returns:
      the attributes for TierInternalMedia in some TierData
    • getTierLinkAttributes

      public SimpleAttributeSet getTierLinkAttributes()
      Gets the attributes for a TierLink in some TierData
      Returns:
      the attributes for a TierLink in some TierData
    • getMonospaceFontAttributes

      public SimpleAttributeSet getMonospaceFontAttributes()
      Gets the attributes corresponding to the monospace font
      Returns:
      a mutable attribute set containing the attributes corresponding to the monospace font
    • getGemAttributes

      public SimpleAttributeSet getGemAttributes(Gem gem)
      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

      public SimpleAttributeSet getCommentAttributes(Comment comment)
      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

      public SimpleAttributeSet getCommentLabelAttributes(Comment comment)
      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

      public SimpleAttributeSet getGemLabelAttributes(Gem gem)
      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

      public SimpleAttributeSet 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

      public AttributeSet getTrailingAttributes(List<DefaultStyledDocument.ElementSpec> elementSpecs)
      Gets the attributes of the last DefaultStyledDocument.ElementSpec in a provided list
      Parameters:
      elementSpecs - the list of elementspecs
      Returns:
      the attributes of the last elementspec