(reverted) Changed Util class names
This commit is contained in:
parent
fa3afc7c74
commit
68c9795674
|
@ -18,7 +18,7 @@ package dorkbox.systemTray;
|
|||
import java.awt.event.ActionListener;
|
||||
|
||||
import dorkbox.systemTray.peer.CheckboxPeer;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
/**
|
||||
* This represents a common menu-checkbox entry, that is cross platform in nature
|
||||
|
@ -189,7 +189,7 @@ class Checkbox extends Entry {
|
|||
*/
|
||||
public
|
||||
void setShortcut(final int key) {
|
||||
this.mnemonicKey = Swing.getFromVirtualKey(key);
|
||||
this.mnemonicKey = SwingUtil.getFromVirtualKey(key);
|
||||
|
||||
if (peer != null) {
|
||||
((CheckboxPeer) peer).setShortcut(this);
|
||||
|
|
|
@ -25,7 +25,7 @@ import javax.imageio.stream.ImageInputStream;
|
|||
|
||||
import dorkbox.systemTray.peer.MenuItemPeer;
|
||||
import dorkbox.systemTray.util.ImageResizeUtil;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
/**
|
||||
* This represents a common menu-entry, that is cross platform in nature
|
||||
|
@ -336,7 +336,7 @@ class MenuItem extends Entry {
|
|||
*/
|
||||
public
|
||||
void setShortcut(final int key) {
|
||||
this.mnemonicKey = Swing.getFromVirtualKey(key);
|
||||
this.mnemonicKey = SwingUtil.getFromVirtualKey(key);
|
||||
|
||||
if (peer != null) {
|
||||
((MenuItemPeer) peer).setShortcut(this);
|
||||
|
|
|
@ -26,7 +26,7 @@ import dorkbox.systemTray.MenuItem;
|
|||
import dorkbox.systemTray.Separator;
|
||||
import dorkbox.systemTray.Status;
|
||||
import dorkbox.systemTray.peer.MenuPeer;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
// this is a weird composite class, because it must be a Menu, but ALSO a Entry -- so it has both
|
||||
@SuppressWarnings("ForLoopReplaceableByForEach")
|
||||
|
@ -53,7 +53,7 @@ class AwtMenu implements MenuPeer {
|
|||
public
|
||||
void add(final Menu parentMenu, final Entry entry, final int index) {
|
||||
// must always be called on the EDT
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -92,7 +92,7 @@ class AwtMenu implements MenuPeer {
|
|||
@Override
|
||||
public
|
||||
void setEnabled(final MenuItem menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -105,7 +105,7 @@ class AwtMenu implements MenuPeer {
|
|||
@Override
|
||||
public
|
||||
void setText(final MenuItem menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -125,9 +125,9 @@ class AwtMenu implements MenuPeer {
|
|||
public
|
||||
void setShortcut(final MenuItem menuItem) {
|
||||
// yikes...
|
||||
final int vKey = Swing.getVirtualKey(menuItem.getShortcut());
|
||||
final int vKey = SwingUtil.getVirtualKey(menuItem.getShortcut());
|
||||
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -139,7 +139,7 @@ class AwtMenu implements MenuPeer {
|
|||
@Override
|
||||
public
|
||||
void remove() {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.awt.event.ActionListener;
|
|||
|
||||
import dorkbox.systemTray.SystemTray;
|
||||
import dorkbox.systemTray.peer.MenuItemPeer;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
class AwtMenuItem implements MenuItemPeer {
|
||||
|
||||
|
@ -45,7 +45,7 @@ class AwtMenuItem implements MenuItemPeer {
|
|||
@Override
|
||||
public
|
||||
void setEnabled(final dorkbox.systemTray.MenuItem menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -57,7 +57,7 @@ class AwtMenuItem implements MenuItemPeer {
|
|||
@Override
|
||||
public
|
||||
void setText(final dorkbox.systemTray.MenuItem menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -103,9 +103,9 @@ class AwtMenuItem implements MenuItemPeer {
|
|||
void setShortcut(final dorkbox.systemTray.MenuItem menuItem) {
|
||||
char shortcut = menuItem.getShortcut();
|
||||
// yikes...
|
||||
final int vKey = Swing.getVirtualKey(shortcut);
|
||||
final int vKey = SwingUtil.getVirtualKey(shortcut);
|
||||
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -118,7 +118,7 @@ class AwtMenuItem implements MenuItemPeer {
|
|||
@Override
|
||||
public
|
||||
void remove() {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.awt.event.ActionListener;
|
|||
import dorkbox.systemTray.Checkbox;
|
||||
import dorkbox.systemTray.SystemTray;
|
||||
import dorkbox.systemTray.peer.CheckboxPeer;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
class AwtMenuItemCheckbox implements CheckboxPeer {
|
||||
|
||||
|
@ -42,7 +42,7 @@ class AwtMenuItemCheckbox implements CheckboxPeer {
|
|||
@Override
|
||||
public
|
||||
void setEnabled(final Checkbox menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -54,7 +54,7 @@ class AwtMenuItemCheckbox implements CheckboxPeer {
|
|||
@Override
|
||||
public
|
||||
void setText(final Checkbox menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -102,9 +102,9 @@ class AwtMenuItemCheckbox implements CheckboxPeer {
|
|||
void setShortcut(final Checkbox menuItem) {
|
||||
char shortcut = menuItem.getShortcut();
|
||||
// yikes...
|
||||
final int vKey = Swing.getVirtualKey(shortcut);
|
||||
final int vKey = SwingUtil.getVirtualKey(shortcut);
|
||||
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -122,7 +122,7 @@ class AwtMenuItemCheckbox implements CheckboxPeer {
|
|||
if (checked != this.isChecked) {
|
||||
this.isChecked = checked;
|
||||
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -136,7 +136,7 @@ class AwtMenuItemCheckbox implements CheckboxPeer {
|
|||
@Override
|
||||
public
|
||||
void remove() {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
|
|
@ -17,7 +17,7 @@ package dorkbox.systemTray.ui.awt;
|
|||
|
||||
|
||||
import dorkbox.systemTray.peer.EntryPeer;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
class AwtMenuItemSeparator implements EntryPeer {
|
||||
|
||||
|
@ -34,7 +34,7 @@ class AwtMenuItemSeparator implements EntryPeer {
|
|||
@Override
|
||||
public
|
||||
void remove() {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.awt.MenuItem;
|
|||
|
||||
import dorkbox.systemTray.Status;
|
||||
import dorkbox.systemTray.peer.StatusPeer;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
class AwtMenuItemStatus implements StatusPeer {
|
||||
|
||||
|
@ -39,7 +39,7 @@ class AwtMenuItemStatus implements StatusPeer {
|
|||
@Override
|
||||
public
|
||||
void setText(final Status menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -63,7 +63,7 @@ class AwtMenuItemStatus implements StatusPeer {
|
|||
@Override
|
||||
public
|
||||
void remove() {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
|
|
@ -27,7 +27,7 @@ import javax.swing.ImageIcon;
|
|||
import dorkbox.systemTray.MenuItem;
|
||||
import dorkbox.systemTray.Tray;
|
||||
import dorkbox.util.OS;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
/**
|
||||
* Class for handling all system tray interaction, via AWT. Pretty much EXCLUSIVELY for on MacOS, because that is the only time this
|
||||
|
@ -69,7 +69,7 @@ class _AwtTray extends Tray {
|
|||
@Override
|
||||
public
|
||||
void setEnabled(final MenuItem menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -136,7 +136,7 @@ class _AwtTray extends Tray {
|
|||
return;
|
||||
}
|
||||
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -185,7 +185,7 @@ class _AwtTray extends Tray {
|
|||
@Override
|
||||
public
|
||||
void remove() {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -217,7 +217,7 @@ class _AwtTray extends Tray {
|
|||
}
|
||||
this.tooltipText = tooltipText;
|
||||
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
|
|
@ -30,7 +30,7 @@ import dorkbox.systemTray.Separator;
|
|||
import dorkbox.systemTray.Status;
|
||||
import dorkbox.systemTray.SystemTray;
|
||||
import dorkbox.systemTray.peer.MenuPeer;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
// this is a weird composite class, because it must be a Menu, but ALSO a Entry -- so it has both (and duplicate code)
|
||||
@SuppressWarnings("ForLoopReplaceableByForEach")
|
||||
|
@ -69,7 +69,7 @@ class SwingMenu implements MenuPeer {
|
|||
public
|
||||
void add(final Menu parentMenu, final Entry entry, final int index) {
|
||||
// must always be called on the EDT
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -107,7 +107,7 @@ class SwingMenu implements MenuPeer {
|
|||
@Override
|
||||
public
|
||||
void setImage(final MenuItem menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -127,7 +127,7 @@ class SwingMenu implements MenuPeer {
|
|||
@Override
|
||||
public
|
||||
void setEnabled(final MenuItem menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -141,7 +141,7 @@ class SwingMenu implements MenuPeer {
|
|||
@Override
|
||||
public
|
||||
void setText(final MenuItem menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -162,9 +162,9 @@ class SwingMenu implements MenuPeer {
|
|||
void setShortcut(final MenuItem menuItem) {
|
||||
char shortcut = menuItem.getShortcut();
|
||||
// yikes...
|
||||
final int vKey = Swing.getVirtualKey(shortcut);
|
||||
final int vKey = SwingUtil.getVirtualKey(shortcut);
|
||||
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -179,7 +179,7 @@ class SwingMenu implements MenuPeer {
|
|||
@Override
|
||||
public synchronized
|
||||
void remove() {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
|
|
@ -28,7 +28,7 @@ import dorkbox.systemTray.MenuItem;
|
|||
import dorkbox.systemTray.SystemTray;
|
||||
import dorkbox.systemTray.peer.MenuItemPeer;
|
||||
import dorkbox.systemTray.util.ImageResizeUtil;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
class SwingMenuItem implements MenuItemPeer {
|
||||
|
||||
|
@ -78,7 +78,7 @@ class SwingMenuItem implements MenuItemPeer {
|
|||
@Override
|
||||
public
|
||||
void setImage(final MenuItem menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -97,7 +97,7 @@ class SwingMenuItem implements MenuItemPeer {
|
|||
@Override
|
||||
public
|
||||
void setEnabled(final MenuItem menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -109,7 +109,7 @@ class SwingMenuItem implements MenuItemPeer {
|
|||
@Override
|
||||
public
|
||||
void setText(final MenuItem menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -155,9 +155,9 @@ class SwingMenuItem implements MenuItemPeer {
|
|||
void setShortcut(final MenuItem menuItem) {
|
||||
char shortcut = menuItem.getShortcut();
|
||||
// yikes...
|
||||
final int vKey = Swing.getVirtualKey(shortcut);
|
||||
final int vKey = SwingUtil.getVirtualKey(shortcut);
|
||||
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -170,7 +170,7 @@ class SwingMenuItem implements MenuItemPeer {
|
|||
public
|
||||
void remove() {
|
||||
//noinspection Duplicates
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
|
|
@ -26,8 +26,8 @@ import dorkbox.systemTray.Entry;
|
|||
import dorkbox.systemTray.SystemTray;
|
||||
import dorkbox.systemTray.peer.CheckboxPeer;
|
||||
import dorkbox.systemTray.util.HeavyCheckMark;
|
||||
import dorkbox.util.Font;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.FontUtil;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
class SwingMenuItemCheckbox extends SwingMenuItem implements CheckboxPeer {
|
||||
|
||||
|
@ -50,7 +50,7 @@ class SwingMenuItemCheckbox extends SwingMenuItem implements CheckboxPeer {
|
|||
}
|
||||
|
||||
// Having the checkmark size the same size as the letter X is a reasonably nice size.
|
||||
int size = Font.getFontHeight(jMenuItem.getFont(), "X");
|
||||
int size = FontUtil.getFontHeight(jMenuItem.getFont(), "X");
|
||||
|
||||
// this is the largest size of an image used in a JMenuItem, before the size of the JMenuItem is forced to be larger
|
||||
int menuImageSize = SystemTray.get()
|
||||
|
@ -73,7 +73,7 @@ class SwingMenuItemCheckbox extends SwingMenuItem implements CheckboxPeer {
|
|||
@Override
|
||||
public
|
||||
void setEnabled(final Checkbox menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -85,7 +85,7 @@ class SwingMenuItemCheckbox extends SwingMenuItem implements CheckboxPeer {
|
|||
@Override
|
||||
public
|
||||
void setText(final Checkbox menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -133,9 +133,9 @@ class SwingMenuItemCheckbox extends SwingMenuItem implements CheckboxPeer {
|
|||
void setShortcut(final Checkbox menuItem) {
|
||||
char shortcut = menuItem.getShortcut();
|
||||
// yikes...
|
||||
final int vKey = Swing.getVirtualKey(shortcut);
|
||||
final int vKey = SwingUtil.getVirtualKey(shortcut);
|
||||
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -153,7 +153,7 @@ class SwingMenuItemCheckbox extends SwingMenuItem implements CheckboxPeer {
|
|||
if (checked != this.isChecked) {
|
||||
this.isChecked = checked;
|
||||
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
|
|
@ -19,7 +19,7 @@ import javax.swing.JSeparator;
|
|||
|
||||
import dorkbox.systemTray.SystemTray;
|
||||
import dorkbox.systemTray.peer.EntryPeer;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
class SwingMenuItemSeparator implements EntryPeer {
|
||||
|
||||
|
@ -40,7 +40,7 @@ class SwingMenuItemSeparator implements EntryPeer {
|
|||
@Override
|
||||
public
|
||||
void remove() {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
|
|
@ -24,7 +24,7 @@ import dorkbox.systemTray.Entry;
|
|||
import dorkbox.systemTray.Status;
|
||||
import dorkbox.systemTray.SystemTray;
|
||||
import dorkbox.systemTray.peer.StatusPeer;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
class SwingMenuItemStatus implements StatusPeer {
|
||||
|
||||
|
@ -54,7 +54,7 @@ class SwingMenuItemStatus implements StatusPeer {
|
|||
@Override
|
||||
public
|
||||
void setText(final Status menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -66,7 +66,7 @@ class SwingMenuItemStatus implements StatusPeer {
|
|||
@Override
|
||||
public
|
||||
void remove() {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
|
|
@ -29,7 +29,7 @@ import javax.swing.JPopupMenu;
|
|||
import dorkbox.systemTray.MenuItem;
|
||||
import dorkbox.systemTray.Tray;
|
||||
import dorkbox.util.OS;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
import dorkbox.util.jna.linux.GtkEventDispatch;
|
||||
|
||||
/**
|
||||
|
@ -66,7 +66,7 @@ class _SwingTray extends Tray {
|
|||
@Override
|
||||
public
|
||||
void setEnabled(final MenuItem menuItem) {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -104,7 +104,7 @@ class _SwingTray extends Tray {
|
|||
return;
|
||||
}
|
||||
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -170,7 +170,7 @@ class _SwingTray extends Tray {
|
|||
@Override
|
||||
public
|
||||
void remove() {
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -207,7 +207,7 @@ class _SwingTray extends Tray {
|
|||
}
|
||||
this.tooltipText = tooltipText;
|
||||
|
||||
Swing.invokeLater(new Runnable() {
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.io.File;
|
|||
import javax.imageio.ImageIO;
|
||||
|
||||
import dorkbox.systemTray.SystemTray;
|
||||
import dorkbox.util.Cache;
|
||||
import dorkbox.util.CacheUtil;
|
||||
|
||||
public class HeavyCheckMark {
|
||||
private static final double SVG_ORIG_SIZE_Y = 222.0D;
|
||||
|
@ -51,7 +51,7 @@ public class HeavyCheckMark {
|
|||
targetImageSize = checkMarkSize;
|
||||
}
|
||||
|
||||
final File newFile = Cache.create(name);
|
||||
final File newFile = CacheUtil.create(name);
|
||||
if (newFile.canRead() || newFile.length() == 0) {
|
||||
try {
|
||||
BufferedImage img = HeavyCheckMark.draw(color, checkMarkSize, targetImageSize);
|
||||
|
|
|
@ -30,7 +30,7 @@ import javax.imageio.ImageIO;
|
|||
import javax.imageio.stream.ImageInputStream;
|
||||
|
||||
import dorkbox.systemTray.SystemTray;
|
||||
import dorkbox.util.Cache;
|
||||
import dorkbox.util.CacheUtil;
|
||||
import dorkbox.util.IO;
|
||||
import dorkbox.util.ImageUtil;
|
||||
|
||||
|
@ -47,7 +47,7 @@ class ImageResizeUtil {
|
|||
File getTransparentImage(final int imageSize) {
|
||||
// NOTE: this does not need to be called on the EDT
|
||||
try {
|
||||
final File newFile = Cache.create(imageSize + "_empty.png");
|
||||
final File newFile = CacheUtil.create(imageSize + "_empty.png");
|
||||
return ImageUtil.createImage(imageSize, newFile, null);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Unable to generate transparent image! Something is severely wrong!");
|
||||
|
@ -69,12 +69,12 @@ class ImageResizeUtil {
|
|||
imageStream.mark(0);
|
||||
|
||||
// check if we already have this file information saved to disk, based on size + hash of data
|
||||
final String cacheName = size + "_" + Cache.createNameAsHash(imageStream);
|
||||
final String cacheName = size + "_" + CacheUtil.createNameAsHash(imageStream);
|
||||
((ByteArrayInputStream) imageStream).reset(); // casting to avoid unnecessary try/catch for IOException
|
||||
|
||||
|
||||
// if we already have this fileName, reuse it
|
||||
final File check = Cache.check(cacheName);
|
||||
final File check = CacheUtil.check(cacheName);
|
||||
if (check != null) {
|
||||
return check;
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ class ImageResizeUtil {
|
|||
File resizedFile = resizeFileNoCheck(size, imageStream);
|
||||
|
||||
// now cache that file
|
||||
return Cache.save(cacheName, resizedFile);
|
||||
return CacheUtil.save(cacheName, resizedFile);
|
||||
} catch (Exception e) {
|
||||
// this must be thrown
|
||||
throw new RuntimeException("Serious problems! Unable to extract error image, this should NEVER happen!", e);
|
||||
|
@ -130,12 +130,12 @@ class ImageResizeUtil {
|
|||
imageStream.mark(0);
|
||||
|
||||
// check if we already have this file information saved to disk, based on size + hash of data
|
||||
cacheName = size + "_" + Cache.createNameAsHash(imageStream);
|
||||
cacheName = size + "_" + CacheUtil.createNameAsHash(imageStream);
|
||||
((ByteArrayInputStream) imageStream).reset(); // casting to avoid unnecessary try/catch for IOException
|
||||
|
||||
|
||||
// if we already have this fileName, reuse it
|
||||
final File check = Cache.check(cacheName);
|
||||
final File check = CacheUtil.check(cacheName);
|
||||
if (check != null) {
|
||||
return check;
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ class ImageResizeUtil {
|
|||
|
||||
// now cache that file
|
||||
try {
|
||||
return Cache.save(cacheName, resizedFile);
|
||||
return CacheUtil.save(cacheName, resizedFile);
|
||||
} catch (Exception e) {
|
||||
// have to serve up the error image instead.
|
||||
SystemTray.logger.error("Error caching image. Using error icon instead", e);
|
||||
|
@ -181,7 +181,7 @@ class ImageResizeUtil {
|
|||
} else {
|
||||
// no resize necessary, just cache as is.
|
||||
try {
|
||||
return Cache.save(cacheName, imageStream);
|
||||
return CacheUtil.save(cacheName, imageStream);
|
||||
} catch (Exception e) {
|
||||
// have to serve up the error image instead.
|
||||
SystemTray.logger.error("Error caching image. Using error icon instead", e);
|
||||
|
@ -216,7 +216,7 @@ class ImageResizeUtil {
|
|||
File resizeFileNoCheck(final int size, InputStream inputStream) throws IOException {
|
||||
// have to resize the file (and return the new path)
|
||||
|
||||
File newFile = Cache.create("temp_resize.png");
|
||||
File newFile = CacheUtil.create("temp_resize.png");
|
||||
// if it's already there, we have to delete it
|
||||
newFile.delete();
|
||||
|
||||
|
@ -288,7 +288,7 @@ class ImageResizeUtil {
|
|||
|
||||
return file;
|
||||
} else {
|
||||
return Cache.save(imageUrl);
|
||||
return CacheUtil.save(imageUrl);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// have to serve up the error image instead.
|
||||
|
@ -307,7 +307,7 @@ class ImageResizeUtil {
|
|||
return ImageResizeUtil.resizeAndCache(getSize(isTrayImage), imageStream);
|
||||
} else {
|
||||
try {
|
||||
return Cache.save(imageStream);
|
||||
return CacheUtil.save(imageStream);
|
||||
} catch (IOException e) {
|
||||
SystemTray.logger.error("Error checking cache for information. Using error icon instead", e);
|
||||
return getErrorImage(0);
|
||||
|
@ -337,7 +337,7 @@ class ImageResizeUtil {
|
|||
|
||||
return file;
|
||||
} else {
|
||||
File file = Cache.save(imageInputStream);
|
||||
File file = CacheUtil.save(imageInputStream);
|
||||
imageInputStream.close(); // BAOS doesn't do anything, but here for completeness + documentation
|
||||
|
||||
return file;
|
||||
|
@ -362,7 +362,7 @@ class ImageResizeUtil {
|
|||
if (SystemTray.AUTO_SIZE) {
|
||||
return resizeAndCache(getSize(isTrayImage), fileStream);
|
||||
} else {
|
||||
return Cache.save(fileStream);
|
||||
return CacheUtil.save(fileStream);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// have to serve up the error image instead.
|
||||
|
|
|
@ -33,7 +33,7 @@ import dorkbox.systemTray.SystemTray;
|
|||
import dorkbox.systemTray.Tray;
|
||||
import dorkbox.systemTray.ui.swing._SwingTray;
|
||||
import dorkbox.util.OS;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
import dorkbox.util.jna.linux.GtkTheme;
|
||||
import dorkbox.util.jna.windows.User32;
|
||||
|
||||
|
@ -147,7 +147,7 @@ class SizeAndScalingUtil {
|
|||
} else {
|
||||
final AtomicInteger iconSize = new AtomicInteger();
|
||||
|
||||
Swing.invokeAndWaitQuietly(new Runnable() {
|
||||
SwingUtil.invokeAndWaitQuietly(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
|
@ -159,7 +159,7 @@ class SizeAndScalingUtil {
|
|||
}
|
||||
|
||||
// this is the largest size of an image used in a JMenuItem, before the size of the JMenuItem is forced to be larger
|
||||
int height = Swing.getLargestIconHeightForButton(jMenuItem);
|
||||
int height = SwingUtil.getLargestIconHeightForButton(jMenuItem);
|
||||
iconSize.set(height);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -25,8 +25,8 @@ import dorkbox.systemTray.Menu;
|
|||
import dorkbox.systemTray.MenuItem;
|
||||
import dorkbox.systemTray.Separator;
|
||||
import dorkbox.systemTray.SystemTray;
|
||||
import dorkbox.util.Cache;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.CacheUtil;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
/**
|
||||
* Icons from 'SJJB Icons', public domain/CC0 icon set
|
||||
|
@ -58,9 +58,9 @@ class TestTray {
|
|||
|
||||
public
|
||||
TestTray() {
|
||||
Cache.clear(); // for test apps, make sure the cache is always reset. You should never do this in production.
|
||||
CacheUtil.clear(); // for test apps, make sure the cache is always reset. You should never do this in production.
|
||||
|
||||
Swing.setLookAndFeel(null); // set Native L&F (this is the System L&F instead of CrossPlatform L&F)
|
||||
SwingUtil.setLookAndFeel(null); // set Native L&F (this is the System L&F instead of CrossPlatform L&F)
|
||||
// SystemTray.SWING_UI = new CustomSwingUI();
|
||||
|
||||
this.systemTray = SystemTray.get();
|
||||
|
|
|
@ -24,10 +24,10 @@ import dorkbox.systemTray.Menu;
|
|||
import dorkbox.systemTray.MenuItem;
|
||||
import dorkbox.systemTray.Separator;
|
||||
import dorkbox.systemTray.SystemTray;
|
||||
import dorkbox.util.Cache;
|
||||
import dorkbox.util.CacheUtil;
|
||||
import dorkbox.util.JavaFX;
|
||||
import dorkbox.util.OS;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.SwingUtil;
|
||||
import javafx.application.Application;
|
||||
import javafx.application.Platform;
|
||||
import javafx.event.ActionEvent;
|
||||
|
@ -120,9 +120,9 @@ class TestTrayJavaFX {
|
|||
primaryStage.show();
|
||||
|
||||
|
||||
Cache.clear(); // for test apps, make sure the cache is always reset. You should never do this in production.
|
||||
CacheUtil.clear(); // for test apps, make sure the cache is always reset. You should never do this in production.
|
||||
|
||||
Swing.setLookAndFeel(null); // set Native L&F (this is the System L&F instead of CrossPlatform L&F)
|
||||
SwingUtil.setLookAndFeel(null); // set Native L&F (this is the System L&F instead of CrossPlatform L&F)
|
||||
// SystemTray.SWING_UI = new CustomSwingUI();
|
||||
|
||||
this.systemTray = SystemTray.get();
|
||||
|
|
|
@ -30,8 +30,8 @@ import dorkbox.systemTray.Menu;
|
|||
import dorkbox.systemTray.MenuItem;
|
||||
import dorkbox.systemTray.Separator;
|
||||
import dorkbox.systemTray.SystemTray;
|
||||
import dorkbox.util.Cache;
|
||||
import dorkbox.util.Swing;
|
||||
import dorkbox.util.CacheUtil;
|
||||
import dorkbox.util.SwingUtil;
|
||||
|
||||
/**
|
||||
* Icons from 'SJJB Icons', public domain/CC0 icon set
|
||||
|
@ -74,9 +74,9 @@ class TestTraySwt {
|
|||
helloWorldTest.setText("Hello World SWT ................. ");
|
||||
helloWorldTest.pack();
|
||||
|
||||
Cache.clear(); // for test apps, make sure the cache is always reset. You should never do this in production.
|
||||
CacheUtil.clear(); // for test apps, make sure the cache is always reset. You should never do this in production.
|
||||
|
||||
Swing.setLookAndFeel(null); // set Native L&F (this is the System L&F instead of CrossPlatform L&F)
|
||||
SwingUtil.setLookAndFeel(null); // set Native L&F (this is the System L&F instead of CrossPlatform L&F)
|
||||
// SystemTray.SWING_UI = new CustomSwingUI();
|
||||
|
||||
this.systemTray = SystemTray.get();
|
||||
|
|
Loading…
Reference in New Issue
Block a user