Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
Frame
net.sourceforge.jiu.gui.awt.JiuAwtFrame
public class JiuAwtFrame
extends Frame
implements ActionListener, ComponentListener, JiuInfo, ProgressListener
jiuawt
.
Field Summary | |
static String | |
private ImageCanvas | |
private EditorState | |
private AwtMenuWrapper | |
private AwtOperationProcessor | |
private ScrollPane | |
(package private) static long | |
private Label |
Fields inherited from interface net.sourceforge.jiu.apps.JiuInfo | |
JIU_FEEDBACK_ADDRESS , JIU_HOMEPAGE , JIU_NUMERICAL_VERSION , JIU_VERSION |
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
public static final String APP_NAME
The name of this application, jiuawt, plus the version number taken fromJiuInfo
. Example:jiuawt 0.8.0
. Will be displayed in the title bar of this frame.
private ScrollPane scrollPane
(package private) static final long serialVersionUID
- Field Value:
- 2592450425245L
private Label statusBar
public JiuAwtFrame(EditorState editorState)
Create an object of this class, using the argument editor state. String resources to initialize the menu etc. will be taken from the EditorState object's Strings variable
- Parameters:
editorState
- EditorState object used by this frame
public void actionPerformed(ActionEvent e)
Processes event objects that get created when menu items are picked. Determines theMenuIndexConstants
value for a given event object and calls the internalAwtOperationProcessor
object's process method with the menu value. The operation will then be performed.
- Parameters:
e
- the ActionEvent object
public void componentHidden(ComponentEvent e)
public void componentMoved(ComponentEvent e)
public void componentResized(ComponentEvent e)
public void componentShown(ComponentEvent e)
public void maximize()
Maximize the frame on the desktop. There is no such function in the 1.1 AWT (was added in 1.4), so this class determines the screen size and sets the frame to be a little smaller than that (to make up for task bars etc.). So this is just a heuristical approach.
public void setDefaultCursor()
Sets the current cursor to bejava.awt.Cursor.DEFAULT_CURSOR
.
public void setOriginalSize()
If an image is currently loaded,
public void setProgress(float progress)
Set a new progress status.
- Specified by:
- setProgress in interface ProgressListener
- Parameters:
progress
- float from 0.0f to 1.0f, indicating the progress between 0 and 100 percent
public void setProgress(int zeroBasedIndex, int totalItems)
Sets a new progress level. If an operation consists of totalItems steps, which are numbered from 0 to totalItems - 1, this method can be called after the completion of each step. Example: 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 callsProgressListener.setProgress(float)
with that value.
- Specified by:
- setProgress in interface ProgressListener
- Parameters:
zeroBasedIndex
- the index of the step that was just completedtotalItems
- the number of steps in this operation
public void setStatusBar(String text)
public void setWaitCursor()
public void showError(String text)
Displays the argument text in a message box with error in the title bar.
- Parameters:
text
- the error message to be displayed
public void showInfo(String title, String text)
Shows a modal dialog with given title bar and message text.
- Parameters:
title
- will be displayed in the dialog's title bartext
- will be displayed in the dialog's center part
public void updateCanvas()
If there is an image loaded, forces a canvas redraw by calling repaint.
public void updateImage()
Removes the current canvas from the frame (if there is an image loaded) and creates a new canvas for the current image.
public void updateStatusBar()
Creates a description string for the current image and sets the status bar to that text.
public 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.
public void zoomIn()
If an image is currently displayed, zoom in one level.
public void zoomOut()
If an image is currently displayed, zoom out one level.