diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..e79e5f868000ef4aed64d9c6eb0883a26a24b5dd --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +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. diff --git a/pom.xml b/pom.xml index 1ef32a4f72c9c5f3af0ea3a5f2ae54a835f166df..bc32d8082e8e2fcdf6d25e6ab7080e454cedd4bd 100644 --- a/pom.xml +++ b/pom.xml @@ -1,3 +1,24 @@ +<!-- + 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. +--> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -131,6 +152,11 @@ <version>${cytoscape.api.version}</version> <type>bundle</type> </dependency> + <dependency> + <groupId>org.cytoscape</groupId> + <artifactId>swing-util-api</artifactId> + <version>${cytoscape.api.version}</version> + </dependency> </dependencies> <description>A Cytoscape plugin for graph-based clustering that wraps the yoshiko algorithm.</description> diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java b/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java index 1f4f60ee45e87e9a9d4b8b81ac8341cf9eccb17d..aff1010ede85772e2c4a2a9520cd736004c6ba64 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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; import java.util.Properties; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/AlgorithmTask.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/AlgorithmTask.java index a07a2e9a6441444a9ed4883a647570a05d6cae66..77b7ca998c32261f88236e46f672609d6c16465f 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/AlgorithmTask.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/AlgorithmTask.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.Properties; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/ConfigurationManager.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/ConfigurationManager.java index 3138cdd0cfb4f4d9c9cf29ea618357df498a3d79..1fbcaac81d772d4823c42011b40a246ce02ff402 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/ConfigurationManager.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/ConfigurationManager.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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 org.cytoscape.property.AbstractConfigDirPropsReader; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/CyCore.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/CyCore.java index ef06d00fedfde22a2d6ea1428615d01c94e1d62b..2bd7ce6b34864a832ce0371a5e2ad34d0ae6b72d 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/CyCore.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/CyCore.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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 org.cytoscape.application.CyApplicationManager; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/GraphicsLoader.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/GraphicsLoader.java index 77ba43688d15d15d9e392309e909617954b2863d..3590a50085ced087982e3d73b3b19fcd373e527c 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/GraphicsLoader.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/GraphicsLoader.java @@ -1,22 +1,62 @@ +/******************************************************************************* + * 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.awt.Image; +import java.awt.image.BufferedImage; +import java.io.IOException; + +import javax.imageio.ImageIO; import javax.swing.ImageIcon; public class GraphicsLoader { - private static ImageIcon yoshikoLogo; - private static ImageIcon yoshikoText; + private static BufferedImage yoshikoLogo; + private static BufferedImage yoshikoText; + + private final static ClassLoader classLoader = GraphicsLoader.class.getClassLoader(); - public static ImageIcon getLogo() { + public static ImageIcon getLogo(int size) { if (yoshikoLogo == null) { - yoshikoLogo = new ImageIcon("/resources/graphics/YoshikoAlphaLogo.png"); + try { + yoshikoLogo = ImageIO.read( + classLoader.getResource("graphics/YoshikoAlphaLogo.png") + ); + } catch (IOException e) { + e.printStackTrace(); + } } - return yoshikoLogo; + return new ImageIcon(yoshikoLogo.getScaledInstance(size, size, Image.SCALE_SMOOTH)); } - public static ImageIcon getText() { - if (yoshikoLogo == null) { - yoshikoLogo = new ImageIcon("/graphics/YoshikoAlphaText.png"); + public static ImageIcon getText(int height) { + if (yoshikoText == null) { + try { + yoshikoText = ImageIO.read( + classLoader.getResource("graphics/YoshikoAlphaText.png") + ); + } catch (IOException e) { + e.printStackTrace(); + } } - return yoshikoText; + return new ImageIcon(yoshikoText.getScaledInstance(height*4, height, Image.SCALE_SMOOTH)); } } diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/LocalizationManager.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/LocalizationManager.java index 99807cbdf1befbcfc8a0b61a7fe06f4196d838ec..ef548ffadbe6fe969dfdebc4eb14dad220763e09 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/LocalizationManager.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/LocalizationManager.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.Collection; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/NetChangeListener.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/NetChangeListener.java index 49da3d04fe3ded97a69f4b3013a2aaecbe28ea9a..9a9e48ca36cbdc7c42246efca44b1cd250603c38 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/NetChangeListener.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/NetChangeListener.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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 org.cytoscape.application.events.SetCurrentNetworkEvent; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/NetworkParser.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/NetworkParser.java index 62079e0a5b7f77bd6c663d5f6cfa97184e182554..22e1a6ad69b1464e03dbbcd789af7b6023144e00 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/NetworkParser.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/NetworkParser.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/NodeMap.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/NodeMap.java index 821b51ae1f8db36630c51e53abaf6c55c2f1342a..83a2999a7f4c9bf9869c6999f6f71392e161809b 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/NodeMap.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/NodeMap.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.HashMap; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshikoLoader.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshikoLoader.java index 0934c7c2cfdea8c03b396f4e1f2e75670699e9dc..c8a8708a98c9a300cb4eb4a17b925badb15f97b8 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshikoLoader.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshikoLoader.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/package-info.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/package-info.java index 93b406c8378c0ca6f3c9bcaf520d69ba105153e4..b0e66624085e58b501f96d7f0b0d4dca9d50f654 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/package-info.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/package-info.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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. + ******************************************************************************/ /** * */ @@ -5,4 +26,4 @@ * @author Philipp Spohr, Aug 6, 2017 * */ -package de.hhu.ba.yoshikoWrapper.core; \ No newline at end of file +package de.hhu.ba.yoshikoWrapper.core; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/YoshikoCluster.java b/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/YoshikoCluster.java index 86021ef1f56e30484283ef8524c516e4764002fd..266fe6060ad3d30ed24ff1fa85a5cad9d6c4086d 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/YoshikoCluster.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/YoshikoCluster.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.graphModel; import java.util.ArrayList; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/YoshikoResult.java b/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/YoshikoResult.java index 455518d988e41707132f39be0027d9061d48dbd8..e641e9f9e3576a634a5276d6143ad739b72fe7c2 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/YoshikoResult.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/YoshikoResult.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.graphModel; import java.util.ArrayList; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/YoshikoSolution.java b/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/YoshikoSolution.java index 34394474241d8e3124cc54ffa7216c9b7dba65da..2b1237c8ff4b0eaa89d3906d6b5f4120bcdad175 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/YoshikoSolution.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/YoshikoSolution.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.graphModel; import java.util.ArrayList; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/package-info.java b/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/package-info.java index 0c6ae2fb03e36bf77ba91b7589a8a8ba55e0d185..a828f2d6d0a2eb84be52ef2b6a38410c25c444a4 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/package-info.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/package-info.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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. + ******************************************************************************/ /** * */ @@ -5,4 +26,4 @@ * @author Philipp Spohr, Aug 27, 2017 * */ -package de.hhu.ba.yoshikoWrapper.graphModel; \ No newline at end of file +package de.hhu.ba.yoshikoWrapper.graphModel; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ClusterView.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ClusterView.java index 3dbb10f31c4bafa52f416f3bd7b1fa60db97a7c3..328fa43eb4d4a57d102309885dd5c880f364be5f 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ClusterView.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ClusterView.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; import java.awt.Color; @@ -9,6 +30,7 @@ import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JLabel; +import javax.swing.JPanel; import javax.swing.border.Border; import org.cytoscape.model.CyNode; @@ -18,7 +40,7 @@ import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoCluster; @SuppressWarnings("serial") -public class ClusterView extends ComfortPanel { +public class ClusterView extends JPanel { private final JLabel title; private final JLabel clusterSize; @@ -43,7 +65,7 @@ public class ClusterView extends ComfortPanel { title = new JLabel(LocalizationManager.get("cluster")+" "+(c.id+1)); clusterSize = new JLabel(LocalizationManager.get("clusterSize")+" "+c.nodes.size()); - this.addAll(title,clusterSize); + SwingUtil.addAll(this,title,clusterSize); this.add(Box.createVerticalStrut(4)); //Loop over nodes in the cluster and add them to the view diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ColumnMapper.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ColumnMapper.java index 7d1c83bddaabbf25312c5dc0b3bb45aa4e0d6b79..a9837aad0305b287d2fa92ee42593b1b4f8b50ab 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ColumnMapper.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ColumnMapper.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; @@ -6,6 +27,7 @@ import java.awt.FlowLayout; import javax.swing.BoxLayout; import javax.swing.JCheckBox; import javax.swing.JComboBox; +import javax.swing.JPanel; import org.cytoscape.model.CyColumn; import org.cytoscape.model.CyNetwork; @@ -13,7 +35,7 @@ import org.cytoscape.model.CyNetwork; import de.hhu.ba.yoshikoWrapper.core.CyCore; @SuppressWarnings("serial") //will never be serialized -public class ColumnMapper extends ComfortPanel{ +public class ColumnMapper extends JPanel{ //Swing components @@ -25,9 +47,9 @@ public class ColumnMapper extends ComfortPanel{ private final JCheckBox useMappingPerm; private final JCheckBox useMappingForb; - private final ComfortPanel costGroup; - private final ComfortPanel permGroup; - private final ComfortPanel forbGroup; + private final JPanel costGroup; + private final JPanel permGroup; + private final JPanel forbGroup; public ColumnMapper() { this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); @@ -58,20 +80,20 @@ public class ColumnMapper extends ComfortPanel{ new EnableWhenSelectedListener(useMappingForb, forbiddenMapper) ); - costGroup = new ComfortPanel(); - permGroup = new ComfortPanel(); - forbGroup = new ComfortPanel(); + costGroup = new JPanel(); + permGroup = new JPanel(); + forbGroup = new JPanel(); costGroup.setLayout(new FlowLayout()); permGroup.setLayout(new FlowLayout()); forbGroup.setLayout(new FlowLayout()); - costGroup.addAll(useMappingCost,editingCostMapper); - permGroup.addAll(useMappingPerm,permanentMapper); - forbGroup.addAll(useMappingForb,forbiddenMapper); + SwingUtil.addAll(costGroup,useMappingCost,editingCostMapper); + SwingUtil.addAll(permGroup,useMappingPerm,permanentMapper); + SwingUtil.addAll(forbGroup,useMappingForb,forbiddenMapper); - this.addAll(costGroup,permGroup,forbGroup); + SwingUtil.addAll(this,costGroup,permGroup,forbGroup); //Initial call to get table values updateValues(); diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ComfortCollapsiblePanel.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ComfortCollapsiblePanel.java new file mode 100644 index 0000000000000000000000000000000000000000..9292f723d995d563d4613ebdf11ec3814293dbf2 --- /dev/null +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ComfortCollapsiblePanel.java @@ -0,0 +1,20 @@ +package de.hhu.ba.yoshikoWrapper.gui; + +import org.cytoscape.util.swing.BasicCollapsiblePanel; + +@SuppressWarnings("serial") +public class ComfortCollapsiblePanel extends BasicCollapsiblePanel { + + public ComfortCollapsiblePanel(String text) { + super(text); + } + + @Override + public void setCollapsed(boolean collapse) { + super.setCollapsed(collapse); + //Force resize of parent + if (getParent() != null) { + getParent().revalidate(); + } + } +} diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ComfortPanel.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ComfortPanel.java deleted file mode 100644 index dbe4b53955d61b900773ee3e08abd88f14400a46..0000000000000000000000000000000000000000 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ComfortPanel.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.hhu.ba.yoshikoWrapper.gui; - -import javax.swing.JComponent; -import javax.swing.JPanel; - -/** - * Custom extension of the standard JPanel that provides some comfort functions - * - */ -@SuppressWarnings("serial") -public class ComfortPanel extends JPanel { - - /** - * Comfort Function - * @param components The components that are to be added to this panel - */ - protected void addAll(JComponent... components) { - for (JComponent c : components){ - this.add(c); - } - - } -} diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/DoubleInputField.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/DoubleInputField.java index 80e89e20be5714c8c8a13cf52f6eba603fe83563..0b9da46486606a56b7d5f5086bc8f350560ce023 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/DoubleInputField.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/DoubleInputField.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; import javax.swing.JFormattedTextField; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/EditCostPanel.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/EditCostPanel.java index e8b6192f8d807f75b1c0a51f32a2de303b16c92f..0277bcd6562c61ed29e8e23cdf854bdc224a09fd 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/EditCostPanel.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/EditCostPanel.java @@ -1,19 +1,39 @@ +/******************************************************************************* + * 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.gui; import java.awt.FlowLayout; -import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JLabel; -import javax.swing.border.Border; -import javax.swing.border.EtchedBorder; +import javax.swing.JPanel; import org.cytoscape.model.CyColumn; +import org.cytoscape.util.swing.BasicCollapsiblePanel; import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; @SuppressWarnings("serial") //Will never be serialized -public class EditCostPanel extends ComfortPanel { +public class EditCostPanel extends BasicCollapsiblePanel { //SWING COMPONENTS private ColumnMapper columnMapper; @@ -24,10 +44,11 @@ public class EditCostPanel extends ComfortPanel { private JLabel icLabel; private JLabel dcLabel; - private ComfortPanel groupIC; - private ComfortPanel groupDC; + private JPanel groupIC; + private JPanel groupDC; public EditCostPanel() { + super(LocalizationManager.get("editingCostPanel")); //Define Layout this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); //Initialize components @@ -43,22 +64,20 @@ public class EditCostPanel extends ComfortPanel { icLabel = new JLabel(LocalizationManager.get("defaultInsertion")); dcLabel = new JLabel(LocalizationManager.get("defaultDeletion")); //Group the labels with their text fields - groupIC = new ComfortPanel(); - groupDC = new ComfortPanel(); + groupIC = new JPanel(); + groupDC = new JPanel(); groupIC.setLayout(new FlowLayout()); groupDC.setLayout(new FlowLayout()); - groupIC.addAll(icLabel,icField); - groupDC.addAll(dcLabel,dcField); + SwingUtil.addAll(groupIC,icLabel,icField); + SwingUtil.addAll(groupDC,dcLabel,dcField); - this.addAll(columnMapper,groupIC,groupDC); - - //Decoration/Visual - Border border = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED); - border = BorderFactory.createTitledBorder(border,LocalizationManager.get("editingCostPanel")); + SwingUtil.addAll(this,columnMapper,groupIC,groupDC); - this.setBorder(border); + //Decoration/Visual + //Border border = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED); + //this.setBorder(border); } //SETTER / GETTER diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/EnableWhenSelectedListener.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/EnableWhenSelectedListener.java index 1caa5265f9ab5bc4bc65e7d56ecf5e34779fa2c5..e021d4d2fab29ece3ce285f14d81634101b09fb0 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/EnableWhenSelectedListener.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/EnableWhenSelectedListener.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; import java.awt.event.ActionEvent; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/FormatHelper.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/FormatHelper.java index e85294a2636fd386ba6e066a79fada0bbdaa2a73..27549a353229d5367d5df6842367771bdd89e197 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/FormatHelper.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/FormatHelper.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; import java.text.DecimalFormat; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/IntegerInputField.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/IntegerInputField.java index 09d40d6a932918287d84399220973e38029e62cd..cc6049e807c6f5e02286ce84d4b9f00ab65a13df 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/IntegerInputField.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/IntegerInputField.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; import javax.swing.JFormattedTextField; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/LanguageSwitcher.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/LanguageSwitcher.java index 3bed26beca14fc4fb421aa6d274bc66b2379b72e..6773d7a6aca2cdd14f7401e62a8dd81e36f7ce22 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/LanguageSwitcher.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/LanguageSwitcher.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; import java.awt.event.ActionEvent; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/LibStatusPanel.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/LibStatusPanel.java index 0cc321a47527c0a12e74cf239a1233e368852eb3..a24bfdc32ec03b6593527b9ff064412574ec70ea 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/LibStatusPanel.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/LibStatusPanel.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; import java.awt.Color; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/LibraryPanel.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/LibraryPanel.java index 5b78ee19e147767204a91894c792b2fcc731afb3..bdb7f21577d1c17bea0ad0f9d7ed32dce0278ba9 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/LibraryPanel.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/LibraryPanel.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; import java.awt.event.ActionEvent; @@ -10,12 +31,14 @@ import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.border.EtchedBorder; +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.swig.LibraryInterface; @SuppressWarnings("serial") -public class LibraryPanel extends ComfortPanel { +public class LibraryPanel extends ComfortCollapsiblePanel { //SYMBOLIC LINKS private LibraryPanel self = this; @@ -26,6 +49,7 @@ public class LibraryPanel extends ComfortPanel { public LibraryPanel() { + super(LocalizationManager.get("libraryPanel")); this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); //SWING COMPONENT INITIALIZATION libStatusPanel = new LibStatusPanel(); @@ -54,9 +78,7 @@ public class LibraryPanel extends ComfortPanel { } }); - this.addAll(libStatusPanel,yoshikoVersionLabel,searchLibButton); - - //Decoration/Visual - this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); + SwingUtil.addAll(this,libStatusPanel,yoshikoVersionLabel,searchLibButton); + } } diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/MainPanel.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/MainPanel.java index a328edf645d32b309e04551c182622e4b9a5e429..23480f3cb283cae134abc16c09486580ca6fa656 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/MainPanel.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/MainPanel.java @@ -1,18 +1,44 @@ +/******************************************************************************* + * 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.gui; import java.awt.Component; +import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Arrays; +import javax.swing.BoxLayout; +import javax.swing.GroupLayout; +import javax.swing.GroupLayout.Alignment; import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JOptionPane; +import javax.swing.JPanel; import org.cytoscape.application.swing.CytoPanelComponent; import org.cytoscape.application.swing.CytoPanelName; @@ -26,11 +52,10 @@ import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; import de.hhu.ba.yoshikoWrapper.core.YoshikoLoader; /**This class describes the Swing Panel that the user interacts with in cytoscape - * @author Philipp Spohr, Aug 6, 2017 * */ @SuppressWarnings("serial") -public class MainPanel extends ComfortPanel implements CytoPanelComponent { +public class MainPanel extends JPanel implements CytoPanelComponent { //SWING COMPONENTS @@ -40,93 +65,87 @@ public class MainPanel extends ComfortPanel implements CytoPanelComponent { * Swing is a bit special sometimes, so a panel is used to wrap the lang-switcher. * This prevents stretching of the component */ - private final ComfortPanel langSwitcherWrapper; + private final JPanel langSwitcherWrapper; private final LanguageSwitcher langSwitcher; - private final LibraryPanel libraryPanel; - private final EditCostPanel ecPanel; - - private final ReductionRulesChooser reductionRulesChooser; - private final OperationModePanel opModePanel; - private final JCheckBox showAdvancedOptions; + //OTHER + - - private final ArrayList<JComponent> advancedOptions; - /** * Main constructor, creates a new Panel and initializes subcomponents */ public MainPanel() { //SWING INIT - this.setLayout(new FlowLayout()); + //Initialize Swing components header = new YoshikoHeader(); - langSwitcherWrapper = new ComfortPanel(); + langSwitcherWrapper = new JPanel(); langSwitcher = new LanguageSwitcher(); - langSwitcherWrapper.addAll(new JLabel(LocalizationManager.get("switchLanguage")),langSwitcher); + langSwitcherWrapper.add(new JLabel(LocalizationManager.get("switchLanguage"))); + langSwitcherWrapper.add(langSwitcher); langSwitcherWrapper.setLayout(new FlowLayout()); libraryPanel = new LibraryPanel(); + if (!YoshikoLoader.isLibraryLoaded()) { + libraryPanel.setCollapsed(false); + } ecPanel = new EditCostPanel(); + ecPanel.setCollapsed(false); opModePanel = new OperationModePanel(); reductionRulesChooser = new ReductionRulesChooser(); - JButton runButton = new JButton("RUN"); + JButton runButton = new JButton(LocalizationManager.get("run")); runButton.addActionListener(buttonListener); - showAdvancedOptions = new JCheckBox(LocalizationManager.get("showAdvanced")); - showAdvancedOptions.addActionListener(toggleAdvancedOptionsListener); - - this.addAll( + SwingUtil.addAll(this, header, langSwitcherWrapper, - showAdvancedOptions, libraryPanel, ecPanel, reductionRulesChooser, opModePanel, runButton ); + + + //Layout + GroupLayout layout = new GroupLayout(this); - advancedOptions = new ArrayList<JComponent>(); - //Manage all advanced components separately to enable toggling - advancedOptions.addAll( - Arrays.asList( - opModePanel, - reductionRulesChooser - ) + layout.setHorizontalGroup(layout.createParallelGroup() + .addComponent(header) + .addComponent(langSwitcherWrapper) + .addComponent(libraryPanel) + .addComponent(ecPanel) + .addComponent(reductionRulesChooser) + .addComponent(opModePanel) + .addComponent(runButton) ); - showAdvancedOptions(false); + layout.setVerticalGroup(layout.createSequentialGroup() + .addComponent(header) + .addComponent(langSwitcherWrapper) + .addComponent(libraryPanel) + .addComponent(ecPanel) + .addComponent(reductionRulesChooser) + .addComponent(opModePanel) + .addComponent(runButton) + ); + + this.setLayout(layout); this.setVisible(true); } - - private ActionListener toggleAdvancedOptionsListener = new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - showAdvancedOptions(showAdvancedOptions.isSelected()); - } - - }; - - private void showAdvancedOptions(boolean show) { - for (JComponent j : advancedOptions) { - j.setVisible(show); - } - } /** * ButtonListener for the "Run" Button @@ -191,7 +210,7 @@ public class MainPanel extends ComfortPanel implements CytoPanelComponent { } public Icon getIcon() { - return GraphicsLoader.getLogo(); + return GraphicsLoader.getLogo(16); } diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/OperationModePanel.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/OperationModePanel.java index 133db243b212bfc3f7c40d4b289c9add259cd0a3..f0fa03c1e1094511aef6aee1e651377552da9ebd 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/OperationModePanel.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/OperationModePanel.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; import java.awt.event.ActionEvent; @@ -11,10 +32,12 @@ import javax.swing.JRadioButton; import javax.swing.border.Border; import javax.swing.border.EtchedBorder; +import org.cytoscape.util.swing.BasicCollapsiblePanel; + import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; @SuppressWarnings("serial") -public class OperationModePanel extends ComfortPanel{ +public class OperationModePanel extends ComfortCollapsiblePanel{ private final JRadioButton useHeuristic; private final JRadioButton useILP; private final TimeLimitSetter timeLimitSetter; @@ -25,7 +48,7 @@ public class OperationModePanel extends ComfortPanel{ private final ButtonGroup heuristicGroup; public OperationModePanel() { - + super(LocalizationManager.get("operationMode")); this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); heuristicGroup = new ButtonGroup(); @@ -49,11 +72,8 @@ public class OperationModePanel extends ComfortPanel{ useHeuristic.addActionListener(ilpHeuristicSwitch); - this.addAll(useILP,useHeuristic,solutionNumberChooser,timeLimitSetter,useTriangleCutsBox,usePartitionCutsBox); - - Border border = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED); - border = BorderFactory.createTitledBorder(border,LocalizationManager.get("operationMode")); - this.setBorder(border); + SwingUtil.addAll(this,useILP,useHeuristic,solutionNumberChooser,timeLimitSetter,useTriangleCutsBox,usePartitionCutsBox); + } ActionListener ilpHeuristicSwitch = new ActionListener() { diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ReductionRulesChooser.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ReductionRulesChooser.java index 20b1a2f3f57a19c261a4c9d2384d629d6e3e0757..074cd3460e78051ddbc61448236a9f7f4b3d991f 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ReductionRulesChooser.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ReductionRulesChooser.java @@ -1,20 +1,39 @@ +/******************************************************************************* + * 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.gui; -import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JCheckBox; import javax.swing.JLabel; -import javax.swing.border.Border; -import javax.swing.border.EtchedBorder; +import javax.swing.JPanel; + import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; @SuppressWarnings("serial") -public class ReductionRulesChooser extends ComfortPanel{ +public class ReductionRulesChooser extends ComfortCollapsiblePanel{ private final JCheckBox useCRule; private final JCheckBox useCCRule; @@ -25,10 +44,11 @@ public class ReductionRulesChooser extends ComfortPanel{ private final DoubleInputField multFactor; - private final ComfortPanel SNPanel; + private final JPanel SNPanel; public ReductionRulesChooser() { + super(LocalizationManager.get("redRuleChooserTitle")); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); //Initialize subcomponents useCRule = new JCheckBox("Use Clique Rule"); @@ -39,11 +59,17 @@ public class ReductionRulesChooser extends ComfortPanel{ useSNRule = new JCheckBox("Use Similar Neighborhood Rule"); multFactor = new DoubleInputField(1, Double.POSITIVE_INFINITY); multFactor.setText("1.0"); - SNPanel = new ComfortPanel(); + SNPanel = new JPanel(); + + SwingUtil.addAll(SNPanel,new JLabel(LocalizationManager.get("multFactor")),multFactor); - SNPanel.addAll(new JLabel(LocalizationManager.get("multFactor")),multFactor); useSNRule.setSelected(true); - + useCRule.setSelected(true); + useCCRule.setSelected(true); + useACRule.setSelected(true); + useHERule.setSelected(true); + usePDRRule.setSelected(true); + useSNRule.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -57,7 +83,7 @@ public class ReductionRulesChooser extends ComfortPanel{ }); - this.addAll( + SwingUtil.addAll(this, useCRule, useCCRule, useACRule, @@ -66,16 +92,6 @@ public class ReductionRulesChooser extends ComfortPanel{ useSNRule, SNPanel ); - //By default all reduction rules should be applied - for (Component c :this.getComponents()) { - if (c instanceof JCheckBox) { - ((JCheckBox)c).setSelected(true); - } - } - - //Create titled border - Border border = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED); - this.setBorder(BorderFactory.createTitledBorder(border, LocalizationManager.get("redRuleChooserTitle"))); } diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ResultPanel.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ResultPanel.java index b9a075476f539858e52a9b0c1fc592490ed25acb..a6515d33198d91aab43955683da3447e604622a1 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ResultPanel.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/ResultPanel.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; import java.awt.Component; @@ -9,12 +30,14 @@ import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JOptionPane; +import javax.swing.JPanel; import javax.swing.JTabbedPane; import org.cytoscape.application.swing.CytoPanelComponent; import org.cytoscape.application.swing.CytoPanelName; import de.hhu.ba.yoshikoWrapper.core.CyCore; +import de.hhu.ba.yoshikoWrapper.core.GraphicsLoader; import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoResult; import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoSolution; @@ -23,7 +46,7 @@ import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoSolution; * Conforms to CY 3.5 by being a CytoPanelComponent which is the norm for "result" panels */ @SuppressWarnings("serial")//Will never be serialized -public class ResultPanel extends ComfortPanel implements CytoPanelComponent{ +public class ResultPanel extends JPanel implements CytoPanelComponent{ private final JTabbedPane solutionTabs; private final JLabel costLabel; @@ -56,7 +79,7 @@ public class ResultPanel extends ComfortPanel implements CytoPanelComponent{ }); - addAll(costLabel,solutionTabs,destroyButton); + SwingUtil.addAll(this,costLabel,solutionTabs,destroyButton); } public void deleteSolution() { @@ -106,8 +129,7 @@ public class ResultPanel extends ComfortPanel implements CytoPanelComponent{ @Override public Icon getIcon() { - // TODO Auto-generated method stub - return null; + return GraphicsLoader.getLogo(16); } } diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/SolutionNumberChooser.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/SolutionNumberChooser.java index c75006a6b83624d9129fd818e972093220912db7..6f7e860354b2e5f70495b1b35271b4a8722cee46 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/SolutionNumberChooser.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/SolutionNumberChooser.java @@ -1,13 +1,35 @@ +/******************************************************************************* + * 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.gui; import javax.swing.JLabel; +import javax.swing.JPanel; import javax.swing.JSpinner; import javax.swing.SpinnerNumberModel; import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; @SuppressWarnings("serial") -public class SolutionNumberChooser extends ComfortPanel { +public class SolutionNumberChooser extends JPanel { private final JSpinner numSolutionsSetter; private final JLabel label; @@ -16,7 +38,7 @@ public class SolutionNumberChooser extends ComfortPanel { numSolutionsSetter = new JSpinner(); numSolutionsSetter.setModel(new SpinnerNumberModel(1,1,Integer.MAX_VALUE,1)); label = new JLabel(LocalizationManager.get("nrSolutions")); - this.addAll(label, numSolutionsSetter); + SwingUtil.addAll(this,label, numSolutionsSetter); } @Override diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/SolutionTab.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/SolutionTab.java index 8a71ad1426deacb9c16b0720ed3ed5b34fd46432..4ef005df628b5db3f7fb74ebb19fecc15ac6f6db 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/SolutionTab.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/SolutionTab.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; import java.awt.Dimension; @@ -8,6 +29,7 @@ import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JLabel; +import javax.swing.JPanel; import javax.swing.JScrollPane; import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; @@ -15,10 +37,10 @@ import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoCluster; import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoSolution; @SuppressWarnings("serial") -public class SolutionTab extends ComfortPanel { +public class SolutionTab extends JPanel { private final JScrollPane scrollPane; - private final ComfortPanel scrollPaneContent; + private final JPanel scrollPaneContent; private final JLabel clusterCount; private final JButton createMetaGraph; @@ -30,7 +52,7 @@ public class SolutionTab extends ComfortPanel { this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); //init swing components - scrollPaneContent = new ComfortPanel(); + scrollPaneContent = new JPanel(); scrollPaneContent.setLayout(new BoxLayout(scrollPaneContent,BoxLayout.Y_AXIS)); for (YoshikoCluster c: solution.cluster) { ClusterView clusterView = new ClusterView(c); @@ -52,7 +74,7 @@ public class SolutionTab extends ComfortPanel { } }); - this.addAll(clusterCount,scrollPane,createMetaGraph); + SwingUtil.addAll(this,clusterCount,scrollPane,createMetaGraph); } } diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/SwingUtil.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/SwingUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..2761282dd6f8842d2ca9a63e164386cf0bbc666e --- /dev/null +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/SwingUtil.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * 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.gui; + +import javax.swing.JComponent; +import javax.swing.JPanel; + +public class SwingUtil { + static void addAll(JPanel panel, JComponent ... components) { + for (JComponent c: components) { + panel.add(c); + } + } +} diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/TimeLimitSetter.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/TimeLimitSetter.java index abb2ea29319e33162acc2f57c6d16e832c3715e6..81afa9bda5be7f95c6cd2593ba16f6dfb1349489 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/TimeLimitSetter.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/TimeLimitSetter.java @@ -1,14 +1,36 @@ +/******************************************************************************* + * 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.gui; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JCheckBox; +import javax.swing.JPanel; import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; @SuppressWarnings("serial") -public class TimeLimitSetter extends ComfortPanel{ +public class TimeLimitSetter extends JPanel{ private JCheckBox checkBox; private IntegerInputField numberField; @@ -29,7 +51,7 @@ public class TimeLimitSetter extends ComfortPanel{ } ); //REGISTER COMPONENTS - this.addAll(checkBox,numberField); + SwingUtil.addAll(this,checkBox,numberField); } @Override diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YLibChooser.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YLibChooser.java index 176ec96476cec2782e1e9be3b2353d08ba67fe12..3beb2bd295be1dd0276239a4bb84701e1cc88090 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YLibChooser.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YLibChooser.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; import java.io.File; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YoshikoHeader.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YoshikoHeader.java index 220ddcfa05e0a3ed8a56d1402517680d7d470f36..889a03ba4b84cf4e443511a319430607212667f5 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YoshikoHeader.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YoshikoHeader.java @@ -1,13 +1,35 @@ +/******************************************************************************* + * 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.gui; import javax.swing.BoxLayout; import javax.swing.JLabel; +import javax.swing.JPanel; import de.hhu.ba.yoshikoWrapper.core.GraphicsLoader; @SuppressWarnings("serial") -public class YoshikoHeader extends ComfortPanel { +public class YoshikoHeader extends JPanel { private JLabel logo; private JLabel text; @@ -15,10 +37,10 @@ public class YoshikoHeader extends ComfortPanel { public YoshikoHeader() { this.setLayout(new BoxLayout(this,BoxLayout.X_AXIS)); - logo = new JLabel(GraphicsLoader.getLogo()); - text = new JLabel(GraphicsLoader.getText()); - - this.addAll(logo,text); + logo = new JLabel(GraphicsLoader.getLogo(32)); + text = new JLabel(GraphicsLoader.getText(32)); + + SwingUtil.addAll(this,logo,text); } } diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YoshikoHelpDialog.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YoshikoHelpDialog.java index e30e48b2874341266093b064fc2d6e422853285f..71ae6ea6e7d1a4d0f36b4743f6a5a8c5b698811f 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YoshikoHelpDialog.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YoshikoHelpDialog.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; import javax.swing.JDialog; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YoshikoHelpModel.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YoshikoHelpModel.java index 241ac67a90a9d760cbea6b34305f2ed7b7544784..907a23e6d65d3db0fe85cc02af60efc701dd494a 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YoshikoHelpModel.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/YoshikoHelpModel.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.gui; import javax.swing.event.TreeModelListener; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/package-info.java b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/package-info.java index af1b4ba45c3d45e8e18a4dea897dfc1baf319f6f..602043fa71d32602f9bdc2482005a7b586ccd3c6 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/gui/package-info.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/gui/package-info.java @@ -1,4 +1,25 @@ +/******************************************************************************* + * 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. + ******************************************************************************/ /**This package contains all Swing extensions and components (frontend) * */ -package de.hhu.ba.yoshikoWrapper.gui; \ No newline at end of file +package de.hhu.ba.yoshikoWrapper.gui; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/logging/YoshikoLogger.java b/src/main/java/de/hhu/ba/yoshikoWrapper/logging/YoshikoLogger.java index 09df8c9cadb1ae328cb9951ee900a5c3fa57f7e9..e208f49e83f3e9d6f302b1a54dd3f438f9217e9a 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/logging/YoshikoLogger.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/logging/YoshikoLogger.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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.logging; import org.slf4j.Logger; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/logging/package-info.java b/src/main/java/de/hhu/ba/yoshikoWrapper/logging/package-info.java index 4e8e500c890ca7f22e25bb81ad33dadbf0cde386..92f5ada2d239d344c5e69bea09b8e82a572fa2e5 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/logging/package-info.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/logging/package-info.java @@ -1,4 +1,25 @@ +/******************************************************************************* + * 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.logging; \ No newline at end of file +package de.hhu.ba.yoshikoWrapper.logging; diff --git a/src/main/resources/YoshikoStrings.properties b/src/main/resources/YoshikoStrings.properties index bf621de17807e7de115c41874326f76c66022de3..1ecfdc7ff7ee9efb86c83e1d3e481a677eb72668 100644 --- a/src/main/resources/YoshikoStrings.properties +++ b/src/main/resources/YoshikoStrings.properties @@ -1,3 +1,24 @@ +#------------------------------------------------------------------------------- +# 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 = Yoshiko Results yoshVersion = Yoshiko Version resolveLibPath = Resolve Yoshiko Library Path @@ -24,8 +45,10 @@ createMetaGraph = Create Meta-Graph metaGraph = Meta Graph showAdvanced = Show advanced options 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. Existing mappings overwrite this value. A higher value means that the algorithm is less likely to insert edges in order to generate a cluster. -operationMode = Operation Mode \ No newline at end of file +operationMode = Operation Mode +run = Perform Algorithm diff --git a/src/main/resources/YoshikoStrings_de_DE.properties b/src/main/resources/YoshikoStrings_de_DE.properties index 92b28a93cb86d67279a2428dbd801360868984f9..aa89df1fcf8bfadbcf1e171edffd1a0b87b35b9d 100644 --- a/src/main/resources/YoshikoStrings_de_DE.properties +++ b/src/main/resources/YoshikoStrings_de_DE.properties @@ -1,5 +1,26 @@ +#------------------------------------------------------------------------------- +# 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 = Yoshiko Ergebnisse resolveLibPath = Yoshiko Library suchen clusterSize = Cluster Gr��e: solution = L�sung -clustersFound = Gefundene Cluster: \ No newline at end of file +clustersFound = Gefundene Cluster: diff --git a/src/main/resources/graphics/YoshikoAlphaLogo.png b/src/main/resources/graphics/YoshikoAlphaLogo.png index 526809e194d1b5ba94fe2c78c0f0d884d409d30d..f13dc35cf24becfe8be3f416884073b36b04f8ea 100644 Binary files a/src/main/resources/graphics/YoshikoAlphaLogo.png and b/src/main/resources/graphics/YoshikoAlphaLogo.png differ diff --git a/src/main/resources/graphics/YoshikoAlphaText.png b/src/main/resources/graphics/YoshikoAlphaText.png index eafac8c6726b9433584f17cc41eb11290e4cf5a0..5d9b127ace12d72208f05f4d3633ee0ed0f0472c 100644 Binary files a/src/main/resources/graphics/YoshikoAlphaText.png and b/src/main/resources/graphics/YoshikoAlphaText.png differ diff --git a/src/main/resources/graphics/package-info.java b/src/main/resources/graphics/package-info.java index 0a04afdd37e91f106a5d8050957cc42c77e819e0..d4f1d0f32acf9be174e4bce864697760189f1861 100644 --- a/src/main/resources/graphics/package-info.java +++ b/src/main/resources/graphics/package-info.java @@ -1 +1,22 @@ -package graphics; \ 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. + ******************************************************************************/ +package graphics;