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

📄 annealinglayoutconfigurationdialog.java

📁 用JGraph编的软件
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
        panelLUBounds.add(tf_lu_boundsHeight,
                                    new GridBagConstraints(2, 1, 1, 1, 1.0, 1.0, 
                                                  GridBagConstraints.NORTH,
                                                  GridBagConstraints.HORIZONTAL,
                                                  new Insets(0,0,0,0),
                                                  0,0) );
                                                        
        tf_lu_method_neighborsDepth = new JTextField();
        tf_lu_method_perimeterRadius = new JTextField();
        tf_lu_method_perimeterRadiusInc = new JTextField();

        comb_lu_Method = new JComboBox();
        comb_lu_Method.addItem(
            AnnealingLayoutController.KEY_LAYOUT_UPDATE_METHOD_NEIGHBORS_ONLY);
        comb_lu_Method.addItem(
            AnnealingLayoutController.KEY_LAYOUT_UPDATE_METHOD_PERIMETER);
        comb_lu_Method.setBackground(panelLUSurface.getBackground());
        comb_lu_Method.setOpaque(false);
        comb_lu_Method.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                action_CheckBoxSwitch();
            }
        });
        
        JPanel panelLUMethodLabels = new JPanel(new GridLayout(4,1,10,5));
        JPanel panelLUMethodFields = new JPanel(new GridLayout(4,1,10,5));
        
        panelLUMethodLabels.setOpaque(false);
        panelLUMethodFields.setOpaque(false);
        
        panelLUMethod.setBorder(
            BorderFactory.createTitledBorder(
                    BorderFactory.createRaisedBevelBorder(),
                    "Layout Update Method"));
                    
        panelLUMethod.add(panelLUMethodLabels,BorderLayout.WEST);
        panelLUMethod.add(panelLUMethodFields,BorderLayout.EAST);
        
        panelLUMethodLabels.add(new JLabel("Method for Layout Updates :"));
        panelLUMethodLabels.add(new JLabel("Edge Distance to Neighbors :"));
        panelLUMethodLabels.add(new JLabel("Optical Distance to Neighbors :"));
        panelLUMethodLabels.add(new JLabel("Increase of optical Distance :"));
        
        panelLUMethodFields.add(comb_lu_Method);
        panelLUMethodFields.add(tf_lu_method_neighborsDepth);
        panelLUMethodFields.add(tf_lu_method_perimeterRadius);
        panelLUMethodFields.add(tf_lu_method_perimeterRadiusInc);
        
        JPanel panelLUMethodClustering = new JPanel(new GridLayout(3,2,10,5));
        JPanel panelLUMethodClusteringSwitch = new JPanel(new GridLayout(1,2,10,5));
        JPanel panelLUMethodClusteringEmpty = new JPanel();
        
        panelLUMethodClustering.setOpaque(false);
        panelLUMethodClusteringSwitch.setOpaque(false);
        panelLUMethodClusteringEmpty.setOpaque(false);
        
        tf_lu_clustering_factor    = new JTextField();
        cb_lu_clustering_enable    = new JCheckBox();
        tf_lu_clustering_moveScale = new JTextField();
        cb_lu_clustering_enable.setOpaque(false);
        registerCheckBoxAction(cb_lu_clustering_enable);
        
        panelLUMethodClusteringSwitch.add(new JLabel("on/off"));
        panelLUMethodClusteringSwitch.add(cb_lu_clustering_enable);
        
        panelLUMethodClustering.setBorder(
            BorderFactory.createTitledBorder(
                    BorderFactory.createRaisedBevelBorder(),
                    "Clustering"));
        panelLUMethodClustering.add(panelLUMethodClusteringSwitch);
        panelLUMethodClustering.add(panelLUMethodClusteringEmpty);
        panelLUMethodClustering.add(new JLabel("Clustering factor :"));
        panelLUMethodClustering.add(tf_lu_clustering_factor);
        panelLUMethodClustering.add(new JLabel(
                                            "Cluster move scale factor :"));
        panelLUMethodClustering.add(tf_lu_clustering_moveScale);
        panelLUMethod.add(panelLUMethodClustering,BorderLayout.SOUTH);
        


        /*####################################################################*/

        cb_enableLayoutUpdate = new JCheckBox();
        if( !isOptimizer ){
            JPanel panelGlobal = new JPanel(new GridBagLayout());
            getContentPane().add(panelGlobal,BorderLayout.NORTH);
            
            cb_enableLayoutUpdate.addActionListener(new ActionListener(){
                public void actionPerformed(ActionEvent e ){
                    switchLayoutUpdatePanel();
                }
            });
            panelGlobal.add(new JLabel("Run permanent:"),
                           new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, 
                                                  GridBagConstraints.WEST,
                                                  GridBagConstraints.NONE,
                                                  new Insets(0,5,0,30),
                                                  0,0) );
            panelGlobal.add(cb_enableLayoutUpdate,
                           new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, 
                                                  GridBagConstraints.WEST,
                                                  GridBagConstraints.HORIZONTAL,
                                                  new Insets(0,0,0,0),
                                                  0,0) );
        }
        
        
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent evt) {
                closeDialog();
            }
        });
        
        JButton buttonFinished = new JButton("OK");
        JButton buttonCancel   = new JButton("Cancel");
        
        comb_loadPreSets = new JComboBox();
        
        for( int i = 0; i < preSetConfigs.length; i++ )
            comb_loadPreSets.addItem(preSetConfigs[i].get(
                                    AnnealingLayoutController.KEY_CONFIG_NAME));
        
        
        panelButtons.add(buttonFinished);
        panelButtons.add(comb_loadPreSets);
        panelButtons.add(buttonCancel);

        buttonFinished.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                action_ok();
            }
        });
        
        comb_loadPreSets.addActionListener(new ActionListener() {            
            public void actionPerformed(ActionEvent e){
                action_LoadPreSets(((JComboBox)e.getSource()).
                                                            getSelectedIndex());
            }
            
        });

        buttonCancel.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                action_cancel();
            }
        });
        
        
		panelSurfaceWrapper = new JScrollPane(panelSurface);
		Dimension innerSize = new Dimension(550, 350);
		panelSurfaceWrapper .setPreferredSize(innerSize);
		panelLUSurfaceWrapper= new JScrollPane(panelLUSurface);
		panelLUSurfaceWrapper.setPreferredSize(innerSize);
        
		tp_main.addTab("Values for main run", panelSurfaceWrapper);
        
        getRootPane().setDefaultButton(buttonFinished);

        setToolTipTexts();
                
        pack();
    }
    
/******************************************************************************/    

    private void registerCheckBoxAction(JCheckBox cb){
        cb.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                action_CheckBoxSwitch();
            }
        });
    }

/******************************************************************************/    

    protected JLabel[] getAdditionalCostFunctionLabels(){
        return new JLabel[0];
    }

/******************************************************************************/    

    protected JCheckBox[] getAdditionalCostFunctionCheckBoxes(){
        return new JCheckBox[0];
    }

/******************************************************************************/    

    protected JTextField[] getAdditionalCostFunctionTextFields(){
        return new JTextField[0];
    }

/******************************************************************************/    

    protected JLabel[] getAdditionalLUCostFunctionLabels(){
        return new JLabel[0];
    }

/******************************************************************************/    

    protected JCheckBox[] getAdditionalLUCostFunctionCheckBoxes(){
        return new JCheckBox[0];
    }

/******************************************************************************/    

    protected JTextField[] getAdditionalLUCostFunctionTextFields(){
        return new JTextField[0];
    }

/******************************************************************************/    

    private void switchLayoutUpdatePanel(){
    	/*
        if( cb_enableLayoutUpdate.isSelected() && !isOptimizer){
        	
            getContentPane().remove(panelSurface);
            getContentPane().add(panelSurface,BorderLayout.WEST);
            getContentPane().add(panelLUSurface,BorderLayout.EAST);
        }
        else {
        	
            getContentPane().remove(panelSurface);
            getContentPane().remove(panelLUSurface);
            getContentPane().add(panelSurface,BorderLayout.CENTER);
            
        }
        */
        
		if( cb_enableLayoutUpdate.isSelected() && !isOptimizer){
			tp_main.addTab("Values for Layout updates", panelLUSurfaceWrapper);
		}
		else {
			tp_main.remove(panelLUSurfaceWrapper);
		}
        
        pack();
    }

/******************************************************************************/    
    /** Closes the dialog 
     * @see #action_cancel
     * */
    private void closeDial

⌨️ 快捷键说明

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