diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/SolutionTab.java b/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/SolutionTab.java index ecc1bd984f281a42316d799d186d9557ed9e3e34..a017efc83b95a601a4aa6218345b89df6aa3d2ef 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/SolutionTab.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/SolutionTab.java @@ -1,16 +1,16 @@ /******************************************************************************* * 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 @@ -24,8 +24,8 @@ package de.hhu.ba.yoshikoWrapper.swing.components; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.Comparator; -import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JLabel; @@ -39,33 +39,50 @@ import de.hhu.ba.yoshikoWrapper.swing.SwingUtil; @SuppressWarnings("serial") public class SolutionTab extends JPanel { - + private final JScrollPane scrollPane; private final JPanel scrollPaneContent; private final JLabel clusterCount; private final JButton createMetaGraph; - + private final YoshikoSolution solution; - + public SolutionTab(YoshikoSolution s) { - + this.solution = s; - + this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); //init swing components scrollPaneContent = new JPanel(); scrollPaneContent.setLayout(new BoxLayout(scrollPaneContent,BoxLayout.Y_AXIS)); + + //Sort cluster by size, descending + solution.cluster.sort(new Comparator<YoshikoCluster>() { + + @Override + public int compare(YoshikoCluster o1, YoshikoCluster o2) { + if (o1.getSize() == o2.getSize()) { + return 0; + } + else if(o1.getSize() < o2.getSize()) { + return 1; + } + return -1; + } + + }); + for (YoshikoCluster c: solution.cluster) { ClusterView clusterView = new ClusterView(c); scrollPaneContent.add(clusterView); - scrollPaneContent.add(Box.createVerticalStrut(8)); } + scrollPane = new JScrollPane(scrollPaneContent); scrollPane.setPreferredSize(new Dimension(150,400)); - + clusterCount = new JLabel(LocalizationManager.get("clusterFound")+" "+s.cluster.size()); - + createMetaGraph = new JButton(LocalizationManager.get("createMetaGraph")); createMetaGraph.addActionListener(new ActionListener() { @@ -73,9 +90,9 @@ public class SolutionTab extends JPanel { public void actionPerformed(ActionEvent e) { solution.exportMetaGraph(); } - + }); SwingUtil.addAll(this,clusterCount,scrollPane,createMetaGraph); } - + } diff --git a/thesis/tex/Chapter/alg_overview.tex b/thesis/tex/Chapter/alg_overview.tex index 9e9959a416fe0fecb6d0b11825e0c78341737c30..93e0b8f9e3d9afe12db429fce2289ea0bee05a51 100644 --- a/thesis/tex/Chapter/alg_overview.tex +++ b/thesis/tex/Chapter/alg_overview.tex @@ -2,7 +2,7 @@ text width=5em, text centered, rounded corners, minimum height=4em] \tikzstyle{line} = [draw, -latex'] -\begin{figure} +\begin{figure}[h] \begin{tikzpicture}[node distance = 1cm] \node [block] (datamodel) {Data Modeling}; diff --git a/thesis/tex/Thesis.pdf b/thesis/tex/Thesis.pdf index 8b7d4e4b7f208df91a6ace87dd5a70902e74b0ed..f9c75fd1151540217f7d930dd18c14850a899a3c 100644 Binary files a/thesis/tex/Thesis.pdf and b/thesis/tex/Thesis.pdf differ diff --git a/thesis/tex/Thesis.tex b/thesis/tex/Thesis.tex index dab8775714ea73e212cce27f0be17a9da47a05c4..acc9667447d950c34da0b49f60128a205fa340e5 100644 --- a/thesis/tex/Thesis.tex +++ b/thesis/tex/Thesis.tex @@ -10,6 +10,7 @@ \usepackage{graphicx} \usepackage{tikz} \usepackage{verbatim} +\usepackage{float} \usetikzlibrary{shapes,arrows} \usetikzlibrary{positioning}