A double-buffered variant of ImagePanel.
A double-buffered variant of ImagePanel. Meant to alleviate some of the screen-tearing seen using the old implementation. Note that there is currently no way to resize the internal buffers once they've been created.
The imgType
argument should be one of the constants defined in
java.awt.image.BufferedImage, e.g. BufferedImage.TYPE_3BYTE_BGR.
A panel that displays an image.
A panel that displays an image. Preferred size is initially set to the current image's unscaled dimensions.
A panel that displays an infinite progress bar at its center, with an optional label.
A panel that displays an infinite progress bar at its center, with an optional label.
Drop this panel into your GUI where you want to put components that take a long time to initialize. Once said expensive component has finished its initialization, swap it with your LoadingAnimationPanel.
A mixin that enables right-click-and-drag to adjust the magnification of a Zoomable component.
A mixin that enables right-click-and-drag to adjust the magnification of a Zoomable component.
This style of zoom level control lends itself to non-integral multiplicative zoom changes - e.g. each pixel of drag makes the view 10% larger, as opposed to 1x, 2x, 3x normal size. Note however that not every Swing component (including some of our own visualizations) draw with anti-aliasing enabled - this will become very noticable with non-integral zoom.
Created by gonztobi on 3/31/2014.
Augments a panel with mouse pan and zoom capability (sort of like your favorite online maps application).
Augments a panel with mouse pan and zoom capability (sort of like your favorite online maps application).
Rather than mixing in this trait directly to some panel displaying the visual that you want to pan and zoom, you should wrap that panel in another panel and mix in this trait to the wrapper. This helps guarantee clean redraws of the panel (otherwise a screen clear can "miss" due to the applied pan and zoom).
A ScrollPane that scrolls in response to mouse drags on its viewport, in addition to the standard interactions with its scrollbars.
A ScrollPane that scrolls in response to mouse drags on its viewport, in addition to the standard interactions with its scrollbars. The captured mouse drag events act on the scrollbars directly, so mouse-pan and scrollbar-pan should stay in sync.
---
Note: This is the most robust implementation so far, in that children with tooltips enabled won't interfere with the mouse drag. It's built using an AWTEventListener, which gets ALL mouse events produced by the app, regardless of whether another listener somewhere is getting the events first (e.g. a tooltip enabled child). One small quirk of this approach is that you can initiate a pan by dragging from the blank corner formed by the horizontal and vertical scrollbars.
Created by gonztobi on 3/11/14.
A button that, when clicked, pops up a menu anchored at this button (as opposed to the mouse's current position).
A button that, when clicked, pops up a menu anchored at this button (as opposed to the mouse's current position).
Add scala.swing.Menu Menus and scala.swing.MenuItem MenuItems to it just like you would an ordinary menu.
A popup menu.
A popup menu.
Example usage:
val popupMenu = new PopupMenu { contents += new Menu("menu 1") { contents += new RadioMenuItem("radio 1.1") contents += new RadioMenuItem("radio 1.2") } contents += new Menu("menu 2") { contents += new RadioMenuItem("radio 2.1") contents += new RadioMenuItem("radio 2.2") } } val button = new Button("Show Popup Menu") reactions += { case e: ButtonClicked => popupMenu.show(button, 0, button.bounds.height) } listenTo(button)
javax.swing.JPopupMenu
An icon that is just a small, colored square.
An icon that is just a small, colored square.
Created by gonztobi on 2/20/14.
A data visualization that displays a number of timeseries plots stacked on top of each other.
A data visualization that displays a number of timeseries plots stacked on top of each other. Each chart has its own set of y/range values and range axis, but all share the same x/domain values and axis. This class is intended to provide the same functionality as Cog 3's MultiXYPlot class.
All data is sorted according by the domain value prior to rendering. Thus, the lines drawn on the timeseries plots can never double back.
A wrapper for a JToolBar.
A (hopefully) more intelligent variant of the scala.swing.FlowPanel, in that it should wrap its child components properly when placed inside of ScrollPanes or SplitPanes.
This package is for reusable generic GUI components that have no dependence on Cog, sort of like the old buildingblocks package from the old coggui (perhaps that package should be copied here).