parent
66907a7ce3
commit
c31f5280fd
@ -0,0 +1,58 @@
|
||||
package com.connor.plm.CostListManagement;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Desktop;
|
||||
import java.awt.Panel;
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.AbstractCellEditor;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.table.DefaultTableCellRenderer;
|
||||
import javax.swing.table.TableCellEditor;
|
||||
import javax.swing.table.TableCellRenderer;
|
||||
|
||||
import com.connor.plm.CostListManagement.pojo.Quotation;
|
||||
import com.connor.plm.CreateOuotation.JDBFrame;
|
||||
import com.connor.plm.CreateOuotation.MainApp;
|
||||
import com.teamcenter.rac.kernel.TCComponent;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.soaictstubs.booleanSeq_tHolder;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import javafx.embed.swing.JFXPanel;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.WindowEvent;
|
||||
|
||||
class ButtonCellRenderer extends DefaultTableCellRenderer implements TableCellRenderer {
|
||||
|
||||
private JButton button;
|
||||
private JTable table;
|
||||
private List<Quotation> quotations;
|
||||
private TCSession session;
|
||||
private TCComponent f;
|
||||
private JFrame frame;
|
||||
public ButtonCellRenderer(JTable jTable2, List<Quotation> quotations,TCSession session, TCComponent f,JFrame frame) {
|
||||
button = new JButton();
|
||||
this.quotations = quotations;
|
||||
this.table = jTable2;
|
||||
this.session = session;
|
||||
this.f = f;
|
||||
this.frame = frame;
|
||||
}
|
||||
public interface CostPageCallback {
|
||||
void onOpenCostPage();
|
||||
}
|
||||
@Override
|
||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
|
||||
boolean hasFocus, int row, int column) {
|
||||
button.setText(value != null ? value.toString() : "");
|
||||
return button;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,698 @@
|
||||
package com.connor.plm.CostListManagement;
|
||||
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Cursor;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.Point;
|
||||
import java.awt.Polygon;
|
||||
import java.awt.Stroke;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.FocusListener;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.awt.event.MouseMotionListener;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.Popup;
|
||||
import javax.swing.PopupFactory;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.event.AncestorEvent;
|
||||
import javax.swing.event.AncestorListener;
|
||||
|
||||
public class DateChooser extends JPanel {
|
||||
private static final long serialVersionUID = 4529266044762990227L;
|
||||
private Date initDate;
|
||||
private Calendar now;
|
||||
private Calendar select;
|
||||
private JPanel monthPanel;
|
||||
private DateChooser.JP1 jp1;
|
||||
private DateChooser.JP2 jp2;
|
||||
private DateChooser.JP3 jp3;
|
||||
private DateChooser.JP4 jp4;
|
||||
private Font font;
|
||||
private final DateChooser.LabelManager lm;
|
||||
private SimpleDateFormat sdf;
|
||||
private boolean isShow;
|
||||
private Popup pop;
|
||||
private JComponent showDate;
|
||||
|
||||
public static DateChooser getInstance() {
|
||||
return new DateChooser();
|
||||
}
|
||||
|
||||
public static DateChooser getInstance(Date date) {
|
||||
return new DateChooser(date);
|
||||
}
|
||||
|
||||
public static DateChooser getInstance(String format) {
|
||||
return new DateChooser(format);
|
||||
}
|
||||
|
||||
public static DateChooser getInstance(Date date, String format) {
|
||||
return new DateChooser(date, format);
|
||||
}
|
||||
|
||||
private DateChooser() {
|
||||
this(new Date());
|
||||
}
|
||||
|
||||
private DateChooser(Date date) {
|
||||
this(date, "yyyy年MM月dd日");
|
||||
}
|
||||
|
||||
private DateChooser(String format) {
|
||||
this(new Date(), format);
|
||||
}
|
||||
|
||||
private DateChooser(Date date, String format) {
|
||||
this.now = Calendar.getInstance();
|
||||
this.font = new Font("宋体", 0, 12);
|
||||
this.lm = new DateChooser.LabelManager();
|
||||
this.isShow = false;
|
||||
this.initDate = date;
|
||||
this.sdf = new SimpleDateFormat(format);
|
||||
this.select = Calendar.getInstance();
|
||||
this.select.setTime(this.initDate);
|
||||
this.initPanel();
|
||||
}
|
||||
|
||||
public void setEnabled(boolean b) {
|
||||
super.setEnabled(b);
|
||||
this.showDate.setEnabled(b);
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
return this.select.getTime();
|
||||
}
|
||||
|
||||
public String getStrDate() {
|
||||
return this.sdf.format(this.select.getTime());
|
||||
}
|
||||
|
||||
public String getStrDate(String format) {
|
||||
this.sdf = new SimpleDateFormat(format);
|
||||
return this.sdf.format(this.select.getTime());
|
||||
}
|
||||
|
||||
private void initPanel() {
|
||||
this.monthPanel = new JPanel(new BorderLayout());
|
||||
this.monthPanel.setBorder(BorderFactory.createLineBorder(Color.BLUE));
|
||||
JPanel up = new JPanel(new BorderLayout());
|
||||
up.add(this.jp1 = new DateChooser.JP1(), "North");
|
||||
up.add(this.jp2 = new DateChooser.JP2(), "Center");
|
||||
this.monthPanel.add(this.jp3 = new DateChooser.JP3(), "Center");
|
||||
this.monthPanel.add(up, "North");
|
||||
this.monthPanel.add(this.jp4 = new DateChooser.JP4(), "South");
|
||||
this.addAncestorListener(new AncestorListener() {
|
||||
public void ancestorAdded(AncestorEvent event) {
|
||||
}
|
||||
|
||||
public void ancestorRemoved(AncestorEvent event) {
|
||||
}
|
||||
|
||||
public void ancestorMoved(AncestorEvent event) {
|
||||
DateChooser.this.hidePanel();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void register(final JComponent showDate) {
|
||||
this.showDate = showDate;
|
||||
showDate.setRequestFocusEnabled(true);
|
||||
showDate.addMouseListener(new MouseAdapter() {
|
||||
public void mousePressed(MouseEvent me) {
|
||||
showDate.requestFocusInWindow();
|
||||
}
|
||||
});
|
||||
this.setBackground(Color.WHITE);
|
||||
this.add(showDate, "Center");
|
||||
this.setPreferredSize(new Dimension(90, 25));
|
||||
this.setBorder(BorderFactory.createLineBorder(Color.GRAY));
|
||||
showDate.addMouseListener(new MouseAdapter() {
|
||||
public void mouseEntered(MouseEvent me) {
|
||||
if (showDate.isEnabled()) {
|
||||
showDate.setCursor(new Cursor(12));
|
||||
showDate.setForeground(Color.RED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void mouseExited(MouseEvent me) {
|
||||
if (showDate.isEnabled()) {
|
||||
showDate.setCursor(new Cursor(0));
|
||||
showDate.setForeground(Color.BLACK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent me) {
|
||||
if (showDate.isEnabled()) {
|
||||
showDate.setForeground(Color.CYAN);
|
||||
if (DateChooser.this.isShow) {
|
||||
DateChooser.this.hidePanel();
|
||||
} else {
|
||||
DateChooser.this.showPanel(showDate);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void mouseReleased(MouseEvent me) {
|
||||
if (showDate.isEnabled()) {
|
||||
showDate.setForeground(Color.BLACK);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
showDate.addFocusListener(new FocusListener() {
|
||||
public void focusLost(FocusEvent e) {
|
||||
DateChooser.this.hidePanel();
|
||||
}
|
||||
|
||||
public void focusGained(FocusEvent e) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void refresh() {
|
||||
this.jp1.updateDate();
|
||||
this.jp2.updateDate();
|
||||
this.jp3.updateDate();
|
||||
this.jp4.updateDate();
|
||||
SwingUtilities.updateComponentTreeUI(this);
|
||||
}
|
||||
|
||||
private void commit() {
|
||||
if (this.showDate instanceof JTextField) {
|
||||
((JTextField) this.showDate).setText(this.sdf.format(this.select.getTime()));
|
||||
} else if (this.showDate instanceof JLabel) {
|
||||
((JLabel) this.showDate).setText(this.sdf.format(this.select.getTime()));
|
||||
}
|
||||
|
||||
this.hidePanel();
|
||||
}
|
||||
|
||||
private void hidePanel() {
|
||||
if (this.pop != null) {
|
||||
this.isShow = false;
|
||||
this.pop.hide();
|
||||
this.pop = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void showPanel(Component owner) {
|
||||
if (this.pop != null) {
|
||||
this.pop.hide();
|
||||
}
|
||||
|
||||
Point show = new Point(0, this.showDate.getHeight());
|
||||
SwingUtilities.convertPointToScreen(show, this.showDate);
|
||||
Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
int x = show.x;
|
||||
int y = show.y;
|
||||
if (x < 0) {
|
||||
x = 0;
|
||||
}
|
||||
|
||||
if (x > size.width - 295) {
|
||||
x = size.width - 295;
|
||||
}
|
||||
|
||||
if (y >= size.height - 170) {
|
||||
y -= 188;
|
||||
}
|
||||
|
||||
this.pop = PopupFactory.getSharedInstance().getPopup(owner, this.monthPanel, x, y);
|
||||
this.pop.show();
|
||||
this.isShow = true;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
DateChooser dateChooser1 = getInstance("yyyy-MM-dd HH:mm");
|
||||
DateChooser dateChooser2 = getInstance("yyyy-MM-dd");
|
||||
JTextField showDate1 = new JTextField("单击选择日期");
|
||||
JLabel showDate2 = new JLabel("单击选择日期");
|
||||
dateChooser1.register(showDate1);
|
||||
dateChooser2.register(showDate2);
|
||||
JFrame jf = new JFrame("测试日期选择器");
|
||||
jf.add(showDate1, "North");
|
||||
jf.add(showDate2, "South");
|
||||
jf.pack();
|
||||
jf.setLocationRelativeTo((Component) null);
|
||||
jf.setVisible(true);
|
||||
jf.setDefaultCloseOperation(3);
|
||||
}
|
||||
|
||||
private class JP1 extends JPanel {
|
||||
private static final long serialVersionUID = -5638853772805561174L;
|
||||
JLabel yearleft;
|
||||
JLabel yearright;
|
||||
JLabel monthleft;
|
||||
JLabel monthright;
|
||||
JLabel center;
|
||||
JLabel centercontainer;
|
||||
|
||||
public JP1() {
|
||||
super(new BorderLayout());
|
||||
this.setBackground(new Color(160, 185, 215));
|
||||
this.initJP1();
|
||||
}
|
||||
|
||||
private void initJP1() {
|
||||
this.yearleft = new JLabel(" <<", 0);
|
||||
this.yearleft.setToolTipText("上一年");
|
||||
this.yearright = new JLabel(">> ", 0);
|
||||
this.yearright.setToolTipText("下一年");
|
||||
this.yearleft.setBorder(BorderFactory.createEmptyBorder(2, 0, 0, 0));
|
||||
this.yearright.setBorder(BorderFactory.createEmptyBorder(2, 0, 0, 0));
|
||||
this.monthleft = new JLabel(" <", 4);
|
||||
this.monthleft.setToolTipText("上一月");
|
||||
this.monthright = new JLabel("> ", 2);
|
||||
this.monthright.setToolTipText("下一月");
|
||||
this.monthleft.setBorder(BorderFactory.createEmptyBorder(2, 30, 0, 0));
|
||||
this.monthright.setBorder(BorderFactory.createEmptyBorder(2, 0, 0, 30));
|
||||
this.centercontainer = new JLabel("", 0);
|
||||
this.centercontainer.setLayout(new BorderLayout());
|
||||
this.center = new JLabel("", 0);
|
||||
this.centercontainer.add(this.monthleft, "West");
|
||||
this.centercontainer.add(this.center, "Center");
|
||||
this.centercontainer.add(this.monthright, "East");
|
||||
this.add(this.yearleft, "West");
|
||||
this.add(this.centercontainer, "Center");
|
||||
this.add(this.yearright, "East");
|
||||
this.setPreferredSize(new Dimension(295, 25));
|
||||
this.updateDate();
|
||||
this.yearleft.addMouseListener(new MouseAdapter() {
|
||||
public void mouseEntered(MouseEvent me) {
|
||||
JP1.this.yearleft.setCursor(new Cursor(12));
|
||||
JP1.this.yearleft.setForeground(Color.RED);
|
||||
}
|
||||
|
||||
public void mouseExited(MouseEvent me) {
|
||||
JP1.this.yearleft.setCursor(new Cursor(0));
|
||||
JP1.this.yearleft.setForeground(Color.BLACK);
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent me) {
|
||||
DateChooser.this.select.add(1, -1);
|
||||
JP1.this.yearleft.setForeground(Color.WHITE);
|
||||
DateChooser.this.refresh();
|
||||
}
|
||||
|
||||
public void mouseReleased(MouseEvent me) {
|
||||
JP1.this.yearleft.setForeground(Color.BLACK);
|
||||
}
|
||||
});
|
||||
this.yearright.addMouseListener(new MouseAdapter() {
|
||||
public void mouseEntered(MouseEvent me) {
|
||||
JP1.this.yearright.setCursor(new Cursor(12));
|
||||
JP1.this.yearright.setForeground(Color.RED);
|
||||
}
|
||||
|
||||
public void mouseExited(MouseEvent me) {
|
||||
JP1.this.yearright.setCursor(new Cursor(0));
|
||||
JP1.this.yearright.setForeground(Color.BLACK);
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent me) {
|
||||
DateChooser.this.select.add(1, 1);
|
||||
JP1.this.yearright.setForeground(Color.WHITE);
|
||||
DateChooser.this.refresh();
|
||||
}
|
||||
|
||||
public void mouseReleased(MouseEvent me) {
|
||||
JP1.this.yearright.setForeground(Color.BLACK);
|
||||
}
|
||||
});
|
||||
this.monthleft.addMouseListener(new MouseAdapter() {
|
||||
public void mouseEntered(MouseEvent me) {
|
||||
JP1.this.monthleft.setCursor(new Cursor(12));
|
||||
JP1.this.monthleft.setForeground(Color.RED);
|
||||
}
|
||||
|
||||
public void mouseExited(MouseEvent me) {
|
||||
JP1.this.monthleft.setCursor(new Cursor(0));
|
||||
JP1.this.monthleft.setForeground(Color.BLACK);
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent me) {
|
||||
DateChooser.this.select.add(2, -1);
|
||||
JP1.this.monthleft.setForeground(Color.WHITE);
|
||||
DateChooser.this.refresh();
|
||||
}
|
||||
|
||||
public void mouseReleased(MouseEvent me) {
|
||||
JP1.this.monthleft.setForeground(Color.BLACK);
|
||||
}
|
||||
});
|
||||
this.monthright.addMouseListener(new MouseAdapter() {
|
||||
public void mouseEntered(MouseEvent me) {
|
||||
JP1.this.monthright.setCursor(new Cursor(12));
|
||||
JP1.this.monthright.setForeground(Color.RED);
|
||||
}
|
||||
|
||||
public void mouseExited(MouseEvent me) {
|
||||
JP1.this.monthright.setCursor(new Cursor(0));
|
||||
JP1.this.monthright.setForeground(Color.BLACK);
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent me) {
|
||||
DateChooser.this.select.add(2, 1);
|
||||
JP1.this.monthright.setForeground(Color.WHITE);
|
||||
DateChooser.this.refresh();
|
||||
}
|
||||
|
||||
public void mouseReleased(MouseEvent me) {
|
||||
JP1.this.monthright.setForeground(Color.BLACK);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateDate() {
|
||||
this.center.setText(DateChooser.this.select.get(1) + "年" + (DateChooser.this.select.get(2) + 1) + "月");
|
||||
}
|
||||
}
|
||||
|
||||
private class JP2 extends JPanel {
|
||||
private static final long serialVersionUID = -8176264838786175724L;
|
||||
|
||||
public JP2() {
|
||||
this.setPreferredSize(new Dimension(295, 20));
|
||||
}
|
||||
|
||||
protected void paintComponent(Graphics g) {
|
||||
g.setFont(DateChooser.this.font);
|
||||
g.drawString("星期日 星期一 星期二 星期三 星期四 星期五 星期六", 5, 10);
|
||||
g.drawLine(0, 15, this.getWidth(), 15);
|
||||
}
|
||||
|
||||
private void updateDate() {
|
||||
}
|
||||
}
|
||||
|
||||
private class JP3 extends JPanel {
|
||||
private static final long serialVersionUID = 43157272447522985L;
|
||||
|
||||
public JP3() {
|
||||
super(new GridLayout(6, 7));
|
||||
this.setPreferredSize(new Dimension(295, 100));
|
||||
this.initJP3();
|
||||
}
|
||||
|
||||
private void initJP3() {
|
||||
this.updateDate();
|
||||
}
|
||||
|
||||
public void updateDate() {
|
||||
this.removeAll();
|
||||
DateChooser.this.lm.clear();
|
||||
Date temp = DateChooser.this.select.getTime();
|
||||
Calendar select = Calendar.getInstance();
|
||||
select.setTime(temp);
|
||||
select.set(5, 1);
|
||||
int index = select.get(7);
|
||||
int sum = index == 1 ? 8 : index;
|
||||
select.add(5, 0 - sum);
|
||||
|
||||
for (int i = 0; i < 42; ++i) {
|
||||
select.add(5, 1);
|
||||
DateChooser.this.lm.addLabel(DateChooser.this.new MyLabel(select.get(1), select.get(2), select.get(5)));
|
||||
}
|
||||
|
||||
Iterator var6 = DateChooser.this.lm.getLabels().iterator();
|
||||
|
||||
while (var6.hasNext()) {
|
||||
DateChooser.MyLabel my = (DateChooser.MyLabel) var6.next();
|
||||
this.add(my);
|
||||
}
|
||||
|
||||
select.setTime(temp);
|
||||
}
|
||||
}
|
||||
|
||||
private class JP4 extends JPanel {
|
||||
private static final long serialVersionUID = -6391305687575714469L;
|
||||
|
||||
public JP4() {
|
||||
super(new BorderLayout());
|
||||
this.setPreferredSize(new Dimension(295, 20));
|
||||
this.setBackground(new Color(160, 185, 215));
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
|
||||
final JLabel jl = new JLabel("今天: " + sdf.format(new Date()));
|
||||
jl.setToolTipText("点击选择今天日期");
|
||||
this.add(jl, "Center");
|
||||
jl.addMouseListener(new MouseAdapter() {
|
||||
public void mouseEntered(MouseEvent me) {
|
||||
jl.setCursor(new Cursor(12));
|
||||
jl.setForeground(Color.RED);
|
||||
}
|
||||
|
||||
public void mouseExited(MouseEvent me) {
|
||||
jl.setCursor(new Cursor(0));
|
||||
jl.setForeground(Color.BLACK);
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent me) {
|
||||
jl.setForeground(Color.WHITE);
|
||||
DateChooser.this.select.setTime(new Date());
|
||||
DateChooser.this.refresh();
|
||||
DateChooser.this.commit();
|
||||
}
|
||||
|
||||
public void mouseReleased(MouseEvent me) {
|
||||
jl.setForeground(Color.BLACK);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateDate() {
|
||||
}
|
||||
}
|
||||
|
||||
private class LabelManager {
|
||||
private List<DateChooser.MyLabel> list = new ArrayList();
|
||||
|
||||
public LabelManager() {
|
||||
}
|
||||
|
||||
public List<DateChooser.MyLabel> getLabels() {
|
||||
return this.list;
|
||||
}
|
||||
|
||||
public void addLabel(DateChooser.MyLabel my) {
|
||||
this.list.add(my);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
this.list.clear();
|
||||
}
|
||||
|
||||
public void setSelect(DateChooser.MyLabel my, boolean b) {
|
||||
Iterator var4 = this.list.iterator();
|
||||
|
||||
while (var4.hasNext()) {
|
||||
DateChooser.MyLabel m = (DateChooser.MyLabel) var4.next();
|
||||
if (m.equals(my)) {
|
||||
m.setSelected(true, b);
|
||||
} else {
|
||||
m.setSelected(false, b);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setSelect(Point p, boolean b) {
|
||||
if (b) {
|
||||
boolean findPrevious = false;
|
||||
boolean findNext = false;
|
||||
Iterator var6 = this.list.iterator();
|
||||
|
||||
while (var6.hasNext()) {
|
||||
DateChooser.MyLabel mx = (DateChooser.MyLabel) var6.next();
|
||||
if (mx.contains(p)) {
|
||||
findNext = true;
|
||||
if (mx.getIsSelected()) {
|
||||
findPrevious = true;
|
||||
} else {
|
||||
mx.setSelected(true, b);
|
||||
}
|
||||
} else if (mx.getIsSelected()) {
|
||||
findPrevious = true;
|
||||
mx.setSelected(false, b);
|
||||
}
|
||||
|
||||
if (findPrevious && findNext) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
DateChooser.MyLabel temp = null;
|
||||
Iterator var9 = this.list.iterator();
|
||||
|
||||
while (var9.hasNext()) {
|
||||
DateChooser.MyLabel m = (DateChooser.MyLabel) var9.next();
|
||||
if (m.contains(p)) {
|
||||
temp = m;
|
||||
} else if (m.getIsSelected()) {
|
||||
m.setSelected(false, b);
|
||||
}
|
||||
}
|
||||
|
||||
if (temp != null) {
|
||||
temp.setSelected(true, b);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private class MyLabel extends JLabel
|
||||
implements Comparator<DateChooser.MyLabel>, MouseListener, MouseMotionListener {
|
||||
private static final long serialVersionUID = 3668734399227577214L;
|
||||
private int year;
|
||||
private int month;
|
||||
private int day;
|
||||
private boolean isSelected;
|
||||
|
||||
public MyLabel(int year, int month, int day) {
|
||||
super("" + day, 0);
|
||||
this.year = year;
|
||||
this.day = day;
|
||||
this.month = month;
|
||||
this.addMouseListener(this);
|
||||
this.addMouseMotionListener(this);
|
||||
this.setFont(DateChooser.this.font);
|
||||
if (month == DateChooser.this.select.get(2)) {
|
||||
this.setForeground(Color.BLACK);
|
||||
} else {
|
||||
this.setForeground(Color.LIGHT_GRAY);
|
||||
}
|
||||
|
||||
if (day == DateChooser.this.select.get(5)) {
|
||||
this.setBackground(new Color(160, 185, 215));
|
||||
} else {
|
||||
this.setBackground(Color.WHITE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean getIsSelected() {
|
||||
return this.isSelected;
|
||||
}
|
||||
|
||||
public void setSelected(boolean b, boolean isDrag) {
|
||||
this.isSelected = b;
|
||||
if (b && !isDrag) {
|
||||
int temp = DateChooser.this.select.get(2);
|
||||
DateChooser.this.select.set(this.year, this.month, this.day);
|
||||
if (temp == this.month) {
|
||||
SwingUtilities.updateComponentTreeUI(DateChooser.this.jp3);
|
||||
} else {
|
||||
DateChooser.this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
protected void paintComponent(Graphics g) {
|
||||
if (this.day == DateChooser.this.select.get(5) && this.month == DateChooser.this.select.get(2)) {
|
||||
g.setColor(new Color(160, 185, 215));
|
||||
g.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
}
|
||||
|
||||
if (this.year == DateChooser.this.now.get(1) && this.month == DateChooser.this.now.get(2)
|
||||
&& this.day == DateChooser.this.now.get(5)) {
|
||||
Graphics2D gdx = (Graphics2D) g;
|
||||
gdx.setColor(Color.RED);
|
||||
Polygon p = new Polygon();
|
||||
p.addPoint(0, 0);
|
||||
p.addPoint(this.getWidth() - 1, 0);
|
||||
p.addPoint(this.getWidth() - 1, this.getHeight() - 1);
|
||||
p.addPoint(0, this.getHeight() - 1);
|
||||
gdx.drawPolygon(p);
|
||||
}
|
||||
|
||||
if (this.isSelected) {
|
||||
Stroke s = new BasicStroke(1.0F, 2, 2, 1.0F, new float[] { 2.0F, 2.0F }, 1.0F);
|
||||
Graphics2D gd = (Graphics2D) g;
|
||||
gd.setStroke(s);
|
||||
gd.setColor(Color.BLACK);
|
||||
Polygon px = new Polygon();
|
||||
px.addPoint(0, 0);
|
||||
px.addPoint(this.getWidth() - 1, 0);
|
||||
px.addPoint(this.getWidth() - 1, this.getHeight() - 1);
|
||||
px.addPoint(0, this.getHeight() - 1);
|
||||
gd.drawPolygon(px);
|
||||
}
|
||||
|
||||
super.paintComponent(g);
|
||||
}
|
||||
|
||||
public boolean contains(Point p) {
|
||||
return this.getBounds().contains(p);
|
||||
}
|
||||
|
||||
private void update() {
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent e) {
|
||||
this.isSelected = true;
|
||||
this.update();
|
||||
}
|
||||
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
Point p = SwingUtilities.convertPoint(this, e.getPoint(), DateChooser.this.jp3);
|
||||
DateChooser.this.lm.setSelect(p, false);
|
||||
DateChooser.this.commit();
|
||||
}
|
||||
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
}
|
||||
|
||||
public void mouseExited(MouseEvent e) {
|
||||
}
|
||||
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
Point p = SwingUtilities.convertPoint(this, e.getPoint(), DateChooser.this.jp3);
|
||||
DateChooser.this.lm.setSelect(p, true);
|
||||
}
|
||||
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
}
|
||||
|
||||
public int compare(DateChooser.MyLabel o1, DateChooser.MyLabel o2) {
|
||||
Calendar c1 = Calendar.getInstance();
|
||||
c1.set(o1.year, o2.month, o1.day);
|
||||
Calendar c2 = Calendar.getInstance();
|
||||
c2.set(o2.year, o2.month, o2.day);
|
||||
return c1.compareTo(c2);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.connor.plm.CostListManagement;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.connor.plm.CreateOuotation.MainApp;
|
||||
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class GuiInitializer {
|
||||
|
||||
public static void initGUI() {
|
||||
try {
|
||||
FXMLLoader loader = new FXMLLoader();
|
||||
loader.setLocation(MainApp.class.getResource("PersonOverview.fxml"));
|
||||
Pane rootLayout = loader.load();
|
||||
Scene scene = new Scene(rootLayout);
|
||||
Stage primaryStage = new Stage();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.connor.plm.CostListManagement;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Toolkit;
|
||||
|
||||
import com.teamcenter.rac.aif.AbstractAIFOperation;
|
||||
import com.teamcenter.rac.kernel.TCComponent;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
|
||||
public class QueryQuotationFram extends AbstractAIFOperation{
|
||||
|
||||
TCSession session;
|
||||
private TCComponent f;
|
||||
public QueryQuotationFram(TCSession session, TCComponent component2) {
|
||||
this.f = component2;
|
||||
this.session = session;
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void executeOperation() throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
// try {
|
||||
// for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
|
||||
// if ("Nimbus".equals(info.getName())) {
|
||||
// javax.swing.UIManager.setLookAndFeel(info.getClassName());
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// } catch (ClassNotFoundException ex) {
|
||||
// java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
// } catch (InstantiationException ex) {
|
||||
// java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
// } catch (IllegalAccessException ex) {
|
||||
// java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
// } catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
||||
// java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
// }
|
||||
//</editor-fold>
|
||||
|
||||
/* Create and display the form */
|
||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
NewJFrame newJFrame = new NewJFrame(session,f);
|
||||
int width2 = newJFrame.getWidth();
|
||||
int height2 = newJFrame.getHeight();
|
||||
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取屏幕尺寸
|
||||
int screenWidth = screenSize.width; // 获取屏幕宽度
|
||||
int screenHeight = screenSize.height; // 获取屏幕高度
|
||||
int x = (screenWidth - width2) / 2; // 计算Frame的左上角x坐标
|
||||
int y = (screenHeight - height2) / 2; // 计算Frame的左上角y坐标
|
||||
newJFrame.setTitle("报价成本单查询");
|
||||
// this.getContentPane().setBackground(Color.red);
|
||||
newJFrame.getContentPane().setBackground(new java.awt.Color(255, 255, 255));
|
||||
newJFrame.setSize(width2, height2); // 设置Frame的大小
|
||||
newJFrame.setLocation(x, y); // 设置Frame的位置
|
||||
newJFrame.setResizable(false);
|
||||
newJFrame.setDefaultCloseOperation(2); // 设置窗口关闭时的默认操作
|
||||
newJFrame.setVisible(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.connor.plm.CostListManagement;
|
||||
|
||||
public class QuotationUtil {
|
||||
|
||||
public static String formatString(String input) {
|
||||
if (input == null || input.length() == 0) {
|
||||
return input;
|
||||
}
|
||||
|
||||
double number = Double.parseDouble(input);
|
||||
if (number == (int) number) {
|
||||
return String.valueOf((int) number);
|
||||
} else {
|
||||
return String.format("%.3f", number).replaceAll("0*$", "").replaceAll("\\.$", "");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,176 @@
|
||||
package com.connor.plm.CostListManagement.pojo;
|
||||
|
||||
public class Cusquotation {
|
||||
private String cbdlx;
|
||||
private String projectid;
|
||||
private String revision;
|
||||
private String proname;
|
||||
private String tennumber;
|
||||
private String promanager;
|
||||
private String quantity;
|
||||
private String tramodel;
|
||||
private String capfactor;
|
||||
private String volratio;
|
||||
private String noloadloss;
|
||||
private String loadloss;
|
||||
private String impvoltage;
|
||||
private String traweight;
|
||||
private String totweight;
|
||||
private String copconsumption;
|
||||
private String cmarketprice;
|
||||
private String vollevel;
|
||||
private String factory;
|
||||
public Cusquotation(String cbdlx, String projectid, String revision, String proname, String tennumber,
|
||||
String promanager, String quantity, String tramodel, String capfactor, String volratio, String noloadloss,
|
||||
String loadloss, String impvoltage, String traweight, String totweight, String copconsumption,
|
||||
String cmarketprice, String vollevel,String factory) {
|
||||
super();
|
||||
this.cbdlx = cbdlx;
|
||||
this.projectid = projectid;
|
||||
this.revision = revision;
|
||||
this.proname = proname;
|
||||
this.tennumber = tennumber;
|
||||
this.promanager = promanager;
|
||||
this.quantity = quantity;
|
||||
this.tramodel = tramodel;
|
||||
this.capfactor = capfactor;
|
||||
this.volratio = volratio;
|
||||
this.noloadloss = noloadloss;
|
||||
this.loadloss = loadloss;
|
||||
this.impvoltage = impvoltage;
|
||||
this.traweight = traweight;
|
||||
this.totweight = totweight;
|
||||
this.copconsumption = copconsumption;
|
||||
this.cmarketprice = cmarketprice;
|
||||
this.vollevel = vollevel;
|
||||
this.factory = factory;
|
||||
}
|
||||
public String getCbdlx() {
|
||||
return cbdlx;
|
||||
}
|
||||
public void setCbdlx(String cbdlx) {
|
||||
this.cbdlx = cbdlx;
|
||||
}
|
||||
public String getProjectid() {
|
||||
return projectid;
|
||||
}
|
||||
public void setProjectid(String projectid) {
|
||||
this.projectid = projectid;
|
||||
}
|
||||
public String getRevision() {
|
||||
return revision;
|
||||
}
|
||||
public void setRevision(String revision) {
|
||||
this.revision = revision;
|
||||
}
|
||||
public String getProname() {
|
||||
return proname;
|
||||
}
|
||||
public void setProname(String proname) {
|
||||
this.proname = proname;
|
||||
}
|
||||
public String getTennumber() {
|
||||
return tennumber;
|
||||
}
|
||||
public void setTennumber(String tennumber) {
|
||||
this.tennumber = tennumber;
|
||||
}
|
||||
public String getPromanager() {
|
||||
return promanager;
|
||||
}
|
||||
public void setPromanager(String promanager) {
|
||||
this.promanager = promanager;
|
||||
}
|
||||
public String getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
public void setQuantity(String quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
public String getTramodel() {
|
||||
return tramodel;
|
||||
}
|
||||
public void setTramodel(String tramodel) {
|
||||
this.tramodel = tramodel;
|
||||
}
|
||||
public String getCapfactor() {
|
||||
return capfactor;
|
||||
}
|
||||
public void setCapfactor(String capfactor) {
|
||||
this.capfactor = capfactor;
|
||||
}
|
||||
public String getVolratio() {
|
||||
return volratio;
|
||||
}
|
||||
public void setVolratio(String volratio) {
|
||||
this.volratio = volratio;
|
||||
}
|
||||
public String getNoloadloss() {
|
||||
return noloadloss;
|
||||
}
|
||||
public void setNoloadloss(String noloadloss) {
|
||||
this.noloadloss = noloadloss;
|
||||
}
|
||||
public String getLoadloss() {
|
||||
return loadloss;
|
||||
}
|
||||
public void setLoadloss(String loadloss) {
|
||||
this.loadloss = loadloss;
|
||||
}
|
||||
public String getImpvoltage() {
|
||||
return impvoltage;
|
||||
}
|
||||
public void setImpvoltage(String impvoltage) {
|
||||
this.impvoltage = impvoltage;
|
||||
}
|
||||
public String getTraweight() {
|
||||
return traweight;
|
||||
}
|
||||
public void setTraweight(String traweight) {
|
||||
this.traweight = traweight;
|
||||
}
|
||||
public String getTotweight() {
|
||||
return totweight;
|
||||
}
|
||||
public void setTotweight(String totweight) {
|
||||
this.totweight = totweight;
|
||||
}
|
||||
public String getCopconsumption() {
|
||||
return copconsumption;
|
||||
}
|
||||
public void setCopconsumption(String copconsumption) {
|
||||
this.copconsumption = copconsumption;
|
||||
}
|
||||
public String getCmarketprice() {
|
||||
return cmarketprice;
|
||||
}
|
||||
public void setCmarketprice(String cmarketprice) {
|
||||
this.cmarketprice = cmarketprice;
|
||||
}
|
||||
public String getVollevel() {
|
||||
return vollevel;
|
||||
}
|
||||
public void setVollevel(String vollevel) {
|
||||
this.vollevel = vollevel;
|
||||
}
|
||||
|
||||
public String getFactory() {
|
||||
return factory;
|
||||
}
|
||||
public void setFactory(String factory) {
|
||||
this.factory = factory;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Cusquotation [cbdlx=" + cbdlx + ", projectid=" + projectid + ", revision=" + revision + ", proname="
|
||||
+ proname + ", tennumber=" + tennumber + ", promanager=" + promanager + ", quantity=" + quantity
|
||||
+ ", tramodel=" + tramodel + ", capfactor=" + capfactor + ", volratio=" + volratio + ", noloadloss="
|
||||
+ noloadloss + ", loadloss=" + loadloss + ", impvoltage=" + impvoltage + ", traweight=" + traweight
|
||||
+ ", totweight=" + totweight + ", copconsumption=" + copconsumption + ", cmarketprice=" + cmarketprice
|
||||
+ ", vollevel=" + vollevel + ", factory=" + factory + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,180 @@
|
||||
package com.connor.plm.CostListManagement.pojo;
|
||||
|
||||
import com.teamcenter.soaictstubs.stringSeq_tHolder;
|
||||
|
||||
public class Quotation {
|
||||
private String technical;
|
||||
private String factory;
|
||||
private String proname;
|
||||
private String tennumber;
|
||||
private String promanager;
|
||||
private String quantity;
|
||||
private String tramodel;
|
||||
private String capfactor;
|
||||
private String volratio;
|
||||
private String noloadloss;
|
||||
private String loadloss;
|
||||
private String impvoltage;
|
||||
private String traweight;
|
||||
private String totweight;
|
||||
private String copconsumption;
|
||||
private String cmarketprice;
|
||||
private String vollevel;
|
||||
private String rectime;
|
||||
private String state;
|
||||
|
||||
|
||||
public Quotation() {
|
||||
super();
|
||||
}
|
||||
public Quotation(String technical, String factory, String proname, String tennumber,
|
||||
String promanager, String quantity, String tramodel, String capfactor, String volratio, String noloadloss,
|
||||
String loadloss, String impvoltage, String traweight, String totweight, String copconsumption,
|
||||
String cmarketprice, String vollevel, String rectime, String state) {
|
||||
super();
|
||||
this.technical = technical;
|
||||
this.factory = factory;
|
||||
this.proname = proname;
|
||||
this.tennumber = tennumber;
|
||||
this.promanager = promanager;
|
||||
this.quantity = quantity;
|
||||
this.tramodel = tramodel;
|
||||
this.capfactor = capfactor;
|
||||
this.volratio = volratio;
|
||||
this.noloadloss = noloadloss;
|
||||
this.loadloss = loadloss;
|
||||
this.impvoltage = impvoltage;
|
||||
this.traweight = traweight;
|
||||
this.totweight = totweight;
|
||||
this.copconsumption = copconsumption;
|
||||
this.cmarketprice = cmarketprice;
|
||||
this.vollevel = vollevel;
|
||||
this.rectime = rectime;
|
||||
this.state = state;
|
||||
}
|
||||
public String getTechnical() {
|
||||
return technical;
|
||||
}
|
||||
public void setTechnical(String technical) {
|
||||
this.technical = technical;
|
||||
}
|
||||
public String getFactory() {
|
||||
return factory;
|
||||
}
|
||||
public void setFactory(String factory) {
|
||||
this.factory = factory;
|
||||
}
|
||||
public String getProname() {
|
||||
return proname;
|
||||
}
|
||||
public void setProname(String proname) {
|
||||
this.proname = proname;
|
||||
}
|
||||
public String getTennumber() {
|
||||
return tennumber;
|
||||
}
|
||||
public void setTennumber(String tennumber) {
|
||||
this.tennumber = tennumber;
|
||||
}
|
||||
public String getPromanager() {
|
||||
return promanager;
|
||||
}
|
||||
public void setPromanager(String promanager) {
|
||||
this.promanager = promanager;
|
||||
}
|
||||
public String getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
public void setQuantity(String quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
public String getTramodel() {
|
||||
return tramodel;
|
||||
}
|
||||
public void setTramodel(String tramodel) {
|
||||
this.tramodel = tramodel;
|
||||
}
|
||||
public String getCapfactor() {
|
||||
return capfactor;
|
||||
}
|
||||
public void setCapfactor(String capfactor) {
|
||||
this.capfactor = capfactor;
|
||||
}
|
||||
public String getVolratio() {
|
||||
return volratio;
|
||||
}
|
||||
public void setVolratio(String volratio) {
|
||||
this.volratio = volratio;
|
||||
}
|
||||
public String getNoloadloss() {
|
||||
return noloadloss;
|
||||
}
|
||||
public void setNoloadloss(String noloadloss) {
|
||||
this.noloadloss = noloadloss;
|
||||
}
|
||||
public String getLoadloss() {
|
||||
return loadloss;
|
||||
}
|
||||
public void setLoadloss(String loadloss) {
|
||||
this.loadloss = loadloss;
|
||||
}
|
||||
public String getImpvoltage() {
|
||||
return impvoltage;
|
||||
}
|
||||
public void setImpvoltage(String impvoltage) {
|
||||
this.impvoltage = impvoltage;
|
||||
}
|
||||
public String getTraweight() {
|
||||
return traweight;
|
||||
}
|
||||
public void setTraweight(String traweight) {
|
||||
this.traweight = traweight;
|
||||
}
|
||||
public String getTotweight() {
|
||||
return totweight;
|
||||
}
|
||||
public void setTotweight(String totweight) {
|
||||
this.totweight = totweight;
|
||||
}
|
||||
public String getCopconsumption() {
|
||||
return copconsumption;
|
||||
}
|
||||
public void setCopconsumption(String copconsumption) {
|
||||
this.copconsumption = copconsumption;
|
||||
}
|
||||
public String getCmarketprice() {
|
||||
return cmarketprice;
|
||||
}
|
||||
public void setCmarketprice(String cmarketprice) {
|
||||
this.cmarketprice = cmarketprice;
|
||||
}
|
||||
public String getVollevel() {
|
||||
return vollevel;
|
||||
}
|
||||
public void setVollevel(String vollevel) {
|
||||
this.vollevel = vollevel;
|
||||
}
|
||||
public String getRectime() {
|
||||
return rectime;
|
||||
}
|
||||
public void setRectime(String rectime) {
|
||||
this.rectime = rectime;
|
||||
}
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Quotation [technical=" + technical + ", totalprice=" + ", factory=" + factory
|
||||
+ ", proname=" + proname + ", tennumber=" + tennumber + ", promanager=" + promanager + ", quantity="
|
||||
+ quantity + ", tramodel=" + tramodel + ", capfactor=" + capfactor + ", volratio=" + volratio
|
||||
+ ", noloadloss=" + noloadloss + ", loadloss=" + loadloss + ", impvoltage=" + impvoltage
|
||||
+ ", traweight=" + traweight + ", totweight=" + totweight + ", copconsumption=" + copconsumption
|
||||
+ ", cmarketprice=" + cmarketprice + ", vollevel=" + vollevel + ", rectime=" + rectime + ", state="
|
||||
+ state + "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,298 @@
|
||||
package com.connor.plm.CostListManagement.pojo;
|
||||
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
public class QuotationMX {
|
||||
private String cbdlx;
|
||||
private String projectid;
|
||||
private String revision;
|
||||
private SimpleStringProperty matgroup;
|
||||
private SimpleStringProperty mgsnumber;
|
||||
private SimpleStringProperty materialNameColumn;
|
||||
private SimpleStringProperty matcnumber;
|
||||
private SimpleStringProperty relatedMaterialColumn;
|
||||
private SimpleStringProperty specificationColumn;
|
||||
private SimpleStringProperty manufacturerColumn;
|
||||
private SimpleStringProperty quantityColumn;
|
||||
private SimpleStringProperty utilizationRateColumn;
|
||||
private SimpleStringProperty unitColumn;
|
||||
private SimpleStringProperty amomoney;
|
||||
private SimpleStringProperty unitPriceColumn;
|
||||
private SimpleStringProperty no;
|
||||
private SimpleStringProperty totalprice;
|
||||
private SimpleStringProperty contrastPrice;
|
||||
public QuotationMX() {
|
||||
super();
|
||||
}
|
||||
|
||||
public String getCbdlx() {
|
||||
return cbdlx;
|
||||
}
|
||||
|
||||
public String getContrastPrice() {
|
||||
return contrastPrice.get();
|
||||
}
|
||||
|
||||
|
||||
public void setContrastPrice(SimpleStringProperty contrastPrice) {
|
||||
this.contrastPrice = contrastPrice;
|
||||
}
|
||||
|
||||
public void setCbdlx(String cbdlx) {
|
||||
this.cbdlx = cbdlx;
|
||||
}
|
||||
|
||||
public String getProjectid() {
|
||||
return projectid;
|
||||
}
|
||||
|
||||
public void setProjectid(String projectid) {
|
||||
this.projectid = projectid;
|
||||
}
|
||||
|
||||
|
||||
public String getRevision() {
|
||||
return revision;
|
||||
}
|
||||
|
||||
public void setRevision(String revision) {
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getMatgroup() {
|
||||
return matgroup.get();
|
||||
}
|
||||
|
||||
|
||||
public void setMatgroup(SimpleStringProperty matgroup) {
|
||||
this.matgroup = matgroup;
|
||||
}
|
||||
|
||||
|
||||
public String getMgsnumber() {
|
||||
return mgsnumber.get();
|
||||
}
|
||||
|
||||
|
||||
public void setMgsnumber(SimpleStringProperty mgsnumber) {
|
||||
this.mgsnumber = mgsnumber;
|
||||
}
|
||||
|
||||
public String getMatcname() {
|
||||
return materialNameColumn.get();
|
||||
}
|
||||
|
||||
public void setMatcname(SimpleStringProperty matcname) {
|
||||
this.materialNameColumn = matcname;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getMatcnumber() {
|
||||
return matcnumber.get();
|
||||
}
|
||||
|
||||
public void setMatcnumber(SimpleStringProperty matcnumber) {
|
||||
this.matcnumber = matcnumber;
|
||||
}
|
||||
|
||||
|
||||
public String getMatcatname() {
|
||||
return relatedMaterialColumn.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setMatcatname(SimpleStringProperty matcatname) {
|
||||
this.relatedMaterialColumn = matcatname;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getSpecifications() {
|
||||
return specificationColumn.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setSpecifications(SimpleStringProperty specifications) {
|
||||
this.specificationColumn = specifications;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getManufacturer() {
|
||||
return manufacturerColumn.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setManufacturer(SimpleStringProperty manufacturer) {
|
||||
this.manufacturerColumn = manufacturer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getNwquantity() {
|
||||
return quantityColumn.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setNwquantity(SimpleStringProperty nwquantity) {
|
||||
this.quantityColumn = nwquantity;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getUtirate() {
|
||||
return utilizationRateColumn.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setUtirate(SimpleStringProperty utirate) {
|
||||
this.utilizationRateColumn = utirate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getUnit() {
|
||||
return unitColumn.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setUnit(SimpleStringProperty unit) {
|
||||
this.unitColumn = unit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getAmomoney() {
|
||||
return amomoney.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setAmomoney(SimpleStringProperty amomoney) {
|
||||
this.amomoney = amomoney;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getUnitprice() {
|
||||
return unitPriceColumn.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setUnitprice(SimpleStringProperty unitprice) {
|
||||
this.unitPriceColumn = unitprice;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getNo() {
|
||||
return no.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setNo(SimpleStringProperty no) {
|
||||
this.no = no;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getTotalprice() {
|
||||
return totalprice.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setTotalprice(SimpleStringProperty totalprice) {
|
||||
this.totalprice = totalprice;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QuotationMX [matgroup=" + matgroup + ", mgsnumber=" + mgsnumber
|
||||
+ ", matcname=" + materialNameColumn + ", matcnumber=" + matcnumber + ", matcatname=" + relatedMaterialColumn
|
||||
+ ", specifications=" + specificationColumn + ", manufacturer=" + manufacturerColumn + ", nwquantity=" + quantityColumn
|
||||
+ ", utirate=" + utilizationRateColumn + ", unit=" + unitColumn + ", amomoney=" + amomoney + ", unitprice=" + unitPriceColumn
|
||||
+ ", no=" + no + ", totalprice=" + totalprice + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
package com.connor.plm.CreateOuotation;
|
||||
|
||||
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.event.Event;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.control.TableCell;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableColumn.CellEditEvent;
|
||||
import javafx.scene.control.TablePosition;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.util.converter.DefaultStringConverter;
|
||||
import javafx.util.converter.IntegerStringConverter;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Objects;
|
||||
|
||||
public class EditingCell<T> extends TableCell<T, String> {
|
||||
private TextField textField;
|
||||
|
||||
public EditingCell() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startEdit() {
|
||||
if (!isEmpty()) {
|
||||
super.startEdit();
|
||||
createTextField();
|
||||
setText(null);
|
||||
setGraphic(textField);
|
||||
textField.selectAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelEdit() {
|
||||
super.cancelEdit();
|
||||
|
||||
setText(getItem());
|
||||
setGraphic(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateItem(String item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
if (empty) {
|
||||
setText(null);
|
||||
setGraphic(null);
|
||||
} else {
|
||||
if (isEditing()) {
|
||||
if (textField != null) {
|
||||
textField.setText(getString());
|
||||
}
|
||||
setText(null);
|
||||
setGraphic(textField);
|
||||
} else {
|
||||
setText(getString());
|
||||
setGraphic(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commitEdit(String newValue) {
|
||||
if (!isEditing() && !Objects.equals(newValue, getItem())) {
|
||||
TableView<T> table = getTableView();
|
||||
if (table != null) {
|
||||
TableColumn<T, String> col = getTableColumn();
|
||||
CellEditEvent<T, String> event = new CellEditEvent<>(table,
|
||||
new TablePosition<>(table, getIndex(), col),
|
||||
TableColumn.editCommitEvent(), newValue);
|
||||
Event.fireEvent(col, event);
|
||||
System.out.println("开始利用反射将数据写入对象");
|
||||
T item = getTableView().getItems().get(getIndex());
|
||||
String property = col.getId();
|
||||
Class<?> type = getItemFieldType(item, property);
|
||||
Object convertedValue = convertValue(newValue, type);
|
||||
setItemProperty(item, property, convertedValue);
|
||||
}
|
||||
}
|
||||
|
||||
super.commitEdit(newValue);
|
||||
updateItem(newValue, false);
|
||||
}
|
||||
|
||||
private void setItemProperty(T item, String property, Object value) {
|
||||
try {
|
||||
Field field = item.getClass().getDeclaredField(property);
|
||||
field.setAccessible(true);
|
||||
field.set(item, value);
|
||||
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private Object convertValue(String value, Class<?> type) {
|
||||
if(type == SimpleStringProperty.class) {
|
||||
return new SimpleStringProperty(value);
|
||||
}else if (type == String.class) {
|
||||
return value;
|
||||
} else if (type == Integer.class) {
|
||||
return new IntegerStringConverter().fromString(value);
|
||||
} else if (type == Double.class) {
|
||||
return new DefaultStringConverter().fromString(value);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Class<?> getItemFieldType(T item, String property) {
|
||||
try {
|
||||
Field field = item.getClass().getDeclaredField(property);
|
||||
return field.getType();
|
||||
} catch (NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void createTextField() {
|
||||
textField = new TextField(getString());
|
||||
System.out.println("可读写模式");
|
||||
textField.setAlignment(Pos.CENTER);
|
||||
textField.setMinWidth(getWidth() - getGraphicTextGap() * 2);
|
||||
textField.focusedProperty().addListener((ob, old, now) -> {
|
||||
if (!now) {
|
||||
commitEdit(textField.getText());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private String getString() {
|
||||
return getItem() == null ? "" : getItem();
|
||||
}
|
||||
}
|
@ -0,0 +1,137 @@
|
||||
package com.connor.plm.CreateOuotation;
|
||||
|
||||
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.event.Event;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.control.TableCell;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableColumn.CellEditEvent;
|
||||
import javafx.scene.control.TablePosition;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.util.converter.DefaultStringConverter;
|
||||
import javafx.util.converter.IntegerStringConverter;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Objects;
|
||||
|
||||
public class EditingCellOR<T> extends TableCell<T, String> {
|
||||
private TextField textField;
|
||||
|
||||
public EditingCellOR() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startEdit() {
|
||||
if (!isEmpty()) {
|
||||
super.startEdit();
|
||||
createTextField();
|
||||
setText(null);
|
||||
setGraphic(textField);
|
||||
textField.selectAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelEdit() {
|
||||
super.cancelEdit();
|
||||
|
||||
setText(getItem());
|
||||
setGraphic(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateItem(String item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
if (empty) {
|
||||
setText(null);
|
||||
setGraphic(null);
|
||||
} else {
|
||||
if (isEditing()) {
|
||||
if (textField != null) {
|
||||
textField.setText(getString());
|
||||
}
|
||||
setText(null);
|
||||
setGraphic(textField);
|
||||
} else {
|
||||
setText(getString());
|
||||
setGraphic(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commitEdit(String newValue) {
|
||||
if (!isEditing() && !Objects.equals(newValue, getItem())) {
|
||||
TableView<T> table = getTableView();
|
||||
if (table != null) {
|
||||
TableColumn<T, String> col = getTableColumn();
|
||||
CellEditEvent<T, String> event = new CellEditEvent<>(table,
|
||||
new TablePosition<>(table, getIndex(), col),
|
||||
TableColumn.editCommitEvent(), newValue);
|
||||
Event.fireEvent(col, event);
|
||||
System.out.println("开始利用反射将数据写入对象");
|
||||
T item = getTableView().getItems().get(getIndex());
|
||||
String property = col.getId();
|
||||
Class<?> type = getItemFieldType(item, property);
|
||||
Object convertedValue = convertValue(newValue, type);
|
||||
setItemProperty(item, property, convertedValue);
|
||||
}
|
||||
}
|
||||
|
||||
super.commitEdit(newValue);
|
||||
updateItem(newValue, false);
|
||||
}
|
||||
|
||||
private void setItemProperty(T item, String property, Object value) {
|
||||
try {
|
||||
Field field = item.getClass().getDeclaredField(property);
|
||||
field.setAccessible(true);
|
||||
field.set(item, value);
|
||||
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private Object convertValue(String value, Class<?> type) {
|
||||
if(type == SimpleStringProperty.class) {
|
||||
return new SimpleStringProperty(value);
|
||||
}else if (type == String.class) {
|
||||
return value;
|
||||
} else if (type == Integer.class) {
|
||||
return new IntegerStringConverter().fromString(value);
|
||||
} else if (type == Double.class) {
|
||||
return new DefaultStringConverter().fromString(value);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Class<?> getItemFieldType(T item, String property) {
|
||||
try {
|
||||
Field field = item.getClass().getDeclaredField(property);
|
||||
return field.getType();
|
||||
} catch (NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void createTextField() {
|
||||
textField = new TextField(getString());
|
||||
System.out.println("只读模式");
|
||||
textField.setEditable(false);
|
||||
textField.setAlignment(Pos.CENTER);
|
||||
textField.setMinWidth(getWidth() - getGraphicTextGap() * 2);
|
||||
textField.focusedProperty().addListener((ob, old, now) -> {
|
||||
if (!now) {
|
||||
commitEdit(textField.getText());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private String getString() {
|
||||
return getItem() == null ? "" : getItem();
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.connor.plm.CreateOuotation;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Toolkit;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
|
||||
import com.connor.chint.JDBPackage.KFrame;
|
||||
import com.connor.plm.CostListManagement.pojo.Quotation;
|
||||
|
||||
import javafx.embed.swing.JFXPanel;
|
||||
import javafx.scene.Scene;
|
||||
|
||||
public class JDBFrame extends KFrame{
|
||||
private Quotation quotation;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void initUI() throws Exception {
|
||||
this.setTitle("变压器投标成本单");
|
||||
this.setLayout(new BorderLayout());
|
||||
this.setPreferredSize(new Dimension(1350, 850));
|
||||
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取屏幕尺寸
|
||||
int screenWidth = screenSize.width; // 获取屏幕宽度
|
||||
int screenHeight = screenSize.height; // 获取屏幕高度
|
||||
int x = (screenWidth - 1350) / 2; // 计算Frame的左上角x坐标
|
||||
int y = (screenHeight - 850) / 2; // 计算Frame的左上角y坐标
|
||||
this.setLocation(x, y); // 设置Frame的位置
|
||||
JFXPanel panel = new JFXPanel();
|
||||
panel.setScene(new JDBfxPanel(this).getScene());
|
||||
this.add(BorderLayout.CENTER, panel);
|
||||
// this.setResizable(false);
|
||||
this.setAlwaysOnTop(true);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.connor.plm.CreateOuotation;
|
||||
import java.awt.Window;
|
||||
|
||||
import com.connor.plm.CostListManagement.pojo.Quotation;
|
||||
public class JDBfxPanel extends KFXPanel{
|
||||
private Quotation quotation;
|
||||
public JDBfxPanel(Window dialog) {
|
||||
super(dialog);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
package com.connor.plm.CreateOuotation;
|
||||
|
||||
import com.connor.plm.CostListManagement.pojo.Quotation;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
import java.awt.Window;
|
||||
import javafx.application.Application;
|
||||
import javafx.application.Platform;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.stage.Stage;
|
||||
//import sun.util.logging.PlatformLogger;
|
||||
|
||||
public abstract class KFXPanel extends Application {
|
||||
protected Scene scene;
|
||||
|
||||
protected KFXPanelController aifController;
|
||||
|
||||
protected Parent root;
|
||||
|
||||
protected String cssForm;
|
||||
|
||||
protected Window parentDialog;
|
||||
|
||||
private FXMLLoader fxmlLoader;
|
||||
|
||||
|
||||
|
||||
|
||||
static {
|
||||
Platform.setImplicitExit(false);
|
||||
// Logging.getCSSLogger().setLevel(Platform.class...STYLESHEET_CASPIAN....Level.OFF);
|
||||
}
|
||||
|
||||
public KFXPanel(Window dialog) {
|
||||
setParentDialog(dialog);
|
||||
initUI();
|
||||
initData();
|
||||
}
|
||||
|
||||
public KFXPanel(Window dialog, Class<?> c, String css) {
|
||||
setParentDialog(dialog);
|
||||
this.cssForm = c.getResource(css).toExternalForm();
|
||||
initUI();
|
||||
initData();
|
||||
}
|
||||
|
||||
public void setParentDialog(Window dialog) {
|
||||
this.parentDialog = dialog;
|
||||
}
|
||||
|
||||
public Window getParentDialog() {
|
||||
return this.parentDialog;
|
||||
}
|
||||
|
||||
public Parent getRoot() {
|
||||
return this.root;
|
||||
}
|
||||
|
||||
public KFXPanelController getController() {
|
||||
return this.aifController;
|
||||
}
|
||||
|
||||
public Scene getScene() {
|
||||
if (this.scene == null) {
|
||||
this.scene = new Scene(this.root);
|
||||
this.scene.setFill(null);
|
||||
}
|
||||
return this.scene;
|
||||
}
|
||||
|
||||
public void initData() {
|
||||
try {
|
||||
this.aifController.initData(this);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
post(this.parentDialog, e.getMessage(), "", 1);
|
||||
}
|
||||
}
|
||||
|
||||
protected void initUI() {
|
||||
try {
|
||||
fxmlLoader = new FXMLLoader();
|
||||
String resource = "PersonOverview.fxml";
|
||||
fxmlLoader.setLocation(getClass().getResource(resource));
|
||||
root = fxmlLoader.load();
|
||||
|
||||
this.aifController = (KFXPanelController)fxmlLoader.getController();
|
||||
if (this.cssForm != null)
|
||||
this.root.getStylesheets().add(this.cssForm);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
post(this.parentDialog, e.getMessage(), "", 1);
|
||||
}
|
||||
}
|
||||
|
||||
public static void post(Window dialog, final String msg, final String title, int msgType) {
|
||||
if (dialog == null) {
|
||||
Platform.runLater(new Runnable() {
|
||||
public void run() {
|
||||
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
||||
alert.setTitle(title);
|
||||
alert.setHeaderText("");
|
||||
alert.setContentText(msg);
|
||||
alert.showAndWait();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
MessageBox.post(dialog, msg, title, msgType);
|
||||
}
|
||||
}
|
||||
// protected Stage primaryStage;
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
initUI();
|
||||
initData();
|
||||
// this.primaryStage = primaryStage;
|
||||
primaryStage.setScene(getScene());
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.connor.plm.CreateOuotation;
|
||||
|
||||
|
||||
import com.connor.plm.CostListManagement.pojo.Quotation;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
|
||||
public abstract class KFXPanelController {
|
||||
@FXML
|
||||
protected AnchorPane coverPane;
|
||||
|
||||
public abstract void initData(KFXPanel paramKFXPanel) throws Exception;
|
||||
|
||||
public void setCoverVisible(final boolean visible) {
|
||||
if (this.coverPane != null) {
|
||||
Platform.runLater(new Runnable() {
|
||||
public void run() {
|
||||
KFXPanelController.this.coverPane.setVisible(visible);
|
||||
}
|
||||
});
|
||||
try {
|
||||
Thread.sleep(10L);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.connor.plm.CreateOuotation;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.application.Platform;
|
||||
import javafx.embed.swing.JFXPanel;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class MainApp extends Application {
|
||||
|
||||
private Stage primaryStage;
|
||||
private Pane rootLayout;
|
||||
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
try {
|
||||
System.out.println("1");
|
||||
this.primaryStage = primaryStage;
|
||||
this.primaryStage.setTitle("±äѹÆ÷Ͷ±ê³É±¾µ¥");
|
||||
FXMLLoader loader = new FXMLLoader();
|
||||
loader.setLocation(MainApp.class.getResource("PersonOverview.fxml"));
|
||||
rootLayout = loader.load();
|
||||
Scene scene = new Scene(rootLayout);
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,157 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.ComboBox?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.BorderPane?>
|
||||
<?import javafx.scene.layout.ColumnConstraints?>
|
||||
<?import javafx.scene.layout.FlowPane?>
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
|
||||
<AnchorPane fx:id="coverPane" prefHeight="842.0" prefWidth="1326.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.connor.plm.CreateOuotation.MyController">
|
||||
<children>
|
||||
<GridPane fx:id="gridPane" layoutX="14.0" layoutY="108.0" prefHeight="189.0" prefWidth="1302.0" style="-fx-border-color: gray; -fx-border-width: 0.5px; -fx-border-radius: 5px;" AnchorPane.leftAnchor="9.0" AnchorPane.rightAnchor="10.0">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Label fx:id="projectNameLabel" prefHeight="20.0" prefWidth="83.0" text="项目名称:" />
|
||||
<TextField fx:id="projectNameTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" />
|
||||
<Label fx:id="transformerModelLabel" prefHeight="20.0" prefWidth="83.0" text="变压器型号:" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="transformerModelTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||
<Label fx:id="noLoadLossLabel" prefHeight="20.0" prefWidth="83.0" text="空载损耗:" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="noLoadLossTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
||||
<Label fx:id="loadLossLabel" prefHeight="20.0" prefWidth="120.0" text="负载损耗(KW):" GridPane.rowIndex="3" />
|
||||
<TextField fx:id="loadLossTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" GridPane.rowIndex="3" />
|
||||
<Label fx:id="biddingNumberLabel" prefHeight="20.0" prefWidth="83.0" text="投标编号:" GridPane.columnIndex="2" />
|
||||
<Label fx:id="capacityRatioLabel" prefHeight="20.0" prefWidth="120.0" text="容量比(MVA):" GridPane.columnIndex="2" GridPane.rowIndex="1" />
|
||||
<Label fx:id="impedanceVoltageLabel" prefHeight="20.0" prefWidth="83.0" text="阻抗电压:" GridPane.columnIndex="2" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="biddingNumberTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="3" />
|
||||
<TextField fx:id="capacityRatioTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="3" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="impedanceVoltageTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="3" GridPane.rowIndex="2" />
|
||||
<Label fx:id="projectManagerLabel" prefHeight="20.0" prefWidth="83.0" text="项目经理:" GridPane.columnIndex="4" />
|
||||
<Label fx:id="voltageRatioLabel" prefHeight="20.0" prefWidth="83.0" text="电压比(kV):" GridPane.columnIndex="4" GridPane.rowIndex="1" />
|
||||
<Label fx:id="transportationWeightLabel" prefHeight="20.0" prefWidth="83.0" text="运输重(t):" GridPane.columnIndex="4" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="projectManagerTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="5" />
|
||||
<TextField fx:id="voltageRatioTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="5" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="transportationWeightTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="5" GridPane.rowIndex="2" />
|
||||
<Label fx:id="quantityLabel" prefHeight="20.0" prefWidth="83.0" text="数量:" GridPane.columnIndex="6" />
|
||||
<TextField fx:id="quantityTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="7" />
|
||||
<Label fx:id="totalWeightLabel" prefHeight="20.0" prefWidth="83.0" text="总重(t):" GridPane.columnIndex="6" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="totalWeightTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="7" GridPane.rowIndex="2" />
|
||||
</children>
|
||||
<padding>
|
||||
<Insets right="15.0" />
|
||||
</padding>
|
||||
</GridPane>
|
||||
<FlowPane fx:id="buttonPane" alignment="CENTER_RIGHT" hgap="40.0" layoutX="618.0" layoutY="766.0" prefHeight="60.0" prefWidth="698.0" AnchorPane.bottomAnchor="1.0" AnchorPane.rightAnchor="10.0">
|
||||
<children>
|
||||
<Button fx:id="saveButton" mnemonicParsing="false" prefWidth="100.0" text="保存" />
|
||||
<Button fx:id="calculateButton" mnemonicParsing="false" prefWidth="100.0" text="计算金额" />
|
||||
<Button fx:id="selectComparisonButton" mnemonicParsing="false" prefWidth="100.0" text="选择对比" />
|
||||
<Button fx:id="compareButton" mnemonicParsing="false" prefWidth="100.0" text="对比" />
|
||||
</children>
|
||||
<padding>
|
||||
<Insets right="30.0" />
|
||||
</padding>
|
||||
</FlowPane>
|
||||
<BorderPane fx:id="tablePane" layoutX="14.0" layoutY="365.0" prefHeight="379.0" prefWidth="1302.0" AnchorPane.bottomAnchor="80.0" AnchorPane.leftAnchor="9.0" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="350.0">
|
||||
<center>
|
||||
<TableView fx:id="materialsTable" prefHeight="320.0" prefWidth="1302.0" BorderPane.alignment="CENTER">
|
||||
<columns>
|
||||
<TableColumn fx:id="no" prefWidth="75.0" />
|
||||
<TableColumn fx:id="materialNameColumn" prefWidth="126.0" text="材料名称" />
|
||||
<TableColumn fx:id="relatedMaterialColumn" prefWidth="122.0" text="材料名称" />
|
||||
<TableColumn fx:id="specificationColumn" prefWidth="250.0" text="规格" />
|
||||
<TableColumn fx:id="manufacturerColumn" minWidth="0.0" prefWidth="203.0" text="制造厂商" />
|
||||
<TableColumn fx:id="quantityColumn" prefWidth="91.0" text="数量(净重)" />
|
||||
<TableColumn fx:id="utilizationRateColumn" prefWidth="69.0" text="利用率" />
|
||||
<TableColumn fx:id="unitColumn" prefWidth="70.0" text="单位" />
|
||||
<TableColumn fx:id="unitPriceColumn" prefWidth="86.0" text="单价(元)" />
|
||||
<TableColumn fx:id="amountColumn" prefWidth="94.0" text="金额(元)" />
|
||||
<TableColumn fx:id="comparedResultColumn" prefWidth="115.0" text="对比结果(元)" />
|
||||
</columns>
|
||||
</TableView>
|
||||
</center>
|
||||
<bottom>
|
||||
<BorderPane fx:id="bordPane" prefHeight="60.0" prefWidth="314.0" BorderPane.alignment="CENTER">
|
||||
<center>
|
||||
<FlowPane alignment="CENTER_RIGHT" prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<Label prefWidth="86.0" text=" 总价:" />
|
||||
<TextField fx:id="totalPriceTextField" prefHeight="30.0" prefWidth="131.0" />
|
||||
</children>
|
||||
</FlowPane>
|
||||
</center>
|
||||
<bottom>
|
||||
<FlowPane alignment="CENTER_RIGHT" prefHeight="50.0" prefWidth="314.0" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<Label text="总价对比结果:" />
|
||||
<TextField fx:id="totalPriceCompareTextField" prefHeight="30.0" prefWidth="131.0" />
|
||||
</children>
|
||||
</FlowPane>
|
||||
</bottom>
|
||||
<padding>
|
||||
<Insets top="2.0" />
|
||||
</padding>
|
||||
</BorderPane>
|
||||
</bottom>
|
||||
</BorderPane>
|
||||
<FlowPane alignment="TOP_RIGHT" hgap="40.0" layoutX="160.0" layoutY="26.0" prefHeight="48.0" prefWidth="1151.0" AnchorPane.rightAnchor="10.0">
|
||||
<children>
|
||||
<Label fx:id="costSheetTypeLabel" prefHeight="20.0" prefWidth="83.0" text="成本单类型:" />
|
||||
<ComboBox fx:id="costSheetTypeComboBox" prefHeight="30.0" prefWidth="216.0" />
|
||||
<Label fx:id="editionLabel" prefHeight="20.0" prefWidth="52.0" text="版次:" />
|
||||
<ComboBox fx:id="editionComboBox" prefWidth="100.0" />
|
||||
<Label fx:id="comparedCostSheetLabel" prefHeight="20.0" prefWidth="113.0" text="要对比的成本单:" />
|
||||
<TextField fx:id="comparedCostSheetTextField" prefHeight="30.0" prefWidth="200.0" />
|
||||
</children>
|
||||
</FlowPane>
|
||||
<GridPane fx:id="centerPane" layoutX="14.0" layoutY="304.0" prefHeight="48.0" prefWidth="1297.0" style="-fx-border-color: gray; -fx-border-width: 0.5px; -fx-border-radius: 5px;" AnchorPane.leftAnchor="9.0" AnchorPane.rightAnchor="10.0">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Label fx:id="copperAmountLabel" prefHeight="20.0" prefWidth="83.0" text="用铜量(kg):" />
|
||||
<TextField fx:id="copperAmountTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" />
|
||||
<Label fx:id="copperMarketPriceLabel" prefHeight="20.0" prefWidth="139.0" text="铜价市场价(元/kg):" GridPane.columnIndex="2" />
|
||||
<TextField fx:id="copperMarketPriceTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="3" />
|
||||
<Label fx:id="voltageLevelLabel" prefHeight="20.0" prefWidth="74.0" text="电压等级:" GridPane.columnIndex="4" />
|
||||
<TextField fx:id="voltageLevelTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="5" />
|
||||
</children>
|
||||
<padding>
|
||||
<Insets right="15.0" />
|
||||
</padding>
|
||||
</GridPane>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets bottom="30.0" left="5.0" right="5.0" top="10.0" />
|
||||
</padding>
|
||||
</AnchorPane>
|
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import java.lang.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.ComboBox?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
|
||||
<AnchorPane fx:id="coverPane" prefHeight="814.0" prefWidth="1329.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.connor.plm.CreateOuotation.MyController">
|
||||
<children>
|
||||
<Label fx:id="costSheetTypeLabel" layoutX="461.0" layoutY="50.0" prefHeight="20.0" prefWidth="83.0" text="成本单类型:" />
|
||||
<ComboBox fx:id="costSheetTypeComboBox" layoutX="560.0" layoutY="45.0" prefWidth="160.0" />
|
||||
<Label fx:id="editionLabel" layoutX="762.0" layoutY="50.0" prefHeight="20.0" prefWidth="52.0" text="版次:" />
|
||||
<ComboBox fx:id="editionComboBox" layoutX="822.0" layoutY="45.0" prefWidth="100.0" />
|
||||
<Label fx:id="comparedCostSheetLabel" layoutX="957.0" layoutY="50.0" prefHeight="20.0" prefWidth="113.0" text="要对比的成本单:" />
|
||||
<TextField fx:id="comparedCostSheetTextField" layoutX="1093.0" layoutY="45.0" prefHeight="30.0" prefWidth="200.0" />
|
||||
<Pane fx:id="centerPane" layoutX="14.0" layoutY="299.0" prefHeight="48.0" prefWidth="1302.0" style="-fx-border-color: gray; -fx-border-width: 0.5px; -fx-border-radius: 5px;">
|
||||
<children>
|
||||
<Label fx:id="copperAmountLabel" layoutX="25.0" layoutY="14.0" prefHeight="20.0" prefWidth="83.0" text="用铜量(kg):" />
|
||||
<TextField fx:id="copperAmountTextField" layoutX="131.0" layoutY="9.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<Label fx:id="copperMarketPriceLabel" layoutX="375.0" layoutY="14.0" prefHeight="20.0" prefWidth="139.0" text="铜价市场价(元/kg):" />
|
||||
<TextField fx:id="copperMarketPriceTextField" layoutX="533.0" layoutY="9.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<Label fx:id="voltageLevelLabel" layoutX="766.0" layoutY="14.0" prefHeight="20.0" prefWidth="74.0" text="电压等级:" />
|
||||
<TextField fx:id="voltageLevelTextField" layoutX="854.0" layoutY="9.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
</children>
|
||||
</Pane>
|
||||
<Pane fx:id="tablePane" layoutX="14.0" layoutY="365.0" prefHeight="380.0" prefWidth="1302.0">
|
||||
<children>
|
||||
<TableView fx:id="materialsTable" prefHeight="309.0" prefWidth="1302.0">
|
||||
<columns>
|
||||
<TableColumn fx:id="no" prefWidth="75.0" />
|
||||
<TableColumn fx:id="materialNameColumn" prefWidth="126.0" text="材料名称" />
|
||||
<TableColumn fx:id="relatedMaterialColumn" prefWidth="122.0" text="材料名称" />
|
||||
<TableColumn fx:id="specificationColumn" prefWidth="250.0" text="规格" />
|
||||
<TableColumn fx:id="manufacturerColumn" minWidth="0.0" prefWidth="203.0" text="制造厂商" />
|
||||
<TableColumn fx:id="quantityColumn" prefWidth="91.0" text="数量(净重)" />
|
||||
<TableColumn fx:id="utilizationRateColumn" prefWidth="69.0" text="利用率" />
|
||||
<TableColumn fx:id="unitColumn" prefWidth="70.0" text="单位" />
|
||||
<TableColumn fx:id="unitPriceColumn" prefWidth="86.0" text="单价(元)" />
|
||||
<TableColumn fx:id="amountColumn" prefWidth="94.0" text="金额(元)" />
|
||||
<TableColumn fx:id="comparedResultColumn" prefWidth="115.0" text="对比结果(元)" />
|
||||
</columns>
|
||||
</TableView>
|
||||
<BorderPane fx:id="bordPane" layoutX="974.0" layoutY="309.0" prefHeight="60.0" prefWidth="314.0">
|
||||
<center>
|
||||
<FlowPane alignment="CENTER_RIGHT" prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<Label prefWidth="86.0" text=" 总价:" />
|
||||
<TextField fx:id="totalPriceTextField" prefHeight="30.0" prefWidth="131.0" />
|
||||
</children>
|
||||
</FlowPane>
|
||||
</center>
|
||||
<bottom>
|
||||
<FlowPane alignment="CENTER_RIGHT" prefHeight="50.0" prefWidth="314.0" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<Label text="总价对比结果:" />
|
||||
<TextField fx:id="totalPriceCompareTextField" prefHeight="30.0" prefWidth="131.0" />
|
||||
</children>
|
||||
</FlowPane>
|
||||
</bottom>
|
||||
<padding>
|
||||
<Insets top="2.0" />
|
||||
</padding>
|
||||
</BorderPane>
|
||||
</children>
|
||||
</Pane>
|
||||
<Button fx:id="saveButton" layoutX="750.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="保存" />
|
||||
<Button fx:id="calculateButton" layoutX="900.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="计算金额" />
|
||||
<Button fx:id="selectComparisonButton" layoutX="1050.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="选择对比" />
|
||||
<Button fx:id="compareButton" layoutX="1200.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="对比" />
|
||||
<GridPane fx:id="gridPane" layoutX="14.0" layoutY="108.0" prefHeight="189.0" prefWidth="1302.0">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Label fx:id="projectNameLabel" prefHeight="20.0" prefWidth="83.0" text="项目名称:" />
|
||||
<TextField fx:id="projectNameTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" />
|
||||
<Label fx:id="transformerModelLabel" prefHeight="20.0" prefWidth="83.0" text="变压器型号:" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="transformerModelTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||
<Label fx:id="noLoadLossLabel" prefHeight="20.0" prefWidth="83.0" text="空载损耗:" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="noLoadLossTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
||||
<Label fx:id="loadLossLabel" prefHeight="20.0" prefWidth="120.0" text="负载损耗(KW):" GridPane.rowIndex="3" />
|
||||
<TextField fx:id="loadLossTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="1" GridPane.rowIndex="3" />
|
||||
<Label fx:id="biddingNumberLabel" prefHeight="20.0" prefWidth="83.0" text="投标编号:" GridPane.columnIndex="2" />
|
||||
<Label fx:id="capacityRatioLabel" prefHeight="20.0" prefWidth="120.0" text="容量比(MVA):" GridPane.columnIndex="2" GridPane.rowIndex="1" />
|
||||
<Label fx:id="impedanceVoltageLabel" prefHeight="20.0" prefWidth="83.0" text="阻抗电压:" GridPane.columnIndex="2" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="biddingNumberTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="3" />
|
||||
<TextField fx:id="capacityRatioTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="3" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="impedanceVoltageTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="3" GridPane.rowIndex="2" />
|
||||
<Label fx:id="projectManagerLabel" prefHeight="20.0" prefWidth="83.0" text="项目经理:" GridPane.columnIndex="4" />
|
||||
<Label fx:id="voltageRatioLabel" prefHeight="20.0" prefWidth="83.0" text="电压比(kV):" GridPane.columnIndex="4" GridPane.rowIndex="1" />
|
||||
<Label fx:id="transportationWeightLabel" prefHeight="20.0" prefWidth="83.0" text="运输重(t):" GridPane.columnIndex="4" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="projectManagerTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="5" />
|
||||
<TextField fx:id="voltageRatioTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="5" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="transportationWeightTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="5" GridPane.rowIndex="2" />
|
||||
<Label fx:id="quantityLabel" prefHeight="20.0" prefWidth="83.0" text="数量:" GridPane.columnIndex="6" />
|
||||
<TextField fx:id="quantityTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="7" />
|
||||
<Label fx:id="totalWeightLabel" prefHeight="20.0" prefWidth="83.0" text="总重(t):" GridPane.columnIndex="6" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="totalWeightTextField" prefHeight="20.0" prefWidth="166.0" GridPane.columnIndex="7" GridPane.rowIndex="2" />
|
||||
</children>
|
||||
</GridPane>
|
||||
</children>
|
||||
</AnchorPane>
|
@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.ComboBox?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
|
||||
<AnchorPane fx:id="coverPane" prefHeight="814.0" prefWidth="1329.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.connor.plm.CreateOuotation.MyController">
|
||||
<children>
|
||||
<Pane fx:id="topPane" layoutX="14.0" layoutY="91.0" prefHeight="189.0" prefWidth="1302.0" style="-fx-border-color: gray; -fx-border-width: 0.5px; -fx-border-radius: 5px;">
|
||||
<children>
|
||||
<Label fx:id="projectNameLabel" layoutX="23.0" layoutY="16.0" prefHeight="20.0" prefWidth="83.0" text="项目名称:" />
|
||||
<Label fx:id="transformerModelLabel" layoutX="23.0" layoutY="60.0" prefHeight="20.0" prefWidth="83.0" text="变压器型号:" />
|
||||
<Label fx:id="noLoadLossLabel" layoutX="23.0" layoutY="105.0" prefHeight="20.0" prefWidth="83.0" text="空载损耗:" />
|
||||
<Label fx:id="loadLossLabel" layoutX="23.0" layoutY="148.0" prefHeight="20.0" prefWidth="120.0" text="负载损耗(KW):" />
|
||||
<TextField fx:id="projectNameTextField" layoutX="129.0" layoutY="11.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<TextField fx:id="transformerModelTextField" layoutX="129.0" layoutY="55.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<TextField fx:id="noLoadLossTextField" layoutX="129.0" layoutY="100.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<TextField fx:id="loadLossTextField" layoutX="129.0" layoutY="143.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<Label fx:id="biddingNumberLabel" layoutX="355.0" layoutY="16.0" prefHeight="20.0" prefWidth="83.0" text="投标编号:" />
|
||||
<TextField fx:id="biddingNumberTextField" layoutX="473.0" layoutY="11.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<Label fx:id="capacityRatioLabel" layoutX="355.0" layoutY="60.0" prefHeight="20.0" prefWidth="120.0" text="容量比(MVA):" />
|
||||
<TextField fx:id="capacityRatioTextField" layoutX="473.0" layoutY="55.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<Label fx:id="impedanceVoltageLabel" layoutX="355.0" layoutY="105.0" prefHeight="20.0" prefWidth="83.0" text="阻抗电压:" />
|
||||
<Label fx:id="projectManagerLabel" layoutX="705.0" layoutY="16.0" prefHeight="20.0" prefWidth="83.0" text="项目经理:" />
|
||||
<TextField fx:id="impedanceVoltageTextField" layoutX="473.0" layoutY="100.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<TextField fx:id="projectManagerTextField" layoutX="825.0" layoutY="11.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<Label fx:id="voltageRatioLabel" layoutX="705.0" layoutY="60.0" prefHeight="20.0" prefWidth="83.0" text="电压比(kV):" />
|
||||
<Label fx:id="transportationWeightLabel" layoutX="705.0" layoutY="105.0" prefHeight="20.0" prefWidth="83.0" text="运输重(t):" />
|
||||
<TextField fx:id="voltageRatioTextField" layoutX="825.0" layoutY="55.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<TextField fx:id="transportationWeightTextField" layoutX="825.0" layoutY="100.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<Label fx:id="quantityLabel" layoutX="1044.0" layoutY="15.0" prefHeight="20.0" prefWidth="83.0" text="数量:" />
|
||||
<Label fx:id="totalWeightLabel" layoutX="1044.0" layoutY="105.0" prefHeight="20.0" prefWidth="83.0" text="总重(t):" />
|
||||
<TextField fx:id="quantityTextField" layoutX="1113.0" layoutY="11.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<TextField fx:id="totalWeightTextField" layoutX="1113.0" layoutY="100.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
</children>
|
||||
</Pane>
|
||||
<Label fx:id="costSheetTypeLabel" layoutX="461.0" layoutY="50.0" prefHeight="20.0" prefWidth="83.0" text="成本单类型:" />
|
||||
<ComboBox fx:id="costSheetTypeComboBox" layoutX="560.0" layoutY="45.0" prefWidth="160.0" />
|
||||
<Label fx:id="editionLabel" layoutX="762.0" layoutY="50.0" prefHeight="20.0" prefWidth="52.0" text="版次:" />
|
||||
<ComboBox fx:id="editionComboBox" layoutX="822.0" layoutY="45.0" prefWidth="100.0" />
|
||||
<Label fx:id="comparedCostSheetLabel" layoutX="957.0" layoutY="50.0" prefHeight="20.0" prefWidth="113.0" text="要对比的成本单:" />
|
||||
<TextField fx:id="comparedCostSheetTextField" layoutX="1093.0" layoutY="45.0" prefHeight="30.0" prefWidth="200.0" />
|
||||
<Pane fx:id="centerPane" layoutX="14.0" layoutY="299.0" prefHeight="48.0" prefWidth="1302.0" style="-fx-border-color: gray; -fx-border-width: 0.5px; -fx-border-radius: 5px;">
|
||||
<children>
|
||||
<Label fx:id="copperAmountLabel" layoutX="25.0" layoutY="14.0" prefHeight="20.0" prefWidth="83.0" text="用铜量(kg):" />
|
||||
<TextField fx:id="copperAmountTextField" layoutX="131.0" layoutY="9.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<Label fx:id="copperMarketPriceLabel" layoutX="375.0" layoutY="14.0" prefHeight="20.0" prefWidth="139.0" text="铜价市场价(元/kg):" />
|
||||
<TextField fx:id="copperMarketPriceTextField" layoutX="533.0" layoutY="9.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
<Label fx:id="voltageLevelLabel" layoutX="766.0" layoutY="14.0" prefHeight="20.0" prefWidth="74.0" text="电压等级:" />
|
||||
<TextField fx:id="voltageLevelTextField" layoutX="854.0" layoutY="9.0" prefHeight="20.0" prefWidth="166.0" />
|
||||
</children>
|
||||
</Pane>
|
||||
<Pane fx:id="tablePane" layoutX="14.0" layoutY="365.0" prefHeight="380.0" prefWidth="1302.0">
|
||||
<children>
|
||||
<TableView fx:id="materialsTable" prefHeight="309.0" prefWidth="1302.0">
|
||||
<columns>
|
||||
<TableColumn fx:id="no" prefWidth="75.0" />
|
||||
<TableColumn fx:id="materialNameColumn" prefWidth="126.0" text="材料名称" />
|
||||
<TableColumn fx:id="relatedMaterialColumn" prefWidth="122.0" text="材料名称" />
|
||||
<TableColumn fx:id="specificationColumn" prefWidth="250.0" text="规格" />
|
||||
<TableColumn fx:id="manufacturerColumn" minWidth="0.0" prefWidth="203.0" text="制造厂商" />
|
||||
<TableColumn fx:id="quantityColumn" prefWidth="91.0" text="数量(净重)" />
|
||||
<TableColumn fx:id="utilizationRateColumn" prefWidth="69.0" text="利用率" />
|
||||
<TableColumn fx:id="unitColumn" prefWidth="70.0" text="单位" />
|
||||
<TableColumn fx:id="unitPriceColumn" prefWidth="86.0" text="单价(元)" />
|
||||
<TableColumn fx:id="amountColumn" prefWidth="94.0" text="金额(元)" />
|
||||
<TableColumn fx:id="comparedResultColumn" prefWidth="115.0" text="对比结果(元)" />
|
||||
</columns>
|
||||
</TableView>
|
||||
<TextField fx:id="totalPriceTextField" layoutX="1171.0" layoutY="308.0" prefHeight="30.0" prefWidth="131.0" />
|
||||
<Label layoutX="1085.0" layoutY="313.0" prefWidth="86.0" text=" 总价:" />
|
||||
<Label layoutX="1050.0" layoutY="346.0" text="总价对比结果:" />
|
||||
<TextField fx:id="totalPriceCompareTextField" layoutX="1171.0" layoutY="341.0" prefHeight="30.0" prefWidth="131.0" />
|
||||
</children>
|
||||
</Pane>
|
||||
<Button fx:id="saveButton" layoutX="750.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="保存" />
|
||||
<Button fx:id="calculateButton" layoutX="900.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="计算金额" />
|
||||
<Button fx:id="selectComparisonButton" layoutX="1050.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="选择对比" />
|
||||
<Button fx:id="compareButton" layoutX="1200.0" layoutY="759.0" mnemonicParsing="false" prefWidth="100.0" text="对比" />
|
||||
</children>
|
||||
</AnchorPane>
|
@ -0,0 +1,9 @@
|
||||
package com.connor.plm.CreateOuotation;
|
||||
|
||||
public class test {
|
||||
public static void main(String[] args) {
|
||||
double contrastPrice = Double.parseDouble("0");
|
||||
System.out.println(contrastPrice==0);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
// //开始刷新对比结果数据
|
||||
// if(comparedCostSheetTextField.getText()!=null && !"".equals(comparedCostSheetTextField.getText().trim())) {
|
||||
// //获取数据库该类型成本单最新的版本
|
||||
// String getLastRevSql = "SELECT \"revision\" FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" where \"projectid\" = '"+ButtonCellEditor.cusquotation.getProjectid()+"' and \"cbdlx\" = '" + comparedCostSheetTextField.getText() + "' order by \"revision\" desc" ;
|
||||
// System.out.println("getLastRevSql:"+getLastRevSql);
|
||||
// List<String> revList = new ArrayList<String>();
|
||||
// try {
|
||||
// ResultSet resultSet4 = SqlUtil.read(getLastRevSql);
|
||||
// while(resultSet4.next()) {
|
||||
// revList.add(resultSet4.getString("revision"));
|
||||
// }
|
||||
// } catch (SQLException e1) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e1.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// if(revList.size()>0) {
|
||||
// try {
|
||||
// String reSql = "SELECT \"dbjg\" FROM \"CHINT_DBCUSQUOTATION_ DETAILS_TEMPLATE\" WHERE \"projectid\"='"+ButtonCellEditor.cusquotation.getProjectid()+"' and \"cbdlx\" = '"+costSheetTypeComboBox.getSelectionModel().getSelectedItem()+"' and \"revision\" = '"+selectedItem+ "' and dbrevision = '" + revList.get(0) +"' order by \"matgroup\" asc";
|
||||
// System.out.println("reSql:"+reSql);
|
||||
// ResultSet reSql1 = SqlUtil.read(reSql);
|
||||
// ArrayList<String> tableList = new ArrayList<String>();
|
||||
// while(reSql1.next()) {
|
||||
// tableList.add(reSql1.getString("dbjg"));
|
||||
// }
|
||||
// if(tableList.size()>0) {
|
||||
// System.out.println("查询到了对比结果明细数据,开始插入");
|
||||
// //循环插入刷新明细数据
|
||||
// for(int j=0;j<materialsTable.getItems().size();j++) {
|
||||
// QuotationMX quotationMX = materialsTable.getItems().get(j);
|
||||
// quotationMX.setContrastPrice(new SimpleStringProperty(tableList.get(j)));
|
||||
// }
|
||||
// System.out.println("刷新表格");
|
||||
// materialsTable.refresh();
|
||||
// }
|
||||
// }catch(Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// //开始刷新对比结果数据
|
||||
// if(comparedCostSheetTextField.getText()!=null && !"".equals(comparedCostSheetTextField.getText().trim())) {
|
||||
// //获取数据库该类型成本单最新的版本
|
||||
// String getLastRevSql = "SELECT \"revision\" FROM \"CHINT_ CUSQUOTATION_ DETAILS_TEMPLATE\" where \"projectid\" = '"+ButtonCellEditor.cusquotation.getProjectid()+"' and \"cbdlx\" = '" + comparedCostSheetTextField.getText() + "' order by \"revision\" desc" ;
|
||||
// System.out.println("getLastRevSql:"+getLastRevSql);
|
||||
// List<String> revList = new ArrayList<String>();
|
||||
// try {
|
||||
// ResultSet resultSet4 = SqlUtil.read(getLastRevSql);
|
||||
// while(resultSet4.next()) {
|
||||
// revList.add(resultSet4.getString("revision"));
|
||||
// }
|
||||
// } catch (SQLException e1) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e1.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// if(revList.size()>0) {
|
||||
// try {
|
||||
// String reSql = "SELECT \"dbjg\" FROM \"CHINT_DBCUSQUOTATION_ DETAILS_TEMPLATE\" WHERE \"projectid\"='"+ButtonCellEditor.cusquotation.getProjectid()+"' and \"cbdlx\" = '"+costSheetTypeComboBox.getSelectionModel().getSelectedItem()+"' and \"revision\" = '"+selectedItem+ "' and dbrevision = '" + revList.get(0) +"' order by \"matgroup\" asc";
|
||||
// System.out.println("reSql:"+reSql);
|
||||
// ResultSet reSql1 = SqlUtil.read(reSql);
|
||||
// ArrayList<String> tableList = new ArrayList<String>();
|
||||
// while(reSql1.next()) {
|
||||
// tableList.add(reSql1.getString("dbjg"));
|
||||
// }
|
||||
// if(tableList.size()>0) {
|
||||
// System.out.println("查询到了对比结果明细数据,开始插入");
|
||||
// //循环插入刷新明细数据
|
||||
// for(int j=0;j<materialsTable.getItems().size();j++) {
|
||||
// QuotationMX quotationMX = materialsTable.getItems().get(j);
|
||||
// quotationMX.setContrastPrice(new SimpleStringProperty(tableList.get(j)));
|
||||
// }
|
||||
// System.out.println("刷新表格");
|
||||
// materialsTable.refresh();
|
||||
// }
|
||||
// }catch(Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
@ -0,0 +1,52 @@
|
||||
package com.connor.plm.SendGXToMOM;
|
||||
|
||||
import org.omg.CORBA.PRIVATE_MEMBER;
|
||||
|
||||
public class FileJson {
|
||||
private String name;
|
||||
|
||||
private String uid;
|
||||
|
||||
private String no;
|
||||
|
||||
public FileJson() {
|
||||
super();
|
||||
}
|
||||
|
||||
public FileJson(String name, String uid, String no) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.uid = uid;
|
||||
this.no = no;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getNo() {
|
||||
return no;
|
||||
}
|
||||
|
||||
public void setNo(String no) {
|
||||
this.no = no;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FileJson [name=" + name + ", uid=" + uid + ", no=" + no + "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
package com.connor.plm.SendGXToMOM;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Process {
|
||||
private String factoryCode;
|
||||
|
||||
private String processName;
|
||||
|
||||
private String processCode;
|
||||
|
||||
private String workCenter;
|
||||
|
||||
private String processType;
|
||||
|
||||
private List<FileJson> processRouteFiles;
|
||||
|
||||
private List<FileJson> esopFiles;
|
||||
|
||||
|
||||
|
||||
public Process() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Process(String factoryCode, String processName, String processCode, String workCenter, String processType,
|
||||
List<FileJson> processRouteFiles, List<FileJson> esopFiles) {
|
||||
super();
|
||||
this.factoryCode = factoryCode;
|
||||
this.processName = processName;
|
||||
this.processCode = processCode;
|
||||
this.workCenter = workCenter;
|
||||
this.processType = processType;
|
||||
this.processRouteFiles = processRouteFiles;
|
||||
this.esopFiles = esopFiles;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getFactoryCode() {
|
||||
return factoryCode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setFactoryCode(String factoryCode) {
|
||||
this.factoryCode = factoryCode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getProcessName() {
|
||||
return processName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setProcessName(String processName) {
|
||||
this.processName = processName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getProcessCode() {
|
||||
return processCode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setProcessCode(String processCode) {
|
||||
this.processCode = processCode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getWorkCenter() {
|
||||
return workCenter;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setWorkCenter(String workCenter) {
|
||||
this.workCenter = workCenter;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getProcessType() {
|
||||
return processType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setProcessType(String processType) {
|
||||
this.processType = processType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<FileJson> getProcessRouteFiles() {
|
||||
return processRouteFiles;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setProcessRouteFiles(List<FileJson> processRouteFiles) {
|
||||
this.processRouteFiles = processRouteFiles;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<FileJson> getEsopFiles() {
|
||||
return esopFiles;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setEsopFiles(List<FileJson> esopFiles) {
|
||||
this.esopFiles = esopFiles;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Process [factoryCode=" + factoryCode + ", processName=" + processName + ", processCode=" + processCode
|
||||
+ ", workCenter=" + workCenter + ", processType=" + processType + ", processRouteFiles="
|
||||
+ processRouteFiles + ", esopFiles=" + esopFiles + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.connor.plm.SendGXToMOM;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
|
||||
import com.connor.chint.sap2.util.SqlUtil;
|
||||
import com.connor.plm.CostListManagement.ButtonCellEditor;
|
||||
import com.connor.plm.CostListManagement.QueryQuotationFram;
|
||||
import com.connor.plm.CostListManagement.pojo.Cusquotation;
|
||||
import com.connor.plm.CostListManagement.pojo.QuotationMX;
|
||||
import com.connor.plm.CreateOuotation.JDBFrame;
|
||||
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
|
||||
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
|
||||
import com.teamcenter.rac.aifrcp.AIFUtility;
|
||||
import com.teamcenter.rac.kernel.TCComponent;
|
||||
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
||||
import com.teamcenter.rac.kernel.TCException;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
|
||||
/**
|
||||
* 标准工序传递MOM
|
||||
* @author hongcj
|
||||
* 2023/11/29
|
||||
*/
|
||||
public class sendGXToMOMHandler extends AbstractHandler{
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
// TODO Auto-generated method stub
|
||||
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
|
||||
TCSession session = (TCSession)app.getSession();
|
||||
try {
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
// 获取tc当前选择的操作
|
||||
InterfaceAIFComponent target = app.getTargetComponent();
|
||||
if(target instanceof TCComponentItemRevision) {
|
||||
TCComponentItemRevision revision = (TCComponentItemRevision)target;
|
||||
try {
|
||||
String type = revision.getStringProperty("object_type");
|
||||
if("ZT2_FirstOPRevision".equals(type) || "MEOPRevision".equals(type)) {
|
||||
sendGXToMOMOperation sendGXToMOMOperation = new sendGXToMOMOperation(session,revision);
|
||||
session.queueOperation(sendGXToMOMOperation);
|
||||
}else {
|
||||
MessageBox.post("请选择标准工序对象操作", "提示", MessageBox.INFORMATION);
|
||||
}
|
||||
} catch (TCException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}else {
|
||||
MessageBox.post("请选择版本对象操作", "提示", MessageBox.INFORMATION);
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in new issue