|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Frame | +--javax.swing.JFrame | +--MainFrame
A GUI frame that allows the user to display, load, save and modify image files. This is intended primarily for processing image files that portray musical scores.
The File menu has the following options:
Load Image: Loads and displays a new image file.
Save As: Saves the currently displayed image file under a user provided name.
Quit: Quits the program.
The Process menu has the following options:
Restore Image: Returns the display to that of the image found in the file that
is currently referenced.
Rotate: Rotates the displayed image by a user specified amount.
Remove Staff Lines: Restores the image to that of the file that was last loaded
or saved and removes horizontal lines that fall within user specified colour and run length
thresholds. These settings are specified in the Horizontal Line Removal Settings Dialog Box.
The Settings menu has the following options:
Horizontal Line Removal Settings: Displays the Horizontal Line Removal Settings Dialog Box that allows the user to set the thresholds for the Remove Staff Lines command and to highlight selected pixels on the image.
The button panel has buttons that duplicate commonly used menu commands.
The text area at the bottom of the window displays the currently loaded image file and other messages.
Upon instantiation, objects of this class automatically open a specified file or default to a file in the default directory called "example.jpg".
The rotate
method can be called to rotate the displayed image based
on the contents of the Rotate Dialog Box. The showSelectedPixels
method
can be called to restore the image to that of the file on disk and highlight
certain pixels based on the settings in the Horizontal Line Removal Dialog Box.
The setNewFilePath
method can be called to store the name of a new file
to serve as the original of the currently displayed image and display it in the bottom
text area..
Field Summary |
Fields inherited from class javax.swing.JFrame |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
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_CURSOR |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
MainFrame(String file_name)
Basic constructor that prepares, packs and shows all of the contents of the JFrame . |
Method Summary | |
void |
actionPerformed(ActionEvent event)
Calls the appropriate methods when the buttons are pressed or menu items selected. |
void |
rotate()
Rotate the displayed image based on the contents of the Rotate Dialog Box. |
void |
setNewFilePath(String file_path)
Store the name of a new file to serve as the original of the currently displayed image and display it in the bottom text area. |
void |
showSelectedPixels()
Restore the image to that of the file on disk and highlight certain pixels based on the settings in the Horizontal Line Removal Dialog Box. |
Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Constructor Detail |
public MainFrame(String file_name)
JFrame
.
If a file path is specified to the file_name parameter, then this file
will automatically be opened. If a null is given as the parameter, then a
JFileChooser
dialog box is shown on startup in order to select a
file. If any problems occur, then the program automatically opens a file called
"example.jpg" in the current directory.
file_name
- The path of a file to display initially. May be null.Method Detail |
public void actionPerformed(ActionEvent event)
actionPerformed
in interface ActionListener
event
- The event that is to be reacted to.public void rotate()
public void showSelectedPixels()
public void setNewFilePath(String file_path)
file_path
- The path of the new image file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |