Skip to content

Commit

Permalink
#150 Bug Fixed
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Sep 20, 2020
1 parent 72a7cdd commit ce1d346
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ dependencies {
testCompile 'junit:junit:4.12'
testCompile group: 'org.assertj', name: 'assertj-swing-junit', version: '3.9.2'
testCompile 'io.github.material-ui-swing:DarkStackOverflowTheme:0.0.1-rc2'
testCompile group: 'com.toedter', name: 'jcalendar', version: '1.4'

}

allprojects {
Expand Down
10 changes: 1 addition & 9 deletions src/main/java/mdlaf/components/spinner/MaterialSpinnerUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public static ComponentUI createUI(JComponent c) {
@Override
public void installUI(JComponent c) {
super.installUI(c);

this.spinnerBackground = UIManager.getColor("Spinner.background");
this.spinnerDisableBackground = UIManager.getColor("Spinner.disabledBackground");
}
Expand All @@ -64,11 +63,6 @@ public void uninstallUI(JComponent c) {
@Override
public void paint(Graphics g, JComponent c) {
super.paint(g, c);
if(!c.isEnabled()){
((JSpinner.DefaultEditor)spinner.getEditor()).getTextField().setBackground(spinnerDisableBackground);
}else{
((JSpinner.DefaultEditor)spinner.getEditor()).getTextField().setBackground(spinnerBackground);
}
}

@Override
Expand Down Expand Up @@ -132,9 +126,7 @@ protected void paintFocusRing(Graphics g, JButton b) {
}

@Override
protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) {

}
protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) {}
}

}
Expand Down
14 changes: 13 additions & 1 deletion src/test/java/integration/gui/mock/DemoGUITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
package integration.gui.mock;

import com.toedter.calendar.JDateChooser;
import integration.gui.mock.component.*;
import integration.gui.mock.uiexample.button.ContainedButtonUI;
import io.materialtheme.darkstackoverflow.DarkStackOverflowTheme;
Expand All @@ -42,6 +43,7 @@
import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.File;
import java.util.Date;

/**
* @author https://github.com/vincenzopalazzo
Expand Down Expand Up @@ -123,11 +125,13 @@ public class DemoGUITest extends JFrame {
//TabbedPane test mouse hover on Tab
JPanel tabbedPanetest = new DemoPanelWithTabbedPane();

//ToolBar Tab pane
private JToolBar toolBarEditor;

private JPanel buttonsPanel;
private JButton containedTypeButton;

//JCalendar demo tab
JDateChooser dateNasc;

public JMenuItem getMaterialOceanic() {
return materialOceanic;
Expand Down Expand Up @@ -225,6 +229,13 @@ public void actionPerformed(ActionEvent e) {
JPanel panelToolBar = new JPanel();
panelToolBar.add(toolBarEditor);

JPanel calendarPanel = new JPanel();
dateNasc = new JDateChooser();
dateNasc.setDateFormatString("dd/MM/yyyy");
dateNasc.setMaxSelectableDate(new Date());
dateNasc.setDate(new Date());
calendarPanel.add(dateNasc);

initStyleMouseHoverPanel();

initLayoutContentPanelOne();
Expand All @@ -247,6 +258,7 @@ public void actionPerformed(ActionEvent e) {
tabbedPane.add(panelToolBar, "ToolBar");
tabbedPane.add(new ChooseValueComponentViewPanel(), "Choose Component");
tabbedPane.add(buttonsPanel, "Button Type");
tabbedPane.add(calendarPanel, "JCalendar");
this.setContentPane(tabbedPane);

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Expand Down

0 comments on commit ce1d346

Please sign in to comment.