public class Browser extends ControlDocumentView implements IRequestListener
Modifier and Type | Class and Description |
---|---|
static class |
Browser.ToolMode
Filter display mode
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String[] |
args
Command-line arguments
|
private DashBoard |
dashBoard
The grammatical relations dash board
|
private javax.swing.JComponent |
dashPanel
Dash panel
|
private boolean |
derivedTypedDependenciesFlag
Whether typed dependencies are derived from semantic graph
|
private javax.swing.Icon |
documentIcon
Filter icon
|
private javax.swing.Icon |
engineIcon
Engine icon
|
private static int |
FILTER_HEIGHT |
private static int |
FILTER_WIDTH |
javax.swing.JFrame |
frame
Application's main frame
|
private GraphDecorator<GNode,GEdge> |
graphDecorator
Graph decorator
|
private boolean |
lemmatizeFlag
Whether to lemmatize nodes
|
private javax.swing.JSlider |
lineSpacingSlider
Edits line spacing
|
private javax.swing.JPanel |
mainPanel
Main panel
|
private javax.swing.Icon |
modelIcon
Relations icon
|
(package private) static javax.swing.table.TableCellRenderer |
modelsRenderer |
private java.awt.event.MouseListener |
nullMouseListener
Input-blocking null mouse listener
|
private static int |
PROGRESS_HEIGHT |
private static int |
PROGRESS_WIDTH |
private javax.swing.JProgressBar |
progressBar
Progress bar
|
private static boolean |
PROPAGATE_LANGUAGE_CHANGE_TO_SERVER |
private javax.swing.Icon |
relationFilterIcon
Filter icon
|
private javax.swing.Icon |
relationPaletteIcon
Filter icon
|
private static boolean |
relaunchOnChange |
private Settings |
settings
Settings
|
private javax.swing.JPanel |
statusPanel
Status panel
|
private javax.swing.JToolBar |
toolBar
Toolbar
|
private Browser.ToolMode |
toolMode
Tool mode
|
private javax.swing.JComboBox<TypedDependencyMode> |
typedDependencyModeComboBox
TypedDependencyMode ComboBox
|
private javax.swing.JComboBox<TypedDependencyProvider> |
typedDependencyProviderComboBox
TypedDependencyProvider ComboBox
|
private static java.lang.String |
version
Version string
|
private static int |
VIEW_HEIGHT |
private static int |
VIEW_WIDTH |
private javax.swing.JPanel |
viewPane
View panel
|
private javax.swing.JTabbedPane |
views
Tabbed views
|
private boolean |
xMLModeFlag
XML mode flag
|
typedDependencyMode, typedDependencyProvider, xmlCompatibilityMode
relationFilter, relationFilter2, relationModel, relationPalette
builder, clientProperties, loadServer, server, useNullServer
Constructor and Description |
---|
Browser(java.lang.String[] args)
Constructor
|
Modifier and Type | Method and Description |
---|---|
private void |
addToStatus(javax.swing.JComponent component)
Add component to status bar
|
(package private) void |
addView(View view)
Add view
|
private void |
adjustCombos()
Adjust combos to view
|
private void |
adjustSlider()
Adjust slider position to view
|
private void |
applyClientSettings(Settings settings)
Apply client settings
|
private void |
applySettings(Settings settings)
Apply settings
|
void |
clear()
Clear highlighting command handler
|
void |
clearFocus()
Clear target command handler
|
private void |
clearStatus()
Clear status bar
|
static void |
commandAbout()
About
|
void |
commandAllModels()
All models
|
void |
commandAnalysis()
Display analysis for selected sentence command handler
|
void |
commandAnalyze()
(Re)Analyze selected sentence command handler
|
void |
commandChooseFont()
Font selection command handler
|
void |
commandDepParserModels()
Dep parser models
|
void |
commandDeSerializeAnalysis()
Deserialize analysis
|
void |
commandDeSerializeAnalysisToText()
Deserialize analysis
|
void |
commandEditHighlightFilter()
Edit highlight filter
|
static void |
commandEditor()
Run editor
|
void |
commandExit()
Exit
|
void |
commandExploreRelations()
Explore grammatical relations command handler
|
void |
commandForceLayout()
Force layout view command handler
|
void |
commandGrammaticalStructure()
Display grammatical structure for selected sentence command handler
|
void |
commandHelp()
Help
|
void |
commandLanguage()
Language
|
void |
commandLexParserModels()
Lex parser models
|
void |
commandLoadParser()
Load parser from file
|
void |
commandParseTree()
Display parsed tree for selected sentence command handler
|
void |
commandPosTaggerModels()
POS parser models
|
void |
commandProviderData()
Provider data handler
|
void |
commandRepaint()
Repaint view command handler
|
void |
commandReport()
Display report in text form for selected sentence command handler
|
void |
commandReports()
Display reports in text form for selected sentence command handler
|
void |
commandSemanticGraph()
Display semantic graph for selected sentence command handler
|
void |
commandSerializeAnalysis()
Serialize analysis
|
void |
commandServerSettings()
Server settings command handler
|
void |
commandSettings()
Settings command handler
|
void |
commandSPO()
Subject Predicate Object
|
static void |
commandSystem()
System
|
static void |
commandTest()
Settings command handler
|
void |
commandTextReport()
Display text report in text form command handler
|
void |
commandTextReports()
Display text reports in text form command handler
|
void |
commandTriples()
Display triples for selected sentence command handler
|
void |
commandTypedDependencies()
Display typed dependencies for selected sentence command handler
|
void |
commandTypedDependenciesTexts()
Display analysis in text form for selected sentence command handler
|
void |
commandTypedDependencyGraph()
Display typed dependencies graph for selected sentence command handler
|
static void |
commandTypedDependencySettings()
Typed Dependency settings command handler
|
protected void |
endTask()
Remove input block
|
void |
explore(Relation relation,
EventFirer firer)
Explore grammatical relation
|
void |
exploreRelations(RelationModel model)
Explore grammatical relations
|
boolean |
getAnnotationPadFlag()
Whether annotation pad is shown
|
(package private) java.lang.String[] |
getArgs()
Get command-line arguments
|
boolean |
getDerivedTypedDependencies()
Get graph-derived typed dependencies
|
Document |
getDocument()
Access to document
|
java.util.List<Document> |
getDocuments()
Get document list
|
boolean |
getEdgesAsCurves()
Get render mode return whether to render edges as curves
|
(package private) javax.swing.JFrame |
getFrame() |
boolean |
getLemmatize()
Get lemmatize
|
private boolean |
getLoadArg() |
(package private) java.util.Observable |
getObservable()
Get observable
|
long |
getRenderMode()
Get render mode return render mode
|
(package private) Settings |
getSettings() |
(package private) static java.lang.String |
getSettingsPath(java.lang.String[] args)
Get settings path for overrides on command line
|
javax.swing.JToolBar |
getToolBar()
Access to toolbar
|
Browser.ToolMode |
getToolMode()
Get tool mode
|
View |
getView()
Access to view
|
java.util.List<View> |
getViews()
Access to views
|
boolean |
getWorkflow2()
Get graph-derived typed dependencies
|
static boolean |
getXMLCompatibilityMode()
Get XML compatibility mode
|
boolean |
getXMLMode()
Get XML mode
|
void |
highlight()
Highlight command handler
|
private void |
initializeGUI()
Initializes browser
|
void |
layoutMainPanel(Browser.ToolMode mode)
Lay out main panel
|
static void |
main(java.lang.String[] args)
Start entry point
|
static void |
main2(java.lang.String[] args)
Start entry point (from editor)
|
static java.util.Properties |
makeClientProperties(Settings settings,
java.lang.String[] args)
Make client properties from settings and command-line arguments
|
private DashBoard |
makeDashBoard()
Make the dashboard
|
private static javax.swing.JToolBar |
makeDashBoardToolBar()
Make dashboard toolbar
|
private javax.swing.JComponent |
makeDocumentStatusComponent(javax.swing.Icon icon)
Make document status component
|
private IFilterWidget |
makeFilterWidget(boolean asTable)
Make filter widget
|
private static javax.swing.JComponent |
makeMemoryStatusComponent()
Make memory status component
|
private javax.swing.JMenuBar |
makeMenuBar()
Make menubar
|
static java.util.Properties |
makeProperties(java.lang.String persistFile)
Obtain settings
|
static Settings |
makeSettings(java.lang.String persistFile,
java.lang.String[] args)
Obtain settings
|
private javax.swing.JSlider |
makeSlider()
Make line spacing slider
|
private static javax.swing.JSplitPane |
makeSplitPane()
Make split panel to wrap left panel and dashboard
|
private static javax.swing.JComponent |
makeStatusComponent(javax.swing.Icon icon,
java.lang.String name,
java.lang.String value)
Make status component
|
private javax.swing.JToolBar |
makeToolBar()
Make main toolbar
|
private javax.swing.JComboBox<TypedDependencyMode> |
makeTypedDependencyModeComboBox()
Make typed dependencies mode combo box
|
private javax.swing.JComboBox<TypedDependencyProvider> |
makeTypedDependencyProviderComboBox()
Make typed dependencies provider combo box
|
void |
notified(Event event)
Event notification
|
protected void |
onDone(Document document,
boolean parsed,
boolean analyzed)
Document parsed/analyzed callback
|
protected void |
onPublish(Document document,
java.util.List<java.lang.Integer> sentenceIndices,
boolean parsed,
boolean analyzed)
Document part published callback
|
void |
onServerBound(boolean success)
Server binding callback
|
void |
requested(Request request)
Request notification
|
void |
scrollBackward()
Scroll backward to previous sentence command handler
|
void |
scrollForward()
Scroll forward to next sentence command handler
|
void |
setAnnotationPadFlag(boolean flag)
Show annotation pad
|
void |
setDerivedTypedDependencies(boolean flag)
Set graph-derived typed dependencies
|
void |
setEdgesAsCurves(java.lang.Boolean flag)
Set render mode
|
void |
setLemmatize(boolean flag)
Set lemmatize flag
|
void |
setRenderMode(java.lang.Long mode)
Set render mode
|
void |
setTypedDependencyMode(TypedDependencyMode mode)
Set typed dependency mode
|
void |
setTypedDependencyProvider(TypedDependencyProvider provider)
Set typed dependency provider
|
void |
setXML(boolean flag)
Set XML mode
|
static void |
setXMLCompatibilityMode(boolean flag)
Set XML compatibility mode
|
void |
startProcessing(Document document,
boolean recognize,
boolean parse,
boolean analyze,
boolean clear,
boolean waitServerReady)
Start processing thread
|
protected void |
startTask()
Block input when task is initiated.
|
commandInput, commandOpen, commandOpenPaste, commandOpenUrl, commandOpenXml, getUrl, initControlDocumentView, makeDocument, makeTextDocument, makeXmlDocument, startDocument, startDocumentLoading, startXmlDocumentLoading
commandLoadRelationFilter, commandLoadRelationPalette, commandSaveRelationFilter, commandSaveRelationPalette, initRelationModel, initRelationModel, makeRelationModel, setRelationModel
getFirer
bindToServer, checkCoreNlp, clearClient, initClient, setup, updateClient
getState, lock, resetLock
private static final java.lang.String version
private static final int VIEW_WIDTH
private static final int VIEW_HEIGHT
private static final int FILTER_WIDTH
private static final int FILTER_HEIGHT
private static final int PROGRESS_WIDTH
private static final int PROGRESS_HEIGHT
private static boolean relaunchOnChange
public javax.swing.JFrame frame
private javax.swing.JPanel mainPanel
private javax.swing.JPanel viewPane
private javax.swing.JTabbedPane views
private javax.swing.JPanel statusPanel
private javax.swing.JComponent dashPanel
private DashBoard dashBoard
private javax.swing.JSlider lineSpacingSlider
private javax.swing.JProgressBar progressBar
private javax.swing.JToolBar toolBar
private javax.swing.JComboBox<TypedDependencyProvider> typedDependencyProviderComboBox
private javax.swing.JComboBox<TypedDependencyMode> typedDependencyModeComboBox
private java.awt.event.MouseListener nullMouseListener
private final Settings settings
private final java.lang.String[] args
private javax.swing.Icon engineIcon
private javax.swing.Icon modelIcon
private javax.swing.Icon relationFilterIcon
private javax.swing.Icon relationPaletteIcon
private javax.swing.Icon documentIcon
private Browser.ToolMode toolMode
private boolean xMLModeFlag
private boolean lemmatizeFlag
private boolean derivedTypedDependenciesFlag
private final GraphDecorator<GNode,GEdge> graphDecorator
private static final boolean PROPAGATE_LANGUAGE_CHANGE_TO_SERVER
static final javax.swing.table.TableCellRenderer modelsRenderer
public Browser(java.lang.String[] args)
args
- argumentsprivate void initializeGUI()
private boolean getLoadArg()
public void layoutMainPanel(Browser.ToolMode mode)
mode
- mode (none, splitpane, toolbar)private DashBoard makeDashBoard()
private static javax.swing.JSplitPane makeSplitPane()
private static javax.swing.JToolBar makeDashBoardToolBar()
private javax.swing.JToolBar makeToolBar()
private javax.swing.JMenuBar makeMenuBar()
private javax.swing.JSlider makeSlider()
private void adjustSlider()
private void adjustCombos()
public void setAnnotationPadFlag(boolean flag)
flag
- whether to show annotation padpublic boolean getAnnotationPadFlag()
private javax.swing.JComboBox<TypedDependencyMode> makeTypedDependencyModeComboBox()
private javax.swing.JComboBox<TypedDependencyProvider> makeTypedDependencyProviderComboBox()
Settings getSettings()
getSettings
in class ControlDocumentView
java.lang.String[] getArgs()
ControlDocumentView
getArgs
in class ControlDocumentView
java.util.Observable getObservable()
ControlDocumentView
getObservable
in class ControlDocumentView
public void notified(Event event)
IEventListener
notified
in interface IEventListener
notified
in class ControlDocumentView
event
- eventpublic void requested(Request request)
IRequestListener
requested
in interface IRequestListener
request
- requestpublic View getView()
public java.util.List<View> getViews()
void addView(View view)
ControlDocumentView
addView
in class ControlDocumentView
view
- viewpublic Document getDocument()
public java.util.List<Document> getDocuments()
getDocuments
in class ControlDocumentView
public void onServerBound(boolean success)
onServerBound
in interface IServerListener
onServerBound
in class Client
success
- whether binding was successfulprotected void onDone(Document document, boolean parsed, boolean analyzed)
onDone
in class ControlDocumentView
document
- documentparsed
- parsedanalyzed
- analyzedprotected void onPublish(Document document, java.util.List<java.lang.Integer> sentenceIndices, boolean parsed, boolean analyzed)
onPublish
in class ControlDocumentView
document
- documentsentenceIndices
- indices of done sentences (-1=all done)parsed
- parsedanalyzed
- analyzedpublic void startProcessing(Document document, boolean recognize, boolean parse, boolean analyze, boolean clear, boolean waitServerReady)
ControlDocumentView
startProcessing
in class ControlDocumentView
document
- documentrecognize
- recognize (pos, named entities)parse
- parseanalyze
- analyzeclear
- clear cached datawaitServerReady
- wait until server is readyprotected void startTask()
startTask
in class ControlDocumentView
protected void endTask()
endTask
in class ControlDocumentView
public void setTypedDependencyProvider(TypedDependencyProvider provider)
provider
- providerpublic void setTypedDependencyMode(TypedDependencyMode mode)
mode
- modepublic void setRenderMode(java.lang.Long mode)
mode
- render modepublic long getRenderMode()
public void setEdgesAsCurves(java.lang.Boolean flag)
flag
- whether to render edges as curvespublic boolean getEdgesAsCurves()
public Browser.ToolMode getToolMode()
public void setXML(boolean flag)
flag
- XML mode flagpublic boolean getXMLMode()
public static void setXMLCompatibilityMode(boolean flag)
flag
- XML compatibility mode flagpublic static boolean getXMLCompatibilityMode()
public void setLemmatize(boolean flag)
flag
- lemmatize flagpublic boolean getLemmatize()
public void setDerivedTypedDependencies(boolean flag)
flag
- whether typed dependencies are derived from semantic graphpublic boolean getDerivedTypedDependencies()
public boolean getWorkflow2()
public void clear()
public void clearFocus()
public void highlight()
public void commandEditHighlightFilter()
public void scrollForward()
public void scrollBackward()
public javax.swing.JToolBar getToolBar()
private void addToStatus(javax.swing.JComponent component)
component
- component to addprivate void clearStatus()
private static javax.swing.JComponent makeStatusComponent(javax.swing.Icon icon, java.lang.String name, java.lang.String value)
icon
- iconname
- namevalue
- valueprivate javax.swing.JComponent makeDocumentStatusComponent(javax.swing.Icon icon)
icon
- icon to addprivate static javax.swing.JComponent makeMemoryStatusComponent()
public void exploreRelations(RelationModel model)
model
- relation modelpublic void explore(Relation relation, EventFirer firer)
relation
- relation to explorefirer
- event firerpublic void commandRepaint()
public void commandForceLayout()
public void commandAnalyze()
public void commandAnalysis()
public void commandReport()
public void commandReports()
public void commandTextReport()
public void commandTextReports()
public void commandParseTree()
public void commandGrammaticalStructure()
public void commandTypedDependencies()
private IFilterWidget makeFilterWidget(boolean asTable)
asTable
- as tablepublic void commandTypedDependencyGraph()
public void commandSemanticGraph()
public void commandTriples()
public void commandTypedDependenciesTexts()
public void commandLoadParser()
public void commandLanguage()
public void commandProviderData()
public void commandExploreRelations()
public void commandSerializeAnalysis()
public void commandDeSerializeAnalysis()
public void commandDeSerializeAnalysisToText()
public void commandSPO()
public static void commandEditor()
public static void commandAbout()
public static void commandSystem()
public void commandLexParserModels()
public void commandDepParserModels()
public void commandPosTaggerModels()
public void commandAllModels()
public void commandHelp()
public void commandExit()
public void commandServerSettings()
public void commandSettings()
public static void commandTest()
public void commandChooseFont()
public static void commandTypedDependencySettings()
private void applySettings(Settings settings)
settings
- settingsprivate void applyClientSettings(Settings settings)
settings
- settingsstatic java.lang.String getSettingsPath(java.lang.String[] args)
args
- command line argumentspublic static java.util.Properties makeProperties(java.lang.String persistFile)
persistFile
- persist filepublic static java.util.Properties makeClientProperties(Settings settings, java.lang.String[] args)
settings
- settingsargs
- command-line argumentspublic static Settings makeSettings(java.lang.String persistFile, java.lang.String[] args)
persistFile
- persist fileargs
- command-line argumentspublic static void main2(java.lang.String[] args)
args
- command line parameterspublic static void main(java.lang.String[] args)
args
- command line parameters