Skip to content

Commit

Permalink
8312165: Fix typos in java.desktop Swing
Browse files Browse the repository at this point in the history
Co-authored-by: Alexey Ivanov <aivanov@openjdk.org>
Reviewed-by: aivanov
  • Loading branch information
Andrey Turbanov and aivanov-jdk committed Sep 15, 2023
1 parent 25f32f3 commit 89cb290
Show file tree
Hide file tree
Showing 106 changed files with 309 additions and 307 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ public Component getListCellRendererComponent(final JList<? extends File> list,
}

//
// DataModel for DirectoryComboxbox
// DataModel for DirectoryCombobox
//
protected DirectoryComboBoxModel createDirectoryComboBoxModel(final JFileChooser fc) {
return new DirectoryComboBoxModel();
Expand Down Expand Up @@ -1368,7 +1368,7 @@ public Component getListCellRendererComponent(final JList<? extends FileFilter>
}

//
// DataModel for Types Comboxbox
// DataModel for Types Combobox
//
protected FilterComboBoxModel createFilterComboBoxModel() {
return new FilterComboBoxModel();
Expand Down Expand Up @@ -1412,9 +1412,9 @@ private boolean isSelectedFileFilterInModel(Object filter) {

public Object getSelectedItem() {
// Ensure that the current filter is in the list.
// NOTE: we shouldnt' have to do this, since JFileChooser adds
// NOTE: we shouldn't have to do this, since JFileChooser adds
// the filter to the choosable filters list when the filter
// is set. Lets be paranoid just in case someone overrides
// is set. Let's be paranoid just in case someone overrides
// setFileFilter in JFileChooser.
FileFilter currentFilter = getFileChooser().getFileFilter();
boolean found = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -1179,7 +1179,7 @@ public Action getNewFolderAction() {
}

//
// DataModel for DirectoryComboxbox
// DataModel for DirectoryCombobox
//
protected DirectoryComboBoxModel createDirectoryComboBoxModel(JFileChooser fc) {
return new DirectoryComboBoxModel();
Expand Down Expand Up @@ -1468,9 +1468,9 @@ public void setSelectedItem(Object filter) {

public Object getSelectedItem() {
// Ensure that the current filter is in the list.
// NOTE: we shouldnt' have to do this, since JFileChooser adds
// NOTE: we shouldn't have to do this, since JFileChooser adds
// the filter to the choosable filters list when the filter
// is set. Lets be paranoid just in case someone overrides
// is set. Let's be paranoid just in case someone overrides
// setFileFilter in JFileChooser.
FileFilter currentFilter = getFileChooser().getFileFilter();
boolean found = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -775,10 +775,10 @@ public Object get(SynthContext context, Object key) {
Object value = getClassSpecificValue(classKey);
if (value != null) {
//This is a workaround as the "slider-length" property has been
//deprecated for GtkScale from gtk 3.20, so default value of 31
//is used and makes redering of slider wrong. Value 14 is being
//used as default value for Slider.thumbHeight is 14 and making
//width 14 as well makes slider thumb render in proper shape
//deprecated for GtkScale from gtk 3.20, so the default value of 31
//is used and makes rendering of the slider wrong. Value 14 is being
//used as the default value for Slider.thumbHeight is 14 and making
//width 14 as well makes the slider thumb render in proper shape
if ("Slider.thumbWidth".equals(key) && value.equals(31)) {
return 14;
}
Expand Down Expand Up @@ -1127,7 +1127,7 @@ else if (!loadedRTL) {
}

/**
* GTKLazyValue is a slimmed down version of <code>ProxyLaxyValue</code>.
* GTKLazyValue is a slimmed down version of <code>ProxyLazyValue</code>.
* The code is duplicate so that it can get at the package private
* classes in gtk.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -216,7 +216,7 @@ protected void adjustBoundsForIcon(JInternalFrame.JDesktopIcon icon,

/* Fix for disappearing icons. If the y value is maxy then this
* algorithm would place the icon in a non-displayed cell. Never
* to be ssen again.*/
* to be seen again.*/
y = y >= maxy ? (maxy - 1) : y;

/* Compute the offset for the cell we are trying to go in. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -762,7 +762,7 @@ public void contentsChanged(ListDataEvent e) {
}

//
// DataModel for Types Comboxbox
// DataModel for Types Combobox
//
protected FilterComboBoxModel createFilterComboBoxModel() {
return new FilterComboBoxModel();
Expand Down Expand Up @@ -826,9 +826,9 @@ public void setSelectedItem(Object filter) {

public Object getSelectedItem() {
// Ensure that the current filter is in the list.
// NOTE: we shouldnt' have to do this, since JFileChooser adds
// NOTE: we shouldn't have to do this, since JFileChooser adds
// the filter to the choosable filters list when the filter
// is set. Lets be paranoid just in case someone overrides
// is set. Let's be paranoid just in case someone overrides
// setFileFilter in JFileChooser.
FileFilter currentFilter = getFileChooser().getFileFilter();
boolean found = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -760,7 +760,7 @@ public Object createValue(UIDefaults table) {
MotifLookAndFeel.class,
"icons/DesktopIcon.gif"),
"DesktopIcon.border", null,
// These are a little odd, MotifInternalFrameUI isntalls em!
// These are a little odd, MotifInternalFrameUI installs em!
"DesktopIcon.windowBindings", new Object[]
{ "ESCAPE", "hideSystemMenu" },

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -53,7 +53,7 @@ public static ComponentUI createUI(JComponent x) {
}

/**
* Creates and returns a Container containin the buttons. The buttons
* Creates and returns a Container containing the buttons. The buttons
* are created by calling <code>getButtons</code>.
*/
protected Container createButtonArea() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -556,7 +556,7 @@ else if (!root.isLightweight()) {
}
if ((root instanceof RootPaneContainer) &&
(rootJ instanceof JRootPane)) {
// We're in a Swing heavyeight (JFrame/JWindow...), use double
// We're in a Swing heavyweight (JFrame/JWindow...), use double
// buffering if double buffering enabled on the JRootPane and
// the JRootPane wants true double buffering.
if (rootJ.isDoubleBuffered() &&
Expand Down Expand Up @@ -685,12 +685,12 @@ public Container getRoot() {
}

/**
* Returns the BufferStartegy. This will return null if
* the BufferStartegy hasn't been created and <code>create</code> is
* Returns the BufferStrategy. This will return null if
* the BufferStrategy hasn't been created and <code>create</code> is
* false, or if there is a problem in creating the
* <code>BufferStartegy</code>.
* <code>BufferStrategy</code>.
*
* @param create If true, and the BufferStartegy is currently null,
* @param create If true and the BufferStrategy is currently null,
* one will be created.
*/
public BufferStrategy getBufferStrategy(boolean create) {
Expand Down Expand Up @@ -793,7 +793,7 @@ private BufferStrategy createBufferStrategy(Container root,
} catch (AWTException e) {
// Type is not supported
if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) {
LOGGER.finer("createBufferStratety failed",
LOGGER.finer("createBufferStrategy failed",
e);
}
}
Expand All @@ -805,7 +805,7 @@ private BufferStrategy createBufferStrategy(Container root,
} catch (AWTException e) {
// Type not supported
if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) {
LOGGER.finer("createBufferStratety failed",
LOGGER.finer("createBufferStrategy failed",
e);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/java.desktop/share/classes/javax/swing/FocusManager.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -95,7 +95,7 @@ public static FocusManager getCurrentManager() {
* <p>
* If a <code>SecurityManager</code> is installed,
* the calling thread must be granted the <code>AWTPermission</code>
* "replaceKeyboardFocusManager" in order to replace the
* "replaceKeyboardFocusManager" in order to replace
* the current <code>KeyboardFocusManager</code>.
* If this permission is not granted,
* this method will throw a <code>SecurityException</code>,
Expand Down
4 changes: 2 additions & 2 deletions src/java.desktop/share/classes/javax/swing/GroupLayout.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -3521,7 +3521,7 @@ String getMatchDescription() {
}


// LinkInfo contains the set of ComponentInfosthat are linked along a
// LinkInfo contains the set of ComponentInfos that are linked along a
// particular axis.
private static class LinkInfo {
private final int axis;
Expand Down
12 changes: 6 additions & 6 deletions src/java.desktop/share/classes/javax/swing/JComponent.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -5050,11 +5050,11 @@ public void paintImmediately(int x,int y,int w, int h) {
return;
}

JComponent paintingOigin = SwingUtilities.getPaintingOrigin(this);
if (paintingOigin != null) {
JComponent paintingOrigin = SwingUtilities.getPaintingOrigin(this);
if (paintingOrigin != null) {
Rectangle rectangle = SwingUtilities.convertRectangle(
c, new Rectangle(x, y, w, h), paintingOigin);
paintingOigin.paintImmediately(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
c, new Rectangle(x, y, w, h), paintingOrigin);
paintingOrigin.paintImmediately(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
return;
}

Expand Down Expand Up @@ -5510,7 +5510,7 @@ private static class ReadObjectCallback implements ObjectInputValidation {
/**
* This is the method that's called after the entire graph
* of objects has been read in. It initializes
* the UI property of all of the copmonents with
* the UI property of all of the components with
* <code>SwingUtilities.updateComponentTreeUI</code>.
*/
public void validateObject() throws InvalidObjectException {
Expand Down
8 changes: 4 additions & 4 deletions src/java.desktop/share/classes/javax/swing/JEditorPane.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -1227,7 +1227,7 @@ public void replaceSelection(String content) {
*/
@SuppressWarnings("deprecation")
public static EditorKit createEditorKitForContentType(String type) {
Hashtable<String, EditorKit> kitRegistry = getKitRegisty();
Hashtable<String, EditorKit> kitRegistry = getKitRegistry();
EditorKit k = kitRegistry.get(type);
if (k == null) {
// try to dynamically load the support
Expand Down Expand Up @@ -1294,7 +1294,7 @@ public static void registerEditorKitForContentType(String type, String classname
} else {
getKitLoaderRegistry().remove(type);
}
getKitRegisty().remove(type);
getKitRegistry().remove(type);
}

/**
Expand Down Expand Up @@ -1326,7 +1326,7 @@ private static Hashtable<String, ClassLoader> getKitLoaderRegistry() {
return tmp;
}

private static Hashtable<String, EditorKit> getKitRegisty() {
private static Hashtable<String, EditorKit> getKitRegistry() {
@SuppressWarnings("unchecked")
Hashtable<String, EditorKit> ht =
(Hashtable)SwingUtilities.appContextGet(kitRegistryKey);
Expand Down
4 changes: 2 additions & 2 deletions src/java.desktop/share/classes/javax/swing/JFileChooser.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -1665,7 +1665,7 @@ public boolean accept(File f) {
* @see FileSystemView
*/
@BeanProperty(expert = true, description
= "Sets the FileSytemView used to get filesystem information.")
= "Sets the FileSystemView used to get filesystem information.")
public void setFileSystemView(FileSystemView fsv) {
FileSystemView oldValue = fileSystemView;
fileSystemView = fsv;
Expand Down
8 changes: 4 additions & 4 deletions src/java.desktop/share/classes/javax/swing/JLayeredPane.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -465,7 +465,7 @@ public void setPosition(Component c, int position) {
* @param c the Component to check
* @return an int giving the component's position, where 0 is the
* topmost position and the highest index value = the count
* count of components at that layer, minus 1
* of components at that layer minus 1
*
* @see #getComponentCountInLayer
*/
Expand Down Expand Up @@ -529,7 +529,7 @@ public int getComponentCountInLayer(int layer) {
curLayer = getLayer(getComponent(i));
if(curLayer == layer) {
layerCount++;
/// Short-circuit the counting when we have them all
// Short-circuit the counting when we have them all
} else if(layerCount > 0 || curLayer < layer) {
break;
}
Expand All @@ -555,7 +555,7 @@ public Component[] getComponentsInLayer(int layer) {
curLayer = getLayer(getComponent(i));
if(curLayer == layer) {
results[layerCount++] = getComponent(i);
/// Short-circuit the counting when we have them all
// Short-circuit the counting when we have them all
} else if(layerCount > 0 || curLayer < layer) {
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/java.desktop/share/classes/javax/swing/JList.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -1769,7 +1769,7 @@ public void setListData(final Vector<? extends E> listData) {
* during construction to initialize the list's selection model
* property.
*
* @return a {@code DefaultListSelecitonModel}, used to initialize
* @return a {@code DefaultListSelectionModel}, used to initialize
* the list's selection model property during construction
* @see #setSelectionModel
* @see DefaultListSelectionModel
Expand Down
4 changes: 2 additions & 2 deletions src/java.desktop/share/classes/javax/swing/JMenu.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -362,7 +362,7 @@ protected Point getPopupMenuOrigin() {
int x;
int y;
JPopupMenu pm = getPopupMenu();
// Figure out the sizes needed to caclulate the menu position
// Figure out the sizes needed to calculate the menu position
Dimension s = getSize();
Dimension pmSize = pm.getSize();
// For the first time the menu is popped up,