public class JiuAwtFrame extends java.awt.Frame implements java.awt.event.ActionListener, java.awt.event.ComponentListener, JiuInfo, ProgressListener
jiuawt.java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
APP_NAME
The name of this application, jiuawt, plus the version number taken
from
JiuInfo. |
private ImageCanvas |
canvas |
private EditorState |
editor |
private AwtMenuWrapper |
menuWrapper |
private AwtOperationProcessor |
processor |
private java.awt.ScrollPane |
scrollPane |
(package private) static long |
serialVersionUID |
private java.awt.Label |
statusBar |
CROSSHAIR_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_CURSORaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTJIU_FEEDBACK_ADDRESS, JIU_HOMEPAGE, JIU_NUMERICAL_VERSION, JIU_VERSION| Constructor and Description |
|---|
JiuAwtFrame(EditorState editorState)
Create an object of this class, using the argument editor
state.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Processes event objects that get created when menu items are
picked.
|
void |
componentHidden(java.awt.event.ComponentEvent e) |
void |
componentMoved(java.awt.event.ComponentEvent e) |
void |
componentResized(java.awt.event.ComponentEvent e) |
void |
componentShown(java.awt.event.ComponentEvent e) |
void |
maximize()
Maximize the frame on the desktop.
|
void |
setDefaultCursor()
Sets the current cursor to be
Cursor.DEFAULT_CURSOR. |
void |
setOriginalSize()
If an image is currently loaded,
|
void |
setProgress(float progress)
Set a new progress status.
|
void |
setProgress(int zeroBasedIndex,
int totalItems)
Sets a new progress level.
|
void |
setStatusBar(java.lang.String text) |
void |
setWaitCursor() |
void |
showError(java.lang.String text)
Displays the argument text in a message box with
error in the title bar.
|
void |
showInfo(java.lang.String title,
java.lang.String text)
Shows a modal dialog with given title bar and message text.
|
void |
updateCanvas()
If there is an image loaded, forces a canvas redraw by
calling repaint.
|
void |
updateImage()
Removes the current canvas from the frame (if there
is an image loaded) and creates a new canvas for the
current image.
|
void |
updateStatusBar()
Creates a description string for the current image and sets the
status bar to that text.
|
void |
updateTitle()
Sets the frame's title bar to the application name, plus the file name of
the currently loaded image file, plus the current zoom factor, plus an
optional asterisk in case the image was modified but not yet saved.
|
void |
zoomIn()
If an image is currently displayed, zoom in one level.
|
void |
zoomOut()
If an image is currently displayed, zoom out one level.
|
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setBackground, setCursor, setExtendedState, setIconImage, 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, processWindowEvent, 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, addImpl, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, 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, getGraphics, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final java.lang.String APP_NAME
JiuInfo.
Example: jiuawt 0.8.0.
Will be displayed in the title bar of this frame.static final long serialVersionUID
private EditorState editor
private AwtMenuWrapper menuWrapper
private AwtOperationProcessor processor
private java.awt.Label statusBar
private java.awt.ScrollPane scrollPane
private ImageCanvas canvas
public JiuAwtFrame(EditorState editorState)
editorState - EditorState object used by this framepublic void actionPerformed(java.awt.event.ActionEvent e)
MenuIndexConstants value for a given
event object and calls the internal AwtOperationProcessor
object's process method with the menu value.
The operation will then be performed.actionPerformed in interface java.awt.event.ActionListenere - the ActionEvent objectpublic void componentHidden(java.awt.event.ComponentEvent e)
componentHidden in interface java.awt.event.ComponentListenerpublic void componentMoved(java.awt.event.ComponentEvent e)
componentMoved in interface java.awt.event.ComponentListenerpublic void componentResized(java.awt.event.ComponentEvent e)
componentResized in interface java.awt.event.ComponentListenerpublic void componentShown(java.awt.event.ComponentEvent e)
componentShown in interface java.awt.event.ComponentListenerpublic void maximize()
public void showError(java.lang.String text)
text - the error message to be displayedpublic void setDefaultCursor()
Cursor.DEFAULT_CURSOR.public void setOriginalSize()
public void setProgress(int zeroBasedIndex,
int totalItems)
ProgressListenerExample: if there are three steps and the first one is done, the parameters must be 0 and 3, which will indicated 33% completion. Parameters 1 and 3 mean 66%, 2 and 3 100%. If you use 3 and 3, an IllegalArgumentException will be thrown.
Computes (float)(zeroBasedIndex + 1) / (float)totalItems and calls
ProgressListener.setProgress(float) with that value.
setProgress in interface ProgressListenerzeroBasedIndex - the index of the step that was just completedtotalItems - the number of steps in this operationpublic void setProgress(float progress)
setProgress in interface ProgressListenerprogress - float from 0.0f to 1.0f, indicating the progress between 0 and 100 percentpublic void setStatusBar(java.lang.String text)
public void setWaitCursor()
public void showInfo(java.lang.String title,
java.lang.String text)
title - will be displayed in the dialog's title bartext - will be displayed in the dialog's center partpublic void updateCanvas()
public void updateImage()
public void updateStatusBar()
public void updateTitle()
public void zoomIn()
public void zoomOut()