Skip to content

Commit

Permalink
Componente switch, variaciones de botones, animaciones nuevas y estil…
Browse files Browse the repository at this point in the history
…os nuevos para varios componentes
  • Loading branch information
Israel-ICM committed Oct 19, 2021
1 parent e8b4aa3 commit 3ec3a12
Show file tree
Hide file tree
Showing 36 changed files with 971 additions and 264 deletions.
Binary file modified build/classes/icm/sphynx/styles/MetroUI.class
Binary file not shown.
Binary file modified build/classes/icm/sphynx/ui/components/metro/UIButton.class
Binary file not shown.
Binary file modified build/classes/icm/sphynx/ui/components/metro/UICheckBox.class
Binary file not shown.
Binary file modified build/classes/icm/sphynx/ui/components/metro/UIComboBox.class
Binary file not shown.
Binary file modified build/classes/icm/sphynx/ui/components/metro/UILabel.class
Binary file not shown.
Binary file modified build/classes/icm/sphynx/ui/components/metro/UIList.class
Binary file not shown.
Binary file modified build/classes/icm/sphynx/ui/components/metro/UIProgressBar.class
Binary file not shown.
Binary file modified build/classes/icm/sphynx/ui/components/metro/UIRadioButton.class
Binary file not shown.
Binary file modified build/classes/icm/sphynx/ui/components/metro/UISlider.class
Binary file not shown.
Binary file modified build/classes/icm/sphynx/ui/components/metro/UITabbedPane.class
Binary file not shown.
Binary file modified build/classes/icm/sphynx/ui/components/metro/UITable.class
Binary file not shown.
Binary file modified build/classes/icm/sphynx/ui/components/metro/UITableHeader.class
Binary file not shown.
Binary file modified build/classes/icm/sphynx/ui/components/metro/UITextArea.class
Binary file not shown.
Binary file modified build/classes/icm/sphynx/ui/components/metro/UITools.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 1 addition & 3 deletions nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UITools.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UIProgressBar.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UISplitPane.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UIScrollBar.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UIButton.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UIToggleButton.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UIComboBox.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UIFormattedTextField.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UITableHeader.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UIRadioButton.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/tools/ThemeMetroUI.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UIPasswordField.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/styles/MyStyles.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UITextField.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UITextArea.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/tools/StyleColorsMetro.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UITable.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/MetroUIComponent.java</file>
Expand Down
18 changes: 9 additions & 9 deletions src/icm/sphynx/styles/MetroUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ public static void installLight(String primaryColor, boolean autoColorCorrector)
CompoundBorder bordeAnchoCelda = BorderFactory.createCompoundBorder(bordeDelgadoGris, BorderFactory.createEmptyBorder(UITools.PADDING_CONTENTS, UITools.PADDING_CONTENTS, UITools.PADDING_CONTENTS, UITools.PADDING_CONTENTS));
UIManager.put("TableHeader.cellBorder", bordeAnchoCelda);

UIManager.put("FileChooser.detailsViewIcon", IconsMetroUI.iconListDetail(18, "#FFFFFF"));
UIManager.put("FileChooser.homeFolderIcon", new IconsMetroUI().iconHome(18));
UIManager.put("FileChooser.newFolderIcon", new IconsMetroUI().iconNewFolder(18));
UIManager.put("FileChooser.listViewIcon", new IconsMetroUI().iconList(18));
UIManager.put("FileChooser.upFolderIcon", new IconsMetroUI().iconUpFolder(18));
UIManager.put("FileChooser.detailsViewIcon", IconsMetroUI.iconListDetail(18, "#000000"));
UIManager.put("FileChooser.homeFolderIcon", new IconsMetroUI().iconHome(18, true));
UIManager.put("FileChooser.newFolderIcon", new IconsMetroUI().iconNewFolder(18, true));
UIManager.put("FileChooser.listViewIcon", new IconsMetroUI().iconList(18, true));
UIManager.put("FileChooser.upFolderIcon", new IconsMetroUI().iconUpFolder(18, true));

UIManager.put("FileView.computerIcon", new IconsMetroUI().iconComputer(20));
UIManager.put("FileView.fileIcon", new IconsMetroUI().iconFile(20));
Expand Down Expand Up @@ -141,10 +141,10 @@ public static void installDark(String primaryColor, boolean autoColorCorrector)
UIManager.put("TableHeader.cellBorder", bordeAnchoCelda);

UIManager.put("FileChooser.detailsViewIcon", IconsMetroUI.iconListDetail(18, "#FFFFFF"));
UIManager.put("FileChooser.homeFolderIcon", new IconsMetroUI().iconHome(18));
UIManager.put("FileChooser.newFolderIcon", new IconsMetroUI().iconNewFolder(18));
UIManager.put("FileChooser.listViewIcon", new IconsMetroUI().iconList(18));
UIManager.put("FileChooser.upFolderIcon", new IconsMetroUI().iconUpFolder(18));
UIManager.put("FileChooser.homeFolderIcon", new IconsMetroUI().iconHome(18, false));
UIManager.put("FileChooser.newFolderIcon", new IconsMetroUI().iconNewFolder(18, false));
UIManager.put("FileChooser.listViewIcon", new IconsMetroUI().iconList(18, false));
UIManager.put("FileChooser.upFolderIcon", new IconsMetroUI().iconUpFolder(18, false));

UIManager.put("FileView.computerIcon", new IconsMetroUI().iconComputer(20));
UIManager.put("FileView.fileIcon", new IconsMetroUI().iconFile(20));
Expand Down
101 changes: 90 additions & 11 deletions src/icm/sphynx/ui/components/metro/MetroUIComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,88 @@
* @author israel-icm
*/
public class MetroUIComponent {
private static final String TEXT_FIELD = "MetroTextField";
private static final String PASSWORD_FIELD = "MetroPasswordField";
private static final String BUTTON = "MetroButton";
private static final String CHECK_BOX = "MetroCheckBox";
private static final String PASSWORD_FIELD = "MetroPasswordField";
private static final String TEXT_FIELD = "MetroTextField";
private static final String TEXT_AREA = "MetroTextArea";

private static final String BUTTON_EMPTY = "empty";
private static final String BUTTON_LINK = "link";
private static final String CHECK_BOX_AS_SWITCH = "switch";
private static final String CHECK_BOX_SWITCH_TEXT_ON = "switchTextOn";
private static final String CHECK_BOX_SWITCH_TEXT_OFF = "switchTextOff";
public static final String ICON_SEARCH = "search";
private static final String TEXT_FIELD_PROPERTY_PLACEHOLDER = "placeholder";
private static final String TEXT_FIELD_PROPERTY_ICON = "icon";
public static final String ICON_SEARCH = "search";
private static final String BUTTON_EMPTY = "empty";

/**
* Agrega el ícono predeterminado a un textfield
* @param nameComponent Nombre del componente al que se aplicará la propiedad
* @param value Valor de la propiedad (Ej: MetroUIConfigComponent.ICON_SEARCH)
* @example MetroUIConfigComponent.setPropertyTextField("buscar", TEXT_FIELD_PROPERTY_PLACEHOLDER, "Buscar...");
*/
public static void setTextFieldIcon(String nameComponent, String value) {
UIManager.put(TEXT_FIELD + "." + nameComponent + "." + TEXT_FIELD_PROPERTY_ICON, value);
}
/**
* Agrega el placeholder a un textfield en específico
* Agrega el placeholder a un textarea en específico
* @param nameComponent Nombre del componente al que se aplicará la propiedad
* @param value Texto que se mostrará en la caja de texto
* @example MetroUIConfigComponent.setPropertyTextField("buscar", TEXT_FIELD_PROPERTY_PLACEHOLDER, "Buscar...");
* @example MetroUIConfigComponent.setPropertyTextField("buscar", "Buscar...");
*/
public static void setTextFieldPlaceholder(String nameComponent, String value) {
UIManager.put(TEXT_FIELD + "." + nameComponent + "." + TEXT_FIELD_PROPERTY_PLACEHOLDER, value);
}
/**
* Agrega el placeholder a un textfield en específico
* @param nameComponent Nombre del componente al que se aplicará la propiedad
* @param value Texto que se mostrará en la caja de texto
* @example MetroUIConfigComponent.setPropertyTextField("buscar", "Ingrese el texto...");
*/
public static void setTextAreaPlaceholder(String nameComponent, String value) {
UIManager.put(TEXT_AREA + "." + nameComponent + "." + TEXT_FIELD_PROPERTY_PLACEHOLDER, value);
}
/**
* Agrega el placeholder a un passwordField en específico
* @param nameComponent Nombre del componente al que se aplicará la propiedad
* @param value Texto que se mostrará en la caja de texto
* @example MetroUIConfigComponent.setPropertyTextField("buscar", TEXT_FIELD_PROPERTY_PLACEHOLDER, "Buscar...");
* @example MetroUIConfigComponent.setPropertyTextField("buscar", "Password");
*/
public static void setPasswordFieldPlaceholder(String nameComponent, String value) {
UIManager.put(PASSWORD_FIELD + "." + nameComponent + "." + TEXT_FIELD_PROPERTY_PLACEHOLDER, value);
}
/**
* Estable el botón sin bordes y sin relleno
* @param nameComponent
* @param nameComponent Nombre del componente al que se aplicará la propiedad
*/
public static void setEmpyButton(String nameComponent) {
public static void setButtonEmpty(String nameComponent) {
UIManager.put(BUTTON + "." + nameComponent + "." + BUTTON_EMPTY, true);
}
/**
* Asigna estilos al botón para que se vea como un link
* @param nameComponent Nombre del componente al que se aplicará la propiedad
*/
public static void setButtonLink(String nameComponent) {
UIManager.put(BUTTON + "." + nameComponent + "." + BUTTON_LINK, true);
}
/**
* Convierte un componente checkbox en un switch
* @param nameComponent Nombre del componente al que se aplicará la propiedad
* @param textOn Texto que se mostrará cuando el switch se encuentre activado
* @param textOff Texto que se mostrará cuando el switch se encuentre desactivado
*/
public static void setCheckBoxAsSwitch(String nameComponent, String textOn, String textOff) {
UIManager.put(CHECK_BOX + "." + nameComponent + "." + CHECK_BOX_AS_SWITCH, true);
UIManager.put(CHECK_BOX + "." + nameComponent + "." + CHECK_BOX_SWITCH_TEXT_ON, textOn);
UIManager.put(CHECK_BOX + "." + nameComponent + "." + CHECK_BOX_SWITCH_TEXT_OFF, textOff);
}
/**
* Convierte un componente checkbox en un switch
* @param nameComponent Nombre del componente al que se aplicará la propiedad
*/
public static void setCheckBoxAsSwitch(String nameComponent) {
UIManager.put(CHECK_BOX + "." + nameComponent + "." + CHECK_BOX_AS_SWITCH, true);
}

/**
* Retorna el valor de la propiedad icon
Expand All @@ -67,6 +106,14 @@ public static String getPropertyTextFieldIcon(String nameComponent) {
public static String getPropertyTextFieldPlaceholder(String nameComponent) {
return UIManager.getString(TEXT_FIELD + "." + nameComponent + "." + TEXT_FIELD_PROPERTY_PLACEHOLDER);
}
/**
* Retorna el valor de la propiedad placeholder
* @param nameComponent
* @return
*/
public static String getPropertyTextAreaPlaceholder(String nameComponent) {
return UIManager.getString(TEXT_AREA + "." + nameComponent + "." + TEXT_FIELD_PROPERTY_PLACEHOLDER);
}
/**
* Retorna el valor de la propiedad placeholder
* @param nameComponent
Expand All @@ -80,7 +127,39 @@ public static String getPropertyPasswordFieldPlaceholder(String nameComponent) {
* @param nameComponent
* @return
*/
public static boolean getEmptyButton(String nameComponent) {
public static boolean getPropertyButtonEmpty(String nameComponent) {
return UIManager.getBoolean(BUTTON + "." + nameComponent + "." + BUTTON_EMPTY);
}
/**
* Retorna el valor de la propiedad link button
* @param nameComponent
* @return
*/
public static boolean getPropertyButtonLink(String nameComponent) {
return UIManager.getBoolean(BUTTON + "." + nameComponent + "." + BUTTON_LINK);
}
/**
* Retorna el valor de la propiedad empty button
* @param nameComponent
* @return
*/
public static boolean getPropertyCheckBoxAsSwitch(String nameComponent) {
return UIManager.getBoolean(CHECK_BOX + "." + nameComponent + "." + CHECK_BOX_AS_SWITCH);
}
/**
* Retorna el valor de la propiedad text on del componente switch
* @param nameComponent
* @return
*/
public static String getPropertyCheckBoxSwitchTextOn(String nameComponent) {
return UIManager.getString(CHECK_BOX + "." + nameComponent + "." + CHECK_BOX_SWITCH_TEXT_ON);
}
/**
* Retorna el valor de la propiedad text off del componente switch
* @param nameComponent
* @return
*/
public static String getPropertyCheckBoxSwitchTextOff(String nameComponent) {
return UIManager.getString(CHECK_BOX + "." + nameComponent + "." + CHECK_BOX_SWITCH_TEXT_OFF);
}
}
Loading

0 comments on commit 3ec3a12

Please sign in to comment.