Code cleanup - deprecations

This commit is contained in:
schnautzr
2019-02-23 20:59:19 -06:00
parent 4ddf811118
commit 59214fe332
63 changed files with 131 additions and 144 deletions

View File

@@ -388,7 +388,7 @@ public enum FControl implements KeyEventDispatcher {
return true;
}
}
else if (e.getID() == KeyEvent.KEY_PRESSED && e.getModifiers() == InputEvent.ALT_MASK) {
else if (e.getID() == KeyEvent.KEY_PRESSED && e.getModifiersEx() == InputEvent.ALT_DOWN_MASK) {
altKeyLastDown = true;
}
}

View File

@@ -295,30 +295,10 @@ public class ImportSourceAnalyzer {
// character mangling on some system locales, but we want to replicate the old code here exactly
return out.toString().toLowerCase();
}
@Deprecated
private void addDefaultPicNames(final PaperCard c, final boolean backFace) {
final CardRules card = c.getRules();
final String urls = card.getPictureUrl(backFace);
if (StringUtils.isEmpty(urls)) { return; }
final int numPics = 1 + StringUtils.countMatches(urls, "\\");
if (c.getArtIndex() > numPics) {
return;
}
final String filenameBase = ImageUtil.getImageKey(c, backFace, false);
final String filename = filenameBase + ".jpg";
final boolean alreadyHadIt = null != defaultPicNames.put(filename, filename);
if ( alreadyHadIt ) {
return;
}
// Do you shift artIndex by one here?
final String newLastSymbol = 0 == c.getArtIndex() ? "" : String.valueOf(c.getArtIndex() /* + 1 */);
final String oldFilename = oldCleanString(filenameBase.replaceAll("[0-9]?(\\.full)?$", "")) + newLastSymbol + ".jpg";
//if ( numPics > 1 )
//System.out.printf("Will move %s -> %s%n", oldFilename, filename);
defaultPicOldNameToCurrentName.put(oldFilename, filename);
return;
}

View File

@@ -79,7 +79,7 @@ public class TextSearchFilter<T extends InventoryItem> extends ItemFilter<T> {
itemManager.focus();
break;
case KeyEvent.VK_ENTER:
if (e.getModifiers() == 0) {
if (e.getModifiersEx() == 0) {
if (changeTimer.isRunning()) {
applyChange(); //apply change now if currently delayed
}

View File

@@ -327,7 +327,7 @@ public abstract class ItemView<T extends InventoryItem> {
private boolean popupShowing = false;
private Popup popup;
private Timer popupTimer;
private static final int okModifiers = InputEvent.SHIFT_MASK | InputEvent.ALT_GRAPH_MASK;
private static final int okModifiers = InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_GRAPH_DOWN_MASK;
public IncrementalSearch() {
}
@@ -481,7 +481,7 @@ public abstract class ItemView<T extends InventoryItem> {
//$FALL-THROUGH$
default:
// shift and/or alt-graph down is ok. anything else is a hotkey (e.g. ctrl-f)
if (okModifiers != (e.getModifiers() | okModifiers)
if (okModifiers != (e.getModifiersEx() | okModifiers)
|| !CharUtils.isAsciiPrintable(e.getKeyChar())) { // escape sneaks in here on Windows
return;
}

View File

@@ -585,7 +585,7 @@ public abstract class ACEditorBase<TItem extends InventoryItem, TModel extends D
}
public void addMoveItems(final String verb, final String dest) {
addItems(verb, dest, false, 0, InputEvent.SHIFT_DOWN_MASK, InputEvent.ALT_MASK);
addItems(verb, dest, false, 0, InputEvent.SHIFT_DOWN_MASK, InputEvent.ALT_DOWN_MASK);
}
public void addMoveAlternateItems(final String verb, final String dest) {
@@ -596,7 +596,7 @@ public abstract class ACEditorBase<TItem extends InventoryItem, TModel extends D
addItems(verb, dest, true, InputEvent.CTRL_DOWN_MASK,
//getMenuShortcutKeyMask() instead of CTRL_DOWN_MASK since on OSX, ctrl-shift-space brings up the window manager
InputEvent.SHIFT_DOWN_MASK | Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(),
InputEvent.ALT_MASK | Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
InputEvent.ALT_DOWN_MASK | Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
}
}
}

View File

@@ -42,7 +42,7 @@ public enum VCardScript implements IVDoc<CCardScript> {
txtScript.setDocument(doc);
error = doc.addStyle("error", null);
error.addAttribute(StyleConstants.Background, Color.red);
error.addAttribute(StyleConstants.Bold, new Boolean(true));
error.addAttribute(StyleConstants.Bold, Boolean.valueOf(true));
}
public JTextPane getTxtScript() {

View File

@@ -200,8 +200,8 @@ public class FUndoManager extends UndoManager implements DocumentListener {
public UndoAction() {
putValue(Action.NAME, "Undo");
putValue(Action.SHORT_DESCRIPTION, getValue(Action.NAME));
putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_U));
putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_MASK));
putValue(Action.MNEMONIC_KEY, Integer.valueOf(KeyEvent.VK_U));
putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_DOWN_MASK));
setEnabled(false);
}
@@ -229,8 +229,8 @@ public class FUndoManager extends UndoManager implements DocumentListener {
public RedoAction() {
putValue(Action.NAME, "Redo");
putValue(Action.SHORT_DESCRIPTION, getValue(Action.NAME));
putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_R));
putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Y, InputEvent.CTRL_MASK));
putValue(Action.MNEMONIC_KEY, Integer.valueOf(KeyEvent.VK_R));
putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Y, InputEvent.CTRL_DOWN_MASK));
setEnabled(false);
}