Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review pull request #1

Open
wants to merge 212 commits into
base: review
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 107 commits
Commits
Show all changes
212 commits
Select commit Hold shift + click to select a range
fd97ead
compiles, shows test window
kaeaton Jan 18, 2021
eca4785
add tabbed layout, start tab 1
kaeaton Jan 19, 2021
90a1e42
Add beginning of preferences
kaeaton Mar 1, 2021
125e496
Restructure into microkernal architecture
kaeaton Mar 1, 2021
18a722c
Merge branch 'GfeSearchView' into preferences
kaeaton Mar 1, 2021
b2303ae
clean up Prefs file
kaeaton Mar 15, 2021
393d3d5
create debug tab, add textarea
kaeaton Mar 15, 2021
e9f9340
add css to debug tab
kaeaton Mar 15, 2021
ff03afe
Consume an API without request or headers
kaeaton Mar 22, 2021
b476fab
Add PrefsTest
kaeaton Jun 2, 2021
6e940ad
Re-enable app launch
kaeaton Jun 2, 2021
627f74a
Move Prefs files from utilities to utilities.preference
kaeaton Jun 8, 2021
ec21d43
add Strings to Pref tests
kaeaton Jun 9, 2021
f77c94a
Diversify string testing
kaeaton Jun 9, 2021
041218b
Clean up PrefsTest
kaeaton Jun 9, 2021
2d1fa14
Add Boolean setter and getter, JavaDoc
kaeaton Jun 9, 2021
8c73dd3
Add testing for boolean prefs
kaeaton Jun 9, 2021
fcd1c9f
Fix PreferenceManager JavaDoc
kaeaton Jun 14, 2021
5dad02c
Merge in existing layout changes
kaeaton Jun 14, 2021
8d0ce98
Center single GFE block
kaeaton Jun 21, 2021
999e902
Test padding for GFE boxes
kaeaton Jun 22, 2021
25120c3
Add default prefs testing
kaeaton Jun 22, 2021
ca507d2
Add font to root stage
Jun 23, 2021
cdc27f7
Add TornadoFX test layout
kaeaton Jun 25, 2021
57d7525
Add working test app
kaeaton Jun 26, 2021
8fac900
create test app
kaeaton Jul 2, 2021
7644f73
Add Gfe data class
kaeaton Jul 2, 2021
6858e08
Add default values to GFE data class
kaeaton Jul 2, 2021
083b279
Add array empty test
kaeaton Jul 6, 2021
b46f34b
Add test for searchbox generators
kaeaton Jul 6, 2021
008748f
GFESearchBoxes generates search box sets
kaeaton Jul 6, 2021
b2e5ac2
Add when block to GFESearchBox labelGenerator
kaeaton Jul 7, 2021
dc14aaf
Remove labelGenerator in favor of text concatenation
kaeaton Jul 7, 2021
9b79e7b
Move components into groups for alignment
kaeaton Jul 7, 2021
6264b93
Text appears in the middle of the textfields
kaeaton Jul 7, 2021
a27877b
Add data class for layout data
kaeaton Jul 8, 2021
9b5beb1
Fix alignment for check all and longer locus name
kaeaton Jul 8, 2021
0cfbaf9
Check all box checks and unchecks other checkboxes
kaeaton Jul 12, 2021
8e3bebf
Tweak alignment
kaeaton Jul 12, 2021
17e335b
Add HLA enum with exon count
kaeaton Jul 12, 2021
ca0ada4
Fix label alignment
kaeaton Jul 13, 2021
57ed53b
Clean up testing files
kaeaton Jul 13, 2021
393934f
Populate locus dropdown with HLA Loci
kaeaton Jul 13, 2021
3a3ca4b
Set pref for open tab attempt
kaeaton Jul 17, 2021
34ef263
Add ReadLocalData class and tests
kaeaton Jul 17, 2021
50c9b25
changeLoci function passes test
kaeaton Jul 17, 2021
ccb9444
Add directory management tools and tests
kaeaton Jul 18, 2021
ac8a28e
Add some KDoc
kaeaton Jul 18, 2021
e9e2af8
Clean up directory management & testing
kaeaton Jul 22, 2021
b3fe3ef
Add filemanagement utility & testing
kaeaton Jul 22, 2021
ceed881
Complete folder management utilities, pass all tests
kaeaton Jul 22, 2021
8e6087d
Add createFile method, expand its testing
kaeaton Jul 27, 2021
b476243
Create file & create folder do not overwrite
kaeaton Aug 5, 2021
dae4fa9
Move method for file structure to new class
kaeaton Aug 5, 2021
6f6b15b
Create data file passes tests
kaeaton Aug 6, 2021
eca8a83
Clean up fileManagementTest
kaeaton Aug 10, 2021
3efef28
Make LociLocations an object
kaeaton Aug 10, 2021
0ca980b
Download version data
kaeaton Aug 10, 2021
13625a7
convert version data to JsonArray
kaeaton Aug 11, 2021
817e8ad
Create objects for HLA and version data management
kaeaton Aug 13, 2021
97d7046
Add delete file utility
kaeaton Aug 14, 2021
6d78f3b
Add clarifying comment
kaeaton Aug 14, 2021
15631a9
Remove unneeded class and test
kaeaton Aug 14, 2021
272e43d
Add exon count object
kaeaton Aug 14, 2021
b38900a
Fix text alignment, pre-fill workshop status
kaeaton Aug 15, 2021
61e1249
Add hard reset for GFE text/check arrays
kaeaton Aug 17, 2021
9ab2769
Stop stack overflows, soft reset working
kaeaton Aug 18, 2021
209e7f2
Test seg fault status on another machine
kaeaton Aug 23, 2021
a0aeefd
Convert to Java 11, stack overflows seem to have stopped
kaeaton Aug 25, 2021
d28ec6a
Back down from Kotlin 1.5.30 to 1.5.0, allows compiling
kaeaton Aug 30, 2021
d806fd9
Test button running softReset appropriately
kaeaton Aug 30, 2021
d2d54d2
GFE search check all behaving properly
kaeaton Aug 30, 2021
56ccffe
Dropdown change replaces current search boxes
kaeaton Aug 31, 2021
c9e2e8d
Fix style error
kaeaton Aug 31, 2021
71cdaa3
Begin migration to TornadoFX prefs
Aug 31, 2021
5aff0b2
Program remembers last selected locus
kaeaton Sep 2, 2021
c97fa4b
Can delete all preferences
kaeaton Sep 5, 2021
7fab261
Can download and add versions to appropriate loci
kaeaton Sep 5, 2021
487f18b
Add Dokka to file and directory management utilities
kaeaton Sep 5, 2021
718a13b
Refactor downloading version data
kaeaton Sep 5, 2021
e54236f
add Kotlin version of java-diff-utils
kaeaton Sep 22, 2021
8ba90b5
Refactor LocusComboBox to GfeSearch plugin
kaeaton Sep 27, 2021
b8bfa3f
Add GfeSearch version combobox, stores pref
kaeaton Sep 27, 2021
ece5a0b
Versions dropdown reads data from versions.txt
kaeaton Sep 28, 2021
efa95ec
Can find available versions as strings
kaeaton Sep 28, 2021
84c3379
Local and online versions appear on version list
kaeaton Oct 3, 2021
d2bf9c7
Prep for swapping locus comboboxes
kaeaton Oct 11, 2021
82523d8
Not compiling, moving on to new approach
kaeaton Oct 18, 2021
fe96ef3
Reads local versions
kaeaton Oct 25, 2021
6466f92
Begin adding state pattern for loci switching
kaeaton Oct 25, 2021
76eb3d2
State pattern switching working, does not update
kaeaton Oct 27, 2021
b05d3d6
Changes versions based on state
kaeaton Nov 1, 2021
dbbacf3
Move genes to enumeration
kaeaton Nov 1, 2021
e3ba611
Reorganizing to add state pattern first at the tab level, then within…
kaeaton Nov 10, 2021
326b308
Add State pattern and loci dropdown, refactoring
kaeaton Dec 9, 2021
01547ca
No longer creating duplicate version comboboxes
kaeaton Dec 27, 2021
8b27d11
Resets preferences without breaking
kaeaton Dec 28, 2021
d4f0905
Populates locus menu from enumeration
kaeaton Dec 28, 2021
861a2af
Updates search boxes, but not name label
kaeaton Dec 28, 2021
7c463a2
Updates Label when refreshing GFE search boxes
kaeaton Dec 28, 2021
a4fa64b
Name refactor for clarity
kaeaton Dec 31, 2021
acad326
Gfe search version choicebox updates properly
kaeaton Dec 31, 2021
b839040
Refactor locus choicebox so it can be updated
kaeaton Jan 1, 2022
076b47d
Changing Loci updates version and locus choiceboxes, and searchboxes
kaeaton Jan 1, 2022
b7e12ec
Code clean up
kaeaton Jan 1, 2022
19bab36
More code clean up
kaeaton Jan 2, 2022
bfbe7bd
Checks for internet access at launch and by request
kaeaton Jan 2, 2022
bb81fa7
KIR search boxes skip appropriate features
kaeaton Jan 7, 2022
3f2f53a
Remove unnecessary function from KirLoci
kaeaton Jan 10, 2022
5de5645
Add table
Jan 10, 2022
e3d1f15
Add new table example
Jan 14, 2022
290fb04
KIR loci now grey out skipped exons
kaeaton Jan 20, 2022
391b5a8
Textfields now screen for ints
kaeaton Jan 20, 2022
0b60869
Add check for internet access before downloading
kaeaton Jan 21, 2022
ba7689e
Screens out .DS_Store files
kaeaton Feb 3, 2022
385d09b
changing version changes what locus are available
kaeaton Feb 4, 2022
fbbfde6
Starts with correct locus list
kaeaton Feb 4, 2022
634da3c
Clean up locus and loci code, still need to finish version
kaeaton Feb 4, 2022
51cf8c0
Version dropdown uses interface
kaeaton Feb 7, 2022
de7fdab
Can start JavaFX in test files
kaeaton Feb 8, 2022
1aeaf29
TDD development of BuildRegexString, not complete
kaeaton Feb 8, 2022
4ce50b1
More TDD of BuildRegexString, not complete
kaeaton Feb 8, 2022
0317693
Stuck trying to throw IllegalArgumentException
kaeaton Feb 9, 2022
e58b333
Most regex working for search string
kaeaton Feb 11, 2022
591050c
Close regex string working properly
kaeaton Feb 12, 2022
67eec68
Make requested changes
kaeaton Feb 12, 2022
7cac51e
Generates GFE Search refex string
kaeaton Feb 14, 2022
1a3750a
Generates GFE Search header string
kaeaton Feb 14, 2022
9503567
Begin adding SearchData object
kaeaton Feb 14, 2022
18e90e5
clean up main.kt
kaeaton Feb 15, 2022
6f9fdb3
Create object to generate new GfeSearchData objects
kaeaton Feb 16, 2022
6581b59
Append data source file to GfeSearchData
kaeaton Feb 18, 2022
59dd580
Build setup and takedown for FilterDataTest
kaeaton Feb 20, 2022
01d6769
Add textArea to print non-data information to
kaeaton Feb 21, 2022
94321d4
Prints internet status to Info TextArea on start
kaeaton Feb 22, 2022
b48fee1
Move loci info from GFE layout data to GFE state pattern
kaeaton Feb 23, 2022
e5dabc3
Move version info from GFE layout data to GFE state pattern
kaeaton Feb 24, 2022
af28258
Prefs now use LociEnum.fullName (instead of name)
kaeaton Feb 27, 2022
dfa91f1
Dokka now compiles. (add Dokka to plugins.)
kaeaton Feb 28, 2022
30c428d
Create KIR and HLA Version Objects
kaeaton Mar 1, 2022
36df77a
Restructure to fix replacing search textfields
kaeaton Mar 23, 2022
dca73ce
Add citation information
kaeaton Mar 27, 2022
a052f4c
Merge branch 'searchData' of github.com:kaeaton/GSG-Kotlin into main
kaeaton Mar 30, 2022
22e3c23
Disable unimplemented tabs
kaeaton Mar 30, 2022
d5122ea
Add name tab
kaeaton Apr 16, 2022
06b1339
Merge branch 'main' of github.com:kaeaton/GSG-Kotlin into searchData
kaeaton Apr 16, 2022
f9da5a0
Clean up name search States
kaeaton Apr 16, 2022
b30e8cb
setup testing for pattern matching
kaeaton Apr 17, 2022
59057e2
Core can filter data for desired results
kaeaton Apr 19, 2022
bf5710b
Name search regex working
kaeaton Apr 19, 2022
835d78c
add event bus for namesearch results, still debugging
kaeaton Apr 20, 2022
6e1dfcd
Name search printing results to GUI
kaeaton Apr 21, 2022
180622f
GFE search printing results to GUI
kaeaton Apr 21, 2022
3341b56
Presentation snapshot
kaeaton Apr 27, 2022
9ecac96
Clean up merge
kaeaton May 5, 2022
6a7c95c
add JFX panels to load JavaFX
kaeaton May 5, 2022
7c91534
update Kotlin version
kaeaton Jun 14, 2022
5122963
upgrade to Kotlin 1.7
kaeaton Jun 14, 2022
b1d9e1b
Add ability to test db connection to options
kaeaton Aug 8, 2022
f3a0824
Update Gradle
kaeaton Nov 21, 2022
b6bc35b
Fix build.gradle.kts
kaeaton Nov 21, 2022
f75e74b
Install the CodeSee workflow. Learn more at https://docs.codesee.io
Mar 1, 2023
bef2857
Merge pull request #8 from kaeaton/codesee-arch-diagram-workflow-1677…
kaeaton Mar 1, 2023
8293bb3
Security upgrades, Ktor changes
kaeaton May 8, 2023
4c8f3cb
Can identify internet state once
kaeaton May 9, 2023
e9852c9
Java InternetAccess can't see Kotlin objects
kaeaton May 9, 2023
afff237
Fixed so it launches again
kaeaton Aug 2, 2023
1a3c23f
Upgraded JavaFX v 20 and TornadoFX v 2
kaeaton Aug 14, 2023
8e4f8c5
Shows most recent version on launch
kaeaton Aug 14, 2023
c17da9e
Gui doesn't blow up, label working
kaeaton Aug 17, 2023
01ba0c3
Edit GFE view classes for clarity
kaeaton Aug 17, 2023
217f25c
More name clarification
kaeaton Aug 20, 2023
19ef563
GFE Search GUI working againgit add .
kaeaton Aug 21, 2023
a82f902
Merge branch 'tornadofx2': Successfully upgraded to TornadoFX 2, allo…
kaeaton Aug 21, 2023
f167435
Begin lociStateGfeSearch testing
kaeaton Aug 22, 2023
87f319b
Fix Version change to show locus
kaeaton Aug 22, 2023
da14823
Moved some files for clarity
kaeaton Aug 24, 2023
8501bc2
Restructure more core model for clarity
kaeaton Aug 24, 2023
eb3fd8f
Add output file interface & implementations
kaeaton Aug 24, 2023
699b9d1
More Gfe data output inheritence work
kaeaton Aug 24, 2023
8a45977
fix a typo so csv file isn't tsv
kaeaton Aug 24, 2023
a8a99f1
Adding tests not going great
kaeaton Aug 27, 2023
7067b2c
Doesn't erase search terms when submitting
kaeaton Aug 27, 2023
0c26179
Enter on textfield or checkbox = submit
kaeaton Aug 27, 2023
7b0233e
Extend change to KIR searchboxes
kaeaton Aug 27, 2023
b7aca32
HLA-A works on boot
kaeaton Aug 28, 2023
a62f286
hide unfinished tabs
kaeaton Aug 28, 2023
1457d33
Prepping for compilation
kaeaton Sep 1, 2023
e21516a
Download versions & GFEs to debug tab
kaeaton Sep 3, 2023
268929f
Fix check for internet
kaeaton Sep 4, 2023
9e5e7c9
Cleanup, add Dokka
kaeaton Sep 4, 2023
dfcb3e3
Can generate csv/tsv results files
kaeaton Sep 5, 2023
a5a9032
File save options in gfe tab
kaeaton Sep 6, 2023
df8fd9e
Fighting with tableView
kaeaton Sep 6, 2023
fa4397d
Checks internet (and versions) at start
kaeaton Sep 6, 2023
2bb9cef
Version list managed by tab state pattern for all tabs
kaeaton Sep 7, 2023
559cb0c
Tweak new version indicator
kaeaton Sep 9, 2023
a555e50
Move App class into mainKt
kaeaton Sep 9, 2023
51e61fe
Save current gradle
kaeaton Sep 10, 2023
82e759f
Turns out I needed those javaFX modules
kaeaton Sep 10, 2023
e0ea07a
It builds and runs
kaeaton Sep 11, 2023
2ed4161
Compiles to fat jar
kaeaton Sep 11, 2023
b5afd9d
Update Name Search, still trying to download GFEs
kaeaton Sep 13, 2023
2bd81d6
little fixes and changes, output headers
kaeaton Sep 15, 2023
66369fb
Update README.md
kaeaton Nov 13, 2023
5ef48ad
Update Name Search, still trying to download GFEs
kaeaton Sep 13, 2023
4f7b8fc
little fixes and changes, output headers
kaeaton Sep 15, 2023
7c260f2
compiles again
kaeaton Jan 17, 2024
3b2a24d
Merge remote-tracking branch 'refs/remotes/origin/main'
kaeaton Jan 18, 2024
810f059
update .gitignore
kaeaton Jan 18, 2024
b87e00f
Throws error, no crash when no data on submit.
kaeaton Jan 24, 2024
a4ed50f
Fixed crash on boot w/out data
kaeaton Feb 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
.gradle
#build/
build
*.pages

# Ignore Gradle GUI config
gradle-app.setting
Expand All @@ -15,5 +16,5 @@ gradle-app.setting
# gradle/wrapper/gradle-wrapper.properties

# IDE
.idea/
.idea
*.iml
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
GFE Search Generator
====================

There are currently tens of thousands of known variants of the Human Leukocyte Antigen (HLA) genes, the genes most responsible for transplant success or failure, with new variants (known as “alleles”) being discovered and “named” every day. The current names give very little information about the structure of the proteins encoded by these genes, and in 2015, Dr. Steven Mack proposed a new naming convention called Gene Feature Enumeration (GFE). New tools are required to use the new GFE naming convention, including (1) the ability to switch between the HLA allele names and the GFE names, (2) search through the GFE names, and (3) assign GFE names to new alleles.
ellenspertus marked this conversation as resolved.
Show resolved Hide resolved

The project is built using Kotlin 1.4.0, JVM 11, OpenJavaFX 0.0.9, and TornadoFX 1.7.20, bundled together with Gradle 6.7.1.
kaeaton marked this conversation as resolved.
Show resolved Hide resolved
76 changes: 57 additions & 19 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,33 +1,71 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version "1.4.0"
id 'application'
kotlin("jvm") version "1.5.30"
application
id("org.openjfx.javafxplugin") version "0.0.9"
kotlin("plugin.serialization") version "1.5.0"
}
group = 'com.test'
version = '1.0-SNAPSHOT'

application { mainClassName = "org.b12x.gfe.MainKt" }

repositories {
mavenCentral()
jcenter()
maven("https://plugins.gradle.org/m2/")
maven("https://dl.bintray.com/kotlin/kotlin-eap")
}

javafx {
version = "11.0.2"
modules = ['javafx.controls', 'javafx.fxml']
}
dependencies {
// Kotlin standard library
implementation(kotlin("stdlib-jdk8"))
implementation( "org.jetbrains.kotlin:kotlin-reflect:1.5.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
implementation("io.ktor:ktor-client-core:1.6.7")
implementation("io.ktor:ktor-client-cio:1.6.7")

// TornadoFX dependency
implementation("no.tornado:tornadofx:1.7.20")

// API tools
implementation("com.squareup.okhttp3:okhttp:4.9.1")
implementation("com.squareup.okio:okio:2.10.0")

// JSON parsing
kaeaton marked this conversation as resolved.
Show resolved Hide resolved
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.12.3")
implementation("com.beust:klaxon:5.5")

//Text comparison
kaeaton marked this conversation as resolved.
Show resolved Hide resolved
// https://mvnrepository.com/artifact/io.github.java-diff-utils/java-diff-utils
implementation("io.github.java-diff-utils:java-diff-utils:4.11")


kaeaton marked this conversation as resolved.
Show resolved Hide resolved
// RxJava for Kotlin
implementation("io.reactivex.rxjava3:rxkotlin:3.0.1")

// JUnit 5 for testing
testImplementation("org.junit.jupiter:junit-jupiter:5.7.0")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.7.0")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.7.0")

// Mockito
testImplementation("org.mockito:mockito-core:3.8.0")
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0")

application {
mainClassName = "edu.ucsf.MainKt"
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "no.tornado:tornadofx:$tornadofx_version"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit"
}

compileKotlin {
// JavaFX module to include
javafx { modules("javafx.controls", "javafx.fxml", "javafx.graphics") }

// Set Kotlin/JVM target versions
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "11"
kotlinOptions.languageVersion = "1.5"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "11"
}

// Use JUnit
tasks.test { useJUnitPlatform() }

// Be sure to use latest Gradle version
tasks.named<Wrapper>("wrapper") { gradleVersion = "6.7.1" }

File renamed without changes.
8 changes: 8 additions & 0 deletions local.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## This file must *NOT* be checked into Version Control Systems,
kaeaton marked this conversation as resolved.
Show resolved Hide resolved
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Sun Jan 02 09:33:44 PST 2022
sdk.dir=/Users/EatonK/Library/Android/sdk
2 changes: 0 additions & 2 deletions settings.gradle

This file was deleted.

2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rootProject.name = "GSG"

19 changes: 19 additions & 0 deletions src/main/java/org/b12x/gfe/utilities/preference/ClearPrefs.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.b12x.gfe.utilities.preference;

import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;

public class ClearPrefs {

private static final Preferences preferences = Preferences.userNodeForPackage(PrefsManager.class);

public ClearPrefs() { }

/**
* Clears all program preferences.
*
ellenspertus marked this conversation as resolved.
Show resolved Hide resolved
*/
public static void clearAllPrefs() throws BackingStoreException {
preferences.clear();
}
}
85 changes: 85 additions & 0 deletions src/main/java/org/b12x/gfe/utilities/preference/PrefsManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
package org.b12x.gfe.utilities.preference;

import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;

public class PrefsManager {

private static final Preferences preferences = Preferences.userNodeForPackage(PrefsManager.class);

private PrefsManager() {
}

/**
* Sets the integer value of the named preference.
*
* @param name the preference to be set
* @param newInt the value to be set
*/
public static void setPrefInt(String name, int newInt) {
preferences.putInt(name, newInt);
}

/**
* Gets the integer value of the named preference.
* Returns zero by default.
ellenspertus marked this conversation as resolved.
Show resolved Hide resolved
*
* @param name the preference to be retrieved
* @return the stored integer
*/
public static int getPrefInt(String name) {
return preferences.getInt(name, 1);
kaeaton marked this conversation as resolved.
Show resolved Hide resolved
}

/**
* Sets the string value of the named preference.
*
* @param name the preference to be set
* @param newString the value to be set
*/
public static void setPrefString(String name, String newString) {
preferences.put(name, newString);
}

/**
* Gets the string value of the named preference.
* Returns the string "HLA-A" by default.
kaeaton marked this conversation as resolved.
Show resolved Hide resolved
*
* @param name the preference to be retrieved
* @return the stored string
*/
public static String getPrefString(String name) {
return preferences.get(name, "HLA-A");
}

/**
* Sets the boolean value of the named preference.
*
* @param name the preference to be set
* @param newBoolean the value to be set
*/
public static void setPrefBoolean(String name, Boolean newBoolean) {
preferences.putBoolean(name, newBoolean);
}

/**
* Gets the boolean value of the named preference.
* Returns false by default.
*
* @param name the preference to be retrieved
* @return the stored boolean
*/
public static Boolean getPrefBoolean(String name) {
return preferences.getBoolean(name, false);
}

/**
* Removes the named preference.
*
* @param name preference to be removed
*/
public static void wipePref(String name) throws BackingStoreException {
preferences.remove(name);
preferences.flush();
}
}
6 changes: 0 additions & 6 deletions src/main/kotlin/edu/ucsf/MyApp.kt

This file was deleted.

21 changes: 0 additions & 21 deletions src/main/kotlin/edu/ucsf/Styles.kt

This file was deleted.

7 changes: 0 additions & 7 deletions src/main/kotlin/edu/ucsf/main.kt

This file was deleted.

12 changes: 0 additions & 12 deletions src/main/kotlin/edu/ucsf/view/MainView.kt

This file was deleted.

17 changes: 17 additions & 0 deletions src/main/kotlin/org/b12x/gfe/GSG.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.b12x.gfe

import javafx.stage.Stage
import org.b12x.gfe.core.view.MainView
import org.b12x.gfe.plugins.gfesearch.view.GfeSearchLayoutData
import tornadofx.App
import tornadofx.Stylesheet.Companion.label

class GSG: App(MainView::class, Styles::class) {
override fun start(stage: Stage) {
super.start(stage)
stage.width = 1150.0
stage.height = 800.0

kaeaton marked this conversation as resolved.
Show resolved Hide resolved
}

}
40 changes: 40 additions & 0 deletions src/main/kotlin/org/b12x/gfe/Styles.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package org.b12x.gfe

import javafx.scene.text.Font
import javafx.scene.text.Font.font
import javafx.scene.text.FontWeight
import javafx.scene.text.TextAlignment
import tornadofx.*

class Styles : Stylesheet() {
companion object {
val heading by cssclass()
val textAreas by cssclass()
}

init {

root {
prefHeight = 600.px
prefWidth = 1000.px
fontFamily = "sansserif"
}

textAreas {
padding = box(20.px)
prefWidth = 760.px
prefHeight = 300.px
}

textField {
prefWidth = 25.px
// borderWidth += box(30.px, 30.px, 30.px, 30.px)
}

label and heading {
// padding = box(100.px)
fontSize = 20.px
fontWeight = FontWeight.BOLD
}
}
}
15 changes: 15 additions & 0 deletions src/main/kotlin/org/b12x/gfe/core/controller/PrefsCore.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.b12x.gfe.core.controller

import org.b12x.gfe.GSG
import org.b12x.gfe.plugins.gfesearch.controller.locistategfesearch.PrefsGfeSearch
import java.util.prefs.Preferences

object PrefsCore {
var prefs: Preferences = Preferences.userNodeForPackage(GSG::class.java)

fun nuclearOption() {
prefs.removeNode()
ellenspertus marked this conversation as resolved.
Show resolved Hide resolved
prefs = Preferences.userNodeForPackage(GSG::class.java)
PrefsGfeSearch.prefs = prefs
}
}
19 changes: 19 additions & 0 deletions src/main/kotlin/org/b12x/gfe/core/controller/loci/HlaLoci.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.b12x.gfe.core.controller.loci

enum class HlaLoci(override val fullName: String, override val exons: Int) : LociEnum {
A("HLA-A", 8),
B("HLA-B", 7),
C("HLA-C", 8),
DPA1("HLA-DPA1", 4),
DPB1("HLA-DPB1", 5),
DQA1("HLA-DQA1", 4),
DQB1("HLA-DQB1", 6),
DRB1("HLA-DRB1", 6),
DRB3("HLA-DRB3", 6),
DRB4("HLA-DRB4", 6),
DRB5("HLA-DRB5", 6);

override fun toString(): String {
kaeaton marked this conversation as resolved.
Show resolved Hide resolved
return fullName
kaeaton marked this conversation as resolved.
Show resolved Hide resolved
}
}
Loading