Skip to content
Snippets Groups Projects
Commit 2721a070 authored by LukasEttel's avatar LukasEttel
Browse files

first try, not working jet

parent dff102f7
No related branches found
No related tags found
No related merge requests found
Showing
with 13 additions and 1167 deletions
...@@ -25,17 +25,17 @@ ...@@ -25,17 +25,17 @@
<properties> <properties>
<bundle.symbolicName>de.hhu.ba.yoshikoWrapper</bundle.symbolicName> <bundle.symbolicName>de.hhu.ba.yoshikoWrapper</bundle.symbolicName>
<bundle.namespace>de.hhu.ba.yoshikoWrapper</bundle.namespace> <bundle.namespace>de.hhu.ba.yoshikoWrapper</bundle.namespace>
<cytoscape.api.version>3.6.0</cytoscape.api.version> <cytoscape.api.version>3.7.2</cytoscape.api.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven-bundle-plugin.version>2.3.4</maven-bundle-plugin.version> <maven-bundle-plugin.version>2.3.4</maven-bundle-plugin.version>
<osgi.api.version>4.2.0</osgi.api.version> <osgi.api.version>4.2.0</osgi.api.version>
</properties> </properties>
<groupId>de.hhu.ba</groupId> <groupId>de.hhu.ba</groupId>
<artifactId>yoshikoWrapper</artifactId> <artifactId>yoshikoStandalone</artifactId>
<version>0.1.5</version> <version>0.1.1</version>
<name>YoshikoWrapper</name> <name>YoshikoStandalone</name>
<build> <build>
<plugins> <plugins>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<inherited>true</inherited> <inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version> <version>3.7.0</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
...@@ -121,6 +121,11 @@ ...@@ -121,6 +121,11 @@
<artifactId>org.osgi.core</artifactId> <artifactId>org.osgi.core</artifactId>
<version>${osgi.api.version}</version> <version>${osgi.api.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.jgrapht</groupId>
<artifactId>jgrapht-core</artifactId>
<version>1.3.1</version>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
......
...@@ -51,7 +51,6 @@ import static org.cytoscape.work.ServiceProperties.COMMAND_NAMESPACE; ...@@ -51,7 +51,6 @@ import static org.cytoscape.work.ServiceProperties.COMMAND_NAMESPACE;
import de.hhu.ba.yoshikoWrapper.core.ConfigurationManager; import de.hhu.ba.yoshikoWrapper.core.ConfigurationManager;
import de.hhu.ba.yoshikoWrapper.core.CyCore; import de.hhu.ba.yoshikoWrapper.core.CyCore;
import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; import de.hhu.ba.yoshikoWrapper.core.LocalizationManager;
import de.hhu.ba.yoshikoWrapper.core.YoshikoLoader;
import de.hhu.ba.yoshikoWrapper.swing.components.MainPanel; import de.hhu.ba.yoshikoWrapper.swing.components.MainPanel;
import de.hhu.ba.yoshikoWrapper.taskFactories.CommandTaskFactory; import de.hhu.ba.yoshikoWrapper.taskFactories.CommandTaskFactory;
import de.hhu.ba.yoshikoWrapper.taskFactories.YoshikoCommand; import de.hhu.ba.yoshikoWrapper.taskFactories.YoshikoCommand;
...@@ -101,14 +100,6 @@ public class CyActivator extends AbstractCyActivator { ...@@ -101,14 +100,6 @@ public class CyActivator extends AbstractCyActivator {
//Set language according to settings -> Default to enUS //Set language according to settings -> Default to enUS
LocalizationManager.switchLanguage(cm.getProperties().getProperty("locale", "enUS")); LocalizationManager.switchLanguage(cm.getProperties().getProperty("locale", "enUS"));
//Attempt to find the Yoshiko lib in a previously stored location and load it
//TODO: Move into a separate handler to keep CyActivator clean
if (!YoshikoLoader.isLibraryLoaded()){
String pathToYosh = cm.getProperties().getProperty("pathToYoshiko");
if (pathToYosh != null && pathToYosh != "null") {
YoshikoLoader.loadLibrary(pathToYosh);
}
}
//Register commands / CyRest //TODO: Group shared calls for better code readability / less lines of code //Register commands / CyRest //TODO: Group shared calls for better code readability / less lines of code
TaskFactory commandTaskFactory_PERFORM_ALGORITHM = new CommandTaskFactory(YoshikoCommand.PERFORM_ALGORITHM); TaskFactory commandTaskFactory_PERFORM_ALGORITHM = new CommandTaskFactory(YoshikoCommand.PERFORM_ALGORITHM);
......
/*******************************************************************************
* Copyright (C) 2017 Philipp Spohr
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
package de.hhu.ba.yoshikoWrapper.core;
import java.util.List;
import org.cytoscape.model.CyColumn;
import org.cytoscape.model.CyEdge;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyRow;
import org.slf4j.Logger;
import de.hhu.ba.yoshikoWrapper.cytoUtil.NodeMap;
import de.hhu.ba.yoshikoWrapper.logging.YoshikoLogger;
import de.hhu.ba.yoshikoWrapper.swig.LibraryInput;
public class NetworkParser {
//Symbolic Links
private static Logger logger = YoshikoLogger.getInstance().getLogger();
public static LibraryInput parseNetwork (
CyNetwork net,
NodeMap nodeMap,
CyColumn weightColumn,
CyColumn permanentColumn,
CyColumn forbiddenColumn,
double deletionCostDefault
) throws NetworkParsingException
{
//Create an empty instance / fetch C++ object pointer
LibraryInput generatedInput = new LibraryInput();
if (net != null){
//Create an empty full graph with a given size
generatedInput.setSize(net.getNodeCount());
//Fetch edges
List<CyEdge> edges = net.getEdgeList();
//Loop over edges
for (CyEdge e : edges) {
//Parse editing costs
double weight = deletionCostDefault;
//Fetch entry and check if it exists
CyRow edgeEntry = net.getRow(e);
//Check if there is a weight column defined, else skip
if (weightColumn != null){
//Check if the column contains an entry for the respective edge
//It is possible, that there are missing entries
if (edgeEntry.get(weightColumn.getName(), weightColumn.getType()) != null){
if (weightColumn.getType() == Integer.class) {
weight = 1.0*edgeEntry.get(weightColumn.getName(), Integer.class);
}
else if (weightColumn.getType() == Double.class) {
weight = edgeEntry.get(weightColumn.getName(), Double.class);
}
}
}
//Parse Forbidden/Permanent markers
boolean forbidden = false;
boolean permanent = false;
if (permanentColumn != null) {
//Additional check as it is not required to have a value in every row
if (edgeEntry.get(permanentColumn.getName(), Boolean.class) != null) {
permanent = (boolean)edgeEntry.get(permanentColumn.getName(), Boolean.class);
}
}
if (forbiddenColumn != null) {
//Additional check as it is not required to have a value in every row
if (edgeEntry.get(forbiddenColumn.getName(), Boolean.class) != null) {
forbidden = (boolean)edgeEntry.get(forbiddenColumn.getName(), Boolean.class);
}
}
//Check for edges that are forbidden AND permanent -> Throw exception
if (forbidden && permanent) {
throw new NetworkParsingException(LocalizationManager.get("dualInfinityError"));
}
logger.debug("Found Edge: "+edgeEntry.get("name", String.class)+ " with weight:"+weight);
generatedInput.addEdge(
nodeMap.get(e.getSource()),
nodeMap.get(e.getTarget()),
weight,
permanent,
forbidden
);
}
}
return generatedInput;
}
}
package de.hhu.ba.yoshikoWrapper.core;
/**
* Simple Exception that should be thrown when the CyNetwork combined with the given parameters can not be parsed in a meaningful WCE instance
* @author Philipp Spohr, Dec 12, 2017
*
*/
@SuppressWarnings("serial")
public class NetworkParsingException extends Exception {
private String msg;
public NetworkParsingException(String msg) {
this.msg = msg;
}
@Override
public String getMessage() {
return LocalizationManager.get("networkParsingException")+" "+msg;
}
}
...@@ -108,7 +108,7 @@ public class ParameterSet implements TunableValidator ...@@ -108,7 +108,7 @@ public class ParameterSet implements TunableValidator
permanentColumn = new ListSingleSelection<CyColumn>(booleanColumns); permanentColumn = new ListSingleSelection<CyColumn>(booleanColumns);
//Don't select any columns by default //Don't select any columns by default
weightColumn.setSelectedValue(null); weightColumn.setSelectedValue(numericColumns.get(1));
forbiddenColumn.setSelectedValue(null); forbiddenColumn.setSelectedValue(null);
permanentColumn.setSelectedValue(null); permanentColumn.setSelectedValue(null);
......
package de.hhu.ba.yoshikoWrapper.core;
import java.awt.Window;
import javax.swing.JOptionPane;
import org.cytoscape.work.TaskMonitor;
import de.hhu.ba.yoshikoWrapper.swig.CplexInformer;
import de.hhu.ba.yoshikoWrapper.swig.YoshikoState;
import de.hhu.ba.yoshikoWrapper.swing.SwingUtil;
public class StatusInformer extends CplexInformer {
private final Window statusWindow;
private final TaskMonitor taskMonitor;
public StatusInformer(Window statusWindow, TaskMonitor taskMonitor) {
this.statusWindow = statusWindow;
this.taskMonitor = taskMonitor;
};
@Override
public boolean continueOnTimeout() {
try {
int result = JOptionPane.showConfirmDialog(
statusWindow,
LocalizationManager.get("continueTimeout"),
LocalizationManager.get("timeoutTitle"),
JOptionPane.YES_NO_OPTION,
JOptionPane.INFORMATION_MESSAGE
);
if (result == JOptionPane.YES_OPTION) {
return true;
}
return false;
}
catch(Exception e) {
e.printStackTrace();
return false;
}
}
@Override
public void updateStatus(YoshikoState state, double value) {
if (state == YoshikoState.SOLVING_ILP){
if (value <= 1.0) {
taskMonitor.setStatusMessage(LocalizationManager.get("currentGap")+": "+SwingUtil.twoDecimals.format(value)+"%");
}
}
}
@Override
public void updateStatus(YoshikoState state) {
//TODO: Might improve performance via HashMap but probably irrelevant
if (state == YoshikoState.REDUCTION_AC) {
taskMonitor.setStatusMessage(LocalizationManager.get("status_reductionAC"));
}
else if (state == YoshikoState.REDUCTION_CC) {
taskMonitor.setStatusMessage(LocalizationManager.get("status_reductionCC"));
}
else if (state == YoshikoState.REDUCTION_CR) {
taskMonitor.setStatusMessage(LocalizationManager.get("status_reductionCR"));
}
else if (state == YoshikoState.REDUCTION_HE) {
taskMonitor.setStatusMessage(LocalizationManager.get("status_reductionHE"));
}
else if (state == YoshikoState.REDUCTION_MR) {
taskMonitor.setStatusMessage(LocalizationManager.get("status_reductionMR"));
}
else if (state == YoshikoState.REDUCTION_PD) {
taskMonitor.setStatusMessage(LocalizationManager.get("status_reductionPD"));
}
else if (state == YoshikoState.REDUCTION_SN) {
taskMonitor.setStatusMessage(LocalizationManager.get("status_reductionSN"));
}
else if (state == YoshikoState.SOLVING_ILP) {
taskMonitor.setStatusMessage(LocalizationManager.get("status_solvingILP"));
}
}
}
/*******************************************************************************
* Copyright (C) 2017 Philipp Spohr
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
package de.hhu.ba.yoshikoWrapper.core;
import java.io.File;
import org.slf4j.Logger;
import de.hhu.ba.yoshikoWrapper.logging.YoshikoLogger;
import de.hhu.ba.yoshikoWrapper.swig.LibraryInterface;
public class YoshikoLoader {
public static final String REQUIRED_VERSION = "2.2.0";
private static boolean isLoaded;
//Symbolic Links
private static Logger logger = YoshikoLogger.getInstance().getLogger();
public static void loadLibrary(String libPath) {
//Attempt to load from a previously stored path
File f = new File (libPath);
if (!f.exists()) {
logger.info("Could not load the Yoshiko-library from a previously saved path! You might need to set the path manually.");
return;
}
try {
logger.info("Attempting to load library @: "+libPath);
//Verify version ending
if (!libPath.substring(0,libPath.lastIndexOf(".")).endsWith(REQUIRED_VERSION)) {
logger.info(LocalizationManager.get("libFail")+" "+REQUIRED_VERSION);
return;
}
//Perform actual loading
System.load(libPath);
}
catch(UnsatisfiedLinkError e) {
//This might happen as Java doesn't unload native libs
//One such case might be reloading the Cytoscape app on-the-fly
logger.error(e.getMessage());
}
LibraryInterface.setVerbosity(3);
//update cfg
CyCore.cm.getProperties().setProperty("pathToYoshiko", libPath);
isLoaded = true;
}
//SETTER / GETTER
public static boolean isLibraryLoaded() {
return isLoaded;
}
}
...@@ -27,7 +27,6 @@ import java.util.HashMap; ...@@ -27,7 +27,6 @@ import java.util.HashMap;
import org.cytoscape.model.CyNetwork; import org.cytoscape.model.CyNetwork;
import de.hhu.ba.yoshikoWrapper.core.ResultList; import de.hhu.ba.yoshikoWrapper.core.ResultList;
import de.hhu.ba.yoshikoWrapper.swig.SolutionFlags;
/**Basic data class that represents a CES instance internally. By using this class the C++ resources can be freed upon retrieval. /**Basic data class that represents a CES instance internally. By using this class the C++ resources can be freed upon retrieval.
...@@ -39,14 +38,13 @@ public class YoshikoResult{ ...@@ -39,14 +38,13 @@ public class YoshikoResult{
private HashMap<Long,YoshikoSolution> solutions; private HashMap<Long,YoshikoSolution> solutions;
private SolutionFlags flags;
private int id; private int id;
public YoshikoResult(CyNetwork net, SolutionFlags flags) { public YoshikoResult(CyNetwork net) {
solutions = new HashMap<Long,YoshikoSolution>(); solutions = new HashMap<Long,YoshikoSolution>();
this.originalGraph = net; this.originalGraph = net;
this.flags = flags;
ResultList.add(this); ResultList.add(this);
} }
...@@ -62,9 +60,6 @@ public class YoshikoResult{ ...@@ -62,9 +60,6 @@ public class YoshikoResult{
/** /**
* @return the flags associated with this result * @return the flags associated with this result
*/ */
public SolutionFlags getFlags() {
return flags;
}
public void addSolution(YoshikoSolution solution) { public void addSolution(YoshikoSolution solution) {
solutions.put(solution.getId(),solution); solutions.put(solution.getId(),solution);
......
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.8
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package de.hhu.ba.yoshikoWrapper.swig;
public class ClusterEditingSolutions {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected ClusterEditingSolutions(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(ClusterEditingSolutions obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
LibraryInterfaceJNI.delete_ClusterEditingSolutions(swigCPtr);
}
swigCPtr = 0;
}
}
public long getNumberOfClusters(long i) {
return LibraryInterfaceJNI.ClusterEditingSolutions_getNumberOfClusters(swigCPtr, this, i);
}
public IntVector getCluster(long i, long k) {
return new IntVector(LibraryInterfaceJNI.ClusterEditingSolutions_getCluster(swigCPtr, this, i, k), false);
}
public SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t getSolution(long i) {
return new SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t(LibraryInterfaceJNI.ClusterEditingSolutions_getSolution(swigCPtr, this, i), false);
}
public long getNumberOfSolutions() {
return LibraryInterfaceJNI.ClusterEditingSolutions_getNumberOfSolutions(swigCPtr, this);
}
public SolutionFlags getFlags() {
return new SolutionFlags(LibraryInterfaceJNI.ClusterEditingSolutions_getFlags(swigCPtr, this), true);
}
public void setFlags(SolutionFlags f) {
LibraryInterfaceJNI.ClusterEditingSolutions_setFlags(swigCPtr, this, SolutionFlags.getCPtr(f), f);
}
public void printSolution(long index) {
LibraryInterfaceJNI.ClusterEditingSolutions_printSolution(swigCPtr, this, index);
}
public ClusterEditingSolutions() {
this(LibraryInterfaceJNI.new_ClusterEditingSolutions(), true);
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.8
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package de.hhu.ba.yoshikoWrapper.swig;
public class CoreAlgorithm {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected CoreAlgorithm(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(CoreAlgorithm obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
LibraryInterfaceJNI.delete_CoreAlgorithm(swigCPtr);
}
swigCPtr = 0;
}
}
public ClusterEditingSolutions run() {
long cPtr = LibraryInterfaceJNI.CoreAlgorithm_run(swigCPtr, this);
return (cPtr == 0) ? null : new ClusterEditingSolutions(cPtr, false);
}
public void registerCplexInformer(CplexInformer informer) {
LibraryInterfaceJNI.CoreAlgorithm_registerCplexInformer(swigCPtr, this, CplexInformer.getCPtr(informer), informer);
}
public void cancel() {
LibraryInterfaceJNI.CoreAlgorithm_cancel(swigCPtr, this);
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.8
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package de.hhu.ba.yoshikoWrapper.swig;
public class CplexInformer {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected CplexInformer(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(CplexInformer obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
LibraryInterfaceJNI.delete_CplexInformer(swigCPtr);
}
swigCPtr = 0;
}
}
protected void swigDirectorDisconnect() {
swigCMemOwn = false;
delete();
}
public void swigReleaseOwnership() {
swigCMemOwn = false;
LibraryInterfaceJNI.CplexInformer_change_ownership(this, swigCPtr, false);
}
public void swigTakeOwnership() {
swigCMemOwn = true;
LibraryInterfaceJNI.CplexInformer_change_ownership(this, swigCPtr, true);
}
public void updateStatus(YoshikoState state) {
if (getClass() == CplexInformer.class) LibraryInterfaceJNI.CplexInformer_updateStatus__SWIG_0(swigCPtr, this, state.swigValue()); else LibraryInterfaceJNI.CplexInformer_updateStatusSwigExplicitCplexInformer__SWIG_0(swigCPtr, this, state.swigValue());
}
public void updateStatus(YoshikoState state, double value) {
if (getClass() == CplexInformer.class) LibraryInterfaceJNI.CplexInformer_updateStatus__SWIG_1(swigCPtr, this, state.swigValue(), value); else LibraryInterfaceJNI.CplexInformer_updateStatusSwigExplicitCplexInformer__SWIG_1(swigCPtr, this, state.swigValue(), value);
}
public boolean continueOnTimeout() {
return (getClass() == CplexInformer.class) ? LibraryInterfaceJNI.CplexInformer_continueOnTimeout(swigCPtr, this) : LibraryInterfaceJNI.CplexInformer_continueOnTimeoutSwigExplicitCplexInformer(swigCPtr, this);
}
public CplexInformer() {
this(LibraryInterfaceJNI.new_CplexInformer(), true);
LibraryInterfaceJNI.CplexInformer_director_connect(this, swigCPtr, swigCMemOwn, true);
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.8
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package de.hhu.ba.yoshikoWrapper.swig;
public class DoubleVector {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected DoubleVector(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(DoubleVector obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
LibraryInterfaceJNI.delete_DoubleVector(swigCPtr);
}
swigCPtr = 0;
}
}
public DoubleVector() {
this(LibraryInterfaceJNI.new_DoubleVector__SWIG_0(), true);
}
public DoubleVector(long n) {
this(LibraryInterfaceJNI.new_DoubleVector__SWIG_1(n), true);
}
public long size() {
return LibraryInterfaceJNI.DoubleVector_size(swigCPtr, this);
}
public long capacity() {
return LibraryInterfaceJNI.DoubleVector_capacity(swigCPtr, this);
}
public void reserve(long n) {
LibraryInterfaceJNI.DoubleVector_reserve(swigCPtr, this, n);
}
public boolean isEmpty() {
return LibraryInterfaceJNI.DoubleVector_isEmpty(swigCPtr, this);
}
public void clear() {
LibraryInterfaceJNI.DoubleVector_clear(swigCPtr, this);
}
public void add(double x) {
LibraryInterfaceJNI.DoubleVector_add(swigCPtr, this, x);
}
public double get(int i) {
return LibraryInterfaceJNI.DoubleVector_get(swigCPtr, this, i);
}
public void set(int i, double val) {
LibraryInterfaceJNI.DoubleVector_set(swigCPtr, this, i, val);
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.8
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package de.hhu.ba.yoshikoWrapper.swig;
public class IntVector {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected IntVector(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(IntVector obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
LibraryInterfaceJNI.delete_IntVector(swigCPtr);
}
swigCPtr = 0;
}
}
public IntVector() {
this(LibraryInterfaceJNI.new_IntVector__SWIG_0(), true);
}
public IntVector(long n) {
this(LibraryInterfaceJNI.new_IntVector__SWIG_1(n), true);
}
public long size() {
return LibraryInterfaceJNI.IntVector_size(swigCPtr, this);
}
public long capacity() {
return LibraryInterfaceJNI.IntVector_capacity(swigCPtr, this);
}
public void reserve(long n) {
LibraryInterfaceJNI.IntVector_reserve(swigCPtr, this, n);
}
public boolean isEmpty() {
return LibraryInterfaceJNI.IntVector_isEmpty(swigCPtr, this);
}
public void clear() {
LibraryInterfaceJNI.IntVector_clear(swigCPtr, this);
}
public void add(int x) {
LibraryInterfaceJNI.IntVector_add(swigCPtr, this, x);
}
public int get(int i) {
return LibraryInterfaceJNI.IntVector_get(swigCPtr, this, i);
}
public void set(int i, int val) {
LibraryInterfaceJNI.IntVector_set(swigCPtr, this, i, val);
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.8
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package de.hhu.ba.yoshikoWrapper.swig;
public class LibraryInput {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected LibraryInput(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(LibraryInput obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
LibraryInterfaceJNI.delete_LibraryInput(swigCPtr);
}
swigCPtr = 0;
}
}
public LibraryInput() {
this(LibraryInterfaceJNI.new_LibraryInput(), true);
}
public void addEdge(long sourceID, long targetID, double cost) {
LibraryInterfaceJNI.LibraryInput_addEdge__SWIG_0(swigCPtr, this, sourceID, targetID, cost);
}
public void addEdge(long sourceID, long targetID, double cost, boolean permanent, boolean forbidden) {
LibraryInterfaceJNI.LibraryInput_addEdge__SWIG_1(swigCPtr, this, sourceID, targetID, cost, permanent, forbidden);
}
public void setSize(long id) {
LibraryInterfaceJNI.LibraryInput_setSize(swigCPtr, this, id);
}
public void setDefaultInsertionCost(double cost) {
LibraryInterfaceJNI.LibraryInput_setDefaultInsertionCost(swigCPtr, this, cost);
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.8
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package de.hhu.ba.yoshikoWrapper.swig;
public class LibraryInterface {
public static String getVersionString() {
return LibraryInterfaceJNI.getVersionString();
}
public static void setTimeLimit(int limit) {
LibraryInterfaceJNI.setTimeLimit(limit);
}
public static void setThreadLimit(int limit) {
LibraryInterfaceJNI.setThreadLimit(limit);
}
public static void setVerbosity(int level) {
LibraryInterfaceJNI.setVerbosity(level);
}
public static CoreAlgorithm getRun(LibraryInput input, int nrOptimalSolutions, String rulesBitMask, double multiplicativeFactor, boolean useHeuristic, boolean separatePartitionCuts, boolean separateTriangles, int targetClusterCount) {
long cPtr = LibraryInterfaceJNI.getRun(LibraryInput.getCPtr(input), input, nrOptimalSolutions, rulesBitMask, multiplicativeFactor, useHeuristic, separatePartitionCuts, separateTriangles, targetClusterCount);
return (cPtr == 0) ? null : new CoreAlgorithm(cPtr, false);
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.8
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package de.hhu.ba.yoshikoWrapper.swig;
public class LibraryInterfaceJNI {
public final static native long new_SolutionFlags();
public final static native void SolutionFlags_totalCost_set(long jarg1, SolutionFlags jarg1_, double jarg2);
public final static native double SolutionFlags_totalCost_get(long jarg1, SolutionFlags jarg1_);
public final static native void SolutionFlags_timedOut_set(long jarg1, SolutionFlags jarg1_, boolean jarg2);
public final static native boolean SolutionFlags_timedOut_get(long jarg1, SolutionFlags jarg1_);
public final static native void SolutionFlags_ilpGenerated_set(long jarg1, SolutionFlags jarg1_, boolean jarg2);
public final static native boolean SolutionFlags_ilpGenerated_get(long jarg1, SolutionFlags jarg1_);
public final static native void SolutionFlags_optimal_set(long jarg1, SolutionFlags jarg1_, boolean jarg2);
public final static native boolean SolutionFlags_optimal_get(long jarg1, SolutionFlags jarg1_);
public final static native void SolutionFlags_reducedInstances_set(long jarg1, SolutionFlags jarg1_, int jarg2);
public final static native int SolutionFlags_reducedInstances_get(long jarg1, SolutionFlags jarg1_);
public final static native void SolutionFlags_solvedInstances_set(long jarg1, SolutionFlags jarg1_, int jarg2);
public final static native int SolutionFlags_solvedInstances_get(long jarg1, SolutionFlags jarg1_);
public final static native void SolutionFlags_lastGap_set(long jarg1, SolutionFlags jarg1_, double jarg2);
public final static native double SolutionFlags_lastGap_get(long jarg1, SolutionFlags jarg1_);
public final static native void delete_SolutionFlags(long jarg1);
public final static native long new_IntVector__SWIG_0();
public final static native long new_IntVector__SWIG_1(long jarg1);
public final static native long IntVector_size(long jarg1, IntVector jarg1_);
public final static native long IntVector_capacity(long jarg1, IntVector jarg1_);
public final static native void IntVector_reserve(long jarg1, IntVector jarg1_, long jarg2);
public final static native boolean IntVector_isEmpty(long jarg1, IntVector jarg1_);
public final static native void IntVector_clear(long jarg1, IntVector jarg1_);
public final static native void IntVector_add(long jarg1, IntVector jarg1_, int jarg2);
public final static native int IntVector_get(long jarg1, IntVector jarg1_, int jarg2);
public final static native void IntVector_set(long jarg1, IntVector jarg1_, int jarg2, int jarg3);
public final static native void delete_IntVector(long jarg1);
public final static native long new_DoubleVector__SWIG_0();
public final static native long new_DoubleVector__SWIG_1(long jarg1);
public final static native long DoubleVector_size(long jarg1, DoubleVector jarg1_);
public final static native long DoubleVector_capacity(long jarg1, DoubleVector jarg1_);
public final static native void DoubleVector_reserve(long jarg1, DoubleVector jarg1_, long jarg2);
public final static native boolean DoubleVector_isEmpty(long jarg1, DoubleVector jarg1_);
public final static native void DoubleVector_clear(long jarg1, DoubleVector jarg1_);
public final static native void DoubleVector_add(long jarg1, DoubleVector jarg1_, double jarg2);
public final static native double DoubleVector_get(long jarg1, DoubleVector jarg1_, int jarg2);
public final static native void DoubleVector_set(long jarg1, DoubleVector jarg1_, int jarg2, double jarg3);
public final static native void delete_DoubleVector(long jarg1);
public final static native long ClusterEditingSolutions_getNumberOfClusters(long jarg1, ClusterEditingSolutions jarg1_, long jarg2);
public final static native long ClusterEditingSolutions_getCluster(long jarg1, ClusterEditingSolutions jarg1_, long jarg2, long jarg3);
public final static native long ClusterEditingSolutions_getSolution(long jarg1, ClusterEditingSolutions jarg1_, long jarg2);
public final static native long ClusterEditingSolutions_getNumberOfSolutions(long jarg1, ClusterEditingSolutions jarg1_);
public final static native long ClusterEditingSolutions_getFlags(long jarg1, ClusterEditingSolutions jarg1_);
public final static native void ClusterEditingSolutions_setFlags(long jarg1, ClusterEditingSolutions jarg1_, long jarg2, SolutionFlags jarg2_);
public final static native void ClusterEditingSolutions_printSolution(long jarg1, ClusterEditingSolutions jarg1_, long jarg2);
public final static native long new_ClusterEditingSolutions();
public final static native void delete_ClusterEditingSolutions(long jarg1);
public final static native long new_LibraryInput();
public final static native void delete_LibraryInput(long jarg1);
public final static native void LibraryInput_addEdge__SWIG_0(long jarg1, LibraryInput jarg1_, long jarg2, long jarg3, double jarg4);
public final static native void LibraryInput_addEdge__SWIG_1(long jarg1, LibraryInput jarg1_, long jarg2, long jarg3, double jarg4, boolean jarg5, boolean jarg6);
public final static native void LibraryInput_setSize(long jarg1, LibraryInput jarg1_, long jarg2);
public final static native void LibraryInput_setDefaultInsertionCost(long jarg1, LibraryInput jarg1_, double jarg2);
public final static native void CplexInformer_updateStatus__SWIG_0(long jarg1, CplexInformer jarg1_, int jarg2);
public final static native void CplexInformer_updateStatusSwigExplicitCplexInformer__SWIG_0(long jarg1, CplexInformer jarg1_, int jarg2);
public final static native void CplexInformer_updateStatus__SWIG_1(long jarg1, CplexInformer jarg1_, int jarg2, double jarg3);
public final static native void CplexInformer_updateStatusSwigExplicitCplexInformer__SWIG_1(long jarg1, CplexInformer jarg1_, int jarg2, double jarg3);
public final static native boolean CplexInformer_continueOnTimeout(long jarg1, CplexInformer jarg1_);
public final static native boolean CplexInformer_continueOnTimeoutSwigExplicitCplexInformer(long jarg1, CplexInformer jarg1_);
public final static native void delete_CplexInformer(long jarg1);
public final static native long new_CplexInformer();
public final static native void CplexInformer_director_connect(CplexInformer obj, long cptr, boolean mem_own, boolean weak_global);
public final static native void CplexInformer_change_ownership(CplexInformer obj, long cptr, boolean take_or_release);
public final static native long CoreAlgorithm_run(long jarg1, CoreAlgorithm jarg1_);
public final static native void CoreAlgorithm_registerCplexInformer(long jarg1, CoreAlgorithm jarg1_, long jarg2, CplexInformer jarg2_);
public final static native void CoreAlgorithm_cancel(long jarg1, CoreAlgorithm jarg1_);
public final static native void delete_CoreAlgorithm(long jarg1);
public final static native String getVersionString();
public final static native void setTimeLimit(int jarg1);
public final static native void setThreadLimit(int jarg1);
public final static native void setVerbosity(int jarg1);
public final static native long getRun(long jarg1, LibraryInput jarg1_, int jarg2, String jarg3, double jarg4, boolean jarg5, boolean jarg6, boolean jarg7, int jarg8);
public static void SwigDirector_CplexInformer_updateStatus__SWIG_0(CplexInformer jself, int state) {
jself.updateStatus(YoshikoState.swigToEnum(state));
}
public static void SwigDirector_CplexInformer_updateStatus__SWIG_1(CplexInformer jself, int state, double value) {
jself.updateStatus(YoshikoState.swigToEnum(state), value);
}
public static boolean SwigDirector_CplexInformer_continueOnTimeout(CplexInformer jself) {
return jself.continueOnTimeout();
}
private final static native void swig_module_init();
static {
swig_module_init();
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.8
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package de.hhu.ba.yoshikoWrapper.swig;
public class SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t {
private transient long swigCPtr;
protected SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
swigCPtr = cPtr;
}
protected SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t() {
swigCPtr = 0;
}
protected static long getCPtr(SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.8
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package de.hhu.ba.yoshikoWrapper.swig;
public class SolutionFlags {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected SolutionFlags(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(SolutionFlags obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
LibraryInterfaceJNI.delete_SolutionFlags(swigCPtr);
}
swigCPtr = 0;
}
}
public SolutionFlags() {
this(LibraryInterfaceJNI.new_SolutionFlags(), true);
}
public void setTotalCost(double value) {
LibraryInterfaceJNI.SolutionFlags_totalCost_set(swigCPtr, this, value);
}
public double getTotalCost() {
return LibraryInterfaceJNI.SolutionFlags_totalCost_get(swigCPtr, this);
}
public void setTimedOut(boolean value) {
LibraryInterfaceJNI.SolutionFlags_timedOut_set(swigCPtr, this, value);
}
public boolean getTimedOut() {
return LibraryInterfaceJNI.SolutionFlags_timedOut_get(swigCPtr, this);
}
public void setIlpGenerated(boolean value) {
LibraryInterfaceJNI.SolutionFlags_ilpGenerated_set(swigCPtr, this, value);
}
public boolean getIlpGenerated() {
return LibraryInterfaceJNI.SolutionFlags_ilpGenerated_get(swigCPtr, this);
}
public void setOptimal(boolean value) {
LibraryInterfaceJNI.SolutionFlags_optimal_set(swigCPtr, this, value);
}
public boolean getOptimal() {
return LibraryInterfaceJNI.SolutionFlags_optimal_get(swigCPtr, this);
}
public void setReducedInstances(int value) {
LibraryInterfaceJNI.SolutionFlags_reducedInstances_set(swigCPtr, this, value);
}
public int getReducedInstances() {
return LibraryInterfaceJNI.SolutionFlags_reducedInstances_get(swigCPtr, this);
}
public void setSolvedInstances(int value) {
LibraryInterfaceJNI.SolutionFlags_solvedInstances_set(swigCPtr, this, value);
}
public int getSolvedInstances() {
return LibraryInterfaceJNI.SolutionFlags_solvedInstances_get(swigCPtr, this);
}
public void setLastGap(double value) {
LibraryInterfaceJNI.SolutionFlags_lastGap_set(swigCPtr, this, value);
}
public double getLastGap() {
return LibraryInterfaceJNI.SolutionFlags_lastGap_get(swigCPtr, this);
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.8
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package de.hhu.ba.yoshikoWrapper.swig;
public final class YoshikoState {
public final static YoshikoState PARSING_INPUT = new YoshikoState("PARSING_INPUT", 0);
public final static YoshikoState REDUCTION_AC = new YoshikoState("REDUCTION_AC", 1);
public final static YoshikoState REDUCTION_CR = new YoshikoState("REDUCTION_CR", 2);
public final static YoshikoState REDUCTION_CC = new YoshikoState("REDUCTION_CC", 3);
public final static YoshikoState REDUCTION_PD = new YoshikoState("REDUCTION_PD", 4);
public final static YoshikoState REDUCTION_HE = new YoshikoState("REDUCTION_HE", 5);
public final static YoshikoState REDUCTION_MR = new YoshikoState("REDUCTION_MR", 6);
public final static YoshikoState REDUCTION_SN = new YoshikoState("REDUCTION_SN", 7);
public final static YoshikoState SOLVING_HEURISTIC = new YoshikoState("SOLVING_HEURISTIC", 8);
public final static YoshikoState SOLVING_ILP = new YoshikoState("SOLVING_ILP", 9);
public final static YoshikoState PROCESS_SOLUTION = new YoshikoState("PROCESS_SOLUTION", 10);
public final int swigValue() {
return swigValue;
}
public String toString() {
return swigName;
}
public static YoshikoState swigToEnum(int swigValue) {
if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
return swigValues[swigValue];
for (int i = 0; i < swigValues.length; i++)
if (swigValues[i].swigValue == swigValue)
return swigValues[i];
throw new IllegalArgumentException("No enum " + YoshikoState.class + " with value " + swigValue);
}
private YoshikoState(String swigName) {
this.swigName = swigName;
this.swigValue = swigNext++;
}
private YoshikoState(String swigName, int swigValue) {
this.swigName = swigName;
this.swigValue = swigValue;
swigNext = swigValue+1;
}
private YoshikoState(String swigName, YoshikoState swigEnum) {
this.swigName = swigName;
this.swigValue = swigEnum.swigValue;
swigNext = this.swigValue+1;
}
private static YoshikoState[] swigValues = { PARSING_INPUT, REDUCTION_AC, REDUCTION_CR, REDUCTION_CC, REDUCTION_PD, REDUCTION_HE, REDUCTION_MR, REDUCTION_SN, SOLVING_HEURISTIC, SOLVING_ILP, PROCESS_SOLUTION };
private static int swigNext = 0;
private final int swigValue;
private final String swigName;
}
/*******************************************************************************
* Copyright (C) 2017 Philipp Spohr
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
package de.hhu.ba.yoshikoWrapper.swing;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URI;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.GroupLayout.Alignment;
import org.cytoscape.util.swing.BasicCollapsiblePanel;
import de.hhu.ba.yoshikoWrapper.core.LocalizationManager;
import de.hhu.ba.yoshikoWrapper.core.YoshikoLoader;
import de.hhu.ba.yoshikoWrapper.logging.YoshikoLogger;
import de.hhu.ba.yoshikoWrapper.swing.components.LibStatusPanel;
public class LibraryPanelFactory{
public static BasicCollapsiblePanel createLibraryPanel() {
final BasicCollapsiblePanel ret = new BasicCollapsiblePanel(LocalizationManager.get("libraryPanel"));
final LibStatusPanel libStatusPanel;
final JButton searchLibButton;
final JButton getYoshiko;
//SWING COMPONENT INITIALIZATION
libStatusPanel = new LibStatusPanel();
searchLibButton = new JButton(LocalizationManager.get("resolveLibPath"));
libStatusPanel.setStyle(YoshikoLoader.isLibraryLoaded());
searchLibButton.setEnabled(!YoshikoLoader.isLibraryLoaded());
searchLibButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
final JFileChooser c = new JFileChooser();
int returnVal = c.showOpenDialog(ret);
if (returnVal == JFileChooser.APPROVE_OPTION) {
YoshikoLoader.loadLibrary(c.getSelectedFile().getAbsolutePath());
}
libStatusPanel.setStyle(YoshikoLoader.isLibraryLoaded());
searchLibButton.setEnabled(!YoshikoLoader.isLibraryLoaded());
}
});
getYoshiko = new JButton(LocalizationManager.get("getYoshiko"));
getYoshiko.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO: Far Future: Fetch Yoshiko and auto-compile
Desktop desktop = Desktop.getDesktop();
if (desktop != null){
if(desktop.isSupported(Desktop.Action.BROWSE)) {
try {
desktop.browse(URI.create("https://github.com/spqrPh/yoshiko"));
} catch (Exception ex) {
YoshikoLogger.getInstance().getLogger().info("Can't access desktop browser!");
ex.printStackTrace();
}
}
}
}
});
SwingUtil.addAll(ret,
libStatusPanel,
searchLibButton,
getYoshiko
);
//Layout
GroupLayout layout = new GroupLayout(ret.getContentPane());
layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING,true)
.addComponent(libStatusPanel)
.addComponent(searchLibButton)
.addComponent(getYoshiko)
);
layout.setVerticalGroup(layout.createSequentialGroup()
.addComponent(libStatusPanel)
.addComponent(searchLibButton)
.addComponent(getYoshiko)
);
ret.getContentPane().setLayout(layout);
return ret;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment