-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
CI pipeline
committed
Oct 4, 2024
1 parent
51219e1
commit 229c7a7
Showing
7 changed files
with
548 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,56 @@ | ||
package org.processmining.ebi.objects; | ||
|
||
import javax.swing.JComponent; | ||
import javax.swing.event.ChangeEvent; | ||
import javax.swing.event.ChangeListener; | ||
|
||
import org.processmining.ebi.plugins.EbiDialog.EbiDialogPanel; | ||
import org.processmining.framework.plugin.PluginContext; | ||
import org.processmining.framework.util.HTMLToString; | ||
|
||
import com.fluxicon.slickerbox.components.NiceIntegerSlider; | ||
import com.fluxicon.slickerbox.components.NiceSlider.Orientation; | ||
import com.fluxicon.slickerbox.factory.SlickerFactory; | ||
|
||
public class EbiInteger { | ||
|
||
public static String toEbiString(PluginContext context, int value) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
public static String toEbiString(PluginContext context, Integer value) { | ||
return value.toString(); | ||
} | ||
|
||
public static HTMLToString fromEbiString(PluginContext context, java.lang.String value) { | ||
return new HTMLToString() { | ||
public static Integer fromEbiString(PluginContext context, String value) { | ||
return Integer.parseInt(value); | ||
} | ||
|
||
public static EbiDialogPanel create_input_panel(String explanation) { | ||
SlickerFactory factory = SlickerFactory.instance(); | ||
return new EbiDialogPanel() { | ||
|
||
private int value = 500; | ||
|
||
@Override | ||
public String toHTMLString(boolean includeHTMLTags) { | ||
public JComponent create_left() { | ||
return factory.createLabel(explanation); | ||
} | ||
|
||
@Override | ||
public JComponent create_right() { | ||
NiceIntegerSlider right = factory.createNiceIntegerSlider("", 0, Integer.MAX_VALUE, value, Orientation.HORIZONTAL); | ||
right.addChangeListener(new ChangeListener() { | ||
@Override | ||
public void stateChanged(ChangeEvent e) { | ||
value = right.getValue(); | ||
} | ||
}); | ||
|
||
return right; | ||
} | ||
|
||
@Override | ||
public Object getValue() { | ||
return value; | ||
} | ||
|
||
}; | ||
} | ||
|
||
public static EbiDialogPanel create_input_panel(String string) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,48 @@ | ||
package org.processmining.ebi.objects; | ||
|
||
import java.math.BigInteger; | ||
|
||
import javax.swing.JComponent; | ||
|
||
import org.processmining.contexts.uitopia.annotations.UITopiaVariant; | ||
import org.processmining.contexts.uitopia.annotations.Visualizer; | ||
import org.processmining.contexts.util.HtmlPanel; | ||
import org.processmining.framework.plugin.PluginContext; | ||
import org.processmining.framework.util.HTMLToString; | ||
import org.processmining.framework.plugin.annotations.Plugin; | ||
import org.processmining.framework.plugin.annotations.PluginVariant; | ||
import org.processmining.plugins.InductiveMiner.plugins.dialogs.IMMiningDialog; | ||
|
||
public class EbiLogDiv { | ||
|
||
public BigInteger a; | ||
public BigInteger b; | ||
public BigInteger c; | ||
|
||
public String approximate; | ||
|
||
public static HTMLToString fromEbiString(PluginContext context, java.lang.String value) { | ||
return new HTMLToString() { | ||
|
||
@Override | ||
public String toHTMLString(boolean includeHTMLTags) { | ||
return value; | ||
} | ||
|
||
}; | ||
public static EbiLogDiv fromEbiString(PluginContext context, String value) { | ||
//Ebi returns the value on the first line | ||
String[] arr = value.split("\\R", 2); | ||
|
||
//split in numerator/denominator | ||
String[] arr2 = arr[0].split("/"); | ||
|
||
EbiLogDiv result = new EbiLogDiv(); | ||
result.a = new BigInteger(arr2[0].substring(4)); | ||
result.b = new BigInteger(arr2[1].substring(0, arr2[1].length() - 1)); | ||
result.c = new BigInteger(arr2[2]); | ||
|
||
result.approximate = arr[0].substring(15); | ||
|
||
return result; | ||
} | ||
|
||
} | ||
@Plugin(name = "LogDiv", returnLabels = {"logdiv visualisation" }, returnTypes = { | ||
JComponent.class }, parameterLabels = { "logdiv" }, userAccessible = true) | ||
@Visualizer | ||
@UITopiaVariant(affiliation = IMMiningDialog.affiliation, author = IMMiningDialog.author, email = IMMiningDialog.email) | ||
@PluginVariant(variantLabel = "Visualise logdiv", requiredParameterLabels = { 0 }) | ||
public JComponent fancy(PluginContext context, EbiLogDiv logdiv) { | ||
return new HtmlPanel("Approximate value: " + logdiv.approximate + "<br>Exact value: log(<br>" + logdiv.a + "<br>/<br>" + logdiv.b + ") / <br>" + logdiv.c); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.