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

Cosmetic changes

parent bb28c093
No related branches found
No related tags found
No related merge requests found
...@@ -32,10 +32,14 @@ import javax.imageio.ImageIO; ...@@ -32,10 +32,14 @@ import javax.imageio.ImageIO;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
public class GraphicsLoader { public class GraphicsLoader {
//TODO: Organize Images in HashMap for better readability / flexibility
private static BufferedImage yoshikoLogo; private static BufferedImage yoshikoLogo;
private static BufferedImage yoshikoLogo_solved; private static BufferedImage yoshikoLogo_solved;
private static BufferedImage yoshikoText; private static BufferedImage yoshikoText;
private static BufferedImage infoIcon; private static BufferedImage infoIcon;
private static BufferedImage infoIcon_highlighted;
public final static Color yoshikoGreen = new Color(0,128,0); public final static Color yoshikoGreen = new Color(0,128,0);
...@@ -58,6 +62,19 @@ public class GraphicsLoader { ...@@ -58,6 +62,19 @@ public class GraphicsLoader {
return new ImageIcon(flags.get(lcl).getScaledInstance(width, height, Image.SCALE_SMOOTH)); return new ImageIcon(flags.get(lcl).getScaledInstance(width, height, Image.SCALE_SMOOTH));
} }
public static ImageIcon getInfoIconHL(int size) {
if (infoIcon_highlighted == null) {
try {
infoIcon_highlighted = ImageIO.read(
classLoader.getResource("graphics/InfoHighlighted.png")
);
} catch (IOException e) {
e.printStackTrace();
}
}
return new ImageIcon(infoIcon_highlighted.getScaledInstance(size, size, Image.SCALE_SMOOTH));
}
public static ImageIcon getInfoIcon(int size) { public static ImageIcon getInfoIcon(int size) {
if (infoIcon == null) { if (infoIcon == null) {
try { try {
......
package de.hhu.ba.yoshikoWrapper.swing.components; package de.hhu.ba.yoshikoWrapper.swing.components;
import java.awt.Insets;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton; import javax.swing.JButton;
import de.hhu.ba.yoshikoWrapper.core.GraphicsLoader; import de.hhu.ba.yoshikoWrapper.core.GraphicsLoader;
...@@ -14,10 +17,16 @@ import de.hhu.ba.yoshikoWrapper.help.HelpLinks; ...@@ -14,10 +17,16 @@ import de.hhu.ba.yoshikoWrapper.help.HelpLinks;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class HelpButton extends JButton{ public class HelpButton extends JButton{
private static final int SIZE = 16;
private static final ImageIcon defaultIcon = GraphicsLoader.getInfoIcon(SIZE);
private static final ImageIcon hlIcon = GraphicsLoader.getInfoIconHL(SIZE);
public HelpButton() { public HelpButton() {
super(GraphicsLoader.getInfoIcon(12)); super(defaultIcon);
setMargin(new Insets(0,0,0,0));
setToolTipText(LocalizationManager.get("tooltip_helpButton")); setToolTipText(LocalizationManager.get("tooltip_helpButton"));
setBorder(BorderFactory.createEmptyBorder());
addActionListener( addActionListener(
new ActionListener() { new ActionListener() {
@Override @Override
...@@ -31,9 +40,24 @@ public class HelpButton extends JButton{ ...@@ -31,9 +40,24 @@ public class HelpButton extends JButton{
} }
} }
} }
} }
); );
//Add mouse listener (cosmetic only)
addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) {}
@Override
public void mousePressed(MouseEvent e) {}
@Override
public void mouseReleased(MouseEvent e) {}
@Override
public void mouseEntered(MouseEvent e) {
setIcon(hlIcon);
}
@Override
public void mouseExited(MouseEvent e) {
setIcon(defaultIcon);
}
});
} }
} }
...@@ -13,6 +13,9 @@ import de.hhu.ba.yoshikoWrapper.core.GraphicsLoader; ...@@ -13,6 +13,9 @@ import de.hhu.ba.yoshikoWrapper.core.GraphicsLoader;
@SuppressWarnings("serial") @SuppressWarnings("serial")
class LanguageRenderer extends JPanel implements ListCellRenderer<Locale>{ class LanguageRenderer extends JPanel implements ListCellRenderer<Locale>{
private static final int FLAG_SIZE_X = 48;
private static final int FLAG_SIZE_Y = 24;
private final JLabel label; private final JLabel label;
public LanguageRenderer() { public LanguageRenderer() {
...@@ -37,7 +40,7 @@ class LanguageRenderer extends JPanel implements ListCellRenderer<Locale>{ ...@@ -37,7 +40,7 @@ class LanguageRenderer extends JPanel implements ListCellRenderer<Locale>{
setForeground(list.getForeground()); setForeground(list.getForeground());
} }
label.setIcon(GraphicsLoader.getFlag(value, 64, 32)); label.setIcon(GraphicsLoader.getFlag(value, FLAG_SIZE_X, FLAG_SIZE_Y));
label.setText(value.getDisplayLanguage()); label.setText(value.getDisplayLanguage());
return this; return this;
......
src/main/resources/graphics/Info.png

4.02 KiB | W: | H:

src/main/resources/graphics/Info.png

1.89 KiB | W: | H:

src/main/resources/graphics/Info.png
src/main/resources/graphics/Info.png
src/main/resources/graphics/Info.png
src/main/resources/graphics/Info.png
  • 2-up
  • Swipe
  • Onion skin
src/main/resources/graphics/InfoHighlighted.png

2.8 KiB

...@@ -26,3 +26,5 @@ ...@@ -26,3 +26,5 @@
\end{figure} \end{figure}
ROUGH IDEA:
COMPLETE GRAPH, CHOOSE EDGES SO THAT sum of C(E) is MAX while satisfying Triangle inequalities > Fully Disjunct Clique-Graph
\ No newline at end of file
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment