home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Late Night VRML 2.0 with Java CD-ROM
/
code.zip
/
Ch12
/
ui
/
dialogs
/
AppearanceDialog.java
< prev
next >
Wrap
Text File
|
1997-01-02
|
1KB
|
55 lines
// VRML Generator
// (c) Justin Couch
//
// From Chapter 13: Late Night VRML 2.0 and Java
//
// The Appearance node dialog
package ui.dialogs;
import java.awt.*;
import ui.dialogs.VrmlBaseDialog;
import geometry.Appearance;
import ui.VrmlTree;
import VrmlScene;
import VrmlTypes;
import exceptions.NoSelectedNodeException;
public class AppearanceDialog extends VrmlBaseDialog
{
public AppearanceDialog(Frame parent, VrmlTree tree, VrmlScene data)
{
super(parent, "Edit Appearance Node");
vrml_data = data;
screen_data = tree;
pack();
}
// this class needs to be implemented by the derived class.
public boolean applyInformation()
{
String str;
Appearance appearance = new Appearance(browser);
str = name.getText();
if(str.equals(""))
appearance.name = null;
else
appearance.name = new String(name.getText());
try
{
vrml_data.addNode(VrmlTypes.Appearance, appearance);
}
catch (NoSelectedNodeException e)
{
System.out.println("No node selected");
}
return false;
}
}