/*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* - Neither the name of Oracle nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* This source code is provided to illustrate the usage of a given feature
* or technique and has been deliberately simplified. Additional steps
* required for a production-quality application, such as security checks,
* input validation and proper error handling, might not be present in
* this sample code.
*/
/**
* This is the main container frame for the Metalworks demo app
*
* @author Steve Wilson
* @author Alexander Kouznetsov
*/
@SuppressWarnings("serial")
+ "show off the Java Look & Feel. \n \nWritten by the JavaSoft "
+ "Look & Feel Team \n Michael Albers\n Tom Santos\n "
+ "Jeff Shapiro\n Steve Wilson";
public MetalworksFrame() {
super("Metalworks");
final int inset = 50;
* 2);
buildContent();
buildMenus();
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
quit();
}
});
(JComponent) getRootPane()));
}
protected void buildMenus() {
// load a theme from a text file
try {
"/resources/MyTheme.theme");
} catch (NullPointerException e) {
}
// build an array of themes
new DefaultMetalTheme(),
new GreenMetalTheme(),
new AquaMetalTheme(),
new KhakiMetalTheme(),
new DemoMetalTheme(),
new ContrastMetalTheme(),
new BigContrastMetalTheme(),
myTheme };
// put the themes in a menu
}
public void actionPerformed(ActionEvent e) {
newDocument();
}
});
public void actionPerformed(ActionEvent e) {
openDocument();
}
});
public void actionPerformed(ActionEvent e) {
quit();
}
});
file.addSeparator();
return file;
}
undo.setEnabled(false);
copy.setEnabled(false);
cut.setEnabled(false);
paste.setEnabled(false);
public void actionPerformed(ActionEvent e) {
}
});
edit.addSeparator();
edit.addSeparator();
return edit;
}
outBox.setEnabled(false);
public void actionPerformed(ActionEvent e) {
openInBox();
}
});
return views;
}
live.setSelected(true);
public void actionPerformed(ActionEvent e) {
// for right now I'm saying if you set the mode
// to something other than a specified mode
// it will revert to the old way
// This is mostly for comparison's sake
}
});
public void actionPerformed(ActionEvent e) {
}
});
public void actionPerformed(ActionEvent e) {
}
});
return speed;
}
public void actionPerformed(ActionEvent e) {
showAboutBox();
}
});
public void actionPerformed(ActionEvent e) {
}
});
return help;
}
protected void buildContent() {
desktop = new JDesktopPane();
}
public void quit() {
}
public void newDocument() {
try {
doc.setVisible(true);
doc.setSelected(true);
}
}
public void openDocument() {
chooser.showOpenDialog(this);
}
public void openHelpWindow() {
try {
help.setVisible(true);
help.setSelected(true);
}
}
public void showAboutBox() {
}
public void openPrefsWindow() {
dialog.setVisible(true);
}
public void openInBox() {
try {
doc.setVisible(true);
doc.setSelected(true);
}
}
}