public class ImageManager
extends javax.swing.JFrame
implements java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.WindowFocusListener
ImageManager allows us to set a default Project Root. The Project Root is the root or parent directory into which all images can be stored. Images can be saved anywhere, but the File dialogs will use the Project Root as your current directory when prompting you for a image name and save location. You would typically save images to this root directory or one of its subdirectories.
With ImageManager running, you can start the image capture process in two ways.
The Image Manager window is expected to remain the Active window.
This mode can be used to capture arbitrary onscreen images when the item
or Window containing the item does not need to become the active window.
The item or Window containing the item must become the Active window.
Image Manager must track the mouse when it is NOT the active window.
ImageManager can accept one argument in its constructor or from the Java command-line:
From inside a Java application:
From the Java command-line:
ImageManager requires Java 1.5 or higher.
| Modifier and Type | Class and Description |
|---|---|
class |
ImageManager.MyCanvas
Class used internally to present the screen captured image in the Save As dialog.
|
class |
ImageManager.MyThread |
javax.swing.JFrame.AccessibleJFramejava.awt.Window.AccessibleAWTWindow, java.awt.Window.Type| Modifier and Type | Field and Description |
|---|---|
(package private) javax.swing.JButton |
_altstart |
(package private) javax.swing.JTextField |
_focus |
(package private) java.lang.String |
_focus_capture |
(package private) java.lang.String |
_focus_release |
(package private) java.lang.String |
_focus_swapoff |
(package private) java.lang.String |
_focus_swapon |
(package private) java.lang.String |
_focus_unknown |
(package private) javax.swing.JLabel |
_info |
(package private) javax.swing.JButton |
_start |
(package private) javax.swing.JButton |
_stop |
(package private) ImageManager.MyThread |
altrect |
(package private) boolean |
ctrl_mode |
(package private) java.awt.Point |
end_rect |
(package private) java.awt.image.BufferedImage |
image |
(package private) java.lang.String |
info_unknown |
(package private) javax.swing.JTextField |
path |
(package private) javax.swing.JButton |
project_browse |
(package private) javax.swing.JLabel |
project_label |
(package private) java.awt.Rectangle |
rect |
(package private) boolean |
rect_started |
(package private) java.awt.Robot |
robot |
(package private) boolean |
running |
(package private) java.awt.Point |
start_rect |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabledCROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSORBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Modifier | Constructor and Description |
|---|---|
|
ImageManager()
Default constructor trying to set C:\SAFS\Project as the initial Project Root.
|
protected |
ImageManager(java.awt.GraphicsConfiguration arg0) |
|
ImageManager(java.lang.String prjroot)
Constructor trying to set an alternate Project Root at startup.
|
protected |
ImageManager(java.lang.String arg0,
java.awt.GraphicsConfiguration arg1) |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent event) |
void |
keyPressed(java.awt.event.KeyEvent e) |
void |
keyReleased(java.awt.event.KeyEvent e) |
void |
keyTyped(java.awt.event.KeyEvent e) |
static void |
main(java.lang.String[] args)
Accepts one optional argument -- the path to a valid Project Root directory.
|
protected void |
promptSaveSnapshot() |
protected void |
startAltCaptureEvents() |
protected void |
startCaptureEvents() |
protected void |
startCaptureRect() |
protected void |
stopCaptureEvents() |
protected void |
stopCaptureRect() |
void |
windowGainedFocus(java.awt.event.WindowEvent e) |
void |
windowLostFocus(java.awt.event.WindowEvent e) |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateaddNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedaddPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFrontadd, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclejava.lang.String info_unknown
java.lang.String _focus_unknown
java.lang.String _focus_capture
java.lang.String _focus_release
java.lang.String _focus_swapon
java.lang.String _focus_swapoff
javax.swing.JLabel project_label
javax.swing.JButton project_browse
javax.swing.JTextField path
javax.swing.JLabel _info
javax.swing.JButton _start
javax.swing.JButton _altstart
javax.swing.JButton _stop
javax.swing.JTextField _focus
java.awt.Robot robot
java.awt.image.BufferedImage image
boolean ctrl_mode
boolean running
boolean rect_started
java.awt.Point start_rect
java.awt.Point end_rect
java.awt.Rectangle rect
ImageManager.MyThread altrect
public ImageManager()
throws java.awt.HeadlessException
java.awt.HeadlessExceptionprotected ImageManager(java.awt.GraphicsConfiguration arg0)
public ImageManager(java.lang.String prjroot)
throws java.awt.HeadlessException
prjroot - -- full path to a valid directory to serve as the Project Root.java.awt.HeadlessExceptionprotected ImageManager(java.lang.String arg0,
java.awt.GraphicsConfiguration arg1)
protected void startCaptureRect()
protected void stopCaptureRect()
protected void promptSaveSnapshot()
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListenerpublic void windowGainedFocus(java.awt.event.WindowEvent e)
windowGainedFocus in interface java.awt.event.WindowFocusListenerpublic void windowLostFocus(java.awt.event.WindowEvent e)
windowLostFocus in interface java.awt.event.WindowFocusListenerprotected void startAltCaptureEvents()
protected void startCaptureEvents()
protected void stopCaptureEvents()
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed in interface java.awt.event.ActionListenerpublic static void main(java.lang.String[] args)
From the Java command-line:
args - String[] of which only arg[0] will be used.Copyright © SAS Institute. All Rights Reserved.