Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f72862b

Browse filesBrowse files
committed
Merge branch 'development' into releases
2 parents f1cb168 + caf3237 commit f72862b
Copy full SHA for f72862b

File tree

Expand file treeCollapse file tree

71 files changed

+1216
-636
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

71 files changed

+1216
-636
lines changed

‎pom.xml

Copy file name to clipboardExpand all lines: pom.xml
+6-7Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>kotik-coder</groupId>
55
<artifactId>PULsE</artifactId>
6-
<version>1.97</version>
6+
<version>1.97b</version>
77
<name>PULsE</name>
88
<description>Processing Unit for Laser flash Experiments</description>
99
<developers>
@@ -18,20 +18,19 @@
1818
<name>The Apache License, Version 2.0</name>
1919
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
2020
</license>
21-
</licenses>
22-
21+
</licenses>
2322
<dependencies>
2423
<dependency>
2524
<groupId>org.jfree</groupId>
2625
<artifactId>jfreechart</artifactId>
2726
<version>1.5.0</version>
2827
</dependency>
2928
<dependency>
30-
<groupId>com.weblookandfeel</groupId>
31-
<artifactId>weblaf-ui</artifactId>
32-
<version>1.2.13</version>
29+
<groupId>com.formdev</groupId>
30+
<artifactId>flatlaf</artifactId>
31+
<version>3.0</version>
3332
</dependency>
34-
<dependency>
33+
<dependency>
3534
<groupId>org.apache.commons</groupId>
3635
<artifactId>commons-math3</artifactId>
3736
<version>3.6.1</version>

‎src/main/java/pulse/baseline/LinearBaseline.java

Copy file name to clipboardExpand all lines: src/main/java/pulse/baseline/LinearBaseline.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public LinearBaseline(double intercept, double slope) {
4141
super(intercept, slope);
4242
}
4343

44-
public LinearBaseline(LinearBaseline baseline) {
44+
public LinearBaseline(AdjustableBaseline baseline) {
4545
super( (double) baseline.getIntercept().getValue(),
4646
(double) baseline.getSlope().getValue()
4747
);

‎src/main/java/pulse/io/export/LogPaneExporter.java renamed to ‎src/main/java/pulse/io/export/TextLogPaneExporter.java

Copy file name to clipboardExpand all lines: src/main/java/pulse/io/export/TextLogPaneExporter.java
+13-11Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,23 @@
44

55
import java.io.FileOutputStream;
66
import java.io.IOException;
7+
import javax.swing.JEditorPane;
78

89
import javax.swing.text.BadLocationException;
910
import javax.swing.text.html.HTMLEditorKit;
1011

11-
import pulse.ui.components.LogPane;
12+
import pulse.ui.components.TextLogPane;
1213

1314
/**
1415
* Similar to a {@code LogExporter}, except that it works only on the contents
1516
* of a {@code LogPane} currently being displayed to the user.
1617
*
1718
*/
18-
public class LogPaneExporter implements Exporter<LogPane> {
19+
public class TextLogPaneExporter implements Exporter<TextLogPane> {
1920

20-
private static LogPaneExporter instance = new LogPaneExporter();
21+
private static TextLogPaneExporter instance = new TextLogPaneExporter();
2122

22-
private LogPaneExporter() {
23+
private TextLogPaneExporter() {
2324
// intentionally blank
2425
}
2526

@@ -29,10 +30,11 @@ private LogPaneExporter() {
2930
* argument is ignored. After exporting, the stream is explicitly closed.
3031
*/
3132
@Override
32-
public void printToStream(LogPane pane, FileOutputStream fos, Extension extension) {
33-
var kit = (HTMLEditorKit) pane.getEditorKit();
33+
public void printToStream(TextLogPane pane, FileOutputStream fos, Extension extension) {
34+
var editorPane = (JEditorPane) pane.getGUIComponent();
35+
var kit = (HTMLEditorKit) editorPane.getEditorKit();
3436
try {
35-
kit.write(fos, pane.getDocument(), 0, pane.getDocument().getLength());
37+
kit.write(fos, editorPane.getDocument(), 0, editorPane.getDocument().getLength());
3638
} catch (IOException | BadLocationException e) {
3739
System.err.println("Could not export the log pane!");
3840
e.printStackTrace();
@@ -50,16 +52,16 @@ public void printToStream(LogPane pane, FileOutputStream fos, Extension extensio
5052
*
5153
* @return an instance of{@code LogPaneExporter}.
5254
*/
53-
public static LogPaneExporter getInstance() {
55+
public static TextLogPaneExporter getInstance() {
5456
return instance;
5557
}
5658

5759
/**
5860
* @return {@code LogPane.class}.
5961
*/
6062
@Override
61-
public Class<LogPane> target() {
62-
return LogPane.class;
63+
public Class<TextLogPane> target() {
64+
return TextLogPane.class;
6365
}
6466

6567
/**
@@ -70,4 +72,4 @@ public Extension[] getSupportedExtensions() {
7072
return new Extension[]{HTML};
7173
}
7274

73-
}
75+
}

‎src/main/java/pulse/math/ParameterIdentifier.java

Copy file name to clipboardExpand all lines: src/main/java/pulse/math/ParameterIdentifier.java
+22-9Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package pulse.math;
22

3+
import java.util.Objects;
34
import pulse.properties.NumericPropertyKeyword;
45

56
public class ParameterIdentifier {
@@ -15,6 +16,14 @@ public ParameterIdentifier(NumericPropertyKeyword keyword, int index) {
1516
public ParameterIdentifier(NumericPropertyKeyword keyword) {
1617
this(keyword, 0);
1718
}
19+
20+
@Override
21+
public int hashCode() {
22+
int hash = 7;
23+
hash = 29 * hash + Objects.hashCode(this.keyword);
24+
hash = 29 * hash + this.index;
25+
return hash;
26+
}
1827

1928
public ParameterIdentifier(int index) {
2029
this.index = index;
@@ -30,24 +39,28 @@ public int getIndex() {
3039

3140
@Override
3241
public boolean equals(Object id) {
33-
if(!id.getClass().equals(ParameterIdentifier.class)) {
42+
if(id.getClass() == null) {
3443
return false;
3544
}
3645

37-
var pid = (ParameterIdentifier) id;
38-
39-
boolean result = true;
46+
var classA = id.getClass();
47+
var classB = this.getClass();
4048

41-
if(keyword != pid.keyword || index != pid.index)
42-
result = false;
43-
44-
return result;
49+
if(classA != classB) {
50+
return false;
51+
}
4552

53+
var pid = (ParameterIdentifier) id;
54+
return keyword == pid.keyword && Math.abs(index - pid.index) < 1;
4655
}
4756

4857
@Override
4958
public String toString() {
50-
return keyword + " # " + index;
59+
StringBuilder sb = new StringBuilder("").append(keyword);
60+
if(index > 0) {
61+
sb.append(" # ").append(index);
62+
}
63+
return sb.toString();
5164
}
5265

5366
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.