Package VASSAL.tools.swing
Class SwingUtils
java.lang.Object
VASSAL.tools.swing.SwingUtils
public class SwingUtils extends Object
-
Field Summary
Fields Modifier and Type Field Description static Map<?,?>FONT_HINTS -
Constructor Summary
Constructors Constructor Description SwingUtils() -
Method Summary
Modifier and Type Method Description static AffineTransformdescaleTransform(AffineTransform t)static KeyStrokegenericToSystem(KeyStroke k)static KeyStrokegetKeyStrokeForEvent(KeyEvent e)static booleanisContextMouseButtonDown(MouseEvent e)static booleanisControlDown(MouseEvent e)Deprecated.static booleanisDragTrigger(DragGestureEvent e)static booleanisLeftMouseButton(MouseEvent e)Deprecated.static booleanisMacLegacy()Supports swapping most Control and Command button functions on Mac so as not to punish long-time users for our "old non-standard implementations"static booleanisMainMouseButtonDown(MouseEvent e)static booleanisRightMouseButton(MouseEvent e)Deprecated.static booleanisSelectionToggle(MouseEvent e)static voidsetMacLegacy(boolean b)Supports swapping most Control and Command button functions on Mac so as not to punish long-time users for our "old non-standard implementations"static KeyStrokesystemToGeneric(KeyStroke k)
-
Field Details
-
Constructor Details
-
SwingUtils
public SwingUtils()
-
-
Method Details
-
isMacLegacy
public static boolean isMacLegacy()Supports swapping most Control and Command button functions on Mac so as not to punish long-time users for our "old non-standard implementations" -
setMacLegacy
public static void setMacLegacy(boolean b)Supports swapping most Control and Command button functions on Mac so as not to punish long-time users for our "old non-standard implementations" -
descaleTransform
-
isLeftMouseButton
Deprecated.- Returns:
- whether the event is effectively for the left button.
-
isRightMouseButton
Deprecated.- Returns:
- whether the event is effectively for the right button.
-
isControlDown
Deprecated.- Returns:
- whether the event effectively has Control down.
-
isContextMouseButtonDown
- Returns:
- whether the event has the key/mouse combo for Context Menu active, whether it would raise one "right now" or not. (normally plain right mouse button, but some funky mac bonuses)
-
isMainMouseButtonDown
- Returns:
- whether the event has the key/mouse combo for selecting things down (normally just plain left mouse button, but on Mac only if not pretending to be right button)
-
isSelectionToggle
- Returns:
- whether the event has the key/mouse combo toggling targets in and out of selection (normally Ctrl+Click on most platforms, normally Command+Click on Mac)
-
systemToGeneric
-
genericToSystem
-
getKeyStrokeForEvent
-
isDragTrigger
- Returns:
- whether the drag is non-mouse or effectively from the left button
-