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

📄 rightcdlg.java

📁 J2EE & Tomcat books published by hope
💻 JAVA
字号:
package org.impact.stars.appclient.concept;


/**
 * Insert the type's description here.
 * Creation date: (7/28/00 12:42:27 PM)
 * @author: Jian Cai
 */
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;

import org.impact.stars.appclient.concept.model.*;

public class Rightcdlg extends javax.swing.JDialog {
    
    boolean registerButtonPressed = false;
    boolean fComponentsAdjusted = false;
    
    public boolean addtochildclicked = false;
    public boolean updateclicked = false;
    public boolean reconstructclicked = false;
    public boolean deleteclicked = false;
    
    public boolean linktotaskclicked = false;
    public boolean addrelationclicked = false;
    public boolean linktoproductclicked = false;
    public boolean linktostateclicked = false;
    
    public boolean addperspectiveclicked = false;
    public boolean shareperspectiveclicked = false;
    public boolean ownperspectiveclicked = false;    
    
    public boolean conflictclicked = false;        
    
    private javax.swing.JButton addchildButton = new JButton();
    private javax.swing.JButton updateButton = new JButton();
    private javax.swing.JButton reconstructButton = new JButton();
    private javax.swing.JButton deleteButton = new JButton();
    private javax.swing.JButton linktotaskButton = new JButton();
    private javax.swing.JButton addrelationButton = new JButton();
    private javax.swing.JButton linktoproductButton = new JButton();
    private javax.swing.JButton linktostateButton = new JButton();
    private javax.swing.JButton addperspectiveButton = new JButton();
    private javax.swing.JButton ownperspectiveButton = new JButton();
    private javax.swing.JButton shareperspectiveButton = new JButton();
    private javax.swing.JButton conflictButton = new JButton();
    
    class SymWindow extends java.awt.event.WindowAdapter {
        public void windowClosing(java.awt.event.WindowEvent event) {
            Object object = event.getSource();
            if (object == Rightcdlg.this)
                Dialog1_WindowClosing(event);
        }
    }
    
        /*linktotaskButton.addActionListener(lSymAction);
                linktostateButton.addActionListener(lSymAction);
                addchildButton.addActionListener(lSymAction);
                addperspectiveButton.addActionListener(lSymAction);
                linktoproductButton.addActionListener(lSymAction);
                addrelationButton.addActionListener(lSymAction);
                updateButton.addActionListener(lSymAction);*/
    
    class SymAction implements java.awt.event.ActionListener {
        public void actionPerformed(java.awt.event.ActionEvent event) {
            Object object = event.getSource();
            if (object == linktotaskButton)
                linktotaskButton_Action(event);
            
            else if (object == linktostateButton)
                linktostateButton_Action(event);
            
            else if (object == addchildButton)
                addchildButton_Action(event);
            
            else if (object == addperspectiveButton)
                addperspectiveButton_Action(event);
            
            else if (object == linktoproductButton)
                linktoproductButton_Action(event);
            
            else if (object == addrelationButton)
                addrelationButton_Action(event);
            
            else if (object == updateButton)
                updateButton_Action(event);
            
            else if (object == deleteButton)
                deleteButton_Action(event);
            
            else if (object == shareperspectiveButton)
                shareperspectiveButton_Action(event);
            
            else if (object == ownperspectiveButton)
                ownperspectiveButton_Action(event);
            
            else if (object == conflictButton)
                conflictButton_Action(event);
            
            
            
        }
    }
    
    /**
     * Rightcdlg constructor comment.
     */
    public Rightcdlg() {
        super();
    }
    public Rightcdlg(JFrame parent, String title, boolean modal) {
        this(parent, modal);
        setTitle(title);
    }
    public Rightcdlg(JFrame parent, boolean modal) {
        super(parent, modal);
        parent.setResizable(false);
        
        getContentPane().setLayout(new GridLayout(11,1));
        setSize(120,240);
        
        setVisible(false);
        
        addchildButton = new javax.swing.JButton();
        addchildButton.setName("addchildButton");
        addchildButton.setToolTipText("new a child concept");
        addchildButton.setText("Add new child");
        addchildButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        addchildButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        addchildButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        getContentPane().add(addchildButton);
        
        updateButton = new javax.swing.JButton();
        updateButton.setName("updateButton");
        updateButton.setToolTipText("modify concept attribute");
        updateButton.setText("Modify Concept");
        updateButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        updateButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        updateButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        getContentPane().add(updateButton);
        
        deleteButton = new javax.swing.JButton();
        deleteButton.setName("deleteButton");
        deleteButton.setToolTipText("delete concept");
        deleteButton.setText("Delete Concept");
        deleteButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        deleteButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        deleteButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        getContentPane().add(deleteButton);
        
        
        addperspectiveButton = new javax.swing.JButton();
        addperspectiveButton.setName("addperspectiveButton");
        addperspectiveButton.setToolTipText("delear perspective");
        addperspectiveButton.setText("Declear Perspective");
        addperspectiveButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        addperspectiveButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        addperspectiveButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        getContentPane().add(addperspectiveButton);
        
        ownperspectiveButton = new javax.swing.JButton();
        ownperspectiveButton.setName("ownperspectiveButton");
        ownperspectiveButton.setToolTipText("review own perspective");
        ownperspectiveButton.setText("Own Perspective");
        ownperspectiveButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        ownperspectiveButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        ownperspectiveButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        getContentPane().add(ownperspectiveButton);
                
        shareperspectiveButton = new javax.swing.JButton();
        shareperspectiveButton.setName("shareperspectiveButton");
        shareperspectiveButton.setToolTipText("evalue others' perspective");
        shareperspectiveButton.setText("Share Perspective");
        shareperspectiveButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        shareperspectiveButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        shareperspectiveButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        getContentPane().add(shareperspectiveButton);

        conflictButton = new javax.swing.JButton();
        conflictButton.setName("conflictButton");
        conflictButton.setToolTipText("review the conflicts");
        conflictButton.setText("View Conflict");
        conflictButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        conflictButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        conflictButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        getContentPane().add(conflictButton);
        
        addrelationButton = new javax.swing.JButton();
        addrelationButton.setName("addrelationButton");
        addrelationButton.setToolTipText("Add Relation");
        addrelationButton.setText("Add Relation");
        addrelationButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        addrelationButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        addrelationButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        getContentPane().add(addrelationButton);
        
        linktostateButton = new javax.swing.JButton();
        linktostateButton.setName("linktostateButton");
        linktostateButton.setToolTipText("reference this concept to State");
        linktostateButton.setText("Link to State");
        linktostateButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        linktostateButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        linktostateButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        getContentPane().add(linktostateButton);
        
        
        linktoproductButton = new javax.swing.JButton();
        linktoproductButton.setName("linktoproductButton");
        linktoproductButton.setToolTipText("reference this concept to product");
        linktoproductButton.setText("Link to Product");
        linktoproductButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        linktoproductButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        linktoproductButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        getContentPane().add(linktoproductButton);
        
        linktotaskButton.setName("totaskButton");
        linktotaskButton.setToolTipText("reference this concept to task");
        linktotaskButton.setText("Link to Task");
        linktotaskButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        linktotaskButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        linktotaskButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        getContentPane().add(linktotaskButton);
        
        setTitle("Add New Concept");
        this.setResizable(false);
        //}}
        
        //{{REGISTER_LISTENERS
        SymWindow aSymWindow = new SymWindow();
        this.addWindowListener(aSymWindow);
        SymAction lSymAction = new SymAction();
        
        linktotaskButton.addActionListener(lSymAction);
        linktostateButton.addActionListener(lSymAction);
        addchildButton.addActionListener(lSymAction);
        addperspectiveButton.addActionListener(lSymAction);
        ownperspectiveButton.addActionListener(lSymAction);
        shareperspectiveButton.addActionListener(lSymAction);
        linktoproductButton.addActionListener(lSymAction);
        addrelationButton.addActionListener(lSymAction);
        updateButton.addActionListener(lSymAction);
        deleteButton.addActionListener(lSymAction);
        conflictButton.addActionListener(lSymAction);        
        //}}*/
    }
    void addchildButton_Action(java.awt.event.ActionEvent event) {
        addtochildclicked = true;
        this.setVisible(false);
        
    }
    void updateButton_Action(java.awt.event.ActionEvent event) {
        updateclicked = true;
        this.setVisible(false);
    }
    
    void deleteButton_Action(java.awt.event.ActionEvent event) {
        deleteclicked = true;
        this.setVisible(false);
    }
    
    void addperspectiveButton_Action(java.awt.event.ActionEvent event) {
        addperspectiveclicked = true;
        this.setVisible(false);        
    }
    
    void ownperspectiveButton_Action(java.awt.event.ActionEvent event) {
        ownperspectiveclicked = true;
        this.setVisible(false);        
    }
    
    void conflictButton_Action(java.awt.event.ActionEvent event) {
        conflictclicked = true;
        this.setVisible(false);        
    }

    
    
    void addrelationButton_Action(java.awt.event.ActionEvent event) {
    }
    void linktostateButton_Action(java.awt.event.ActionEvent event) {
        // to do: code goes here.
        registerButtonPressed = false;
        this.setVisible(false);
    }
    void linktoproductButton_Action(java.awt.event.ActionEvent event) {
    }
    void linktotaskButton_Action(java.awt.event.ActionEvent event) {
        // to do: code goes here.
        registerButtonPressed = false;
        this.setVisible(false);
    }
    void cancelButton_Action(java.awt.event.ActionEvent event) {
        // to do: code goes here.
        registerButtonPressed = false;
        this.setVisible(false);
    }
    void Dialog1_WindowClosing(java.awt.event.WindowEvent event) {
        dispose();
    }
    
    public void addNotify() {
        // Record the size of the window prior to calling parents addNotify.
        Dimension d = getSize();
        
        super.addNotify();
        
        if (fComponentsAdjusted)
            return;
        
        // Adjust components according to the insets
        setSize(getInsets().left + getInsets().right + d.width, getInsets().top + getInsets().bottom + d.height);
        Component components[] = getComponents();
        for (int i = 0; i < components.length; i++) {
            Point p = components[i].getLocation();
            p.translate(getInsets().left, getInsets().top);
            components[i].setLocation(p);
        }
        fComponentsAdjusted = true;
    }
    
    public boolean getaddtochild() {
        return addtochildclicked;
    }
    public boolean isRegisterButtonPressed() {
        return registerButtonPressed;
    }
    void shareperspectiveButton_Action(java.awt.event.ActionEvent event) {
        shareperspectiveclicked = true;
        this.setVisible(false);
    }
}

⌨️ 快捷键说明

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