Skip to content

Commit

Permalink
Merge pull request #172 from berry120/master
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
vincenzopalazzo committed Oct 2, 2021
2 parents 5581451 + 5131578 commit c355cf9
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 33 deletions.
4 changes: 2 additions & 2 deletions src/main/java/mdlaf/MaterialLookAndFeel.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class MaterialLookAndFeel extends MetalLookAndFeel {
protected MaterialTheme theme;

private static final String buttonUI = MaterialButtonUI.class.getCanonicalName();
private static final String textfieldUI = MaterialTextFieldUI.class.getCanonicalName();
private static final String textFieldUI = MaterialTextFieldUI.class.getCanonicalName();
private static final String passwordFieldUI = MaterialPasswordFieldUI.class.getCanonicalName();
private static final String tableUI = MaterialTableUI.class.getCanonicalName();
private static final String tableHeaderUI = MaterialTableHeaderUI.class.getCanonicalName();
Expand Down Expand Up @@ -198,7 +198,7 @@ public boolean getSupportsWindowDecorations() {
protected void initClassDefaults(UIDefaults table) {
super.initClassDefaults(table);
table.put("ButtonUI", buttonUI);
table.put("TextFieldUI", textfieldUI);
table.put("TextFieldUI", textFieldUI);
table.put("PasswordFieldUI", passwordFieldUI);
table.put("TableUI", tableUI);
table.put("TableHeaderUI", tableHeaderUI);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mdlaf/animation/MaterialUIMovement.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ public static MaterialUITimer getMovement(JComponent c, Color fadeTo) {

/**
* This method create a new effect mouse hover static, not create a wake effect This method is
* util in all component for click, an example: The button for JSpinner, JCombobox, JScroolbar
* util in all component for click, an example: The button for JSpinner, JCombobox, JScrollbar
* param c is the component param colorEffect is the color for effect, (For using color, look the
* MaterialColors class) param colorOnClick is the color of the component on click on it return a
* new MaterialUIStaticMovement this class implement a only MouseListner for moment
* new MaterialUIStaticMovement this class implement a only MouseListener for moment
*
* @author https://github.com/vincenzopalazzo
* @deprecated This method will be removed inside the version 1.2, because with the new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

/**
* This class recreate a effect mouse hover static, This component not implement a wake effect, and
* is util in all component for click, an example: The button for JSpinner, JCombobox, JScroolBar
* is util in all component for click, an example: The button for JSpinner, JCombobox, JScrollBar
*
* @author https://github.com/vincenzopalazzo
* @deprecated This method will be removed inside the version 1.2, because with the new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ protected void paintText(Graphics g, JComponent c, Rectangle textRect, String te
* This method paint background, inside it will paint the border to buttons.
*
* <p>param g Graphics Object, with this object is possible paint the component JButton param c
* Component Object, rappresent the button, if possible use this object or the propriety called
* Component Object, represent the button, if possible use this object or the propriety called
* button inside this class
*/
protected void paintBackground(Graphics g, JComponent c) {
Expand Down
26 changes: 13 additions & 13 deletions src/main/java/mdlaf/components/rootpane/MaterialRootPaneUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ public static ComponentUI createUI(JComponent c) {

public MaterialRootPaneUI() {
super();
int devideWithd = 0;
int deviceWidth = 0;
int deviceHeight = 0;
GraphicsDevice graphicDevices[] =
GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
for (GraphicsDevice graphicsDevice : graphicDevices) {
devideWithd += graphicsDevice.getDisplayMode().getWidth();
deviceWidth += graphicsDevice.getDisplayMode().getWidth();
deviceHeight += graphicsDevice.getDisplayMode().getHeight();
}
this.dimensionDevices = new Dimension(devideWithd, deviceHeight);
this.dimensionDevices = new Dimension(deviceWidth, deviceHeight);
this.parentBounds = this.dimensionDevices;
}

Expand Down Expand Up @@ -527,7 +527,7 @@ protected class MaterialHandler
// are the mousePressed location in absolute coordinate system
int absoluteX, absoluteY;
// are the mousePressed location in source view's coordinate system
int windiwNowX, windowNowY;
int windowNowX, windowNowY;
Rectangle startingBounds;
int resizeDir;
protected final int RESIZE_NONE = 0;
Expand Down Expand Up @@ -560,7 +560,7 @@ void finishMouseReleased(Window w) {
}
absoluteX = 0;
absoluteY = 0;
windiwNowX = 0;
windowNowX = 0;
windowNowY = 0;
startingBounds = null;
resizeDir = RESIZE_NONE;
Expand All @@ -571,7 +571,7 @@ void finishMouseReleased(Window w) {
}

public void mousePressed(MouseEvent ev) {
windiwNowX = ev.getX();
windowNowX = ev.getX();
windowNowY = ev.getY();
// fix
Point mouseCurent = MouseInfo.getPointerInfo().getLocation();
Expand All @@ -593,7 +593,7 @@ public void mousePressed(MouseEvent ev) {
}
startingBounds = w.getBounds();
Insets i = w.getInsets();
Point ep = new Point(windiwNowX, windowNowY);
Point ep = new Point(windowNowX, windowNowY);
// Point convertedDragWindowOffset = SwingUtilities.convertPoint(w, dragWindowOffset,
// getTitlePane());
boolean resizable = false;
Expand Down Expand Up @@ -799,11 +799,11 @@ public void mouseDragged(MouseEvent e) {
// button was not used.
return;
}
// Dimension dimensioDevices = Toolkit.getDefaultToolkit().getScreenSize();
// Dimension dimensionDevices = Toolkit.getDefaultToolkit().getScreenSize();
/* GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
int width = gd.getDisplayMode().getWidth();
int height = gd.getDisplayMode().getHeight();
Dimension dimensioDevices = new Dimension(width, height);*/
Dimension dimensionDevices = new Dimension(width, height);*/

int parentWidth = dimensionDevices.width;
int parentHeight = dimensionDevices.height;
Expand All @@ -813,15 +813,15 @@ public void mouseDragged(MouseEvent e) {

// TODO see this point because with two display not worked well (Resolved -> testing)
// Make sure we stay in-bounds
if (newX + windows.left <= -windiwNowX) {
if (newX + windows.left <= -windowNowX) {
// What operation do this?
newX = -windiwNowX - windows.left + 1;
newX = -windowNowX - windows.left + 1;
} else if (newY + windows.top <= -windowNowY) {
// What operation do this?
newY = -windowNowY - windows.top + 1;
} else if (newX + windiwNowX + windows.right >= parentWidth) {
} else if (newX + windowNowX + windows.right >= parentWidth) {
// What operation do this?
newX = parentWidth - windiwNowX - windows.right - 1;
newX = parentWidth - windowNowX - windows.right - 1;
} else if (newY + windowNowY + windows.bottom >= parentHeight) {
// What operation do this?
newY = parentHeight - windowNowY - windows.bottom - 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Component getTableCellRendererComponent(
table, value, isSelected, hasFocus, row, column);
}

// OLD version code restored for JMars offical version
// OLD version code restored for JMars official version
/*
boolean alternativeRow = UIManager.getBoolean("Table.alternateRowColor");
Color alternateRowColor = UIManager.getColor("Table.alternateRowBackground");
Expand Down Expand Up @@ -81,7 +81,7 @@ public Component getTableCellRendererComponent(
}

// This method setting a MaterialCellRender at the particular class
// With this class not working correctly the color alternate in the Jtable
// With this class not working correctly the color alternate in the JTable
// in particular the IconImage without this code the cell is painted not correctly or
// in the cell did print the path of the image
protected void setDefaultCellRenderWithAllType(
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mdlaf/components/table/MaterialTableUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void update(Graphics g, JComponent c) {
}

// This method setting a MaterialCellRender at the particular class
// With this class not working correctly the color alternate in the Jtable
// With this class not working correctly the color alternate in the JTable
protected void setDefaultCellRenderWithType(JTable table) {
if (table == null) {
throw new IllegalArgumentException("Table is null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected class MaterialPaneBorder extends PaneBorder {
* This set also the border to the component.
*
* <p>- is possible define with the propriety TaskPanel.arch if the TaskPane title should be a
* rettangle or an with an arch
* rectangle or with an arch
*/
protected void paintTitleBackground(JXTaskPane group, Graphics g) {
this.label.setBackground(background);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ protected void updateSystemIcon() {
mySystemIcon = icons.get(0);
} else {
mySystemIcon = icons.get(0);
// TODO: find cross-platofrm replacement for this?
// TODO: find cross-platform replacement for this?
// mySystemIcon = SunToolkit.getScaledIconImage(icons, IMAGE_WIDTH, IMAGE_HEIGHT);
}
}
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/mdlaf/themes/AbstractMaterialTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,16 @@ public abstract class AbstractMaterialTheme implements MaterialTheme {

protected BorderUIResource cellBorderTableHeader;

/** Whent the Table row is unselected but the checkbox is uncheck */
/** When the Table row is unselected but the checkbox is unchecked */
protected IconUIResource unselectedCheckBoxIconTable;

/** Whent the Table row is unselected but the checkbox is check */
/** When the Table row is unselected but the checkbox is checked */
protected IconUIResource selectedCheckBoxIconTable;

/** Whent the Table row is selected but the checkbox is check */
/** When the Table row is selected but the checkbox is checked */
protected IconUIResource unselectedCheckBoxIconSelectionRowTable;

/** Whent the Table row is selected but the checkbox is check */
/** When the Table row is selected but the checkbox is checked */
protected IconUIResource selectedCheckBoxIconSelectionRowTable;

// ---------------------------------------------------
Expand Down Expand Up @@ -1090,7 +1090,6 @@ public boolean getEnableArrowScrollBar() {
return false;
}

// get jslider
public ColorUIResource getTrackColorSlider() {
return trackColorSlider;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mdlaf/utils/MaterialFontFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

/**
* This class managed the font inside the library and inside the Look and Feel, in fact this class
* use a flaywait patter to minimized the font instance created from the library. In fact on a lot
* of component you have only 4 instance of font in a normal use case.
* uses a flyweight pattern to minimized the font instance created from the library. In fact on a lot
* of components you have only 4 instance of font in a normal use case.
*
* @author https://github.com/vincenzopalazzo
*/
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mdlaf/utils/MaterialImageFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static void registerIcons(IconCode iconCode) {

private static MaterialImageFactory SINGLETON;

private static final String PATH_RESOUSES = "/imgs/";
private static final String PATH_RESOURCES = "/imgs/";

// blank image
public static final String BLANK = "blank";
Expand Down Expand Up @@ -103,7 +103,7 @@ public IconUIResource getImage(String key) {
if (key == null) {
throw new IllegalArgumentException("Argument null");
}
String path = PATH_RESOUSES.trim() + key.trim() + ".png".trim();
String path = PATH_RESOURCES.trim() + key.trim() + ".png".trim();
if (cacheImage.containsKey(path)) {
return cacheImage.get(path);
}
Expand Down

0 comments on commit c355cf9

Please sign in to comment.