Commit e5764cff authored by Philipp Spohr's avatar Philipp Spohr
Browse files

Better feedback + new logo

parent d3a91a4b
......@@ -33,7 +33,7 @@
<groupId>de.hhu.ba</groupId>
<artifactId>yoshikoWrapper</artifactId>
<version>0.1.0</version>
<version>0.1.1</version>
<name>YoshikoWrapper</name>
......
......@@ -32,7 +32,7 @@ import de.hhu.ba.yoshikoWrapper.swig.LibraryInterface;
public class YoshikoLoader {
public static final String REQUIRED_VERSION = "2.1";
public static final String REQUIRED_VERSION = "2.1.1";
private static boolean isLoaded;
......@@ -52,11 +52,8 @@ public class YoshikoLoader {
logger.info("Attempting to load library @: "+libPath);
if (!libPath.substring(0,libPath.lastIndexOf(".")).endsWith(REQUIRED_VERSION)) {
throw new Exception(LocalizationManager.get("libFail")+" "+REQUIRED_VERSION);
//TODO: Error output!
}
System.load(libPath);
//update cfg
CyCore.cm.getProperties().setProperty("pathToYoshiko", libPath);
}
catch(Exception e) {
logger.error(e.getMessage());
......@@ -64,6 +61,8 @@ public class YoshikoLoader {
return;
}
LibraryInterface.setVerbosity(3);
//update cfg
CyCore.cm.getProperties().setProperty("pathToYoshiko", libPath);
isLoaded = true;
}
......
......@@ -18,8 +18,12 @@ public class LibraryInterfaceJNI {
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_instances_set(long jarg1, SolutionFlags jarg1_, long jarg2, DoubleVector jarg2_);
public final static native long SolutionFlags_instances_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);
......
......@@ -71,13 +71,28 @@ public class SolutionFlags {
return LibraryInterfaceJNI.SolutionFlags_optimal_get(swigCPtr, this);
}
public void setInstances(DoubleVector value) {
LibraryInterfaceJNI.SolutionFlags_instances_set(swigCPtr, this, DoubleVector.getCPtr(value), value);
public void setReducedInstances(int value) {
LibraryInterfaceJNI.SolutionFlags_reducedInstances_set(swigCPtr, this, value);
}
public DoubleVector getInstances() {
long cPtr = LibraryInterfaceJNI.SolutionFlags_instances_get(swigCPtr, this);
return (cPtr == 0) ? null : new DoubleVector(cPtr, false);
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);
}
}
......@@ -10,6 +10,7 @@ import java.net.URI;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import de.hhu.ba.yoshikoWrapper.core.LocalizationManager;
import de.hhu.ba.yoshikoWrapper.help.HelpLinks;
......@@ -45,6 +46,7 @@ public class HelpButton extends JButton{
try {
java.awt.Desktop.getDesktop().browse(uri);
} catch (IOException ex) {
JOptionPane.showMessageDialog(null, "DEBUG: Thesis is currently not online! Works only on my pc!");
ex.printStackTrace();
}
}
......
......@@ -13,8 +13,8 @@ import de.hhu.ba.yoshikoWrapper.swing.GraphicsLoader;
@SuppressWarnings("serial")
class LanguageRenderer extends JPanel implements ListCellRenderer<Locale>{
private static final int FLAG_SIZE_X = 48;
private static final int FLAG_SIZE_Y = 24;
private static final int FLAG_SIZE_X = 36;
private static final int FLAG_SIZE_Y = 18;
private final JLabel label;
......
/*******************************************************************************
* 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
......@@ -51,18 +51,18 @@ import de.hhu.ba.yoshikoWrapper.swing.SwingUtil;
*/
@SuppressWarnings("serial")//Will never be serialized
public class ResultPanel extends JPanel implements CytoPanelComponent{
private final JTabbedPane solutionTabs;
private final JButton destroyButton;
private BasicCollapsiblePanel marker;
private final YoshikoResult result;
public ResultPanel(YoshikoResult result) {
this.result = result;
//Init subcomponents
solutionTabs = new JTabbedPane();
for (YoshikoSolution s : result.solutions) {
......@@ -85,13 +85,8 @@ public class ResultPanel extends JPanel implements CytoPanelComponent{
optimalLabel = new JLabel(LocalizationManager.get("notOptimal"));
optimalLabel.setForeground(Color.RED);
marker.add(optimalLabel);
for (int i = 0; i < result.flags.getInstances().size();i++) {
marker.add(new JLabel(
LocalizationManager.get("instance")+" "+i+" "+
LocalizationManager.get("gap")+": "+
((int)(100*result.flags.getInstances().get(i)))+"%")
);
}
marker.add(new JLabel(result.flags.getSolvedInstances()+"/"+result.flags.getReducedInstances()+" "+LocalizationManager.get("redSolved")));
marker.add(new JLabel(LocalizationManager.get("lastInstanceGap")+" "+(int)(100*result.flags.getLastGap())+"%"));
}
JLabel costLabel = new JLabel(LocalizationManager.get("cost")+" "+result.flags.getTotalCost());
marker.add(costLabel);
......@@ -101,7 +96,7 @@ public class ResultPanel extends JPanel implements CytoPanelComponent{
marker.setCollapsed(false);
this.add(marker);
}
destroyButton = new JButton(LocalizationManager.get("discardSolution"));
destroyButton.addActionListener(new ActionListener() {
......@@ -109,24 +104,24 @@ public class ResultPanel extends JPanel implements CytoPanelComponent{
public void actionPerformed(ActionEvent e) {
deleteSolution();
}
});
SwingUtil.addAll(this,solutionTabs,destroyButton);
//Layout
GroupLayout layout = new GroupLayout(this);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
if (result.flags.getIlpGenerated()) {
layout.setVerticalGroup(layout.createSequentialGroup()
.addComponent(marker)
.addComponent(solutionTabs)
.addComponent(destroyButton)
);
layout.setHorizontalGroup(layout.createParallelGroup()
.addComponent(marker)
.addComponent(solutionTabs)
......@@ -138,7 +133,7 @@ public class ResultPanel extends JPanel implements CytoPanelComponent{
.addComponent(solutionTabs)
.addComponent(destroyButton)
);
layout.setHorizontalGroup(layout.createParallelGroup()
.addComponent(solutionTabs)
.addComponent(destroyButton)
......@@ -147,7 +142,7 @@ public class ResultPanel extends JPanel implements CytoPanelComponent{
this.setLayout(layout);
}
public void deleteSolution() {
int dialogResult = JOptionPane.showConfirmDialog (
null,
......@@ -158,12 +153,12 @@ public class ResultPanel extends JPanel implements CytoPanelComponent{
if (dialogResult != JOptionPane.YES_OPTION) {
return;
}
CyCore.registrar.unregisterService(this,CytoPanelComponent.class);
removeAll();
super.setVisible(false);
}
private void addSolutionTab(YoshikoSolution s) {
SolutionTab tab = new SolutionTab(s);
solutionTabs.add(
......
......@@ -26,7 +26,7 @@ cluster = Cluster
clusterFound = Clusters found:
clusterSize = Cluster Size:
continueTimeout = The ILP has exceeded the given time limit. Do you want to continue? (This may take a long time)
cost = Cost:
cost = Editing Cost:
createMetaGraph = Create Meta-Graph
currentGap = [ILP] Current Instance Gap
defaultDeletion = Default deletion cost:
......@@ -42,6 +42,7 @@ icTooltip = This value is used to determine what the algorithm pays when inserti
ilpMarker = ILP Properties
incompleteResult = This run yielded no usable result!
instance = Instance
lastInstanceGap = Gap (Current Instance):
libFail = Failed to load library! Make sure you got the right file. The required version for this version of the wrapper is:
libraryPanel = Library
metaGraph = Meta Graph
......@@ -51,12 +52,13 @@ noLibMessage = There is no Yoshiko Library currently loaded! You might have to s
noLibTitle = Library not loaded!
noMappingHint = You haven't mapped the cost value to a column in your edge table.\nYoshiko runs significantly faster and generates better solutions if you map values.
nodes = Nodes
notOptimal = Non-Optimal Solution
notOptimal = Optimality not guaranteed
nrSolutions = Number of Solutions:
operationMode = Operation Mode
optimal = Optimal Solution
paidCost = Paid a total modification cost of:
redRuleChooserTitle = Reduction Rules
redSolved = reduced instances solved
resolveLibPath = Resolve Yoshiko Library Path
restartNeeded = Changes only take effect after restart!
resultsPanelTitle = Yoshiko Results
......
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\author{Philipp Spohr}
\title{Rough Analysis of Cluster Editing Reduction Rules in Multi-Graphs}
\begin{document}
\maketitle
\section{}
\end{document}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment