View Javadoc
1 /* 2 * MythSim 3 * 4 * Copyright (C) 2002-2004 Jason Vroustouris <jasonv@jasonv.com> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 */ 20 21 package org.mythsim.swing.plugin; 22 import org.mythsim.swing.*; 23 import javax.swing.*; 24 import javax.swing.event.*; 25 import java.awt.event.*; 26 import java.awt.*; 27 /*** 28 * Base class for all Plugins. 29 * @author Jason Vroustouris 30 */ 31 public class MythPlugInFrame extends JDialog implements ActionListener { 32 MythSimSwing ms = null; 33 private JCheckBoxMenuItem jCheckBoxMenuItem = new JCheckBoxMenuItem(); 34 public Color SELECTION_COLOR_UCODE = new Color(255,200,200); 35 public Color SELECTION_COLOR_MEM = new Color(200,255,200); 36 public Color SELECTION_COLOR_REGISTERS = new Color(200,200,255); 37 PluginAction action = new PluginAction(); 38 public MythPlugInFrame(String aa, // title 39 boolean ab, // resizable 40 boolean ac, // closable 41 boolean ad, // maximizable 42 boolean ae, // iconifiable 43 int ba, // set size x 44 int bb, // set size y 45 int ca, // set location x 46 int cb, // set location y 47 MythSimSwing da, 48 JFrame owner) { // MythSim object 49 //super(aa,ab,ac,ad,ae); 50 super(owner,aa); 51 addWindowListener(new WindowEventHandler()); 52 action.putValue(Action.NAME,aa); 53 //setEnabled(false); 54 ms = da; 55 super.setSize(ba,bb); 56 super.setLocation(ca,cb); 57 super.hide(); 58 } 59 public void setup() { 60 } 61 public void step() { 62 super.repaint(); 63 } 64 public void repaint() { 65 super.repaint(); 66 } 67 public Action getAction() { 68 return action; 69 } 70 71 public void setEnabled(boolean value) { 72 action.setEnabled(value); 73 super.setEnabled(value); 74 } 75 76 /*** remove all highlights */ 77 public void clean() { 78 } 79 public void setJCheckBoxMenuItem(JCheckBoxMenuItem a) { 80 jCheckBoxMenuItem = a; 81 } 82 public void actionPerformed(ActionEvent a) { 83 jCheckBoxMenuItem = (JCheckBoxMenuItem)a.getSource(); 84 setVisible(jCheckBoxMenuItem.getState()); 85 } 86 87 private class PluginAction extends AbstractAction { 88 public void actionPerformed(ActionEvent a) { 89 } 90 } 91 92 class WindowEventHandler extends WindowAdapter { 93 public void windowClosing(WindowEvent e) { 94 jCheckBoxMenuItem.setState(false); 95 } 96 } 97 98 }

This page was automatically generated by Maven