Package com.ganteater.ae.desktop.util


package com.ganteater.ae.desktop.util
Desktop/Swing utility helpers used by the Anteater Editor desktop UI.

This package contains small, reusable helpers for common desktop UI tasks such as:

  • Persisting and restoring window/dialog geometry (location and size) using AEWorkspace user configuration keys.
  • Applying a configured Swing look-and-feel with a safe fallback to the cross-platform default.
  • Adding a standard edit context menu (undo/cut/copy/paste/select-all) to JTextComponent instances.
  • Opening hyperlinks or files using Desktop.
  • Computing a contrasting foreground color for a given background color.
  • Playing a timed sequence of inactivity notification sounds for an AEFrame.

Key classes

  • UIUtils: Swing/window helpers and small UI utilities.
  • SoundManager: plays a sequence of WAV notifications when the user is inactive.

Usage examples

Restore and persist a dialog's geometry:


 JDialog dialog = new JDialog(frame, "Settings", true);
 UIUtils.applyPreferedView(dialog, "settingsDialog", 400, 600);
 dialog.setVisible(true);
 UIUtils.saveDialogPreferedView(dialog, "settingsDialog");
 
 

Add a standard context menu to a text component:


 JTextField field = new JTextField();
 UIUtils.addJPopupMenuTo(field);