|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
PictureEdit
public class PictureEdit
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
PictureEdit()
Constructor will use the JFileChooser to open a file |
|
PictureEdit(File file)
Constructor will use the JFileChooser to open a file |
|
PictureEdit(String fileName)
Constructor will use the JFileChooser to open a file |
Method Summary | |
---|---|
void |
displayImage()
Displays the current image in a new JFrame. |
void |
displayImage(String title)
Displays the current image in a new JFrame. |
Color |
getColor(int x,
int y)
Returns a Color object of the color at a given point. |
int |
getHeight()
Returns the height of the image file |
Image |
getImage()
Returns the image file as an Image object. |
int |
getRGBColor(int x,
int y)
Returns the integer value of the color at a given point. |
int |
getWidth()
Returns the width of the image file |
boolean |
open()
Opens a file by opening a JFileChooser which allows the user to select the file they would like to open. |
boolean |
open(File file)
Opens an image file given a File object. |
boolean |
open(String fileName)
Opens an image file based on the file name in String format |
void |
revert()
Reverts to the original file, all unsaved changes are lost. |
boolean |
saveAs()
Saves a file by opening a JFileChooser which allows the user to select the file they would like to save over or create a new file to save onto. |
boolean |
saveAs(String fileName)
Saves a file by writing a new file with the given fileName String. |
boolean |
setColor(int x,
int y,
Color color)
Sets the color at a given x,y coordinate. |
boolean |
setColor(int x,
int y,
int color)
Sets the color at a given x,y coordinate. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PictureEdit()
public PictureEdit(String fileName)
fileName
- is the String file name including the directory pathpublic PictureEdit(File file)
file
- is the File object of the picture that will be opened.Method Detail |
---|
public boolean open()
public boolean open(String fileName)
fileName
- the name of the file including file path.
public boolean open(File file)
file
- the File object of the image file.
public void revert()
public boolean saveAs()
public boolean saveAs(String fileName)
fileName
- is a String with the file name and path directory.
public int getWidth()
getWidth
in class JComponent
public int getHeight()
getHeight
in class JComponent
public Image getImage()
public void displayImage()
public void displayImage(String title)
title
- Title of the window.public int getRGBColor(int x, int y)
x
- x-coordinate of the selected pixely
- y-coordinate of the selected pixel
public Color getColor(int x, int y)
x
- x-coordinate of the selected pixely
- y-coordinate of the selected pixel
public boolean setColor(int x, int y, int color)
x
- x-coordinate of the selected pixely
- y-coordinate of the selected pixelcolor
- the color in integer RGB form
public boolean setColor(int x, int y, Color color)
x
- x-coordinate of the selected pixely
- y-coordinate of the selected pixelcolor
- Color object of the color to change to
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |