home *** CD-ROM | disk | FTP | other *** search
- import java.awt.BorderLayout;
- import java.awt.Button;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Event;
- import java.awt.FlowLayout;
- import java.awt.Panel;
-
- public class button_panel extends Panel {
- Sitemapper parent_applet;
- int view;
- static final int STRUCTURE_VIEW = 0;
- static final int OUTLINE_VIEW = 1;
- static final int SEARCH_VIEW = 2;
-
- public boolean action(Event evt, Object arg) {
- if (arg.equals("Structure")) {
- if (this.view != 0) {
- this.parent_applet.remove_current_components(this.view);
- this.parent_applet.add("South", this.parent_applet.user_level_panel);
- this.parent_applet.display_view(this.view = 0);
- return true;
- }
- } else if (arg.equals(" Outline ")) {
- if (this.view != 1) {
- this.parent_applet.remove_current_components(this.view);
- this.parent_applet.add("South", this.parent_applet.user_level_panel);
- this.parent_applet.display_view(this.view = 1);
- return true;
- }
- } else if (arg.equals(" Search ") && this.view != 2) {
- this.parent_applet.remove_current_components(this.view);
- this.parent_applet.remove(this.parent_applet.user_level_panel);
- this.parent_applet.display_view(this.view = 2);
- return true;
- }
-
- return false;
- }
-
- button_panel(Sitemapper parent_applet) {
- this.parent_applet = parent_applet;
- ((Component)this).setBackground(Color.lightGray);
- ((Container)this).setLayout(new BorderLayout());
- Panel p = new Panel();
- ((Container)this).add("East", p);
- ((Container)p).setLayout(new FlowLayout());
- ((Container)p).add(new Button("Structure"));
- ((Container)p).add(new Button(" Outline "));
- ((Container)p).add(new Button(" Search "));
- this.view = 0;
- }
- }
-