Skip to content

Commit

Permalink
Merge pull request #333 from scenerygraphics/i2k-fixes-take-2
Browse files Browse the repository at this point in the history
#I2K2020 fixes, take 2
  • Loading branch information
skalarproduktraum authored Dec 2, 2020
2 parents b931062 + 033fc94 commit 52071e8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<!-- NB: Deploy releases to the SciJava Maven repository. -->
<releaseProfiles>deploy-to-scijava</releaseProfiles>

<scenery.version>5582fd1</scenery.version>
<scenery.version>5de0b1e</scenery.version>
<!-- <scijava-common.version>2.84.0</scijava-common.version>-->
<ui-behaviour.version>2.0.3</ui-behaviour.version>
<imagej-mesh.version>a40d46f</imagej-mesh.version>
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/sc/iview/Controls.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import org.scijava.ui.behaviour.ClickBehaviour
import sc.iview.commands.help.Help
import sc.iview.controls.behaviours.*
import sc.iview.controls.behaviours.Ruler
import java.io.File
import java.util.*
import java.util.function.Supplier
import kotlin.concurrent.thread
Expand Down Expand Up @@ -194,6 +195,9 @@ open class Controls(val sciview: SciView) {
val ruler = Ruler(sciview)
h.addBehaviour("ruler: keep the button pressed and drag with the mouse", ruler)
h.addKeyBinding("ruler: keep the button pressed and drag with the mouse", "E")

val configFile = File(System.getProperty("user.home")).resolve(".sciview.keybindings.yaml")
inputHandler.readFromFile(configFile)
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class LoadCremiDatasetAndNeurons: Command {
}
val files = ui.chooseFiles(null, emptyList(), filter, FileWidget.OPEN_STYLE)

val nai = readCremiHDF5(files.first().canonicalPath, 0.5)
val nai = readCremiHDF5(files.first().canonicalPath, 1.0)

if(nai == null) {
log.error("Could not get neuron IDs")
Expand All @@ -114,7 +114,7 @@ class LoadCremiDatasetAndNeurons: Command {

val volume = sciview.addVolume(nai.third, files.first().name) as? Volume
volume?.origin = Origin.FrontBottomLeft
volume?.scale = Vector3f(0.04f, 0.04f, 2.5f)
volume?.scale = Vector3f(0.08f, 0.08f, 5.0f)
volume?.transferFunction = TransferFunction.ramp(0.3f, 0.1f, 0.1f)
// min 20, max 180, color map fire

Expand Down

This file was deleted.

26 changes: 26 additions & 0 deletions src/main/java/sc/iview/commands/edit/settings/KeyBindings.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package sc.iview.commands.edit.settings

import org.scijava.command.Command
import org.scijava.plugin.Menu
import org.scijava.plugin.Parameter
import org.scijava.plugin.Plugin
import sc.iview.SciView
import sc.iview.commands.MenuWeights
import sc.iview.commands.MenuWeights.EDIT_SETTINGS
import sc.iview.commands.MenuWeights.EDIT_SETTINGS_BINDINGS

/**
* A command for interactively editing input controls.
* @author Vladimir Ulman
* @author Ulrik Guenther
*/
@Plugin(type = Command::class, menuRoot = "SciView", menu = [Menu(label = "Edit", weight = MenuWeights.EDIT), Menu(label = "Settings", weight = EDIT_SETTINGS), Menu(label = "Key Bindings", weight = EDIT_SETTINGS_BINDINGS)])
class KeyBindings : Command {

@Parameter
private lateinit var sciView: SciView

override fun run() {
sciView.publicGetInputHandler().openKeybindingsGuiEditor("SciView's Key bindings editor", ".sciview.keybindings.yaml", "all")
}
}

0 comments on commit 52071e8

Please sign in to comment.