Skip to content
Snippets Groups Projects
Commit a3c19b48 authored by Philipp Spohr's avatar Philipp Spohr
Browse files

When it's really time to take a break

parent 0bf99ba6
No related branches found
No related tags found
No related merge requests found
Showing
with 226 additions and 25 deletions
......@@ -25,6 +25,8 @@ import java.awt.Color;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.HashMap;
import java.util.Locale;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
......@@ -38,6 +40,23 @@ public class GraphicsLoader {
private final static ClassLoader classLoader = GraphicsLoader.class.getClassLoader();
private final static HashMap<Locale,BufferedImage> flags;
static {
flags = new HashMap<Locale,BufferedImage>();
try {
flags.put(LocalizationManager.usEnglish, ImageIO.read(classLoader.getResource("graphics/flags/enUS.png")));
flags.put(LocalizationManager.german, ImageIO.read(classLoader.getResource("graphics/flags/deDE.png")));
flags.put(LocalizationManager.serbocroatianLatin, ImageIO.read(classLoader.getResource("graphics/flags/hrHR.png")));
flags.put(LocalizationManager.modernGreek, ImageIO.read(classLoader.getResource("graphics/flags/elEL.png")));
} catch (IOException e) {
e.printStackTrace();
}
}
public static ImageIcon getFlag(Locale lcl, int width, int height) {
return new ImageIcon(flags.get(lcl).getScaledInstance(width, height, Image.SCALE_SMOOTH));
}
public static ImageIcon getLogo(int size) {
if (yoshikoLogo == null) {
try {
......
......@@ -38,8 +38,11 @@ public class LocalizationManager {
//Locales
static private final Locale usEnglish = new Locale("en","US");
static private final Locale german = new Locale("de","DE");
static public final Locale usEnglish = new Locale("en","US");
static public final Locale german = new Locale("de","DE");
static public final Locale serbocroatianLatin = new Locale("hr","HR");
static public final Locale modernGreek = new Locale("el","EL");
//Map
static private final HashMap<String, Locale> locales;
......@@ -48,6 +51,9 @@ public class LocalizationManager {
locales = new HashMap<String, Locale>();
locales.put("enUS", usEnglish);
locales.put("deDE", german);
locales.put("hrHR", serbocroatianLatin);
locales.put("elEL", modernGreek);
}
......@@ -64,6 +70,14 @@ public class LocalizationManager {
);
}
//https://en.wikipedia.org/wiki/Regional_Indicator_Symbol -> Right now there are not enough fonts support this
public static String localeToUnicodeFlag(Locale locale) {
String countryCode = locale.getCountry();
int firstLetter = Character.codePointAt(countryCode, 0)-0x41+0x1F1E6;
int secondLetter = Character.codePointAt(countryCode, 1)-0x41+0x1F1E6;
return new String(Character.toChars(firstLetter))+new String(Character.toChars(secondLetter));
}
//SETTER/GETTER methods
......
package de.hhu.ba.yoshikoWrapper.gui;
import java.awt.Component;
import java.util.Locale;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.ListCellRenderer;
import de.hhu.ba.yoshikoWrapper.core.GraphicsLoader;
@SuppressWarnings("serial")
class LanguageRenderer extends JPanel implements ListCellRenderer<Locale>{
private final JLabel label;
public LanguageRenderer() {
label = new JLabel();
this.add(label);
}
@Override
public Component getListCellRendererComponent(
JList<? extends Locale> list,
Locale value,
int index,
boolean isSelected,
boolean cellHasFocus)
{
if (isSelected) {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());
} else {
setBackground(list.getBackground());
setForeground(list.getForeground());
}
label.setIcon(GraphicsLoader.getFlag(value, 64, 32));
label.setText(value.getDisplayLanguage());
return this;
}
}
......@@ -33,7 +33,11 @@ import de.hhu.ba.yoshikoWrapper.core.LocalizationManager;
@SuppressWarnings( "serial")
public class LanguageSwitcher extends JComboBox<Locale>{
public LanguageSwitcher() {
this.setRenderer(new LanguageRenderer());
for (Locale l: LocalizationManager.getLocales() ) {
this.addItem(l);
if (LocalizationManager.getCurrentLocale() == l) {
......
......@@ -24,3 +24,4 @@ resolveLibPath = Yoshiko Library suchen
clusterSize = Cluster Größe:
solution = Lösung
clustersFound = Gefundene Cluster:
showAdvanced = Erweiterte Optionen anzeigen
#-------------------------------------------------------------------------------
# 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.
#-------------------------------------------------------------------------------
resultsPanelTitle = \u0393\u03B5\u03B9\u03BF\u03C7\u03AF\u03BA\u03BF Results
yoshVersion = \u0393\u03B5\u03B9\u03BF\u03C7\u03AF\u03BA\u03BF Version
resolveLibPath = Resolve Yoshiko Library Path
yoshTask = Performing Yoshiko Algorithm
solution = Solution
restartNeeded = Changes only take effect after restart!
noLibTitle = Library not loaded!
noLibMessage = There is no Yoshiko Library currently loaded! You might have to specify its location.
cluster = Cluster
clusterSize = Cluster Size:
multFactor = Multiplicative Factor for SNR:
paidCost = Paid a total modification cost of:
clusterFound = Clusters found:
deleteSolution = Do you really want to delete this solution?
warning = Warning
timeLimitILP = Use time limit for ILP (s):
timedOutTitle = Timeout
timedOutMessage = The ILP exceeded the time-limit!
cost = Cost:
nrSolutions = Number of Solutions:
redRuleChooserTitle = Reduction Rules
discardSolution = Discard
createMetaGraph = Create Meta-Graph
metaGraph = Meta Graph
showAdvanced = \u03A0\u03C1\u03BF\u03B7\u03B3\u03BC\u03AD\u03BD\u03B5\u03C2 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AD\u03C2
editingCostPanel = Editing Costs
libraryPanel = Library
defaultInsertion = Default insertion cost:
defaultDeletion = Default deletion cost:
switchLanguage = Plugin language
icTooltip = This value is used to determine what the algorithm pays when inserting an edge.\nExisting mappings overwrite this value.\nA higher value means that the algorithm is less likely to insert edges in order to generate a cluster.
operationMode = Operation Mode
run = Perform Algorithm
nodes = Nodes
continueTimeout = The ILP has exceeded the given time limit. Do you want to continue? (This may take a long time)
timeoutTitle = Timeout
incompleteResult = This run yielded no usable result!
optimal = Optimal Solution
notOptimal = Non-Optimal Solution
ilpMarker = ILP Properties
timeoutMarker = Timed Out
instance = Instance
gap = Gap
currentGap = [ILP] Current Instance Gap
disableMultiThreading = Disable Multithreading
yoshikoHint = Yoshiko Hint
getYoshiko = Get Yoshiko Library
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.
firstStart = Thanks for using the Yoshiko Clustering Tool!\nIt appears, that this is your first time using this tool.\nIf you want an in-depth explanation of the algorithm please refer to: [INSERT COOL LINK HERE]
\ No newline at end of file
#-------------------------------------------------------------------------------
# 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.
#-------------------------------------------------------------------------------
resultsPanelTitle = Yo\u0161iko Results
yoshVersion = Yoshiko Version
resolveLibPath = Resolve Yoshiko Library Path
yoshTask = Performing Yoshiko Algorithm
solution = Solution
restartNeeded = Changes only take effect after restart!
noLibTitle = Library not loaded!
noLibMessage = There is no Yoshiko Library currently loaded! You might have to specify its location.
cluster = Cluster
clusterSize = Cluster Size:
multFactor = Multiplicative Factor for SNR:
paidCost = Paid a total modification cost of:
clusterFound = Clusters found:
deleteSolution = Do you really want to delete this solution?
warning = Warning
timeLimitILP = Use time limit for ILP (s):
timedOutTitle = Timeout
timedOutMessage = The ILP exceeded the time-limit!
cost = Cost:
nrSolutions = Number of Solutions:
redRuleChooserTitle = Reduction Rules
discardSolution = Discard
createMetaGraph = Create Meta-Graph
metaGraph = Meta Graph
showAdvanced = Prika\u017Ei/sakrij napredne opcije
editingCostPanel = Editing Costs
libraryPanel = Library
defaultInsertion = Default insertion cost:
defaultDeletion = Default deletion cost:
switchLanguage = Plugin language
icTooltip = This value is used to determine what the algorithm pays when inserting an edge.\nExisting mappings overwrite this value.\nA higher value means that the algorithm is less likely to insert edges in order to generate a cluster.
operationMode = Operation Mode
run = Perform Algorithm
nodes = Nodes
continueTimeout = The ILP has exceeded the given time limit. Do you want to continue? (This may take a long time)
timeoutTitle = Timeout
incompleteResult = This run yielded no usable result!
optimal = Optimal Solution
notOptimal = Non-Optimal Solution
ilpMarker = ILP Properties
timeoutMarker = Timed Out
instance = Instance
gap = Gap
currentGap = [ILP] Current Instance Gap
disableMultiThreading = Disable Multithreading
yoshikoHint = Yoshiko Hint
getYoshiko = Get Yoshiko Library
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.
firstStart = Thanks for using the Yoshiko Clustering Tool!\nIt appears, that this is your first time using this tool.\nIf you want an in-depth explanation of the algorithm please refer to: [INSERT COOL LINK HERE]
\ No newline at end of file
src/main/resources/graphics/flags/deDE.png

562 B

<svg xmlns="http://www.w3.org/2000/svg" height="512" width="512" viewBox="0 0 512 512">
<path fill="#ffce00" d="M0 341.338h512.005v170.67H0z"/>
<path d="M0 0h512.005v170.67H0z"/>
<path fill="#d00" d="M0 170.67h512.005v170.668H0z"/>
</svg>
src/main/resources/graphics/flags/elEL.png

867 B

src/main/resources/graphics/flags/enUS.png

12.5 KiB

<svg xmlns="http://www.w3.org/2000/svg" height="512" width="512" viewBox="0 0 512 512">
<g fill-rule="evenodd" transform="scale(3.9385)">
<g stroke-width="1pt">
<path d="M0 0h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0z" fill="#bd3d44"/>
<path d="M0 10h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0z" fill="#fff"/>
</g>
<path fill="#192f5d" d="M0 0h98.8v70H0z"/>
<g fill="#fff">
<path d="M8.233 2.996l.9 2.767h2.908l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.353 1.71.898 2.766L24.7 8.53l-2.353 1.71.898-2.766-2.353-1.71h2.909zm16.467 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.466 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.354 1.71.9 2.766L74.1 8.53l-2.353 1.71.898-2.766-2.353-1.71h2.909zm16.467 0l.899 2.767h2.909l-2.354 1.71.9 2.766-2.354-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zM16.467 9.996l.899 2.767h2.909l-2.353 1.71.898 2.766-2.353-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zm16.466 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.353 1.71.898 2.766-2.353-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.466 0l.899 2.767h2.909l-2.354 1.71.9 2.766-2.354-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zM8.233 16.996l.9 2.767h2.908l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.353 1.71.898 2.766-2.353-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zm16.467 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.466 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.354 1.71.9 2.766-2.354-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zm16.467 0l.899 2.767h2.909l-2.354 1.71.9 2.766-2.354-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zM16.467 23.996l.899 2.767h2.909l-2.353 1.71.898 2.766-2.353-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zm16.466 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.353 1.71.898 2.766-2.353-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.466 0l.899 2.767h2.909l-2.354 1.71.9 2.766-2.354-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zM8.233 30.996l.9 2.767h2.908l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.353 1.71.898 2.766-2.353-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zm16.467 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.466 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.354 1.71.9 2.766-2.354-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zm16.467 0l.899 2.767h2.909l-2.354 1.71.9 2.766-2.354-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zM16.467 37.996l.899 2.767h2.909l-2.353 1.71.898 2.766-2.353-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zm16.466 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.353 1.71.898 2.766-2.353-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.466 0l.899 2.767h2.909l-2.354 1.71.9 2.766-2.354-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909z"/>
<g>
<path d="M8.233 44.996l.9 2.767h2.908l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.353 1.71.898 2.766-2.353-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zm16.467 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.466 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.354 1.71.9 2.766-2.354-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zm16.467 0l.899 2.767h2.909l-2.354 1.71.9 2.766-2.354-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zM16.467 51.996l.899 2.767h2.909l-2.353 1.71.898 2.766-2.353-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zm16.466 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.353 1.71.898 2.766-2.353-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.466 0l.899 2.767h2.909l-2.354 1.71.9 2.766-2.354-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909z"/>
</g>
<g>
<path d="M8.233 58.996l.9 2.767h2.908l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.353 1.71.898 2.766-2.353-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zm16.467 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.466 0l.899 2.767h2.909l-2.353 1.71.899 2.766-2.354-1.71-2.353 1.71.899-2.766-2.354-1.71h2.91zm16.467 0l.899 2.767h2.909l-2.354 1.71.9 2.766-2.354-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909zm16.467 0l.899 2.767h2.909l-2.354 1.71.9 2.766-2.354-1.71-2.353 1.71.898-2.766-2.353-1.71h2.909z"/>
</g>
</g>
</g>
</svg>
src/main/resources/graphics/flags/hrHR.png

26.8 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment