Skip to content

Commit

Permalink
Formatting improvements - learning to use IntelliJ
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSNelson committed Jan 11, 2024
1 parent d2f734b commit 3fdd3ce
Show file tree
Hide file tree
Showing 8 changed files with 247 additions and 254 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: build
- uses: actions/upload-artifact@v3
with:
name: jar
path: build/libs
retention-days: 7
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: build
- uses: actions/upload-artifact@v3
with:
name: jar
path: build/libs
retention-days: 7
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# qp_scope

Controlling a microscope through some sort of python control interface (Pycromanager) and MicroManager
26 changes: 13 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
plugins {
// Main gradle plugin for building a Java library
//id 'java-library'
// Support writing the extension in Groovy (remove this if you don't want to)
id 'groovy'
// To create a shadow/fat jar that bundle up all dependencies
id 'com.github.johnrengelman.shadow' version '7.1.2'
// Include this plugin to avoid downloading JavaCPP dependencies for all platforms
id 'org.bytedeco.gradle-javacpp-platform'
// Main gradle plugin for building a Java library
//id 'java-library'
// Support writing the extension in Groovy (remove this if you don't want to)
id 'groovy'
// To create a shadow/fat jar that bundle up all dependencies
id 'com.github.johnrengelman.shadow' version '7.1.2'
// Include this plugin to avoid downloading JavaCPP dependencies for all platforms
id 'org.bytedeco.gradle-javacpp-platform'
}

//the module name
Expand Down Expand Up @@ -73,9 +73,9 @@ jar {
* Copy the LICENSE file into the jar... if we have one (we should!)
*/
processResources {
from ("${projectDir}/LICENSE") {
into 'licenses/'
}
from("${projectDir}/LICENSE") {
into 'licenses/'
}
}

/*
Expand Down Expand Up @@ -116,7 +116,7 @@ tasks.withType(Javadoc).configureEach {
* Specify that the encoding should be UTF-8 for source files
*/
tasks.named('compileJava') {
options.encoding = 'UTF-8'
options.encoding = 'UTF-8'
}

/*
Expand All @@ -141,7 +141,7 @@ repositories {
// Add this if you need access to dependencies only installed locally
mavenLocal()

flatDir{
flatDir {
dirs 'C:/ImageAnalysis/QPExtensionTest/BasicStitching/build/libs'
}

Expand Down
130 changes: 65 additions & 65 deletions src/main/groovy/qupath/ext/qp_scope/QP_scope.groovy
Original file line number Diff line number Diff line change
@@ -1,92 +1,92 @@
package qupath.ext.qp_scope;
package qupath.ext.qp_scope

import javafx.scene.control.MenuItem
import qupath.lib.common.Version;
import qupath.lib.gui.QuPathGUI
import qupath.lib.gui.extensions.QuPathExtension;
import qupath.ext.qp_scope.functions.*
import org.slf4j.LoggerFactory
import qupath.ext.qp_scope.functions.QP_scope_GUI
import qupath.lib.common.Version
import qupath.lib.gui.QuPathGUI
import qupath.lib.gui.extensions.QuPathExtension

/**
* Built from the QuPath extension template - an extension to control a microscope through a Python interface
*/
class QP_scope implements QuPathExtension {

// Setting the variables here is enough for them to be available in the extension
String name = "Microscopy in QuPath"
String description = "Interact with a microscope from QuPath via Python interfaces like PycroManager or PyMMCore"
Version QuPathVersion = Version.parse("v0.4.4")
// Setting the variables here is enough for them to be available in the extension
String name = "Microscopy in QuPath"
String description = "Interact with a microscope from QuPath via Python interfaces like PycroManager or PyMMCore"
Version QuPathVersion = Version.parse("v0.4.4")

// @Override
// void installExtension(QuPathGUI qupath) {
// qupath.installActions(ActionTools.getAnnotatedActions(new BSCommands(qupath)))
// addMenuItem(qupath)
// }
@Override
void installExtension(QuPathGUI qupath) {
addMenuItem(qupath)
@Override
void installExtension(QuPathGUI qupath) {
addMenuItem(qupath)

}
/**
* Get the description of the extension.
*
* @return The description of the extension.
*/
@Override
public String getDescription() {
return "Control a microscope!";
}

}
/**
* Get the description of the extension.
*
* @return The description of the extension.
*/
@Override
public String getDescription() {
return "Control a microscope!";
}
/**
* Get the name of the extension.
*
* @return The name of the extension.
*/
@Override
public String getName() {
return "qp_scope";
}

/**
* Get the name of the extension.
*
* @return The name of the extension.
*/
@Override
public String getName() {
return "qp_scope";
}
private void addMenuItem(QuPathGUI qupath) {
def logger = LoggerFactory.getLogger(QuPathGUI.class)
// Check for dependencies and QuPath version
logger.info("QuPath Version")
logger.info(getQuPathVersion().toString())
// TODO: how to check if version is supported?

private void addMenuItem(QuPathGUI qupath) {
def logger = LoggerFactory.getLogger(QuPathGUI.class)
// Check for dependencies and QuPath version
logger.info("QuPath Version")
logger.info(getQuPathVersion().toString())
// TODO: how to check if version is supported?
// Get or create the menu
def menu = qupath.getMenu("Extensions>${name}", true)

// Get or create the menu
def menu = qupath.getMenu("Extensions>${name}", true)
// First menu item
def qpScope1 = new MenuItem("Start qp_scope")
// TODO: tooltip
qpScope1.setOnAction(e -> {
// TODO: check preferences for all necessary entries
QP_scope_GUI.createGUI1()
})

// First menu item
def qpScope1 = new MenuItem("Start qp_scope")
// TODO: tooltip
qpScope1.setOnAction(e -> {
// TODO: check preferences for all necessary entries
QP_scope_GUI.createGUI1()
})
// Second menu item
def qpScope2 = new MenuItem("Second scan on existing annotations")
// TODO: tooltip
qpScope2.setOnAction(e -> {
// TODO: check preferences for all necessary entries
QP_scope_GUI.createGUI2()
})

// Second menu item
def qpScope2 = new MenuItem("Second scan on existing annotations")
// TODO: tooltip
qpScope2.setOnAction(e -> {
// TODO: check preferences for all necessary entries
QP_scope_GUI.createGUI2()
})
// Third menu item - "Use current image as macro view"
def qpScope3 = new MenuItem("Use current image as macro view")
// TODO: tooltip
qpScope3.setOnAction(e -> {
QP_scope_GUI.createGUI3()
})

// Third menu item - "Use current image as macro view"
def qpScope3 = new MenuItem("Use current image as macro view")
// TODO: tooltip
qpScope3.setOnAction(e -> {
QP_scope_GUI.createGUI3()
})
// Add the menu items to the menu
menu.getItems() << qpScope1
menu.getItems() << qpScope2
menu.getItems() << qpScope3
}

// Add the menu items to the menu
menu.getItems() << qpScope1
menu.getItems() << qpScope2
menu.getItems() << qpScope3
}


}
//@ActionMenu("Extensions")
//public class BSCommands {
Expand Down
Loading

0 comments on commit 3fdd3ce

Please sign in to comment.