Skip to content

Commit

Permalink
Merge pull request #17 from cschar/features/2023.1-update
Browse files Browse the repository at this point in the history
Features/2023.1 update
  • Loading branch information
cschar committed Mar 19, 2023
2 parents 5cfdb8b + 34f396f commit e6845de
Show file tree
Hide file tree
Showing 49 changed files with 1,728 additions and 1,311 deletions.
18 changes: 18 additions & 0 deletions README_dev_refactor.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ links to
[2] https://github.com/krasa/StringManipulation/commit/08422d714ce70126093c051bd5147c8f9dbcdd3f



## DIAGNOSTICS
#com.cschar.pmode3:all

## TESTS

[ ] - robotUI test: make a test to load settings UI when it is disabled, check if checkboxes are disabled
Expand All @@ -27,9 +31,23 @@ links to

## BUGS ?


-- Dyanmic Plugin memory when shutting down
-- HeapDump debug with VisualVM, start VM with same JDK that Sandbox IDe is running
-- Use VisualVMPlugin extension tool to start it with same JDK
-- When stopping with CTRL+SHIFT+Z.... particles/dinos still float away instead of immediatly disappearing
-- in Droste, moving caret with arrow keys doesnt resize cover

## upgrade
put docs on astro site
https://docs.astro.build/en/guides/deploy/github/


/opt/jdk/11/bin/javadoc \
-docletpath -docletpath ./build/classes/java/main \
-doclet com.cschar.pmode3.MyDoclet \
src/main/java/com/cschar/pmode3/MyDoclet.java

-docletpath -docletpath ./build/classes/java/main \
-doclet com.cschar.pmode3.MyTagScannerDoclet \
src/main/java/com/cschar/pmode3/MyTagScannerDoclet.java
65 changes: 21 additions & 44 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import jdk.javadoc.doclet.Doclet
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML
import org.gradle.api.tasks.testing.TestResult.ResultType
Expand All @@ -6,7 +7,7 @@ fun properties(key: String) = providers.gradleProperty(key)
fun environment(key: String) = providers.environmentVariable(key)

plugins {

//Gradle Test Output
id("com.adarshr.test-logger") version "3.2.0"

// Java support
Expand Down Expand Up @@ -76,10 +77,13 @@ intellij {
version.set(properties("platformVersion"))
type.set(properties("platformType"))

// instrumentCode.set(false)

// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins.set(properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) })
}


// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
groups.empty()
Expand All @@ -99,11 +103,26 @@ kover.xmlReport {
onCheck.set(true)
}




tasks {

// https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#tasks-buildsearchableoptions
buildSearchableOptions {
// enabled = false
}

wrapper {
gradleVersion = properties("gradleVersion").get()
}

runIde {
maxHeapSize = "4g"
systemProperties["idea.log.debug.categories"] = "#com.cschar.pmode3"
systemProperties["idea.log.trace.categories"] = "#com.cschar.pmode3"
}

jar {
// https://docs.gradle.org/current/userguide/more_about_tasks.html
// https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html#org.gradle.api.tasks.bundling.Jar:archiveBaseName
Expand Down Expand Up @@ -148,49 +167,9 @@ tasks {
// custom gradle test config: https://stackoverflow.com/a/59022129/5198805
// https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html
test {

// we can specify to use Junit5... above
// but still have normal Junit4 tests working
// https://www.baeldung.com/junit-5-gradle#enabling-support-for-old-versions.
useJUnitPlatform()


outputs.upToDateWhen { false }
testLogging.showStandardStreams = true
//
// // https://stackoverflow.com/a/69840376/5198805
testLogging {
showCauses = false
showExceptions = false
showStackTraces = false

val ansiReset = "\u001B[0m"
val ansiGreen = "\u001B[32m"
val ansiRed = "\u001B[31m"
val ansiYellow = "\u001B[33m"

fun getColoredResultType(resultType: ResultType): String {
return when (resultType) {
ResultType.SUCCESS -> "$ansiGreen $resultType $ansiReset"
ResultType.FAILURE -> "$ansiRed $resultType $ansiReset"
ResultType.SKIPPED -> "$ansiYellow $resultType $ansiReset"
}
}

afterTest(
KotlinClosure2({ desc: TestDescriptor, result: TestResult ->
println("${desc.className} | ${desc.displayName} = ${getColoredResultType(result.resultType)}")
})
)

afterSuite(
KotlinClosure2({ desc: TestDescriptor, result: TestResult ->
if (desc.parent == null) {
println("Result: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)")
}
})
)
}
}

// Configure UI tests plugin
Expand All @@ -204,9 +183,7 @@ tasks {



// buildSearchableOptions {
// enabled = false
// }


runPluginVerifier {
ideVersions.set(listOf(properties("pluginVerifierIdeVersions").get()))
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ pluginGroup = com.github.cschar.pmode3
pluginName = power-mode-zeranthium
pluginRepositoryUrl = https://github.com/cschar/power-mode-zeranthium
# SemVer format -> https://semver.org
pluginVersion = 3.2.0-eap
pluginVersion = 3.2.0-eap.2

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 231
pluginUntilBuild = 231.*

# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType = IC
#platformVersion = 231-EAP-SNAPSHOT
platformVersion = LATEST-EAP-SNAPSHOT
#platformVersion = 231-EAP-SNAPSHOT
#platformVersion = 2022.3

pluginVerifierIdeVersions = 2023.1
Expand Down
53 changes: 35 additions & 18 deletions src/main/java/com/cschar/pmode3/ParticleContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@

package com.cschar.pmode3;

import com.cschar.pmode3.actionHandlers.MyCaretListener;
import com.cschar.pmode3.config.*;
import com.cschar.pmode3.config.common.SpriteDataAnimated;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.event.CaretListener;
import com.intellij.openapi.util.Disposer;

import javax.swing.*;
import java.awt.*;
Expand All @@ -32,25 +36,46 @@
*
* Modified by cschar
*/
public class ParticleContainer extends JComponent implements ComponentListener {
public class ParticleContainer extends JComponent implements ComponentListener, Disposable {
private static final Logger LOGGER = Logger.getInstance(ParticleContainer.class);

private final JComponent parent;
public final JComponent parentJComponent;
private final Editor editor;
private boolean shakeDir;
private ConcurrentLinkedQueue<Particle> particles = new ConcurrentLinkedQueue<Particle>();

// private ArrayList<Particle> particles = new ArrayList<>(50);

private CaretListener myCaretListener;
public ParticleContainer(Editor editor) {
this.editor = editor;
parent = this.editor.getContentComponent();
parent.add(this);
parentJComponent = this.editor.getContentComponent();
parentJComponent.add(this);
updateBounds();
setVisible(true);
parent.addComponentListener(this);
parentJComponent.addComponentListener(this);

myCaretListener = new MyCaretListener();
MyCaretListener.enabled = true; //TODO make this non-static wtf lol
editor.getCaretModel().addCaretListener(myCaretListener);
}

@Override
public void dispose() {
LOGGER.debug("Particle instance disposing..." + this);
this.cleanupReferences();
}

public void cleanupReferences() {
LOGGER.trace("Removing JComponent Listener");
parentJComponent.removeComponentListener(this);
parentJComponent.remove(this);
LOGGER.trace("Removing Caret Listener");
editor.getCaretModel().removeCaretListener(this.myCaretListener);
}



public void addExternalParticle(Particle p){
this.particles.add(p);
}
Expand Down Expand Up @@ -126,7 +151,7 @@ public void addParticle(int x, int y, PowerMode3 settings) {


if (settings.getSpriteTypeEnabled(PowerMode3.ConfigType.BASIC_PARTICLE)) {
LOGGER.debug("adding basic_particle");
// LOGGER.debug("adding basic_particle");

int maxSize = settings.BASIC_PARTICLE.maxParticleSize;
Color basicColor = settings.BASIC_PARTICLE.basicColor;
Expand Down Expand Up @@ -156,7 +181,7 @@ public void addParticle(int x, int y, PowerMode3 settings) {
}

if(settings.getSpriteTypeEnabled(PowerMode3.ConfigType.TAP_ANIM)){
LOGGER.trace("adding tap_anim");
// LOGGER.trace("adding tap_anim");

ParticleSpriteTapAnim.updateCursor(this.editor, x, y);
ParticleSpriteTapAnim.incrementFrame(this.editor);
Expand Down Expand Up @@ -487,23 +512,13 @@ public void renderParticles(Graphics g) {
}


// public void update(Point point) {
// //TODO configurable
// for (int i = 0; i < 7; i++) {
// addParticle(point.x, point.y);
// }
// shakeEditor(parent, 5, 5, shakeDir);
// shakeDir = !shakeDir;
// this.repaint();
// }

public void updateWithAnchors(Point point, Anchor[] anchors){
PowerMode3 settings = PowerMode3.getInstance();

addParticle(point.x, point.y, settings);
addParticleUsingAnchors(point.x, point.y, anchors, settings);

shakeEditor(parent, settings.getShakeDistance(), settings.getShakeDistance(), shakeDir);
shakeEditor(parentJComponent, settings.getShakeDistance(), settings.getShakeDistance(), shakeDir);
shakeDir = !shakeDir;
this.repaint();
}
Expand Down Expand Up @@ -532,4 +547,6 @@ public void componentShown(ComponentEvent e) {
public void componentHidden(ComponentEvent e) {

}


}
Loading

0 comments on commit e6845de

Please sign in to comment.