惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
GbyAI
GbyAI
Google DeepMind News
Google DeepMind News
Jina AI
Jina AI
B
Blog
aimingoo的专栏
aimingoo的专栏
酷 壳 – CoolShell
酷 壳 – CoolShell
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
月光博客
月光博客
H
Help Net Security
V
Visual Studio Blog
量子位
A
About on SuperTechFans
博客园 - Franky
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
Martin Fowler
Martin Fowler
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
P
Proofpoint News Feed
MongoDB | Blog
MongoDB | Blog

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
GitHub - anticleiades/swing-fluid-swipe: Fluid-Swipe Gest...
anticleiades · 2026-05-07 · via Hacker News: Show HN

SwingFluidSwipeAPI

Maven Central Version

Extend the Swing framework with fluid-swipe gesture support. Our aim is to reduce the gap between native applications and AWT/Swing applications, providing a more consistent and pleasant UI/UX with animated feedback.

IntelliJ.Demo.mov

macOS/OS X case

Support for the fluid-swipe gesture that is largely used for navigation in many AppKit-built programs, notably Safari, Xcode and Photos, is not offered by JDK – in fact, as far as swipe gestures are concerned, the JDK supports only the discrete ones (namely, 3-finger swipe gestures via com.apple.eawt.event)

Usage

This project is available on Maven Central:

Maven

<dependency>
  <groupId>eu.giulianogorgone</groupId>
  <artifactId>fluidswipe-core</artifactId>
  <version>1.2.0</version>
</dependency>

Gradle

implementation("eu.giulianogorgone:fluidswipe-core:1.2.0")

To start event monitoring:

FluidSwipe.startEventMonitoring();

Please note that the above function internally calls Toolkit.getDefaultToolkit().

To stop instead event monitoring:

FluidSwipe.stopEventMonitoring();

Adding listeners and blocking unwanted incoming gestures

import javax.swing.*;

public class NavigableComponent extends JComponent implements FluidSwipeVetoer {
  // [...]
  protected void configGestures() {
    FluidSwipe.addListenerTo(this, new FluidSwipeAdapter() {
      @Override
      public void fluidSwipeEnded(final FluidSwipeEvent e) {
        if (e.getGestureState() == FluidSwipeEvent.State.SUCCESS) {
          if (contentDirection == FluidSwipeEvent.Direction.LEFT_TO_RIGHT)
            this.navigateBack();
          else this.navigateForward();
        }
      }
    });
  }

  // [...]
  @Override
  public boolean permitFluidSwipeGesture(final FluidSwipeEvent e) {
    if (e.getLogicalGestureDirection() == FluidSwipeEvent.Direction.LEFT_TO_RIGHT)
      return this.canNavigateBack();
    else return this.canNavigateForward();
  }
}

A runnable sample is also provided here

OS settings (macOS/OS X)

In order for fluid-swipe gesture to work, the following conditions must be met, in normal circumstances:

  • If using a supported trackpad:
    • System Preferences/System Settings > Accessibility > Pointer Control/Mouse & Trackpad > Trackpad Options... > Use trackpad for scrolling/Scrolling is flagged on
    • System Preferences/System Settings > Trackpad > More Gestures > Swipe with Two or Three Fingers or Scroll Left or Right with Two Fingers is selected
  • If using a mouse such a Magic Mouse:
    • System Preferences/System Settings > Accessibility > Pointer Control/Mouse & Trackpad > Mouse Options... > Use mouse for scrolling/Scrolling is flagged on
    • System Preferences/System Settings > Trackpad > More Gestures > Swipe with One or Two Fingers or Scroll Left or Right with One Finger is selected

Glossary

  • "veto a fluid-swipe": consists in preventing the performed physical swipe gesture from being interpreted as fluid-swipe, in which case this gesture will be handled as usual (i.e., as a horizontal scroll gesture, thus a set of MouseWheelEvent will be dispatched).
  • "swipeable component": a Swing component enabled to receive fluid-swipe events, i.e., at least a proper listener has been attached to this component via FluidSwipe#addListenerTo
  • "vetoer component": a Swing component that implements FluidSwipeVetoer; it has the facility to veto fluid-swipe event.

Avoiding common pitfalls

Conflicting gestures — implementation of a scroll/fluid-swipe coexistence mechanism

The physical gesture that may start a fluid-swipe can also be interpreted as a horizontal scroll gesture. It is absolutely recommended that components listening for scroll-wheel events implement FluidSwipeVetoer; not to veto an incoming fluid-swipe results in MouseWheelEvent not to be dispatching as expected. Ideally, fluid-swipe gesture should have a lower priority than scroll event. We strongly encourage you to consider the following example involving a JScrollPane.

public class FluidSwipeAwareJScrollPane extends JScrollPane implements FluidSwipeVetoer {
    // [...]
    @Override
    public boolean permitFluidSwipeGesture(FluidSwipeEvent e) {
      final FluidSwipeEvent.Direction contentDirection = e.getLogicalGestureDirection();
      if (horizontalScrollBar == null || getHorizontalScrollBarPolicy() == HORIZONTAL_SCROLLBAR_NEVER) return true;
      return (contentDirection == FluidSwipeEvent.Direction.RIGHT_TO_LEFT && (horizontalScrollBar.getValue() + horizontalScrollBar.getModel().getExtent()) == horizontalScrollBar.getMaximum())
              || (contentDirection == FluidSwipeEvent.Direction.LEFT_TO_RIGHT && horizontalScrollBar.getValue() == horizontalScrollBar.getMinimum());
    }
}

Starting from version 1.2.0, the above logic is default for JScrollPane; to override it, extend JScrollPane and implement FluidSwipeVetoer.

HW/SW Requirements

  • OS:macOS/OS X >= 10.13.
  • Hardware: Apple Magic Trackpad, Mac laptop's built-in trackpad et similia. Apple Magic Mouse is expected to work, but it has not yet been tested — unfortunately, we do not own this device.

Contribute

If any problem is encountered, please submit an issue and eventually propose a solution.

Guidelines

Ensure to provide also:

  • information about the running machine and environment (which version of macOS/OS X, JDK, architecture)
  • steps to reproduce the malfunction (ideally an SCCE)
  • a brief but complete written description of the issue.

Avoid please:

  • The use of sexualized language or imagery and unwelcome sexual attention or advances
  • Trolling, insulting/derogatory comments, and personal or political attacks
  • Public or private harassment
  • Publishing others' private information, such as a physical or electronic address, without explicit permission
  • Other conducts which could reasonably be considered inappropriate in a professional setting

Any content deemed as abuse or spam will be reported to GitHub.

why not?

  • ensure that Magic Mouse works flawlessly — testers are welcome
  • add other platform support

License

This project is licensed under the Apache 2.0 license.