GrammarScope  4.0.0
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
grammarscope.browser.View Class Reference
Inheritance diagram for grammarscope.browser.View:
Inheritance graph
[legend]
Collaboration diagram for grammarscope.browser.View:
Collaboration graph
[legend]

Classes

enum  RenderMode
 
enum  TooltipMode
 

Public Member Functions

 View ()
 
Document getDoc ()
 
void setDoc (final Document document)
 
void setText ()
 
void setFilter (final RelationOrderedFilter relationFilter)
 
void setFilter2 (final RelationFilter relationFilter)
 
void setPalette (final RelationPalette relationPalette)
 
void applySettings (final Settings settings)
 
void changeFont (final Font font, final Color color)
 
void changeTypedDependencyProvider (final TypedDependencyProvider provider)
 
void changeTypedDependencyMode (final TypedDependencyMode mode)
 
void setFont (final Font font0, final Color color)
 
long getRenderMode ()
 
void setRenderMode (final Long mode)
 
TooltipMode getSentenceTooltipMode ()
 
void setSentenceTooltipMode (final TooltipMode mode)
 
boolean getAnnotationTooltipMode ()
 
void setAnnotationTooltipMode (final Boolean flag)
 
boolean getHighlightFlag ()
 
void setHighlightFlag (final Boolean flag)
 
boolean getHighlightHeadFlag ()
 
void setHighlightHeadFlag (final Boolean flag)
 
boolean getHighlightMarkHeadFlag ()
 
void setHighlightMarkHeadFlag (final Boolean flag)
 
boolean getHatchFlag ()
 
void setHatchFlag (final Boolean flag)
 
boolean getGradientFlag ()
 
boolean getEdgesAsCurvesFlag ()
 
void setEdgesAsCurvesFlag (final Boolean flag)
 
float getLineSpacing ()
 
void setLineSpacing (final Float spacing)
 
void setAnnotationPadFlag (final boolean flag)
 
boolean getAnnotationPadFlag ()
 
void setTypedDependencyProvider (final TypedDependencyProvider provider)
 
TypedDependencyProvider getTypedDependencyProvider ()
 
void setTypedDependencyMode (final TypedDependencyMode mode)
 
TypedDependencyMode getTypedDependencyMode ()
 
void highlight ()
 
void highlight (final int sentenceIdx)
 
void setFocusStyle (final int from, final int to)
 
void clearFocusStyle ()
 
void clearHighlight ()
 
void forceLayout ()
 
void paintPadBackground (final Graphics g) throws BadLocationException
 
String getStringAt (final Point point)
 
int getSentenceAt (final Point point)
 
String getToolTipText (final MouseEvent event)
 
void notified (final Event event)
 
void notifyParsed ()
 
void notifyAnalyzed ()
 
- Public Member Functions inherited from grammarscope.browser.components.TextPane
 TextPane ()
 

Static Public Member Functions

static Rectangle modelToView (final JTextComponent textComponent, final Segment segment) throws BadLocationException
 
static int getTop (final JTextComponent textComponent) throws BadLocationException
 

Protected Member Functions

void paintChildren (final Graphics g)
 
void paintPadForeground (final Graphics g)
 
- Protected Member Functions inherited from grammarscope.browser.components.TextPane
void spaceLines (final float lineSpacing)
 
void setCharacterStyle (final int from, final int to, final SimpleAttributeSet style, final boolean replace)
 
void setParagraphStyle (@SuppressWarnings("SameParameterValue") final int from, final int to, final SimpleAttributeSet style, @SuppressWarnings("SameParameterValue") final boolean replace)
 

Private Member Functions

void setBackcolor (final Color backColor)
 
void setGradientFlag (final Boolean flag)
 
boolean tryLayoutPad (final Graphics g) throws BadLocationException
 
boolean layoutPad (final Graphics g) throws BadLocationException
 
void paintPad (final Graphics g) throws BadLocationException
 
void makeRenderers (final Graphics g)
 
Paint makeHatchPaint ()
 
Paint makeGradientPaint (final int top, final int height)
 
String getFocusToolTipText (final MouseEvent event)
 
String getNumberToolTipText (final MouseEvent event)
 
String getParseToolTipText (final MouseEvent event, final boolean scoreFlag)
 
String getGrammaticalStructureToolTipText (final MouseEvent event, final boolean scoreFlag)
 
String getTypedDependenciesToolTipText (final MouseEvent event)
 

Private Attributes

Document document
 
int hash
 
RelationOrderedFilter relationFilter
 
RelationFilter relationFilter2
 
RelationPalette relationPalette
 
TypedDependencyProvider typedDependencyProvider
 
TypedDependencyMode typedDependencyMode
 
final SimpleAttributeSet paragraphStyle
 
final SimpleAttributeSet defaultStyle
 
final SimpleAttributeSet focusStyle
 
final SimpleAttributeSet nonFocusStyle
 
long renderMode
 
TooltipMode sentenceTooltipMode
 
boolean annotationTooltipMode
 
boolean highlightHeadFlag
 
boolean markHeadFlag
 
boolean hatchFlag
 
boolean gradientFlag
 
final boolean tagBarsFlag
 
boolean edgesAsCurvesFlag
 
boolean annotatePadFlag
 
float lineSpacing
 
int increment
 
int fontHeight
 
final Image backgroundImage
 
Color backColor
 
final HotSpots hotSpots
 
Map< RenderMode, IRendererrenderers
 

Static Private Attributes

static final long serialVersionUID = 2L
 
static final long RENDERMODE_DEFAULT = RenderMode.RELATIONS.mask()
 
static final TooltipMode SENTENCE_TOOLTIP_DEFAULT = TooltipMode.PARSE
 
static final boolean ANNOTATION_TOOLTIP_DEFAULT = true
 
static final boolean HIGHLIGHT_HEAD_DEFAULT = true
 
static final boolean HIGHLIGHT_MARK_HEAD_DEFAULT = false
 
static final boolean GRADIENT_DEFAULT = true
 
static final boolean HATCH_DEFAULT = true
 
static final boolean TAG_BARS_DEFAULT = true
 
static final boolean EDGES_AS_CURVES_DEFAULT = true
 
static final float LINE_SPACING_DEFAULT = 20.f
 
static final boolean ANNOTATE_PAD_DEFAULT = true
 
static final int LEFT_MARGIN = 50
 
static final int RIGHT_MARGIN = 50
 
static final Color DEFAULT_BACKCOLOR = new Color(204, 205, 255)
 
static final boolean PARTITION_FLAG = true
 

Detailed Description

Document view

Author
Bernard Bou

Constructor & Destructor Documentation

◆ View()

grammarscope.browser.View.View ( )

Constructor

Member Function Documentation

◆ applySettings()

void grammarscope.browser.View.applySettings ( final Settings  settings)

Apply settings

Parameters
settingssettings

◆ changeFont()

void grammarscope.browser.View.changeFont ( final Font  font,
final Color  color 
)

Set font

Parameters
fontfont
colorfont color

◆ changeTypedDependencyMode()

void grammarscope.browser.View.changeTypedDependencyMode ( final TypedDependencyMode  mode)

Set typed dependency mode

Parameters
modetyped dependency mode

◆ changeTypedDependencyProvider()

void grammarscope.browser.View.changeTypedDependencyProvider ( final TypedDependencyProvider  provider)

Set typed dependency provider

Parameters
providertyped dependency provider

◆ clearFocusStyle()

void grammarscope.browser.View.clearFocusStyle ( )

Clear focus styles in substring

◆ clearHighlight()

void grammarscope.browser.View.clearHighlight ( )

Clear all styles

◆ forceLayout()

void grammarscope.browser.View.forceLayout ( )

Force layout

◆ getAnnotationPadFlag()

boolean grammarscope.browser.View.getAnnotationPadFlag ( )

◆ getAnnotationTooltipMode()

boolean grammarscope.browser.View.getAnnotationTooltipMode ( )

Get annotation tooltip mode

Returns
annotation tooltip mode

◆ getDoc()

Document grammarscope.browser.View.getDoc ( )

Get view's document

Returns
document

◆ getEdgesAsCurvesFlag()

boolean grammarscope.browser.View.getEdgesAsCurvesFlag ( )

Get render edges as curves flag

Returns
true/false

◆ getFocusToolTipText()

String grammarscope.browser.View.getFocusToolTipText ( final MouseEvent  event)
private

Tooltip attached to registered hotspot

Parameters
eventmouse event
Returns
tooltip text

◆ getGradientFlag()

boolean grammarscope.browser.View.getGradientFlag ( )

Get display gradient flag

Returns
true/false

◆ getGrammaticalStructureToolTipText()

String grammarscope.browser.View.getGrammaticalStructureToolTipText ( final MouseEvent  event,
final boolean  scoreFlag 
)
private

Tooltip with sentence's parse

Parameters
eventmouse event
scoreFlagtrue if score is to be displayed in tooltip
Returns
tooltip text

◆ getHatchFlag()

boolean grammarscope.browser.View.getHatchFlag ( )

Get hatch background flag

Returns
true/false

◆ getHighlightFlag()

boolean grammarscope.browser.View.getHighlightFlag ( )

Get highlight relations flag

Returns
true/false

◆ getHighlightHeadFlag()

boolean grammarscope.browser.View.getHighlightHeadFlag ( )

Get highlight heads flag

Returns
true/false

◆ getHighlightMarkHeadFlag()

boolean grammarscope.browser.View.getHighlightMarkHeadFlag ( )

Get mark heads flag

Returns
true/false

◆ getLineSpacing()

float grammarscope.browser.View.getLineSpacing ( )

Get spacing value (number of line heights)

Returns
spacing value (number of line heights)

◆ getNumberToolTipText()

String grammarscope.browser.View.getNumberToolTipText ( final MouseEvent  event)
private

Tooltip with sentence's number

Parameters
eventmouse event
Returns
tooltip text

◆ getParseToolTipText()

String grammarscope.browser.View.getParseToolTipText ( final MouseEvent  event,
final boolean  scoreFlag 
)
private

Tooltip with sentence's parse

Parameters
eventmouse event
scoreFlagtrue if score is to be displayed in tooltip
Returns
tooltip text

◆ getRenderMode()

long grammarscope.browser.View.getRenderMode ( )

Get render mode

Returns
render mode

◆ getSentenceAt()

int grammarscope.browser.View.getSentenceAt ( final Point  point)

Get sentence at view location

Parameters
pointlocation
Returns
sentence

◆ getSentenceTooltipMode()

TooltipMode grammarscope.browser.View.getSentenceTooltipMode ( )

Get tooltip mode

Returns
tooltip mode

◆ getStringAt()

String grammarscope.browser.View.getStringAt ( final Point  point)

Get word string at view location

Parameters
pointlocation
Returns
word or null

◆ getToolTipText()

String grammarscope.browser.View.getToolTipText ( final MouseEvent  event)

◆ getTop()

static int grammarscope.browser.View.getTop ( final JTextComponent  textComponent) throws BadLocationException
static

Get top

Parameters
textComponenttext component
Returns
top
Exceptions
BadLocationExceptionexception

◆ getTypedDependenciesToolTipText()

String grammarscope.browser.View.getTypedDependenciesToolTipText ( final MouseEvent  event)
private

Tooltip with sentence's typed dependencies

Parameters
eventmouse event
Returns
tooltip text

◆ getTypedDependencyMode()

TypedDependencyMode grammarscope.browser.View.getTypedDependencyMode ( )

Get typed dependency mode

Returns
typed dependency mode

◆ getTypedDependencyProvider()

TypedDependencyProvider grammarscope.browser.View.getTypedDependencyProvider ( )

Get typed dependency provider

Returns
typed dependency provider

◆ highlight() [1/2]

void grammarscope.browser.View.highlight ( )

Highlight

◆ highlight() [2/2]

void grammarscope.browser.View.highlight ( final int  sentenceIdx)

Highlight sentence

Parameters
sentenceIdxsentence index

◆ layoutPad()

boolean grammarscope.browser.View.layoutPad ( final Graphics  g) throws BadLocationException
private

Lay out

Parameters
ggraphics context
Returns
true if layout is to be done
Exceptions
BadLocationExceptionexception

◆ makeGradientPaint()

Paint grammarscope.browser.View.makeGradientPaint ( final int  top,
final int  height 
)
private

Make gradient paint

Parameters
toptop
heightheight
Returns
paint

◆ makeHatchPaint()

Paint grammarscope.browser.View.makeHatchPaint ( )
private

Make hatch paint

Returns
paint

◆ makeRenderers()

void grammarscope.browser.View.makeRenderers ( final Graphics  g)
private

Make renderers

Parameters
ggraphics context

◆ modelToView()

static Rectangle grammarscope.browser.View.modelToView ( final JTextComponent  textComponent,
final Segment  segment 
) throws BadLocationException
static

Get rectangle for segment in text

Parameters
textComponenttext component
segmenttarget segment
Returns
rectangle
Exceptions
BadLocationExceptionexception

◆ notified()

void grammarscope.browser.View.notified ( final Event  event)

Event notification

Parameters
eventevent

Implements grammarscope.message.IEventListener.

◆ notifyAnalyzed()

void grammarscope.browser.View.notifyAnalyzed ( )

Notifies analyzed

◆ notifyParsed()

void grammarscope.browser.View.notifyParsed ( )

Notifies parsed

◆ paintChildren()

void grammarscope.browser.View.paintChildren ( final Graphics  g)
protected

◆ paintPad()

void grammarscope.browser.View.paintPad ( final Graphics  g) throws BadLocationException
private

Paint pad

Parameters
ggraphics context

◆ paintPadBackground()

void grammarscope.browser.View.paintPadBackground ( final Graphics  g) throws BadLocationException

Paint background

Parameters
ggraphic context
Exceptions
BadLocationExceptionexception

◆ paintPadForeground()

void grammarscope.browser.View.paintPadForeground ( final Graphics  g)
protected

View enhanced paint component body

Parameters
ggraphic context

◆ setAnnotationPadFlag()

void grammarscope.browser.View.setAnnotationPadFlag ( final boolean  flag)

◆ setAnnotationTooltipMode()

void grammarscope.browser.View.setAnnotationTooltipMode ( final Boolean  flag)

Set annotation tooltip mode

Parameters
flagflag

◆ setBackcolor()

void grammarscope.browser.View.setBackcolor ( final Color  backColor)
private

Set back color

Parameters
backColorback color

◆ setDoc()

void grammarscope.browser.View.setDoc ( final Document  document)

Set view's document

Parameters
documentdocument

◆ setEdgesAsCurvesFlag()

void grammarscope.browser.View.setEdgesAsCurvesFlag ( final Boolean  flag)

Set render edges as curves flag

Parameters
flagtrue/false

◆ setFilter()

void grammarscope.browser.View.setFilter ( final RelationOrderedFilter  relationFilter)

Attach relation filter to view

Parameters
relationFilterrelation filter

◆ setFilter2()

void grammarscope.browser.View.setFilter2 ( final RelationFilter  relationFilter)

Attach relation filter 2 to view

Parameters
relationFilterrelation filter

◆ setFocusStyle()

void grammarscope.browser.View.setFocusStyle ( final int  from,
final int  to 
)

Set focus style to substring

Parameters
fromfrom-index
toto-index

◆ setFont()

void grammarscope.browser.View.setFont ( final Font  font0,
final Color  color 
)

Set font

Parameters
font0font
colorfont color

◆ setGradientFlag()

void grammarscope.browser.View.setGradientFlag ( final Boolean  flag)
private

Set display gradient flag

Parameters
flagtrue/false

◆ setHatchFlag()

void grammarscope.browser.View.setHatchFlag ( final Boolean  flag)

Set hatch background flag

Parameters
flagtrue/false

◆ setHighlightFlag()

void grammarscope.browser.View.setHighlightFlag ( final Boolean  flag)

Set highlight relations flag

Parameters
flagtrue/false

◆ setHighlightHeadFlag()

void grammarscope.browser.View.setHighlightHeadFlag ( final Boolean  flag)

Set highlight heads flag

Parameters
flagtrue/false

◆ setHighlightMarkHeadFlag()

void grammarscope.browser.View.setHighlightMarkHeadFlag ( final Boolean  flag)

Set mark heads flag

Parameters
flagtrue/false

◆ setLineSpacing()

void grammarscope.browser.View.setLineSpacing ( final Float  spacing)

Set line spacing value

Parameters
spacingspacing value (number of line heights)

◆ setPalette()

void grammarscope.browser.View.setPalette ( final RelationPalette  relationPalette)

Attach relation palette to view

Parameters
relationPaletterelation palette

◆ setRenderMode()

void grammarscope.browser.View.setRenderMode ( final Long  mode)

Set render mode

Parameters
moderender mode

◆ setSentenceTooltipMode()

void grammarscope.browser.View.setSentenceTooltipMode ( final TooltipMode  mode)

Set tooltip mode

Parameters
modetooltip mode

◆ setText()

void grammarscope.browser.View.setText ( )

Set text document

◆ setTypedDependencyMode()

void grammarscope.browser.View.setTypedDependencyMode ( final TypedDependencyMode  mode)

Set typed dependency mode

Parameters
modetyped dependency mode

◆ setTypedDependencyProvider()

void grammarscope.browser.View.setTypedDependencyProvider ( final TypedDependencyProvider  provider)

Set typed dependency provider

Parameters
providertyped dependency provider

◆ tryLayoutPad()

boolean grammarscope.browser.View.tryLayoutPad ( final Graphics  g) throws BadLocationException
private

Try lay out

Parameters
ggraphics context
Returns
true if layout has been done
Exceptions
BadLocationExceptionexception

Member Data Documentation

◆ ANNOTATE_PAD_DEFAULT

final boolean grammarscope.browser.View.ANNOTATE_PAD_DEFAULT = true
staticprivate

◆ annotatePadFlag

boolean grammarscope.browser.View.annotatePadFlag
private

Annotate pad flag

◆ ANNOTATION_TOOLTIP_DEFAULT

final boolean grammarscope.browser.View.ANNOTATION_TOOLTIP_DEFAULT = true
staticprivate

◆ annotationTooltipMode

boolean grammarscope.browser.View.annotationTooltipMode
private

Tooltip mode in sentence

◆ backColor

Color grammarscope.browser.View.backColor
private

Pad background color

◆ backgroundImage

final Image grammarscope.browser.View.backgroundImage
private

Pattern image for line space

◆ DEFAULT_BACKCOLOR

final Color grammarscope.browser.View.DEFAULT_BACKCOLOR = new Color(204, 205, 255)
staticprivate

Default background color

◆ defaultStyle

final SimpleAttributeSet grammarscope.browser.View.defaultStyle
private

Default char style

◆ document

Document grammarscope.browser.View.document
private

Document

◆ EDGES_AS_CURVES_DEFAULT

final boolean grammarscope.browser.View.EDGES_AS_CURVES_DEFAULT = true
staticprivate

◆ edgesAsCurvesFlag

boolean grammarscope.browser.View.edgesAsCurvesFlag
private

Draw edges as curves

◆ focusStyle

final SimpleAttributeSet grammarscope.browser.View.focusStyle
private

Focus char style

◆ fontHeight

int grammarscope.browser.View.fontHeight
private

Font height for this layout

◆ GRADIENT_DEFAULT

final boolean grammarscope.browser.View.GRADIENT_DEFAULT = true
staticprivate

◆ gradientFlag

boolean grammarscope.browser.View.gradientFlag
private

Display gradient paint between lines

◆ hash

int grammarscope.browser.View.hash
private

Layout hash

◆ HATCH_DEFAULT

final boolean grammarscope.browser.View.HATCH_DEFAULT = true
staticprivate

◆ hatchFlag

boolean grammarscope.browser.View.hatchFlag
private

Display hatch between lines

◆ HIGHLIGHT_HEAD_DEFAULT

final boolean grammarscope.browser.View.HIGHLIGHT_HEAD_DEFAULT = true
staticprivate

◆ HIGHLIGHT_MARK_HEAD_DEFAULT

final boolean grammarscope.browser.View.HIGHLIGHT_MARK_HEAD_DEFAULT = false
staticprivate

◆ highlightHeadFlag

boolean grammarscope.browser.View.highlightHeadFlag
private

Highlight relation head

◆ hotSpots

final HotSpots grammarscope.browser.View.hotSpots
private

◆ increment

int grammarscope.browser.View.increment
private

Line increment for this layout

◆ LEFT_MARGIN

final int grammarscope.browser.View.LEFT_MARGIN = 50
staticprivate

Left margin

◆ LINE_SPACING_DEFAULT

final float grammarscope.browser.View.LINE_SPACING_DEFAULT = 20.f
staticprivate

◆ lineSpacing

float grammarscope.browser.View.lineSpacing
private

Line spacing value

◆ markHeadFlag

boolean grammarscope.browser.View.markHeadFlag
private

Highlight mark relation head

◆ nonFocusStyle

final SimpleAttributeSet grammarscope.browser.View.nonFocusStyle
private

Non-focus char style

◆ paragraphStyle

final SimpleAttributeSet grammarscope.browser.View.paragraphStyle
private

Default paragraph style

◆ PARTITION_FLAG

final boolean grammarscope.browser.View.PARTITION_FLAG = true
staticprivate

Whether to draw partition line between renderer space

◆ relationFilter

RelationOrderedFilter grammarscope.browser.View.relationFilter
private

Annotation pad relation filter

◆ relationFilter2

RelationFilter grammarscope.browser.View.relationFilter2
private

Highlight relation filter

◆ relationPalette

RelationPalette grammarscope.browser.View.relationPalette
private

Relation palette

◆ renderers

Map<RenderMode, IRenderer> grammarscope.browser.View.renderers
private

View renderers

◆ renderMode

long grammarscope.browser.View.renderMode
private

Composite rendering mode

◆ RENDERMODE_DEFAULT

final long grammarscope.browser.View.RENDERMODE_DEFAULT = RenderMode.RELATIONS.mask()
staticprivate

◆ RIGHT_MARGIN

final int grammarscope.browser.View.RIGHT_MARGIN = 50
staticprivate

Right margin

◆ SENTENCE_TOOLTIP_DEFAULT

final TooltipMode grammarscope.browser.View.SENTENCE_TOOLTIP_DEFAULT = TooltipMode.PARSE
staticprivate

◆ sentenceTooltipMode

TooltipMode grammarscope.browser.View.sentenceTooltipMode
private

Tooltip mode for annotation pad

◆ serialVersionUID

final long grammarscope.browser.View.serialVersionUID = 2L
staticprivate

◆ TAG_BARS_DEFAULT

final boolean grammarscope.browser.View.TAG_BARS_DEFAULT = true
staticprivate

◆ tagBarsFlag

final boolean grammarscope.browser.View.tagBarsFlag
private

Tag bars with relation name

◆ typedDependencyMode

TypedDependencyMode grammarscope.browser.View.typedDependencyMode
private

Typed Dependency mode

◆ typedDependencyProvider

TypedDependencyProvider grammarscope.browser.View.typedDependencyProvider
private

Typed Dependency provider


The documentation for this class was generated from the following file: