📄 permispolicyeditormain.java
字号:
/*
* Copyright (c) 2000-2005, University of Salford
* All rights reserved.
*
* 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 documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the University of Salford 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.
*/
package issrg.editor.gui2;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.Toolkit;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JLayeredPane;
import javax.swing.JInternalFrame;
import issrg.editor.*;
/**
* Classname: PermisPolicyEditorMain.java
*
* Description: PermisPolicyEditorMain is the main class of the Editor
* application. It creates the desktop pane that displays the
* required forms, the required buttons and the menu.
* Version 1.0.
*
*
* Copyright(c) the authors April 2004
*
* @author Professor D.W.Chadwick
* P.Langley
* U.Mbanaso
*
*/
public class PermisPolicyEditorMain extends JFrame
{
protected static final String TITLE = " X.509 Permis Policy Editor ";
private PermisXMLObject xmlObject;
private JDesktopPane policyDesktopPane;
private PermisPolicyEditorMenuBar permisPolicyEditorMenuBar;
private PermisPolicyEditorPane editPane;
/**************************************************************************\
* Constructor *
\**************************************************************************/
public PermisPolicyEditorMain() {
initComponents();
}
/**************************************************************************\
* initComponents *
\**************************************************************************/
/**
* Initialises the form
*/
protected void initComponents()
{
this.policyDesktopPane = new JDesktopPane();
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent evt) {
exitForm(evt);
}
});
this.permisPolicyEditorMenuBar = new PermisPolicyEditorMenuBar(this);
this.setJMenuBar(this.permisPolicyEditorMenuBar.getMenuBar());
this.getContentPane().add(policyDesktopPane);
setTitle(TITLE);
pack();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
this.setBounds(300, 300, 820, 740);
this.setBackground(java.awt.Color.WHITE);
}
protected void showNewPolicy()
{
JInternalFrame intFrame = new JInternalFrame();
intFrame.setVisible(true);
intFrame.setClosable(true);
intFrame.setIconifiable(true);
intFrame.setMaximizable(true);
intFrame.setResizable(true);
intFrame.setVisible(true);
intFrame.setBounds(0, 0, 800, 650);
PermisPolicyEditorPane editPane = new PermisPolicyEditorPane(this);
intFrame.setContentPane(editPane);
policyDesktopPane.add(intFrame, JLayeredPane.DEFAULT_LAYER);
try{
intFrame.setMaximum(true);
}
catch(java.beans.PropertyVetoException pve){
//ignore!?!
}
}
/**************************************************************************\
* setFrameTitle *
\**************************************************************************/
/**
*
*
*/
protected void setFrameTitle(String fileName)
{
if (fileName == ""){
setTitle( TITLE);
return;
}
setTitle( TITLE + " [ " + fileName + " ]");
}
/**************************************************************************\
* exitMenuItemActionPerformed *
\**************************************************************************/
/**
* Shuts the application down
*
* @param evt Exit selected from menu.
*/
private void exitMenuItemActionPerformed(ActionEvent evt)
{
System.exit(0);
}
/**************************************************************************\
* exitForm *
\**************************************************************************/
/**
* Shuts the application down
*
* @param evt Close Window button operated
*/
private void exitForm(WindowEvent evt)
{
System.exit(0);
}
/**************************************************************************\
* main *
\**************************************************************************/
/**
* Calls the constructor
*
* @param args Command line arguments are not required
*/
public static void main(String args[])
{
new PermisPolicyEditorMain().show();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -