Skip to content

Commit d9537b5

Browse files
committed
Merge remote-tracking branch 'origin/master' into caret-colour
Conflicts: src/main/java/mdlaf/themes/MaterialOceanicTheme.java
2 parents 9075f25 + 6f83e95 commit d9537b5

File tree

66 files changed

+2448
-633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2448
-633
lines changed

README.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Material-UI-Swing
22
[![Maven Central](https://img.shields.io/maven-central/v/io.github.vincenzopalazzo/material-ui-swing?color=%237cc4f4&style=for-the-badge)](https://search.maven.org/search?q=g:%22io.github.vincenzopalazzo%22%20AND%20a:%22material-ui-swing%22)
33
![GitHub All Releases](https://img.shields.io/github/downloads/atarw/material-ui-swing/total?style=for-the-badge)
4-
[![Donation](https://img.shields.io/website/http/vincenzopalazzo.github.io/material-ui-swing-donations.svg?style=for-the-badge&up_color=yellow&up_message=Donation)](https://vincenzopalazzo.github.io/material-ui-swing-donations)
4+
5+
<div align="center">
6+
<img src="https://raw.githubusercontent.com/vincenzopalazzo/material-ui-swing-donations/master/images/iconMaterialOfficial.png" />
7+
</div>
58

69
A modern, Material Design UI for Java Swing
710

@@ -72,28 +75,28 @@ To change the theme, use the below code:
7275
A working example is also found [here](https://github.com/vincenzopalazzo/material-ui-swing/tree/masternow/src/test/java/integration/gui/mock).
7376

7477
This theming system was implemented by [@vincenzopalazzo](https://github.com/vincenzopalazzo)
75-
78+
7679
## Stack Overflow
7780

7881
We don't have much time to write detailed documentation, but if you want to get help, post a question on Stack Overflow with the tags `material-ui-swing`, `java`, `material`, `swing`, `look-and-feel`.
7982

8083
## Repository
81-
84+
8285
_Maven_
83-
86+
8487
```
8588
<dependency>
8689
<groupId>io.github.vincenzopalazzo</groupId>
8790
<artifactId>material-ui-swing</artifactId>
88-
<version>1.1.1_beta</version>
91+
<version>1.1.1_pre-release_6.1</version>
8992
</dependency>
9093
```
9194

9295
_Gradle_
93-
96+
97+
```
98+
implementation 'io.github.vincenzopalazzo:material-ui-swing:1.1.1_pre-release_6.1'
9499
```
95-
implementation 'io.github.vincenzopalazzo:material-ui-swing:1.1.1_beta'
96-
```
97100

98101
Others version [here](https://search.maven.org/artifact/io.github.vincenzopalazzo/material-ui-swing)
99102

@@ -109,7 +112,15 @@ Contact us if you use this look and feel so we can add your project to the list
109112
## Community
110113
[![Gitter chat](https://img.shields.io/gitter/room/vincenzopalazzo/material-ui-swing.svg?style=for-the-badge)](https://gitter.im/material-ui-swing/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
111114

112-
[A fork of this project exists](https://github.com/vincenzopalazzo/material-ui-swing) and is maintained by [@vincenzopalazzo](https://github.com/vincenzopalazzo), which implements some Android components not found in the traditional Java Swing library.
115+
### Sponsors
116+
Support this project
117+
118+
[![Donation](https://img.shields.io/website/http/vincenzopalazzo.github.io/material-ui-swing-donations.svg?style=for-the-badge&up_color=yellow&up_message=Donation)](https://vincenzopalazzo.github.io/material-ui-swing-donations)
119+
![Custom badge](https://img.shields.io/endpoint?style=for-the-badge&url=https%3A%2F%2Fshieldsio-patreon.herokuapp.com%2Fmaterialuiswing)
120+
121+
_Donors_
122+
- [lilili87222](https://github.com/lilili87222)
123+
- Arizona State University
113124

114125
# Screenshot
115126
## MaterialLiteTheme
@@ -119,6 +130,16 @@ Contact us if you use this look and feel so we can add your project to the list
119130
![](https://i.ibb.co/fdHTGf0/Selection-080.png)
120131

121132
## JMarsDarkTheme
122-
![Selection_071](https://i.ibb.co/XFxkWKz/Selection-079.png)
133+
![](https://i.ibb.co/XFxkWKz/Selection-079.png)
134+
135+
Other screenshot you can found [here](https://github.com/vincenzopalazzo/material-ui-swing/releases)
136+
137+
## Java doc
138+
139+
You can consult the javadoc at [this link](https://vincenzopalazzo.github.io/material-ui-swing/)
140+
141+
## Dev
123142

124-
Other screenshot you can found [here](https://github.com/vincenzopalazzo/material-ui-swing/releases)
143+
This is the official repository of material-ui-swing but the developing of a new feature we do in this
144+
in this repository [vincenzopalazzo/material-ui-swing](https://github.com/vincenzopalazzo/material-ui-swing) and after testing
145+
the official release will release in this branch.
2.63 MB
Binary file not shown.

demo/Demo-Swing-set3.tar

1.58 MB
Binary file not shown.

pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.mdlaf</groupId>
88
<artifactId>material-ui-swing</artifactId>
9-
<version>1.1.1-beta</version>
9+
<version>1.1.1_pre-release_6.1</version>
1010

1111
<dependencies>
1212
<dependency>
@@ -23,6 +23,20 @@
2323
<version>1.6.1</version>
2424
</dependency>
2525

26+
<dependency>
27+
<groupId>com.github.jiconfont</groupId>
28+
<artifactId>jiconfont-swing</artifactId>
29+
<version>1.0.1</version>
30+
</dependency>
31+
32+
33+
34+
<dependency>
35+
<groupId>com.github.jiconfont</groupId>
36+
<artifactId>jiconfont-google_material_design_icons</artifactId>
37+
<version>2.2.0.2</version>
38+
</dependency>
39+
2640
</dependencies>
2741

2842
<build>

src/main/java/MaterialUISwingDemo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ public void actionPerformed(ActionEvent e) {
328328
// make everything visible to the world
329329
frame.pack ();
330330
frame.setVisible (true);
331-
331+
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
332+
332333
JFileChooser fileChooser = new JFileChooser ();
333334
fileChooser.showOpenDialog (frame);
334335
}

src/main/java/mdlaf/MaterialLookAndFeel.java

Lines changed: 60 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
/*
1+
/**
22
* MIT License
33
*
4-
* Copyright (c) 2018-2019 atharva washimkar,
5-
* Copyright (c) 2019 Vincent Palazzo vincenzopalazzodev@gmail.com
4+
* Copyright (c) 2018-2020 atharva washimkar, Vincenzo Palazzo vincenzopalazzo1996@gmail.com
65
*
76
* Permission is hereby granted, free of charge, to any person obtaining a copy
87
* of this software and associated documentation files (the "Software"), to deal
@@ -74,6 +73,7 @@
7473

7574
import javax.swing.*;
7675
import javax.swing.plaf.BorderUIResource;
76+
import javax.swing.plaf.InsetsUIResource;
7777
import javax.swing.plaf.basic.BasicLookAndFeel;
7878
import javax.swing.plaf.metal.MetalLookAndFeel;
7979
import javax.swing.text.DefaultEditorKit;
@@ -254,6 +254,8 @@ protected void initComponentDefaults(UIDefaults table) {
254254
table.put("Button.foreground", theme.getButtonTextColor());
255255
table.put("Button[Default].background", theme.getButtonDefaultBackgroundColor());
256256
table.put("Button[Default].foreground", theme.getButtonDefaultTextColor());
257+
// table.put("Button[Default].disabledBackground", MaterialColors.LIGHT_BLUE_800);
258+
//table.put("Button[Default].disabledForeground", MaterialColors.COSMO_DARK_GRAY);
257259
table.put("Button.disabledBackground", theme.getButtonDisabledBackground());
258260
table.put("Button.disabledForeground", theme.getButtonDisabledForeground());
259261
table.put("Button.font", theme.getButtonFont());
@@ -265,7 +267,7 @@ protected void initComponentDefaults(UIDefaults table) {
265267
table.put("Button[focus].color", theme.getButtonFocusColor());
266268
table.put("Button.disabledText", theme.getButtonDisableTextColor());
267269
table.put("Button[Default].shadowPixel", 3);
268-
table.put("Button[Default].shadowEnable", false);
270+
//table.put("Button[Default].shadowEnable", false); removed
269271
table.put("Button[Default][focus].color", theme.getButtonDefaultFocusColor());
270272
table.put("Button[border].enable", theme.getButtonBorderEnable());
271273
table.put("Button[border].color", theme.getButtonBorderColor());
@@ -302,7 +304,9 @@ protected void initComponentDefaults(UIDefaults table) {
302304
table.put("Label.font", theme.getFontRegular());
303305
table.put("Label.background", theme.getBackgroundPrimary());
304306
table.put("Label.foreground", theme.getTextColor());
305-
table.put("Label.opaque", true);
307+
//TODO remove set opaque to material-ui-swing because this propriety is an ""BUG""
308+
//and this is an good answer implementation on stack overflow https://stackoverflow.com/a/2452381/10854225
309+
// table.put("Label.opaque", true);
306310
table.put("Label.disabledForeground", theme.getDisableTextColor());
307311
table.put("Label.border", new BorderUIResource(BorderFactory.createEmptyBorder()));
308312

@@ -387,37 +391,45 @@ protected void initComponentDefaults(UIDefaults table) {
387391
table.put("Slider[halo].color", theme.getHaloColorSlider());
388392
table.put("Slider.border", theme.getBorderSlider());
389393

394+
// also, look this style https://material.io/design/platform-guidance/android-split-screen.html#usage
390395
table.put("SplitPane.border", theme.getBorderPanel());
391-
table.put("SplitPane.background", theme.getBackgroundPrimary());
392-
table.put("SplitPane.dividerSize", 5);
393-
table.put("SplitPaneDivider.border", new BorderUIResource(BorderFactory.createEmptyBorder()));
394-
table.put("SplitPaneDivider.background", theme.getBackgroundPrimary());
395-
396+
table.put("SplitPane.background", theme.getDisableTextColor());
397+
table.put("SplitPane.dividerSize", theme.getSizeDividierSplitPane());
398+
table.put("SplitPaneDivider.border", theme.getDividierBorderSplitPane());
399+
table.put("SplitPaneDivider.background", theme.getColorDividierSplitPane());
400+
table.put("SplitPaneDivider.draggingColor", theme.getColorDividierFocusSplitPane());
401+
402+
//TODO the comment proprieties will be remove to version 1.2 of the library
403+
//for the moment are deprecated
396404
table.put("TabbedPane.font", theme.getFontRegular());
397405
table.put("TabbedPane.background", theme.getBackgroundPrimary());
398406
table.put("TabbedPane.tabAreaBackground", theme.getBackgroundPrimary());
399407
table.put("TabbedPane.foreground", theme.getTextColor());
408+
table.put("TabbedPane.disabledForeground", theme.getDisableTextColor());
400409
table.put("TabbedPane.selectionForeground", theme.getFocusColorLineTabbedPane());
401410
table.put("TabbedPane.contentAreaColor", theme.getButtonTextColor());
402411
table.put("TabbedPane.disableContentAreaColor", theme.getDisableColorTabTabbedPane());
403412
table.put("TabbedPane.border", theme.getBorderPanel());
404413
table.put("TabbedPane.shadow", theme.getBackgroundPrimary());
405-
table.put("TabbedPane.darkShadow", theme.getBackgroundPrimary());
414+
table.put("TabbedPane.darkShadow", theme.getBackgroundPrimary()); //TODO add another propriety for change this color in the MaterialTheming
406415
table.put("TabbedPane.highlight", theme.getDisableTextColor());
407416
table.put("TabbedPane.selected", theme.getTextColor());
408417
table.put("TabbedPane.light", theme.getBackgroundPrimary());
409418
table.put("TabbedPane.borderHighlightColor", theme.getBorderHighlightColorTabbedPane());
410419
table.put("TabbedPane[focus].colorLine", theme.getFocusColorLineTabbedPane());
411420
table.put("TabbedPane[MouseHover].enable", theme.getMouseHoverEnableTabbedPane());
412-
table.put("TabbedPane.spacer", theme.getSpacerTabbedPane());
413-
table.put("TabbedPane.indent", theme.getIndentTabbedPane());
414-
table.put("TabbedPane.tabInsets", theme.getTabInsetsTabbedPane());
421+
//table.put("TabbedPane.spacer", theme.getSpacerTabbedPane());
422+
//table.put("TabbedPane.indent", theme.getIndentTabbedPane());
423+
table.put("TabbedPane.tabInsets", new InsetsUIResource(6, 12, 10, 12));
424+
table.put("TabbedPane.contentBorderInsets", new InsetsUIResource(6, 20, 10, 20));
415425
table.put("TabbedPane.selectedTabPadInsets", theme.getSelectedTabInsetsTabbedPane());
416-
table.put("TabbedPane.linePositionY", theme.getLinePositionYTabbedPane());
417-
table.put("TabbedPane.linePositionX", theme.getLinePositionXTabbedPane());
418-
table.put("TabbedPane.lineWidth", theme.getLineWithTabbedPane());
426+
//table.put("TabbedPane.linePositionY", theme.getLinePositionYTabbedPane());
427+
//table.put("TabbedPane.linePositionX", theme.getLinePositionXTabbedPane());
428+
//table.put("TabbedPane.lineWidth", theme.getLineWithTabbedPane());
419429
table.put("TabbedPane.lineHeight", theme.getLineHeightTabbedPane());
420-
table.put("TabbedPane.lineArch", theme.getLineArchTabbedPane());
430+
//table.put("TabbedPane.lineArch", theme.getLineArchTabbedPane());
431+
table.put("TabbedPane[focus].margin", 5);
432+
421433

422434
table.put("Table.selectionBackground", theme.getSelectionBackgroundTable());
423435
table.put("Table.selectionForeground", theme.getSelectionForegroundTable());
@@ -428,20 +440,28 @@ protected void initComponentDefaults(UIDefaults table) {
428440
table.put("Table.gridColor", theme.getGridColorTable());
429441
table.put("Table.focusable", theme.getTableFocusable());
430442
table.put("Table.opaque", theme.getTableOpaque());
431-
table.put("Table.alternateRowColor", theme.getAlternateRowColorEnableTable());
432-
table.put("Table.alternateRowBackground", theme.getAlternateRowBackgroundTable());
443+
//This propriety was used also how default
444+
//TODO refactoring this proprieties
445+
//TODO add why
446+
table.put("Table.alternateRowColor", theme.getAlternateRowBackgroundTable());
447+
//table.put("Table.alternateRowColor", theme.getAlternateRowColorEnableTable());
448+
//table.put("Table.alternateRowBackground", theme.getAlternateRowBackgroundTable());
433449
table.put("Table[row].height", theme.getHeightRowTable());
434450
table.put("Table[CheckBox].checked", theme.getSelectedCheckBoxIconTable());
435451
table.put("Table[CheckBox].unchecked", theme.getUnselectedCheckBoxIconTable());
436452
table.put("Table[CheckBox].selectionChecked", theme.getSelectedCheckBoxIconSelectionRowTable());
437453
table.put("Table[CheckBox].selectionUnchecked", theme.getUnselectedCheckBoxIconSelectionRowTable());
438454
table.put("Table.focusCellHighlightBorder", new BorderUIResource(BorderFactory.createEmptyBorder()));
455+
table.put("Table.showVerticalLines", false);
456+
table.put("Table.showHorizontalLines", false);
457+
table.put("Table.intercellSpacing", new java.awt.Dimension(0, 0));
439458

440459
table.put("TableHeader.background", theme.getBackgroundTableHeader());
441460
table.put("TableHeader.foreground", theme.getForegroundTableHeader());
442461
table.put("TableHeader.border", theme.getBorderTableHeader());
443462
table.put("TableHeader.font", theme.getFontBold());
444463
table.put("TableHeader.cellBorder", theme.getCellBorderTableHeader());
464+
table.put("TableHeader.gridColor", theme.getBackgroundTableHeader());
445465

446466
table.put("TextArea.background", theme.getBackgroundTextField());
447467
table.put("TextArea.border", theme.getBorderTextField());
@@ -456,8 +476,15 @@ protected void initComponentDefaults(UIDefaults table) {
456476
table.put("ToggleButton.select", theme.getHighlightBackgroundPrimary());
457477
table.put("ToggleButton.foreground", theme.getTextColor());
458478
table.put("ToggleButton.disabledText", theme.getDisableTextColor());
459-
table.put("ToggleButton.icon", MaterialImageFactory.getInstance().getImage(MaterialImageFactory.TOGGLE_BUTTON_BLACK_OFF));
460-
table.put("ToggleButton.selectedIcon", MaterialImageFactory.getInstance().getImage(MaterialImageFactory.TOGGLE_BUTTON_BLACK_ON));
479+
table.put("ToggleButton.icon", theme.getUnselectedIconToggleButton());
480+
table.put("ToggleButton.selectedIcon", theme.getSelectedIconToggleButton());
481+
table.put("ToggleButton.withoutIcon", theme.isWithoutIconToggleButton());
482+
table.put("ToggleButton[withoutIcon].selectedBackground", theme.getWithoutIconSelectedBackgroundToggleButton());
483+
table.put("ToggleButton[withoutIcon].selectedForeground", theme.getWithoutIconSelectedForegoundToggleButton());
484+
table.put("ToggleButton[withoutIcon].background", theme.getWithoutIconBackgroundToggleButton());
485+
table.put("ToggleButton[withoutIcon].foreground", theme.getWithoutIconForegroundToggleButton());
486+
table.put("ToggleButton[withoutIcon].selectedBorder", theme.getWithoutIconSelectedBorderToggleButton());
487+
table.put("ToggleButton[withoutIcon].border", theme.getWithoutIconBorderToggleButton());
461488

462489
table.put("ToolBar.font", theme.getFontRegular());
463490
table.put("ToolBar.background", theme.getBackgroundPrimary());
@@ -472,6 +499,7 @@ protected void initComponentDefaults(UIDefaults table) {
472499
table.put("Tree.selectionBackground", theme.getSelectionBackgroundTree());
473500
table.put("Tree.background", theme.getBackgroundPrimary());
474501
table.put("Tree.selectionBorderColor", theme.getSelectionBorderColorTree());
502+
table.put("Tree.border", theme.getBorderTree());
475503
table.put("Tree.collapsedIcon", null);
476504
table.put("Tree.expandedIcon", null);
477505
table.put("Tree.closedIcon", theme.getClosedIconTree());
@@ -510,8 +538,8 @@ protected void initComponentDefaults(UIDefaults table) {
510538
table.put("EditorPane.font", theme.getFontRegular());
511539
table.put("EditorPane.focusInputMap", multilineInputMap);
512540

513-
table.put("Separator.background", MaterialColors.GRAY_300);
514-
table.put("Separator.foreground", MaterialColors.GRAY_300);
541+
table.put("Separator.background", theme.getBackgroundSeparator());
542+
table.put("Separator.foreground", theme.getForegroundSeparator());
515543

516544
table.put("ToolTip.background", MaterialColors.GRAY_500);
517545
table.put("ToolTip.foreground", MaterialColors.GRAY_50);
@@ -520,6 +548,8 @@ protected void initComponentDefaults(UIDefaults table) {
520548
table.put("TextField.background", theme.getBackgroundTextField());
521549
table.put("TextField.foreground", theme.getTextColor());
522550
table.put("TextField.font", theme.getFontRegular());
551+
table.put("TextField.disabledBackground", theme.getDisabledBackgroudnTextField());
552+
table.put("TextField.disabledForeground", theme.getDisabledForegroundTextField());
523553
table.put("TextField.inactiveForeground", theme.getInactiveForegroundTextField());
524554
table.put("TextField.inactiveBackground", theme.getInactiveBackgroundTextField());
525555
table.put("TextField.selectionBackground", theme.getSelectionBackgroundTextField());
@@ -531,6 +561,8 @@ protected void initComponentDefaults(UIDefaults table) {
531561

532562
table.put("PasswordField.background", theme.getBackgroundTextField());
533563
table.put("PasswordField.foreground", theme.getTextColor());
564+
table.put("PasswordField.disabledBackground", theme.getDisabledBackgroudnTextField());
565+
table.put("PasswordField.disabledForeground", theme.getDisabledForegroundTextField());
534566
table.put("PasswordField.inactiveForeground", theme.getInactiveForegroundTextField());
535567
table.put("PasswordField.inactiveBackground", theme.getInactiveBackgroundTextField());
536568
table.put("PasswordField.selectionBackground", theme.getSelectionBackgroundTextField());
@@ -541,10 +573,11 @@ protected void initComponentDefaults(UIDefaults table) {
541573
table.put("PasswordField.echoChar", theme.getEchoCharPasswordField());
542574
table.put("PasswordField.focusInputMap", fieldInputMap);
543575

544-
table.put("TitledBorder.border", MaterialBorders.LIGHT_LINE_BORDER);
576+
table.put("TitledBorder.border", theme.getBorderTitledBorder());
545577
table.put("TitledBorder.font", theme.getFontMedium());
578+
table.put("TitledBorder.titleColor", theme.getColorTextTitledBorder());
546579

547-
table.put("TaskPane.font", theme.getFontMedium());
580+
table.put("TaskTaskPane.font", theme.getFontMedium());
548581
table.put("TaskPane.titleBackgroundGradientStart", theme.getTitleBackgroundGradientStartTaskPane());
549582
table.put("TaskPane.titleBackgroundGradientEnd", theme.getTitleBackgroundGradientEndTaskPane());
550583
table.put("TaskPane.titleOver", theme.getTitleOverTaskPane());
@@ -589,7 +622,7 @@ protected void initComponentDefaults(UIDefaults table) {
589622
//TODO exist an bug inside the icon
590623
table.put("InternalFrame.maximizeIcon", MaterialImageFactory.getInstance().getImage(MaterialImageFactory.MAXIMIZE_WINDOWS_WHITE));
591624
table.put("InternalFrame.minimizeIcon", MaterialImageFactory.getInstance().getImage(MaterialImageFactory.MINIMIZE_WINDOWS_WHITE));
592-
table.put("InternalFrame.closeIcon", MaterialImageFactory.getInstance().getImage(MaterialImageFactory.CLOSE_WINDOWS_WHITE));
625+
table.put("InternalFrame.closeIcon", theme.getIconCloseTitlePane());
593626
table.put("InternalFrame.iconifyIcon", MaterialImageFactory.getInstance().getImage(MaterialImageFactory.ICONIFY_WINDOWS_WHITE));
594627
table.put("InternalFrame.activeTitleBackground", MaterialColors.COSMO_BLACK);
595628
table.put("InternalFrame.activeTitleForeground", MaterialColors.BLACK);

src/main/java/mdlaf/animation/MaterialUIMovement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* MIT License
33
*
4-
* Copyright (c) 2018-2019 atharva washimkar, Vincent Palazzo
4+
* Copyright (c) 2018-2020 atharva washimkar, Vincenzo Palazzo vincenzopalazzo1996@gmail.com
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)