Skip to content

Commit

Permalink
Actualizacion ExperienceUI
Browse files Browse the repository at this point in the history
Se han corregido el color de seleccion de los siguientes componentes:
-JTable
-JList
Ademas, se ha corregido el color de fuente al seleccionar un JComboBox.
Tambien se ha corrregido el error de renderizacion sobre JTable, ya que motaba el color del borde del header de las tablas de color gris, se cambio al color del fondo que defina el programador de la aplicacion.

Co-Authored-By: garnica1999 <garnica1999@users.noreply.github.com>
  • Loading branch information
Garnica1999 and Garnica1999 committed Mar 31, 2018
1 parent 9f73b51 commit 187a1f2
Show file tree
Hide file tree
Showing 17 changed files with 377 additions and 80 deletions.
2 changes: 1 addition & 1 deletion ExperienceUI/build/built-jar.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Mon, 26 Mar 2018 21:33:08 -0500
#Fri, 30 Mar 2018 21:05:57 -0500


C\:\\Users\\Carlos\\Desktop\\ExperienceUI\\ExperienceUI=
1 change: 1 addition & 0 deletions ExperienceUI/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<file>file:/C:/Users/Carlos/Desktop/ExperienceUI/ExperienceUI/src/com/experienceui/componentes/ExComboBox.java</file>
<file>file:/C:/Users/Carlos/Desktop/ExperienceUI/ExperienceUI/src/com/experienceui/componentes/ExUtilities.java</file>
<file>file:/C:/Users/Carlos/Desktop/ExperienceUI/ExperienceUI/src/com/experienceui/componentes/ExTextPane.java</file>
<file>file:/C:/Users/Carlos/Desktop/ExperienceUI/ExperienceUI/src/com/experienceui/componentes/IComponents.java</file>
<file>file:/C:/Users/Carlos/Desktop/ExperienceUI/ExperienceUI/src/com/experienceui/componentes/ExTabbedPane.java</file>
<file>file:/C:/Users/Carlos/Desktop/ExperienceUI/ExperienceUI/src/com/experienceui/color/ColorUI.java</file>
<file>file:/C:/Users/Carlos/Desktop/ExperienceUI/ExperienceUI/src/com/experienceui/componentes/TextUtilities.java</file>
Expand Down
97 changes: 90 additions & 7 deletions ExperienceUI/src/com/experienceui/ExperienceUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package com.experienceui;

import com.experienceui.color.ColorUI;
import com.experienceui.componentes.ExButton;
import com.experienceui.componentes.ExComboBox;
import com.experienceui.componentes.ExListBox;
import com.experienceui.componentes.ExScrollPane;
Expand All @@ -26,6 +27,22 @@ public class ExperienceUI {

private static ColorUI colorUI;

public static ColorUI getColorUI() {
return colorUI;
}

public static void setColorUI(ColorUI aColorUI) {
colorUI = aColorUI;
}
private ExListBox exListBox;
private ExTabbedPane exTabbedPane;
private ExScrollPane exScrollPane;
private ExTable exTable;
private ExTextField exTextField;
private ExTextPane exTextPane;
private ExComboBox exComboBox;
private ExButton exButton;

public ExperienceUI(ColorUI colorUI) {
this.colorUI = colorUI;
try {
Expand All @@ -48,24 +65,90 @@ public void createUI() {
}

public void createIndependentUI() {
ExListBox exListBox = new ExListBox(colorUI);
ExTabbedPane exTabbedPane = new ExTabbedPane(colorUI);
ExScrollPane exScrollPane = new ExScrollPane(colorUI);
exListBox = new ExListBox(colorUI);
exTabbedPane = new ExTabbedPane(colorUI);
exScrollPane = new ExScrollPane(colorUI);
exButton = new ExButton(colorUI);

exListBox.crearDisenio();
exTabbedPane.crearDisenio();
exScrollPane.crearDisenio();
}

public void createDependentUI() {
ExTable exTable = new ExTable(colorUI);
ExTextField exTextField = new ExTextField(colorUI);
ExTextPane exTextPane = new ExTextPane(colorUI);
ExComboBox exComboBox = new ExComboBox(colorUI);
exTable = new ExTable(colorUI);
exTextField = new ExTextField(colorUI);
exTextPane = new ExTextPane(colorUI);
exComboBox = new ExComboBox(colorUI);
exTable.crearDisenio();
exTextField.crearDisenio();
exTextPane.crearDisenio();
exComboBox.crearDisenio();
}

public ExListBox getExListBox() {
return exListBox;
}

public void setExListBox(ExListBox exListBox) {
this.exListBox = exListBox;
}

public ExTabbedPane getExTabbedPane() {
return exTabbedPane;
}

public void setExTabbedPane(ExTabbedPane exTabbedPane) {
this.exTabbedPane = exTabbedPane;
}

public ExScrollPane getExScrollPane() {
return exScrollPane;
}

public void setExScrollPane(ExScrollPane exScrollPane) {
this.exScrollPane = exScrollPane;
}

public ExTable getExTable() {
return exTable;
}

public void setExTable(ExTable exTable) {
this.exTable = exTable;
}

public ExTextField getExTextField() {
return exTextField;
}

public void setExTextField(ExTextField exTextField) {
this.exTextField = exTextField;
}

public ExTextPane getExTextPane() {
return exTextPane;
}

public void setExTextPane(ExTextPane exTextPane) {
this.exTextPane = exTextPane;
}

public ExComboBox getExComboBox() {
return exComboBox;
}

public void setExComboBox(ExComboBox exComboBox) {
this.exComboBox = exComboBox;
}

public ExButton getExButton() {
return exButton;
}

public void setExButton(ExButton exButton) {
this.exButton = exButton;
}


}
27 changes: 17 additions & 10 deletions ExperienceUI/src/com/experienceui/componentes/ExButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import com.sun.glass.ui.Cursor;
import java.awt.Font;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.plaf.ButtonUI;
import javax.swing.plaf.basic.BasicButtonUI;
Expand All @@ -19,10 +19,11 @@
*
* @author Carlos
*/
public class ExButton extends BasicButtonUI{
public class ExButton extends BasicButtonUI implements IComponents{
private static ColorUI colorUI;
private Font fuente;
private Border border;

public ExButton(ColorUI colorUI, int size) {
this.colorUI = colorUI;
fuente = new Font("Segoe UI", Font.BOLD, size);
Expand Down Expand Up @@ -53,14 +54,6 @@ public static ColorUI getColorUI() {
public static void setColorUI(ColorUI aColorUI) {
colorUI = aColorUI;
}

public void modificarBoton(JButton bt){
bt.setFont(fuente);
bt.setBackground(this.colorUI.getColorFondo());
bt.setBackground(this.colorUI.getColorForeground());
bt.setBorder(border);
bt.setCursor(new java.awt.Cursor(Cursor.CURSOR_POINTING_HAND));
}

public Font getFuente() {
return fuente;
Expand All @@ -77,6 +70,20 @@ public Border getBorder() {
public void setBorder(Border border) {
this.border = border;
}

@Override
public void modificarUI(JComponent c) {
c.setFont(fuente);
c.setBackground(this.colorUI.getColorFondo());
c.setForeground(this.colorUI.getColorTerciario());
c.setBorder(border);
c.setCursor(new java.awt.Cursor(Cursor.CURSOR_POINTING_HAND));
}

@Override
public void crearDisenio() {
UIManager.put("Button.foreground", this.colorUI.getColorForeground());
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import javax.swing.DefaultCellEditor;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;

Expand Down
25 changes: 20 additions & 5 deletions ExperienceUI/src/com/experienceui/componentes/ExComboBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import com.experienceui.color.ColorUI;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.BorderFactory;
Expand All @@ -23,7 +24,7 @@
*
* @author sala7
*/
public class ExComboBox extends BasicComboBoxUI{
public class ExComboBox extends BasicComboBoxUI implements IComponents{
private static ColorUI colorUI;
private Border borderButton;
private Color buttonBackground;
Expand All @@ -32,13 +33,17 @@ public class ExComboBox extends BasicComboBoxUI{
private Color selectionForeground;
private Color selectionBackground;
private Color control;
private Font fuente;

public ExComboBox(ColorUI colorUI){
ExComboBox.colorUI = colorUI;
borderButton = BorderFactory.createMatteBorder(0, 0, 2, 0, colorUI.getColorBorde());
this.fuente = new Font("Segoe UI", Font.BOLD, 14);
selectionForeground = colorUI.getColorFondo();
selectionBackground = colorUI.getColorTerciario();
}

public ExComboBox(ColorUI colorUI, Border borderButton, Color buttonBackground, Color buttonhighlight, Color buttonShadow, Color selectionForeground, Color selectionBackground, Color control) {
public ExComboBox(ColorUI colorUI, Border borderButton, Color buttonBackground, Color buttonhighlight, Color buttonShadow, Color selectionForeground, Color selectionBackground, Color control, Font fuente) {
ExComboBox.colorUI = colorUI;
this.borderButton = borderButton;
this.buttonBackground = buttonBackground;
Expand All @@ -47,16 +52,19 @@ public ExComboBox(ColorUI colorUI, Border borderButton, Color buttonBackground,
this.selectionForeground = selectionForeground;
this.selectionBackground = selectionBackground;
this.control = control;
this.fuente = fuente;
}

public ExComboBox(Color buttonBackground, Color buttonhighlight, Color buttonShadow, Color selectionForeground, Color selectionBackground, Color control) {
public ExComboBox(ColorUI colorUI, Color buttonBackground, Color buttonhighlight, Color buttonShadow, Color selectionForeground, Color selectionBackground, Color control) {
this.colorUI = colorUI;
this.buttonBackground = buttonBackground;
this.buttonhighlight = buttonhighlight;
this.buttonShadow = buttonShadow;
this.selectionForeground = selectionForeground;
this.selectionBackground = selectionBackground;
this.control = control;
borderButton = BorderFactory.createMatteBorder(0, 0, 2, 0, colorUI.getColorBorde());
this.fuente = new Font("Segoe UI", Font.BOLD, 14);
}

public Border getBorderButton() {
Expand Down Expand Up @@ -130,8 +138,13 @@ protected JButton createArrowButton() {
return a;
}

public void modificarUI(JComboBox cb){
cb.setUI(this);
@Override
public void modificarUI(JComponent c){
if(c instanceof JComboBox){
JComboBox cb = (JComboBox)c;
cb.setUI(this);
}

}

public static void addFocusBorder(JComboBox comboBox){
Expand All @@ -153,6 +166,7 @@ protected static void addFocusOnSelectedComponent(JComboBox componente, Color ne
componente.setBorder(BorderFactory.createMatteBorder(0, 0, 2, 0, newColor));
}

@Override
public void crearDisenio(){
UIManager.put("Combobox.rendererUseListColors", true);
UIManager.put("ComboBox.background", colorUI.getColorFondo());
Expand All @@ -162,6 +176,7 @@ public void crearDisenio(){
//UIManager.put("ComboBox.buttonDarkShadow", new Color(255,255,255));
UIManager.put("ComboBox.buttonHighlight", buttonhighlight);
UIManager.put("ComboBox.buttonShadow", buttonShadow);
UIManager.put("ComboBox.font", fuente);
UIManager.put("ComboBox.control", control);
UIManager.put("ComboBox.selectionBackground", this.colorUI.getColorPrincipal());
UIManager.put("ComboBox.selectionForeground", selectionForeground);
Expand Down
14 changes: 13 additions & 1 deletion ExperienceUI/src/com/experienceui/componentes/ExListBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.experienceui.color.ColorUI;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.UIManager;
import javax.swing.plaf.ListUI;
import javax.swing.plaf.basic.BasicListUI;
Expand All @@ -16,7 +17,7 @@
*
* @author Carlos
*/
public class ExListBox extends BasicListUI{
public class ExListBox extends BasicListUI implements IComponents{
private static ColorUI colorUI;

public ExListBox(ColorUI colorUI) {
Expand All @@ -28,9 +29,20 @@ public static ListUI createUI(JComponent c){
return new ExListBox(colorUI);
}

@Override
public void crearDisenio(){
UIManager.put("List.selectionForeground", this.colorUI.getColorFondo());
UIManager.put("List.selectionBackground", this.colorUI.getColorTerciario());
UIManager.put("List.focusCellHighlightBorder", BorderFactory.createEmptyBorder());
UIManager.put("List.border", BorderFactory.createLineBorder(this.colorUI.getColorBordeSecundario()));
}

@Override
public void modificarUI(JComponent c) {
if(c instanceof JList){
JList ls = (JList)c;
ls.setUI(this);
}
}

}
15 changes: 11 additions & 4 deletions ExperienceUI/src/com/experienceui/componentes/ExScrollPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.experienceui.color.ColorUI;
import java.awt.Insets;
import javax.swing.JComponent;
import javax.swing.JScrollPane;
import javax.swing.UIManager;
import javax.swing.plaf.ScrollPaneUI;
import javax.swing.plaf.basic.BasicScrollPaneUI;
Expand All @@ -16,7 +17,7 @@
*
* @author Carlos
*/
public class ExScrollPane extends BasicScrollPaneUI{
public class ExScrollPane extends BasicScrollPaneUI implements IComponents{
private static ColorUI colorUI;

public ExScrollPane(ColorUI colorUI){
Expand All @@ -35,12 +36,18 @@ public static ScrollPaneUI createUI(JComponent c){
return new ExScrollPane(colorUI);
}


@Override
public void crearDisenio(){
UIManager.put("ScrollPane.border", null);
UIManager.put("ScrollPane.viewportBorder", null);
UIManager.put("ScrollPane.viewportBorderInsets", new Insets(0,0,0,0));
}



@Override
public void modificarUI(JComponent c) {
if(c instanceof JScrollPane){
JScrollPane js = (JScrollPane)c;
js.setUI(this);
}
}
}
Loading

0 comments on commit 187a1f2

Please sign in to comment.