Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 69ba6de

Browse files
committed
Merge pull request #78 from tiwiz/native-look-and-feel
Native look and feel
2 parents 5952071 + 2ba4e21 commit 69ba6de

File tree

16 files changed

+63
-124
lines changed

16 files changed

+63
-124
lines changed
281 Bytes
Loading
313 Bytes
Loading
803 Bytes
Loading
165 Bytes
Loading
290 Bytes
Loading
224 Bytes
Loading

ClassySharkWS/src/com/google/classyshark/gui/GuiMode.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,11 @@ public void run() {
4040
});
4141
}
4242

43-
private static void setParamsForOtherPlatforms() throws Exception {
44-
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
45-
UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
46-
}
47-
4843
private static void buildAndShowClassyShark(List<String> cmdLineArgs) {
4944
try {
50-
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
45+
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
5146
} catch (UnsupportedLookAndFeelException | IllegalAccessException | ClassNotFoundException
52-
| InstantiationException ex) {
47+
| InstantiationException | SecurityException ex) {
5348
ex.printStackTrace();
5449
}
5550

ClassySharkWS/src/com/google/classyshark/gui/panel/ClassySharkPanel.java

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,6 @@ public ClassySharkPanel(JFrame frame, File archive) {
9191

9292
public ClassySharkPanel(JFrame frame) {
9393
super(false);
94-
UIManager.put("swing.boldMetal", Boolean.FALSE);
95-
UIManager.put("Button.select", Color.GRAY);
96-
UIManager.put("ToggleButton.select", Color.GRAY);
97-
98-
UIManager.put("TabbedPane.contentAreaColor ", ColorScheme.LIGHT_GRAY);
99-
UIManager.put("TabbedPane.selected", ColorScheme.BLACK);
100-
UIManager.put("TabbedPane.background", ColorScheme.LIGHT_GRAY);
101-
UIManager.put("TabbedPane.shadow", ColorScheme.FOREGROUND_CYAN);
102-
UIManager.put("TabbedPane.darkShadow", ColorScheme.LIGHT_GRAY);
103-
UIManager.put("TabbedPane.foreground", ColorScheme.FOREGROUND_CYAN);
104-
UIManager.put("TabbedPane.unselectedTabForeground", ColorScheme.FOREGROUND_CYAN);
105-
UIManager.put("TabbedPane.selectedForeground", ColorScheme.FOREGROUND_CYAN);
106-
UIManager.put("TabbedPane.tabInsets", new Insets(5, 10, 5, 10));
107-
UIManager.put("TabbedPane.font", new Font("SansSerif", Font.BOLD, 16));
108-
10994
buildUI();
11095
parentFrame = frame;
11196
toolbar.setText("");
@@ -283,8 +268,6 @@ private void buildUI() {
283268
BorderLayout borderLayout = new BorderLayout();
284269
setLayout(borderLayout);
285270

286-
setBackground(ColorScheme.BLACK);
287-
288271
ringChartPanel = new RingChartPanel(this);
289272

290273
toolbar = new Toolbar(this);
@@ -296,12 +279,11 @@ private void buildUI() {
296279

297280
filesTree = new FilesTree(this);
298281
JTabbedPane jTabbedPane = new JTabbedPane();
299-
jTabbedPane.setBackground(ColorScheme.BACKGROUND);
300282
JScrollPane leftScrollPane = new JScrollPane(filesTree.getJTree());
301283

302-
jTabbedPane.addTab("Archive", leftScrollPane);
284+
jTabbedPane.addTab("Classes", leftScrollPane);
303285
methodsCountPanel = new MethodsCountPanel(this);
304-
jTabbedPane.addTab("Packages", methodsCountPanel);
286+
jTabbedPane.addTab("Methods count", methodsCountPanel);
305287

306288
jTabbedPane.addChangeListener(new ChangeListener() {
307289
@Override
@@ -318,7 +300,6 @@ public void stateChanged(ChangeEvent e) {
318300
});
319301

320302
jSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
321-
jSplitPane.setBackground(ColorScheme.BACKGROUND);
322303
jSplitPane.setDividerSize(3);
323304
jSplitPane.setPreferredSize(new Dimension(1000, 700));
324305

ClassySharkWS/src/com/google/classyshark/gui/panel/ColorScheme.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,10 @@
2424
public class ColorScheme {
2525
private ColorScheme(){}
2626

27-
public static final Color BACKGROUND = new Color(0x2b, 0x2b, 0x2b);
28-
public static final Color FOREGROUND_YELLOW = new Color(0xFF, 0xFF, 0x80);
29-
public static final Color FOREGROUND_ORANGE = new Color(0xFF, 0x99, 0x33);
30-
public static final Color FOREGROUND_CYAN = new Color(0xd8, 0xd8, 0xd8);
31-
public static final Color WHITE = Color.white;
32-
public static final Color BLACK = Color.black;
33-
public static final Color FOREGROUND_YELLOW_ANNOTATIONS = new Color(0xBB, 0xB5, 0x29);
27+
public static final Color DEFAULT = new Color(0x61, 0x62, 0x7C);
28+
public static final Color KEYWORDS = new Color(0xAA, 0x7D, 0x29);
29+
public static final Color IDENTIFIERS = new Color(0x78, 0x8A, 0x4);
30+
public static final Color ANNOTATIONS = new Color(0xD2, 0x16, 0x5B);
3431
public static final Color SELECTION_BG = new Color(0x21, 0x42, 0x83);
35-
public static final Color LIGHT_GRAY = new Color(0x58, 0x58, 0x58);
32+
public static final Color NAMES = new Color(0x61, 0x62, 0x7C);
3633
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.google.classyshark.gui.panel;
2+
3+
4+
public class IconSchemes {
5+
6+
private static final String ROOT_PATH = "resources/";
7+
private static final String EXTENSION = ".png";
8+
9+
public static final String TOGGLE_ICON_PATH = ROOT_PATH + "ic_menu" + EXTENSION;
10+
public static final String RECENT_ICON_PATH = ROOT_PATH + "ic_history" + EXTENSION;
11+
public static final String BACK_ICON_PATH = ROOT_PATH + "ic_back" + EXTENSION;
12+
public static final String NEXT_ICON_PATH = ROOT_PATH + "ic_next" + EXTENSION;
13+
public static final String OPEN_ICON_PATH = ROOT_PATH + "ic_open" + EXTENSION;
14+
public static final String EXPORT_ICON_PATH = ROOT_PATH + "ic_export" + EXTENSION;
15+
}

0 commit comments

Comments
 (0)