diff --git a/.idea/misc.xml b/.idea/misc.xml
index f63c058..5b2bcaf 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -7,7 +7,7 @@
-
+
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..e96534f
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index d00da3f..cbcbc29 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -10,8 +10,10 @@
+
-
+
+
@@ -63,14 +65,82 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
@@ -173,10 +238,10 @@
-
+
@@ -200,23 +265,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
@@ -253,24 +338,39 @@
-
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -310,15 +410,6 @@
-
-
-
-
-
-
-
-
-
@@ -326,7 +417,7 @@
-
+
@@ -347,23 +438,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1535193665777
+
+
+ 1535193665777
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
+
+
+
-
+
@@ -371,16 +508,19 @@
-
+
+
+
+
-
+
@@ -400,12 +540,6 @@
-
-
-
-
-
-
@@ -442,20 +576,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -474,13 +596,7 @@
-
-
-
-
-
-
-
+
@@ -669,38 +785,57 @@
-
-
-
-
-
-
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -747,7 +882,7 @@
- Java 8
+ 1.8
diff --git a/material-ui-swing.iml b/material-ui-swing.iml
index add79fc..454640f 100644
--- a/material-ui-swing.iml
+++ b/material-ui-swing.iml
@@ -1,5 +1,6 @@
+
diff --git a/src/main/java/mdlaf/components/textfield/MaterialTextFieldUI.java b/src/main/java/mdlaf/components/textfield/MaterialTextFieldUI.java
index 13535e4..d57f486 100644
--- a/src/main/java/mdlaf/components/textfield/MaterialTextFieldUI.java
+++ b/src/main/java/mdlaf/components/textfield/MaterialTextFieldUI.java
@@ -30,171 +30,191 @@ public class MaterialTextFieldUI extends BasicTextFieldUI implements FocusListen
private Color inactiveBackground;
private Color inactiveForeground;
- public MaterialTextFieldUI () {
- this (true);
+ public MaterialTextFieldUI() {
+ this(true);
}
- public MaterialTextFieldUI (boolean drawLine) {
- super ();
+ public MaterialTextFieldUI(boolean drawLine) {
+ super();
this.drawLine = drawLine;
}
- public static ComponentUI createUI (JComponent c) {
- return new MaterialTextFieldUI ();
+ public static ComponentUI createUI(JComponent c) {
+ return new MaterialTextFieldUI();
}
@Override
- public void installUI (JComponent c) {
- super.installUI (c);
+ /**
+ * This method not override because non paint correct in the JFileChooser
+ * @fixed by https://github.com/vincenzopalazzo
+ */
+ public void installUI(JComponent c) {
+ super.installUI(c);
+ }
- JTextField textField = (JTextField) c;
- textField.setOpaque (false);
- textField.setBorder (drawLine ?
- BorderFactory.createEmptyBorder (5, 2, 10, 0) :
- BorderFactory.createEmptyBorder (2, 2, 2, 2));
+ @Override
+ protected void installDefaults() {
+ super.installDefaults();
+ installMyDefaults();
+ }
+
+ @Override
+ protected void uninstallDefaults() {
+ getComponent().setBorder(null);
+ super.uninstallDefaults();
+ }
- textField.setFont (MaterialFonts.REGULAR);
- this.activeBackground = UIManager.getColor ("TextField.selectionBackground");
- this.activeForeground = UIManager.getColor ("TextField.selectionForeground");
- this.inactiveBackground = UIManager.getColor ("TextField.inactiveBackground");
- this.inactiveForeground = UIManager.getColor ("TextField.inactiveForeground");
+ @Override
+ protected void installListeners() {
+ super.installListeners();
+ getComponent().addFocusListener(this);
+ getComponent().addPropertyChangeListener(this);
+ }
- textField.setSelectionColor (c.hasFocus () && c.isEnabled () ? activeBackground : inactiveBackground);
- textField.setSelectedTextColor (c.hasFocus () && c.isEnabled () ? activeForeground : inactiveForeground);
- textField.setForeground (c.hasFocus () && c.isEnabled () ? activeForeground : inactiveForeground);
+ @Override
+ protected void uninstallListeners() {
+ getComponent().removeFocusListener(this);
+ super.uninstallListeners();
}
+ private void installMyDefaults() {
+ this.activeBackground = UIManager.getColor("TextField.selectionBackground");
+ this.activeForeground = UIManager.getColor("TextField.selectionForeground");
+ this.inactiveBackground = UIManager.getColor("TextField.inactiveBackground");
+ this.inactiveForeground = UIManager.getColor("TextField.inactiveForeground");
+ getComponent().setFont(MaterialFonts.REGULAR);
+ getComponent().setSelectionColor(getComponent().hasFocus() && getComponent().isEnabled() ? activeBackground : inactiveBackground);
+ getComponent().setSelectedTextColor(getComponent().hasFocus() && getComponent().isEnabled() ? activeForeground : inactiveForeground);
+ getComponent().setForeground(getComponent().hasFocus() && getComponent().isEnabled() ? activeForeground : inactiveForeground);
+ getComponent().setBorder(BorderFactory.createEmptyBorder(3, 5, 2,5));
+ }
@Override
- protected void installListeners () {
- super.installListeners ();
- getComponent ().addFocusListener (this);
- getComponent ().addPropertyChangeListener (this);
+ protected void paintBackground(Graphics g) {
+ super.paintBackground(MaterialDrawingUtils.getAliasedGraphics(g));
+ }
+
+
+ @Override
+ public void focusGained(FocusEvent e) {
+ changeColorOnFocus(true);
+ }
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ changeColorOnFocus(false);
+ }
+
+ private void changeColorOnFocus(boolean hasFocus) {
+ JTextField c = (JTextField) getComponent();
+ c.setSelectionColor(hasFocus ? activeBackground : inactiveBackground);
+ c.setForeground(hasFocus ? activeForeground : inactiveForeground);
+ c.setSelectedTextColor(hasFocus ? activeForeground : inactiveForeground);
+ c.paint(c.getGraphics());
}
@Override
- protected void installKeyboardActions () {
- super.installKeyboardActions ();
+ protected void installKeyboardActions() {
+ super.installKeyboardActions();
- Action selectAll = new AbstractAction () {
+ Action selectAll = new AbstractAction() {
@Override
- public void actionPerformed (ActionEvent e) {
- getComponent ().selectAll ();
+ public void actionPerformed(ActionEvent e) {
+ getComponent().selectAll();
}
};
- Action delete = new AbstractAction () {
+ Action delete = new AbstractAction() {
@Override
- public void actionPerformed (ActionEvent e) {
- if (getComponent ().getSelectedText () == null) {
- int pos = getComponent ().getCaretPosition () - 1;
+ public void actionPerformed(ActionEvent e) {
+ if (getComponent().getSelectedText() == null) {
+ int pos = getComponent().getCaretPosition() - 1;
if (pos >= 0) {
- getComponent ().select (pos, pos + 1);
- getComponent ().replaceSelection ("");
+ getComponent().select(pos, pos + 1);
+ getComponent().replaceSelection("");
}
- }
- else {
- getComponent ().replaceSelection ("");
+ } else {
+ getComponent().replaceSelection("");
}
}
};
- Action left = new AbstractAction () {
+ Action left = new AbstractAction() {
@Override
- public void actionPerformed (ActionEvent e) {
- getComponent ().setCaretPosition (Math.max (0, getComponent ().getCaretPosition () - 1));
+ public void actionPerformed(ActionEvent e) {
+ getComponent().setCaretPosition(Math.max(0, getComponent().getCaretPosition() - 1));
}
};
- Action right = new AbstractAction () {
+ Action right = new AbstractAction() {
@Override
- public void actionPerformed (ActionEvent e) {
- getComponent ().setCaretPosition (Math.min (getComponent ().getText ().length (), getComponent ().getCaretPosition () + 1));
+ public void actionPerformed(ActionEvent e) {
+ getComponent().setCaretPosition(Math.min(getComponent().getText().length(), getComponent().getCaretPosition() + 1));
}
};
- Action enter = new AbstractAction () {
+ Action enter = new AbstractAction() {
@Override
- public void actionPerformed (ActionEvent e) {
- ((JTextField) getComponent ()).postActionEvent ();
+ public void actionPerformed(ActionEvent e) {
+ ((JTextField) getComponent()).postActionEvent();
}
};
// note getMenuShortcutKeyMask() is deprecated in Java 10 - change to getMenuShortcutKeyMaskEx()
- getComponent ().getInputMap ().put (KeyStroke.getKeyStroke (KeyEvent.VK_A, Toolkit.getDefaultToolkit ().getMenuShortcutKeyMask ()), "selectAll");
- getComponent ().getInputMap ().put (KeyStroke.getKeyStroke (KeyEvent.VK_BACK_SPACE, 0), "delete");
- getComponent ().getInputMap ().put (KeyStroke.getKeyStroke (KeyEvent.VK_LEFT, 0), "left");
- getComponent ().getInputMap ().put (KeyStroke.getKeyStroke (KeyEvent.VK_RIGHT, 0), "right");
- getComponent ().getInputMap ().put (KeyStroke.getKeyStroke (KeyEvent.VK_ENTER, 0), "enter");
-
- getComponent ().getActionMap ().put ("selectAll", selectAll);
- getComponent ().getActionMap ().put ("delete", delete);
- getComponent ().getActionMap ().put ("left", left);
- getComponent ().getActionMap ().put ("right", right);
- getComponent ().getActionMap ().put ("enter", enter);
+ getComponent().getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_A, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()), "selectAll");
+ getComponent().getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), "delete");
+ getComponent().getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), "left");
+ getComponent().getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), "right");
+ getComponent().getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "enter");
+
+ getComponent().getActionMap().put("selectAll", selectAll);
+ getComponent().getActionMap().put("delete", delete);
+ getComponent().getActionMap().put("left", left);
+ getComponent().getActionMap().put("right", right);
+ getComponent().getActionMap().put("enter", enter);
}
@Override
- public void paintSafely (Graphics g) {
- JTextField c = (JTextField) getComponent ();
- g = MaterialDrawingUtils.getAliasedGraphics (g);
-
+ /**
+ *This metod drive a line button on JTextField
+ * @fixed by https://github.com/vincenzopalazzo
+ */
+ public void paintSafely(Graphics g) {
+ JTextField c = (JTextField) getComponent();
+ super.paintSafely(g);
if (drawLine) {
- int x = c.getInsets ().left;
- int y = c.getInsets ().top;
- int w = c.getWidth () - c.getInsets ().left - c.getInsets ().right;
+ int x = c.getInsets().left;
+ int y = c.getInsets().top;
+ int w = c.getWidth() - c.getInsets().left - c.getInsets().right;
+ g.setColor(c.getSelectionColor());
- g.setColor (c.getSelectionColor ());
- g.fillRect (x, c.getHeight () - y, w, 2);
+ g.fillRect(x, c.getHeight() - y - 1, w, 2);
}
-
- super.paintSafely (g);
- }
-
- @Override
- public void focusGained (FocusEvent e) {
- changeColorOnFocus (true);
}
@Override
- public void focusLost (FocusEvent e) {
- changeColorOnFocus (false);
- }
-
- private void changeColorOnFocus (boolean hasFocus) {
- JTextField c = (JTextField) getComponent ();
-
- c.setSelectionColor (hasFocus ? activeBackground : inactiveBackground);
- c.setForeground (hasFocus ? activeForeground : inactiveForeground);
- c.setSelectedTextColor (hasFocus ? activeForeground : inactiveForeground);
+ public void propertyChange(PropertyChangeEvent pce) {
+ super.propertyChange(pce);
- c.paint (c.getGraphics ());
- }
-
- @Override
- public void propertyChange (PropertyChangeEvent pce) {
- super.propertyChange (pce);
-
- if (pce.getPropertyName ().equals ("selectionColor")) {
- Color newColor = (Color) pce.getNewValue ();
-
- if (!newColor.equals (activeBackground) && !newColor.equals (inactiveBackground)) {
+ if (pce.getPropertyName().equals("selectionColor")) {
+ Color newColor = (Color) pce.getNewValue();
+ if (!newColor.equals(activeBackground) && !newColor.equals(inactiveBackground)) {
this.activeBackground = newColor;
- getComponent ().repaint ();
+ getComponent().repaint();
}
}
- if (pce.getPropertyName ().equals ("selectedTextColor")) {
- Color newColor = (Color) pce.getNewValue ();
-
- if (!newColor.equals (activeForeground) && !newColor.equals (inactiveForeground)) {
+ if (pce.getPropertyName().equals("selectedTextColor")) {
+ Color newColor = (Color) pce.getNewValue();
+ if (!newColor.equals(activeForeground) && !newColor.equals(inactiveForeground)) {
this.activeForeground = newColor;
- getComponent ().repaint ();
+ getComponent().repaint();
}
}
-
- if (pce.getPropertyName ().equals ("background")) {
- getComponent ().repaint ();
+ if (pce.getPropertyName().equals("background")) {
+ getComponent().repaint();
}
+
}
+
}
\ No newline at end of file
diff --git a/target/classes/META-INF/material-ui-swing.kotlin_module b/target/classes/META-INF/material-ui-swing.kotlin_module
new file mode 100644
index 0000000..8fb6019
Binary files /dev/null and b/target/classes/META-INF/material-ui-swing.kotlin_module differ
diff --git a/target/classes/material-ui-swing.jar b/target/classes/material-ui-swing.jar
index 33ce4e1..ec37a98 100644
Binary files a/target/classes/material-ui-swing.jar and b/target/classes/material-ui-swing.jar differ
diff --git a/target/material-ui-swing-0.9.4.5-jar-with-dependencies.jar b/target/material-ui-swing-0.9.4.5-jar-with-dependencies.jar
new file mode 100644
index 0000000..00027ab
Binary files /dev/null and b/target/material-ui-swing-0.9.4.5-jar-with-dependencies.jar differ
diff --git a/target/material-ui-swing-0.9.4.5.jar b/target/material-ui-swing-0.9.4.5.jar
new file mode 100644
index 0000000..429ac6d
Binary files /dev/null and b/target/material-ui-swing-0.9.4.5.jar differ
diff --git a/target/material-ui-swing-0.9.6-jar-with-dependencies.jar b/target/material-ui-swing-0.9.6-jar-with-dependencies.jar
new file mode 100644
index 0000000..39adcf0
Binary files /dev/null and b/target/material-ui-swing-0.9.6-jar-with-dependencies.jar differ
diff --git a/target/material-ui-swing-0.9.6.jar b/target/material-ui-swing-0.9.6.jar
new file mode 100644
index 0000000..26dbf87
Binary files /dev/null and b/target/material-ui-swing-0.9.6.jar differ
diff --git a/target/material-ui-swing-osgi.jar b/target/material-ui-swing-osgi.jar
index 16b1b19..81925a6 100644
Binary files a/target/material-ui-swing-osgi.jar and b/target/material-ui-swing-osgi.jar differ
diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties
new file mode 100644
index 0000000..0b9ffe3
--- /dev/null
+++ b/target/maven-archiver/pom.properties
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Sat Dec 29 15:57:10 CET 2018
+version=0.9.6
+groupId=mlaf.material-swing
+artifactId=material-ui-swing
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
new file mode 100644
index 0000000..e69de29
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
new file mode 100644
index 0000000..6bff6a8
--- /dev/null
+++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -0,0 +1,47 @@
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/tree/MaterialTreeCellEditor.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/tree/MaterialTreeCellRenderer.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/spinner/MaterialSpinnerUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/animation/MaterialUITimer.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/checkboxmenuitem/MaterialCheckBoxMenuItemUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/togglebutton/MaterialToggleButtonUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/menu/MaterialMenuUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/table/MaterialTableUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/shadows/DropShadowBorder.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/utils/MaterialDrawingUtils.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/separator/MaterialSeparatorUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/radiobutton/MaterialRadioButtonUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/editorpane/MaterialEditorPaneUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/progressbar/MaterialProgressBarUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/checkbox/MaterialCheckBoxUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/combobox/MaterialComboBoxUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/table/MaterialTableHeaderUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/menubar/MaterialMenuBarUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/utils/MaterialBorders.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/filechooser/MaterialFileChooserUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/radiobuttonmenuitem/MaterialRadioButtonMenuItemUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/textfield/MaterialTextFieldUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/MaterialLookAndFeel.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/button/MaterialButtonUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/table/MaterialTableCellRenderer.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/utils/MaterialColors.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/tabbedpane/MaterialTabbedPaneUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/table/MaterialTableCellEditor.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/combobox/MaterialComboBoxRenderer.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/tree/MaterialTreeUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/utils/MaterialImages.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/panel/MaterialPanelUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/slider/MaterialSliderUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/textpane/MaterialTextPaneUI.java
+/home/vincenzo/Github/material-ui-swing/src/MaterialUISwingDemo.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/utils/MaterialFonts.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/table/MaterialTableHeaderCellRenderer.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/filechooser/MaterialFileChooserUITest.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/popupmenu/MaterialPopupMenuUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/label/MaterialLabelUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/scrollbar/MaterialScrollBarUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/animation/MaterialUIMovement.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/menuitem/MaterialMenuItemUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/tooltip/MaterialToolTipUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/password/MaterialPasswordFieldUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/components/toolbar/MaterialToolBarUI.java
+/home/vincenzo/Github/material-ui-swing/src/mdlaf/utils/MaterialKey.java