Skip to content

Commit

Permalink
Correcciones de todos los componentes y reordenamiento de clases
Browse files Browse the repository at this point in the history
  • Loading branch information
Israel-ICM committed Oct 21, 2021
1 parent 43eb538 commit 21e1030
Show file tree
Hide file tree
Showing 100 changed files with 866 additions and 433 deletions.
Binary file modified build/classes/icm/sphynx/styles/MetroUI.class
Binary file not shown.
Binary file removed build/classes/icm/sphynx/styles/MyStyles.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 9 additions & 3 deletions nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/Users/israel-icm/NetBeansProjects/MyStyles/src/icm/sphynx/styles/MetroUI.java</file>
<file>file:/Users/israel-icm/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UITools.java</file>
<file>file:/Users/israel-icm/NetBeansProjects/MyStyles/src/icm/sphynx/ui/components/metro/UIComboBox.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/metro/manager/UIList.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/metro/tools/MetroUIComponent.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/metro/manager/UITextArea.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/metro/manager/UIFormattedTextField.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/metro/manager/UIPasswordField.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/metro/manager/UITextField.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/metro/tools/IconsMetroUI.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/styles/MetroUI.java</file>
<file>file:/C:/Users/josue2/Documents/NetBeansProjects/MyStyles/src/icm/sphynx/ui/metro/tools/StyleColorsMetro.java</file>
</group>
</open-files>
</project-private>
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package icm.sphynx.styles;
package icm.sphynx;

import icm.sphynx.ui.components.metro.MetroUIConfigTheme;
import icm.sphynx.ui.components.metro.UITools;
import icm.sphynx.ui.tools.StyleColorsMetro;
import icm.sphynx.styles.MetroUI;
import icm.sphynx.ui.metro.tools.MetroUIConfigTheme;
import icm.sphynx.ui.metro.manager.UITools;
import icm.sphynx.ui.metro.tools.StyleColorsMetro;
import java.awt.Color;

/**
Expand Down
86 changes: 36 additions & 50 deletions src/icm/sphynx/styles/MetroUI.java
Original file line number Diff line number Diff line change
@@ -1,50 +1,40 @@
package icm.sphynx.styles;

import icm.sphynx.ui.components.metro.MetroUIConfigTheme;
import icm.sphynx.ui.components.metro.UIButton;
import icm.sphynx.ui.components.metro.UICheckBox;
import icm.sphynx.ui.components.metro.UIComboBox;
import icm.sphynx.ui.components.metro.UIFormattedTextField;
import icm.sphynx.ui.components.metro.UISpinner;
import icm.sphynx.ui.components.metro.UILabel;
import icm.sphynx.ui.components.metro.UIList;
import icm.sphynx.ui.components.metro.UIMenu;
import icm.sphynx.ui.components.metro.UIMenuBar;
import icm.sphynx.ui.components.metro.UIMenuItem;
import icm.sphynx.ui.components.metro.UIOptionPane;
import icm.sphynx.ui.components.metro.UIPanel;
import icm.sphynx.ui.components.metro.UIPasswordField;
import icm.sphynx.ui.components.metro.UIProgressBar;
import icm.sphynx.ui.components.metro.UIRadioButton;
import icm.sphynx.ui.components.metro.UIScrollBar;
import icm.sphynx.ui.components.metro.UISlider;
import icm.sphynx.ui.components.metro.UISplitPane;
import icm.sphynx.ui.components.metro.UITabbedPane;
import icm.sphynx.ui.components.metro.UITable;
import icm.sphynx.ui.components.metro.UITableHeader;
import icm.sphynx.ui.components.metro.UITextArea;
import icm.sphynx.ui.components.metro.UITextField;
import icm.sphynx.ui.components.metro.UIToggleButton;
import icm.sphynx.ui.components.metro.UITools;
import icm.sphynx.ui.tools.IconsMetroUI;
import icm.sphynx.ui.tools.StyleColorsMetro;
import icm.sphynx.ui.tools.ThemeMetroUI;
import icm.sphynx.ui.metro.tools.MetroUIConfigTheme;
import icm.sphynx.ui.metro.manager.UIButton;
import icm.sphynx.ui.metro.manager.UICheckBox;
import icm.sphynx.ui.metro.manager.UIComboBox;
import icm.sphynx.ui.metro.manager.UIFormattedTextField;
import icm.sphynx.ui.metro.manager.UISpinner;
import icm.sphynx.ui.metro.manager.UILabel;
import icm.sphynx.ui.metro.manager.UIList;
import icm.sphynx.ui.metro.manager.UIMenu;
import icm.sphynx.ui.metro.manager.UIMenuBar;
import icm.sphynx.ui.metro.manager.UIMenuItem;
import icm.sphynx.ui.metro.manager.UIOptionPane;
import icm.sphynx.ui.metro.manager.UIPanel;
import icm.sphynx.ui.metro.manager.UIPasswordField;
import icm.sphynx.ui.metro.manager.UIProgressBar;
import icm.sphynx.ui.metro.manager.UIRadioButton;
import icm.sphynx.ui.metro.manager.UIScrollBar;
import icm.sphynx.ui.metro.manager.UISlider;
import icm.sphynx.ui.metro.manager.UISplitPane;
import icm.sphynx.ui.metro.manager.UITabbedPane;
import icm.sphynx.ui.metro.manager.UITable;
import icm.sphynx.ui.metro.manager.UITableHeader;
import icm.sphynx.ui.metro.manager.UITextArea;
import icm.sphynx.ui.metro.manager.UITextField;
import icm.sphynx.ui.metro.manager.UIToggleButton;
import icm.sphynx.ui.metro.manager.UITools;
import icm.sphynx.ui.metro.tools.IconsMetroUI;
import icm.sphynx.ui.metro.tools.StyleColorsMetro;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import javafx.scene.layout.Border;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.Painter;
import javax.swing.UIManager;
import javax.swing.border.CompoundBorder;
import javax.swing.border.LineBorder;
import javax.swing.border.MatteBorder;
import javax.swing.plaf.metal.MetalLookAndFeel;

/**
* @author israel-icm
Expand All @@ -64,22 +54,18 @@ public static void installLight(String primaryColor, boolean autoColorCorrector)

installComponents();

UIManager.put("MenuBar.background", Color.decode(StyleColorsMetro.LIGHT_BACKGROUND_PANEL));
UIManager.put("MenuBar.background", Color.decode(StyleColorsMetro.PANEL_BACKGROUND));
UIManager.put("MenuBar.border", null);

// UIManager.put("Menu.background", Color.decode(StyleColors.LIGHT_BACKGROUND_PANEL));
UIManager.put("Menu.foreground", Color.decode(StyleColorsMetro.LIGHT_FOREGROUND));
UIManager.put("Menu.foreground", Color.decode(StyleColorsMetro.PANEL_FOREGROUND));
UIManager.put("Menu.font", new Font(UITools.FONT_DEFAULT, Font.BOLD, 13));

UIManager.put("MenuItem.background", Color.decode(StyleColorsMetro.LIGHT_BACKGROUND_PANEL));
UIManager.put("MenuItem.foreground", Color.decode(StyleColorsMetro.LIGHT_FOREGROUND));
UIManager.put("MenuItem.background", Color.decode(StyleColorsMetro.PANEL_BACKGROUND));
UIManager.put("MenuItem.foreground", Color.decode(StyleColorsMetro.PANEL_FOREGROUND));

// LineBorder border = new LineBorder(Color.decode(UITools.COLOR_BORDER_DEFAULT), 2);
// UIManager.put("ComboBox.selectionBackground", MetroUIConfigTheme.getPrimaryColor());
UIManager.put("ComboBox.selectionForeground", Color.WHITE);
UIManager.put("ComboBox.font", new Font(UITools.FONT_DEFAULT, Font.PLAIN, 12));
// UIManager.put("ComboBox.border", border);
// UIManager.put("ComboBox.buttonHighlight", MetroUIConfigTheme.getPrimaryColor());

UIManager.put("Table.focusCellHighlightBorder", BorderFactory.createMatteBorder(2, 2, 2, 2, Color.WHITE));

Expand Down Expand Up @@ -114,15 +100,15 @@ public static void installDark(String primaryColor, boolean autoColorCorrector)

installComponents();

UIManager.put("MenuBar.background", Color.decode(StyleColorsMetro.LIGHT_BACKGROUND_PANEL));
UIManager.put("MenuBar.background", Color.decode(StyleColorsMetro.PANEL_BACKGROUND));
UIManager.put("MenuBar.border", null);

// UIManager.put("Menu.background", Color.decode(StyleColors.LIGHT_BACKGROUND_PANEL));
UIManager.put("Menu.foreground", Color.decode(StyleColorsMetro.LIGHT_FOREGROUND));
UIManager.put("Menu.foreground", Color.decode(StyleColorsMetro.PANEL_FOREGROUND));
UIManager.put("Menu.font", new Font(UITools.FONT_DEFAULT, Font.BOLD, 13));

UIManager.put("MenuItem.background", Color.decode(StyleColorsMetro.LIGHT_BACKGROUND_PANEL));
UIManager.put("MenuItem.foreground", Color.decode(StyleColorsMetro.LIGHT_FOREGROUND));
UIManager.put("MenuItem.background", Color.decode(StyleColorsMetro.PANEL_BACKGROUND));
UIManager.put("MenuItem.foreground", Color.decode(StyleColorsMetro.PANEL_FOREGROUND));

LineBorder border = new LineBorder(Color.decode(UITools.COLOR_BORDER_DEFAULT), 2);
// UIManager.put("ComboBox.selectionBackground", MetroUIConfigTheme.getPrimaryColor());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package icm.sphynx.ui.components.metro;
package icm.sphynx.ui.metro.components;

import java.awt.AlphaComposite;
import java.awt.BasicStroke;
Expand All @@ -14,8 +14,8 @@
*
* @author israel-icm
*/
public class MetroUIBorderShadow extends LineBorder {
public MetroUIBorderShadow(Color color, int thickness) {
public class BorderShadow extends LineBorder {
public BorderShadow(Color color, int thickness) {
super(color, thickness);
}

Expand Down
73 changes: 73 additions & 0 deletions src/icm/sphynx/ui/metro/components/CaretMetro.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package icm.sphynx.ui.metro.components;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;
import javax.swing.ImageIcon;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultCaret;
import javax.swing.text.JTextComponent;

/**
*
* @author israel-icm
*/
public class CaretMetro extends DefaultCaret {
/*@Override
protected synchronized void damage(Rectangle r) {
if (r == null)
return;
x = r.x;
y = r.y;
height = r.height;
if (width <= 0) width = getComponent().getWidth();
repaint();
}*/

@Override
public void paint(Graphics g) {
g.setColor(Color.red);
g.fillRect(x, y, 3, height);

/*JTextComponent comp = getComponent();
if (comp == null)
return;
int dot = getDot();
Rectangle r = null;
char dotChar;
try {
r = comp.modelToView(dot);
if (r == null)
return;
dotChar = comp.getText(dot, 1).charAt(0);
} catch (BadLocationException e) {
return;
}
if ( (x != r.x) || (y != r.y) ) {
repaint();
x = r.x;
y = r.y;
height = r.height;
}
g.setColor(Color.decode("#FF0000"));
g.setXORMode(comp.getBackground());
// ImageIcon imgcaret=null;
if (dotChar == '\n') {
int diam = r.height;
if (isVisible()) {
g.fillRect(r.x, r.y, 10, 16);
// g.drawImage(imgcaret.getImage(), r.x, r.y,20,17, comp);
}
width = diam / 2 + 2;
return;
}
width = g.getFontMetrics().charWidth(dotChar);
if (isVisible())
g.fillRect(r.x, r.y, width, r.height);*/
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package icm.sphynx.ui.components.metro;
package icm.sphynx.ui.metro.manager;

import javax.swing.plaf.basic.BasicBorders;

Expand Down
Loading

0 comments on commit 21e1030

Please sign in to comment.