Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Converted variables to final, removed synchronization

AuthorDaveJarvis <email>
Date2020-05-30 09:16:41 GMT-0700
Commit157d052e21d48b4b754f1549ce648b40868001a4
Parente255396
.idea/workspace.xml
<component name="ChangeListManager">
<list default="true" id="3dcf7c8f-87b5-4d25-a804-39da40a621b8" name="Default Changelist" comment="">
- <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/main/java/com/scrivenvar/FileEditorTabPane.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/scrivenvar/FileEditorTabPane.java" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/main/java/com/scrivenvar/MainWindow.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/scrivenvar/MainWindow.java" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/main/java/com/scrivenvar/Messages.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/scrivenvar/Messages.java" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/main/java/com/scrivenvar/definition/yaml/YamlFileDefinitionSource.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/scrivenvar/definition/yaml/YamlFileDefinitionSource.java" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/main/java/com/scrivenvar/editors/markdown/MarkdownEditorPane.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/scrivenvar/editors/markdown/MarkdownEditorPane.java" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/main/java/com/scrivenvar/predicates/files/FileTypePredicate.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/scrivenvar/predicates/files/FileTypePredicate.java" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/main/java/com/scrivenvar/preview/HTMLPreviewPane.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/scrivenvar/preview/HTMLPreviewPane.java" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/main/resources/com/scrivenvar/messages.properties" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/com/scrivenvar/messages.properties" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/main/resources/com/scrivenvar/settings.properties" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/com/scrivenvar/settings.properties" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/main/java/com/scrivenvar/editors/EditorPane.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/scrivenvar/editors/EditorPane.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
</state>
<state x="610" y="411" width="426" height="481" key="FileChooserDialogImpl/0.28.2560.1529@0.28.2560.1529" timestamp="1589659107517" />
- <state width="1573" height="321" key="GridCell.Tab.0.bottom" timestamp="1590854422007">
+ <state width="1573" height="321" key="GridCell.Tab.0.bottom" timestamp="1590855340611">
<screen x="0" y="28" width="2560" height="1529" />
</state>
- <state width="1573" height="321" key="GridCell.Tab.0.bottom/0.28.2560.1529@0.28.2560.1529" timestamp="1590854422007" />
- <state width="1573" height="321" key="GridCell.Tab.0.center" timestamp="1590854422007">
+ <state width="1573" height="321" key="GridCell.Tab.0.bottom/0.28.2560.1529@0.28.2560.1529" timestamp="1590855340611" />
+ <state width="1573" height="321" key="GridCell.Tab.0.center" timestamp="1590855340610">
<screen x="0" y="28" width="2560" height="1529" />
</state>
- <state width="1573" height="321" key="GridCell.Tab.0.center/0.28.2560.1529@0.28.2560.1529" timestamp="1590854422007" />
- <state width="1573" height="321" key="GridCell.Tab.0.left" timestamp="1590854422006">
+ <state width="1573" height="321" key="GridCell.Tab.0.center/0.28.2560.1529@0.28.2560.1529" timestamp="1590855340610" />
+ <state width="1573" height="321" key="GridCell.Tab.0.left" timestamp="1590855340610">
<screen x="0" y="28" width="2560" height="1529" />
</state>
- <state width="1573" height="321" key="GridCell.Tab.0.left/0.28.2560.1529@0.28.2560.1529" timestamp="1590854422006" />
- <state width="1573" height="321" key="GridCell.Tab.0.right" timestamp="1590854422007">
+ <state width="1573" height="321" key="GridCell.Tab.0.left/0.28.2560.1529@0.28.2560.1529" timestamp="1590855340610" />
+ <state width="1573" height="321" key="GridCell.Tab.0.right" timestamp="1590855340610">
<screen x="0" y="28" width="2560" height="1529" />
</state>
- <state width="1573" height="321" key="GridCell.Tab.0.right/0.28.2560.1529@0.28.2560.1529" timestamp="1590854422007" />
+ <state width="1573" height="321" key="GridCell.Tab.0.right/0.28.2560.1529@0.28.2560.1529" timestamp="1590855340610" />
<state width="1573" height="396" key="GridCell.Tab.1.bottom" timestamp="1590853741746">
<screen x="0" y="28" width="2560" height="1529" />
src/main/java/com/scrivenvar/editors/EditorPane.java
public class EditorPane extends AbstractPane {
- private StyleClassedTextArea editor;
- private VirtualizedScrollPane<StyleClassedTextArea> scrollPane;
+ private final StyleClassedTextArea mEditor =
+ new StyleClassedTextArea( false );
+ private final VirtualizedScrollPane<StyleClassedTextArea> mScrollPane =
+ new VirtualizedScrollPane<>( mEditor );
private final ObjectProperty<Path> path = new SimpleObjectProperty<>();
/**
* Set when entering variable edit mode; retrieved upon exiting.
*/
private InputMap<InputEvent> nodeMap;
+
+ public EditorPane() {
+ getScrollPane().setVbarPolicy( ScrollPane.ScrollBarPolicy.ALWAYS );
+ }
@Override
getEditor().moveTo( 0 );
getScrollPane().scrollYToPixel( 0 );
- }
-
- private void setEditor( final StyleClassedTextArea textArea ) {
- this.editor = textArea;
}
-
- public synchronized StyleClassedTextArea getEditor() {
- if( this.editor == null ) {
- setEditor( createTextArea() );
- }
- return this.editor;
+ public StyleClassedTextArea getEditor() {
+ return mEditor;
}
/**
* Returns the scroll pane that contains the text area.
*
* @return The scroll pane that contains the content to edit.
*/
- public synchronized VirtualizedScrollPane<StyleClassedTextArea> getScrollPane() {
- if( this.scrollPane == null ) {
- this.scrollPane = createScrollPane();
- }
-
- return this.scrollPane;
- }
-
- protected VirtualizedScrollPane<StyleClassedTextArea> createScrollPane() {
- final VirtualizedScrollPane<StyleClassedTextArea> pane
- = new VirtualizedScrollPane<>( getEditor() );
- pane.setVbarPolicy( ScrollPane.ScrollBarPolicy.ALWAYS );
-
- return pane;
- }
-
- protected StyleClassedTextArea createTextArea() {
- return new StyleClassedTextArea( false );
+ public VirtualizedScrollPane<StyleClassedTextArea> getScrollPane() {
+ return mScrollPane;
}
Delta21 lines added, 48 lines removed, 27-line decrease