⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phonedesigner.java

📁 WAP ide 代码
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
package Designer;

import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import java.util.*;
import java.lang.*;
import java.io.*;
import java.awt.AWTEvent.*;

/**
 * This class allows users to design customized cellphones for use with J2WAP's WAP
 * browser.  The class is only 50% finished.  It currently allows
 * users to create a functional shell of the cellphone and save and load that shell.
 * However, users cannot yet create their own cellphone menus.  That part of
 * the class is still under development.  All Advanced classes are part of the
 * new menu designer.  They can stand on their own, but where developed to be
 * used within the menu designer component of this class. Currently the
 * menu designer button is available for demonstration purposes only.
 * Copyright (c) 2003
 * @author  Mark Busman
 * @version 1.0
 * Contact info: cougar@skyinet.net
 *
 * * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
public class PhoneDesigner extends javax.swing.JFrame {

  private javax.swing.JMenuBar MainMenuBar;
  private javax.swing.JMenu File;
  private javax.swing.JMenuItem New;
  private javax.swing.JMenuItem Open;
  private javax.swing.JMenuItem Save;
  private javax.swing.JMenuItem SaveAs;
  private javax.swing.JSeparator jSeparator1;
  private javax.swing.JMenuItem Exit;
  private javax.swing.JMenu Edit;
  private javax.swing.JMenuItem Cut;
  private javax.swing.JMenuItem Copy;
  private javax.swing.JMenuItem Paste;
  private javax.swing.JSeparator jSeparator3;
  private javax.swing.JMenuItem Delete;
  private javax.swing.JMenu View;
  private javax.swing.JCheckBoxMenuItem Toolbox;
  private javax.swing.JCheckBoxMenuItem Properties;
  private javax.swing.JSeparator jSeparator13;
  private javax.swing.JCheckBoxMenuItem Toolbar;
  private javax.swing.JCheckBoxMenuItem Statusbar;
  private javax.swing.JSeparator jSeparator8;
  private javax.swing.JMenuItem Add;
  private javax.swing.JSeparator ItemSep;
  private javax.swing.JMenu Help;
  private javax.swing.JMenuItem HelpMenu;
  private javax.swing.JSeparator jSeparator4;
  private javax.swing.JMenuItem AboutMenu;
  private javax.swing.JPopupMenu thePopupMenu;
  private javax.swing.JMenuItem PopupUndo;
  private javax.swing.JSeparator jSeparator7;
  private javax.swing.JMenuItem PopupCut;
  private javax.swing.JMenuItem PopupCopy;
  private javax.swing.JMenuItem PopupPaste;
  private javax.swing.JSeparator jSeparator9;
  private javax.swing.JMenuItem PopupDelete;
  private javax.swing.JSeparator jSeparator10;
  private javax.swing.JMenuItem PopupProperties;
  private javax.swing.JToolBar MainToolbar;
  private javax.swing.JButton ToolbarNewFile;
  private javax.swing.JButton ToolbarOpenFile;
  private javax.swing.JButton ToolbarSaveFile;
  private javax.swing.JSeparator jSeparator2;
  private javax.swing.JButton ToolbarCut;
  private javax.swing.JButton ToolbarCopy;
  private javax.swing.JButton ToolbarPaste;
  private javax.swing.JButton ToolbarDelete;
  private javax.swing.JSeparator jSeparator6;
  private javax.swing.JToggleButton ToolbarTools;
  private javax.swing.JToggleButton ToolbarProperties;
  private javax.swing.JToggleButton ToolbarToolBar;
  private javax.swing.JToggleButton ToolbarStatusBar;
  private javax.swing.JSeparator jSeparator11;
  private javax.swing.JSeparator jSeparator12;
  private javax.swing.JButton ToolbarHelp;
  private javax.swing.JScrollPane ToolsScrollPane;
  private javax.swing.JPanel ToolboxCardPanel;
  private javax.swing.JPanel PhoneToolsPanel;
  private javax.swing.JToolBar PhoneToolsToolbar;
  private javax.swing.JPanel PhoneToolsToolbarPane;
  private javax.swing.JButton BackgroundPicButton;
  private javax.swing.JButton ClearButton;
  private javax.swing.JButton OKButton;
  private javax.swing.JButton NaviButton;
  private javax.swing.JButton ScrollButton;
  private javax.swing.JButton ScreenButton;
  private javax.swing.JButton ScrollKeyButton;
  private javax.swing.JButton AlphaButton;
  private javax.swing.JButton NumericButton;
  private javax.swing.JButton SpecialButton;
  private javax.swing.JPanel MenuToolsPanel;
  private javax.swing.JToolBar MenuToolsToolbar;
  private javax.swing.JPanel MenuToolsToolbarPane;
  private javax.swing.JButton LabelButton;
  private javax.swing.JButton TextAreaButton;
  private javax.swing.JButton InputButton;
  private javax.swing.JButton ListButton;
  private javax.swing.JButton GraphicsButton;
  private javax.swing.JButton OptionButton;
  private javax.swing.JScrollPane PropertiesScrollPane;
  private javax.swing.JPanel PropertiesCardPanel;
  private javax.swing.JPanel ToolPropertiesPanel;
  private javax.swing.JLabel jLabel1;
  private javax.swing.JTextField ImageLocation;
  private javax.swing.JButton FileDialogButton;
  private javax.swing.JLabel jLabel2;
  private javax.swing.JTextField ActionText;
  private javax.swing.JButton ActionButton;
  private javax.swing.JLabel jLabel3;
  private javax.swing.JLabel jLabel4;
  private javax.swing.JLabel jLabel5;
  private javax.swing.JLabel jLabel6;
  private javax.swing.JLabel jLabel9;
  private javax.swing.JTextField HeightText;
  private javax.swing.JTextField WidthText;
  private javax.swing.JTextField XText;
  private javax.swing.JTextField YText;
  private javax.swing.JLabel jLabel11;
  private javax.swing.JButton BlackSwat;
  private javax.swing.JButton LtGraySwat;
  private javax.swing.JButton GraySwat;
  private javax.swing.JButton DarkGraySwat;
  private javax.swing.JButton WhiteSwat;
  private javax.swing.JButton RedSwat;
  private javax.swing.JButton PinkSwat;
  private javax.swing.JButton OrangeSwat;
  private javax.swing.JButton YellowSwat;
  private javax.swing.JButton GreenSwat;
  private javax.swing.JButton MagentaSwat;
  private javax.swing.JButton CyanSwat;
  private javax.swing.JButton BlueSwat;
  private javax.swing.JButton LightBlueSwat;
  private javax.swing.JButton DarkBlueSwat;
  private javax.swing.JButton LightGreenSwat;
  private javax.swing.JButton DarkGreenSwat;
  private javax.swing.JButton LightCyanSwat;
  private javax.swing.JButton DarkCyanSwat;
  private javax.swing.JButton LightMagentaSwat;
  private javax.swing.JButton DarkMagentaSwat;
  private javax.swing.JButton BrownSwat;
  private javax.swing.JButton LightRedSwat;
  private javax.swing.JButton DarkRedSwat;
  private javax.swing.JButton ExtraColor1;
  private javax.swing.JButton ExtraColor2;
  private javax.swing.JButton ColorPicker;
  private javax.swing.JComboBox TransparancyCombo;
  private javax.swing.JPanel MenuPropertiesPanel;
  private javax.swing.JLabel jLabel10;
  private javax.swing.JTextField MenuFontText;
  private javax.swing.JTextField MenuBackgroundText;
  private javax.swing.JButton MenuFontButton;
  private javax.swing.JLabel jLabel13;
  private javax.swing.JTextField MenuHeightText;
  private javax.swing.JLabel jLabel15;
  private javax.swing.JTextField MenuCommandText;
  private javax.swing.JButton MenuCommandButton;
  private javax.swing.JLabel jLabel16;
  private javax.swing.JLabel jLabel17;
  private javax.swing.JLabel jLabel18;
  private javax.swing.JLabel jLabel19;
  private javax.swing.JLabel jLabel20;
  private javax.swing.JTextField MenuBorderText;
  private javax.swing.JTextField MenuForegroundText;
  private javax.swing.JTextField MenuImageFileText;
  private javax.swing.JButton MenuBorderButton;
  private javax.swing.JButton MenuBackgroundButton;
  private javax.swing.JLabel jLabel21;
  private javax.swing.JLabel jLabel22;
  private javax.swing.JLabel jLabel23;
  private javax.swing.JLabel jLabel24;
  private javax.swing.JLabel jLabel25;
  private javax.swing.JTextField MenuXText;
  private javax.swing.JTextField MenuYText;
  private javax.swing.JTextField MenuWidthText;
  private javax.swing.JButton MenuForegroundButton;
  private javax.swing.JButton MenuImageFileButton;
  private javax.swing.JComboBox MenuTransparentCombo;
  private javax.swing.JComboBox MenuHAlignCombo;
  private javax.swing.JComboBox MenuVAlignCombo;
  private javax.swing.JTextField MenuControlText;
  private javax.swing.JLabel jLabel7;
  private javax.swing.JLabel jLabel8;
  private javax.swing.JLabel jLabel12;
  private javax.swing.JLabel jLabel14;
  private javax.swing.JTextField MenuSelBackgroundText;
  private javax.swing.JTextField MenuSelForegroundText;
  private javax.swing.JButton MenuSelBackgroundButton;
  private javax.swing.JButton MenuSelForegroundButton;
  private javax.swing.JComboBox MenuEditableCombo;
  private javax.swing.JPanel MainCardPanel;
  private javax.swing.JScrollPane PhoneEditor;
  private javax.swing.JPanel PhoneEditorPanel;
  private javax.swing.JLabel BKGround;
  private javax.swing.JPanel MenuEditor;
  private javax.swing.JScrollPane ScreenScrollPane;
  private javax.swing.JPanel MenuCentralizerPanel;
  private javax.swing.JPanel ScreenPanel;
  private java.awt.Panel MenuControlsMainPanel;
  private javax.swing.JPanel MenuControlsPanel;
  private javax.swing.JButton BackButton;
  private javax.swing.JButton FirstButton;
  private javax.swing.JButton NewMenuButton;
  private javax.swing.JButton MenuTreeButton;
  private javax.swing.JButton DeleteMenuButton;
  private javax.swing.JButton LastButton;
  private javax.swing.JButton ForwardButton;
  private javax.swing.JLabel MenuControlsLabel;
  private javax.swing.JPanel BottomPanel;
  private javax.swing.JLabel MainStatusbar;
  private javax.swing.JPanel TogglePanel;
  private javax.swing.JToggleButton TogglePhoneDesigner;
  private javax.swing.JToggleButton ToggleMenuDesigner;

  // Phone Class Variables
  private JLabel theControlLabel[] = new JLabel[0];
  private JLabel temp[] = new JLabel[0];
  private Controls theControls;
  private JLabel cutLabel = new JLabel();
  private ButtonTypeDialog buttonDialog = new ButtonTypeDialog(this, true);
  private JMenuItem Items[] = new JMenuItem[10];

  // Menu Class Variables
  private JComponent currentSelectedComp = null;
  private JComponent prevSelectedComp = null;


  // User Variables
  /**
   * Keeps track of the remoced controls ID number
   */
  private Vector RemovedVector = new Vector();

  /**
   * Index counter
   */
  private int i = 0;
  /**
   * Control Pointer - the unique id of the current control.
   */
  private int cp = 0;
  /**
   * The number of menus created, default is 0.
   */
  private int MenuCount = 0;

  /**
   * If a control is copied to memeory due to cut or copy operation
   * has a value of the Control's unique ID number else 0.
   */
  private int ControlCopied = 0;
  /**
   * Like the Control Pointer, but then for the menu designer component.
   */
  private int CurrentComp = 0;
  /**
   * The name of the file in the editor, default "Untitled."
   */
  private String OpenFileName = "Untitled";
  /**
   * Stores the color of the selected color swab.
   */
  private Color colorChoosen = new Color(255, 255, 255);
  /**
   * Used to determine if the extra color swabs have custom colors assigned,
   * default is true.
   */
  private boolean ColorAssigned = true;
  /**
   * Stores the statusbar text when going through menus so that the
   * appropriate text is placed on the statusbar when exiting
   * the menus.
   */
  private String TempStatusText = "";
  /**
   * Same as Index(i variable) but then for menu designer.
   */
  private int ScreenControlIndex = -1;
  /**
   * Info of controls on a per control basis.
   */
  private ControlInfo info[] = new ControlInfo[0];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -