|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object texturesynthesis.JTexSynth
public class JTexSynth
The main program class of JTexSynth. This class starts the application, creates the GUI and initializes all needed parts.
Field Summary | |
---|---|
private int |
_VERSION_MAJOR
Application major version number. |
private int |
_VERSION_MICRO
Application micro version number. |
private int |
_VERSION_MINOR
Application minor version number. |
private FileExtensionFilter |
allImagesFileFilter
|
private javax.swing.JButton |
browseButton
Source image browsing button. |
private javax.swing.JFileChooser |
fileChooser
File chooser for source image and synthesized image saving. |
private javax.swing.JFrame |
frame
The main application window. |
private java.awt.Image |
generatedTexture
The synthesized image. |
private ImageWindow |
generatedTextureIW
A window to show the synthesized image. |
private FileExtensionFilter |
gifFileFilter
|
private javax.swing.JFormattedTextField |
imageHeight
Target image dimensions. |
private javax.swing.JFormattedTextField |
imageWidth
Target image dimensions. |
private FileExtensionFilter |
jpgFileFilter
File filters |
private javax.swing.JComboBox |
pluginSelection
Selector for different plugins. |
private FileExtensionFilter |
pngFileFilter
|
private javax.swing.JPanel |
settingsPanel
Algorithm specific settings. |
private ImageWindow |
sourceImageIW
A window to show the source image. |
private javax.swing.JTextField |
sourceImageTextField
Source image file name. |
private javax.swing.JButton |
startButton
Texture generation start button. |
private java.util.Hashtable<java.lang.String,TextureSynthesizer> |
synthesizerPlugins
Synthesizer plugins. |
private java.lang.String |
version
A string representation of the version number. |
Constructor Summary | |
---|---|
JTexSynth()
Constructor. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
Responses to actions. |
private void |
browseSourceImage()
Shows the user a file chooser to choose a source image. |
private void |
createGui()
Generates the user interface. |
private javax.swing.JMenuBar |
createMenuBar()
Generates the menu bar to the main application window. |
private TextureSynthesizer |
getPlugin(java.lang.String name)
Gets a plugin with the given name. |
private java.util.Hashtable<java.lang.String,TextureSynthesizer> |
getPlugins()
Searches the available synthesizer plugins and places an instance of each plugin to a Hashtable. |
void |
itemStateChanged(java.awt.event.ItemEvent event)
Responses to item state change events. |
static void |
main(java.lang.String[] args)
The main method. |
private void |
quitProgram()
Exits the program. |
private void |
saveGeneratedImage()
Asks the user to select a file name and saves the synthesized image with this name. |
private void |
setSourceImageVisibility(boolean value)
Shows or hides the window showing the source image. |
private void |
setSynthesizedImageVisibility(boolean value)
Shows or hides the window showing the synthesized image. |
private void |
showAboutDialog()
Shows the about dialog that tells about this program. |
private void |
startPlugin()
Starts a texture synthesis plugin. |
void |
windowActivated(java.awt.event.WindowEvent arg0)
Does nothing. |
void |
windowClosed(java.awt.event.WindowEvent arg0)
Does nothing. |
void |
windowClosing(java.awt.event.WindowEvent event)
Hides (but doesn't destroy) the image windows if they are closed. |
void |
windowDeactivated(java.awt.event.WindowEvent arg0)
Does nothing. |
void |
windowDeiconified(java.awt.event.WindowEvent arg0)
Does nothing. |
void |
windowIconified(java.awt.event.WindowEvent arg0)
Does nothing. |
void |
windowOpened(java.awt.event.WindowEvent arg0)
Does nothing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final int _VERSION_MAJOR
private final int _VERSION_MINOR
private final int _VERSION_MICRO
private java.lang.String version
private javax.swing.JFrame frame
private javax.swing.JComboBox pluginSelection
private javax.swing.JFormattedTextField imageWidth
private javax.swing.JFormattedTextField imageHeight
private javax.swing.JTextField sourceImageTextField
private javax.swing.JButton browseButton
private javax.swing.JButton startButton
private javax.swing.JPanel settingsPanel
private javax.swing.JFileChooser fileChooser
private FileExtensionFilter jpgFileFilter
private FileExtensionFilter pngFileFilter
private FileExtensionFilter gifFileFilter
private FileExtensionFilter allImagesFileFilter
private java.util.Hashtable<java.lang.String,TextureSynthesizer> synthesizerPlugins
private ImageWindow sourceImageIW
private java.awt.Image generatedTexture
private ImageWindow generatedTextureIW
Constructor Detail |
---|
public JTexSynth()
Method Detail |
---|
private java.util.Hashtable<java.lang.String,TextureSynthesizer> getPlugins()
private TextureSynthesizer getPlugin(java.lang.String name)
name
- the name of the plugin.
private void browseSourceImage()
private void setSourceImageVisibility(boolean value)
value
- true to show the image window, false to hide it.private void setSynthesizedImageVisibility(boolean value)
value
- true to show the image window, false to hide it.private void saveGeneratedImage()
private void createGui()
private javax.swing.JMenuBar createMenuBar()
private void startPlugin()
private void showAboutDialog()
private void quitProgram()
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
event
- the event fired.public void itemStateChanged(java.awt.event.ItemEvent event)
itemStateChanged
in interface java.awt.event.ItemListener
event
- the event fired.public static void main(java.lang.String[] args)
args
- the command line argumentspublic void windowClosing(java.awt.event.WindowEvent event)
windowClosing
in interface java.awt.event.WindowListener
WindowListener.windowClosing(java.awt.event.WindowEvent)
public void windowOpened(java.awt.event.WindowEvent arg0)
windowOpened
in interface java.awt.event.WindowListener
WindowListener.windowOpened(java.awt.event.WindowEvent)
public void windowClosed(java.awt.event.WindowEvent arg0)
windowClosed
in interface java.awt.event.WindowListener
WindowListener.windowClosed(java.awt.event.WindowEvent)
public void windowIconified(java.awt.event.WindowEvent arg0)
windowIconified
in interface java.awt.event.WindowListener
WindowListener.windowIconified(java.awt.event.WindowEvent)
public void windowDeiconified(java.awt.event.WindowEvent arg0)
windowDeiconified
in interface java.awt.event.WindowListener
WindowListener.windowDeiconified(java.awt.event.WindowEvent)
public void windowActivated(java.awt.event.WindowEvent arg0)
windowActivated
in interface java.awt.event.WindowListener
WindowListener.windowActivated(java.awt.event.WindowEvent)
public void windowDeactivated(java.awt.event.WindowEvent arg0)
windowDeactivated
in interface java.awt.event.WindowListener
WindowListener.windowDeactivated(java.awt.event.WindowEvent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |