📄 getinfooutline.java
字号:
}// /**// * Respond to database changes// * @param batch a batch of changes completed// */// public void databaseEndChangeBatch(Undo.ChangeBatch batch)// {// if (!isVisible()) return;// // check if we care about the changes// boolean reload = false;// for (Iterator it = batch.getChanges(); it.hasNext(); )// {// Undo.Change change = it.next();// ElectricObject obj = change.getObject();// if (obj == ni)// {// reload = true;// break;// }// }// if (reload) loadDialog();// }// /** Don't do anything on little database changes, only after all database changes */// public void databaseChanged(Undo.Change change) {}// /** This is a GUI listener */// public boolean isGUIListener() { return true; } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; done = new javax.swing.JButton(); pointPane = new javax.swing.JScrollPane(); apply = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); xValue = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); yValue = new javax.swing.JTextField(); deletePoint = new javax.swing.JButton(); duplicatePoint = new javax.swing.JButton(); getContentPane().setLayout(new java.awt.GridBagLayout()); setTitle("Outline Properties"); setName(""); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(evt); } }); done.setText("Done"); done.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { done(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); getContentPane().add(done, gridBagConstraints); pointPane.setMinimumSize(new java.awt.Dimension(100, 150)); pointPane.setPreferredSize(new java.awt.Dimension(100, 150)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 3; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; getContentPane().add(pointPane, gridBagConstraints); apply.setText("Apply"); apply.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { applyActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); getContentPane().add(apply, gridBagConstraints); jLabel1.setText("X:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); getContentPane().add(jLabel1, gridBagConstraints); xValue.setColumns(8); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 3; gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); getContentPane().add(xValue, gridBagConstraints); jLabel2.setText("Y:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); getContentPane().add(jLabel2, gridBagConstraints); yValue.setColumns(8); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 4; gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); getContentPane().add(yValue, gridBagConstraints); deletePoint.setText("Delete Point"); deletePoint.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { deletePointActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 3; gridBagConstraints.gridwidth = 2; gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); getContentPane().add(deletePoint, gridBagConstraints); duplicatePoint.setText("Duplicate Point"); duplicatePoint.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { duplicatePointActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 2; gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); getContentPane().add(duplicatePoint, gridBagConstraints); pack(); }// </editor-fold>//GEN-END:initComponents private void applyActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_applyActionPerformed {//GEN-HEADEREND:event_applyActionPerformed int newPointCount = model.size(); EPoint [] pts = new EPoint[newPointCount]; for(int i=0; i<newPointCount; i++) { String line = (String)model.get(i); Point2D pt = getPointValue(line); if (pt != null) pts[i] = new EPoint(pt.getX(), pt.getY()); } new AdjustOutline(ni, pts); }//GEN-LAST:event_applyActionPerformed private void duplicatePointActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_duplicatePointActionPerformed {//GEN-HEADEREND:event_duplicatePointActionPerformed int index = list.getSelectedIndex(); // redraw the entire list so that the indices are correct int newPointCount = model.size(); Point2D [] newPoints = new Point2D[newPointCount+1]; int j = 0; for(int i=0; i<newPointCount; i++) { String line = (String)model.get(i); if (i == index) { Point2D insertPt = getPointValue(line); if (insertPt != null) newPoints[j++] = insertPt; } newPoints[j++] = getPointValue(line); } loadList(newPoints, index); }//GEN-LAST:event_duplicatePointActionPerformed private void deletePointActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_deletePointActionPerformed {//GEN-HEADEREND:event_deletePointActionPerformed int index = list.getSelectedIndex(); // redraw the entire list so that the indices are correct int newPointCount = model.size(); Point2D [] newPoints = new Point2D[newPointCount-1]; int j = 0; for(int i=0; i<newPointCount; i++) { if (i == index) continue; String line = (String)model.get(i); newPoints[j++] = getPointValue(line); } if (index >= newPointCount) index--; loadList(newPoints, index); }//GEN-LAST:event_deletePointActionPerformed private void done(java.awt.event.ActionEvent evt)//GEN-FIRST:event_done {//GEN-HEADEREND:event_done closeDialog(null); }//GEN-LAST:event_done /** Closes the dialog */ private void closeDialog(java.awt.event.WindowEvent evt)//GEN-FIRST:event_closeDialog { super.closeDialog(); }//GEN-LAST:event_closeDialog /** * Class to GetInfoOutline a cell in a new thread. */ private static class AdjustOutline extends Job { private NodeInst ni; private EPoint [] pts; private AdjustOutline(NodeInst ni, EPoint [] pts) { super("Adjust Outline", User.getUserTool(), Job.Type.CHANGE, null, null, Job.Priority.USER); this.ni = ni; this.pts = pts; startJob(); } /** * Method to change the coordinates. */ public boolean doIt() throws JobException { ni.setTrace(pts); return true; } } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton apply; private javax.swing.JButton deletePoint; private javax.swing.JButton done; private javax.swing.JButton duplicatePoint; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JScrollPane pointPane; private javax.swing.JTextField xValue; private javax.swing.JTextField yValue; // End of variables declaration//GEN-END:variables}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -