List of usage examples for java.beans PropertyChangeEvent getPropertyName
public String getPropertyName()
From source file:org.openmicroscopy.shoola.agents.imviewer.view.ImViewerUI.java
/** * Displays information about the image. * //from w w w. jav a 2 s .c om * @param comp */ void showImageInfo(JComponent comp) { if (comp == null) return; if (infoDialog != null) { infoDialog.closeWindow(); hideAnimation(); infoDialog = null; return; } if (channelDialog != null) { channelDialog.closeWindow(); hideAnimation(); channelDialog = null; } infoDialog = new TinyDialog(this, comp, TinyDialog.CLOSE_ONLY); infoDialog.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (TinyDialog.CLOSED_PROPERTY.equals(evt.getPropertyName())) { infoDialog.closeWindow(); hideAnimation(); infoDialog = null; } } }); infoDialog.pack(); Point p; JPanel glass = (JPanel) getGlassPane(); if (glass.getLayout() == null) { Dimension d = infoDialog.getPreferredSize(); d = new Dimension(d.width, d.height + 20); infoDialog.setSize(d); infoDialog.setPreferredSize(d); p = new Point(0, statusBar.getPreferredSize().height); } else { p = new Point(0, 2 * statusBar.getPreferredSize().height); } //setCloseAfter(true); showJDialogAsSheet(infoDialog, p, UP_LEFT); }
From source file:org.openmicroscopy.shoola.agents.imviewer.view.ImViewerUI.java
/** * Shows the plane information.//w w w . j a va2 s .c o m * * @param show Pass <code>true</code> to show the dialog, * <code>false</code> to hide it. * @param comp The component to show. */ void showPlaneInfoDetails(PlaneInfoComponent comp) { if (comp == null) return; if (channelDialog != null) { JComponent c = channelDialog.getCanvas(); channelDialog.closeWindow(); hideAnimation(); channelDialog = null; if (c == comp.getContent()) return; } if (infoDialog != null) { infoDialog.closeWindow(); hideAnimation(); infoDialog = null; } channelDialog = new TinyDialog(this, comp.getContent(), TinyDialog.CLOSE_ONLY); channelDialog.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (TinyDialog.CLOSED_PROPERTY.equals(evt.getPropertyName())) { channelDialog.closeWindow(); hideAnimation(); channelDialog = null; } } }); channelDialog.pack(); Point p; JPanel glass = (JPanel) getGlassPane(); if (glass.getLayout() == null) { Dimension d = channelDialog.getPreferredSize(); d = new Dimension(d.width + 20, d.height); channelDialog.setSize(d); channelDialog.setPreferredSize(d); p = new Point(0, statusBar.getPreferredSize().height); } else { p = new Point(0, 2 * statusBar.getPreferredSize().height); } //setCloseAfter(true); showJDialogAsSheet(channelDialog, p, UP_MIDDLE); }
From source file:ucar.unidata.idv.flythrough.Flythrough.java
/** * _more_//from w w w . j a va2 s . c o m * * @param evt _more_ */ public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(Animation.ANI_VALUE)) { lastMoveWasTrack = true; goToCurrent(); } }
From source file:org.talend.designer.mapper.ui.visualmap.table.DataMapTableView.java
public void propertyChange(PropertyChangeEvent evt) { notifyFocusLost();/*from w w w. j av a 2 s. c o m*/ String request = evt.getPropertyName(); if (request.equals("positionChange") || request.equals(ConnectionTrace.TRACE_PROP)) { //$NON-NLS-1$ if (!tableViewerCreatorForColumns.getTable().isDisposed()) { tableViewerCreatorForColumns.refresh(); InputsZone inputsZone = mapperManager.getUiManager().getInputsZone(); if (inputsZone != null && !inputsZone.isDisposed() && inputsZone.getToolbar() != null) { inputsZone.getToolbar().refreshCurrentRow(); } } } }
From source file:com.lynk.hrm.ui.dialog.InfoEmployee.java
private void initComponents() { addWindowListener(new WindowAdapter() { @Override// w ww . j a v a 2 s. c o m public void windowClosing(WindowEvent e) { thisWindowClosing(e); } }); setSize(836, 674); setTitle(""); setIconImage( Toolkit.getDefaultToolkit().getImage(InfoEmployee.class.getResource("/resource/image/icon.png"))); setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); getContentPane().setLayout(new BorderLayout(0, 0)); { JToolBar toolBar = new JToolBar(); toolBar.setFloatable(false); getContentPane().add(toolBar, BorderLayout.NORTH); { JButton uiSave = new JButton("?"); uiSave.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiSaveActionPerformed(true); } }); uiSave.setFocusable(false); uiSave.setIcon(new ImageIcon(InfoEmployee.class.getResource("/resource/image/emp_save.png"))); uiSave.setFont(APP_FONT); toolBar.add(uiSave); } toolBar.addSeparator(); { JButton uiReadIdCard = new JButton("??"); uiReadIdCard.setFont(APP_FONT); uiReadIdCard.setIcon( new ImageIcon(InfoEmployee.class.getResource("/resource/image/manager_teacher.png"))); uiReadIdCard.setFocusable(false); uiReadIdCard.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiReadIdCardActionPerformed(e); } }); toolBar.add(uiReadIdCard); } toolBar.addSeparator(); { JButton uiInputFinger = new JButton(""); uiInputFinger.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiInputFingerActionPerformed(e); } }); uiInputFinger.setIcon(new ImageIcon(InfoEmployee.class.getResource("/resource/image/finger.png"))); uiInputFinger.setFont(APP_FONT); uiInputFinger.setFocusable(false); toolBar.add(uiInputFinger); } toolBar.addSeparator(); { JButton uiSetSuspend = new JButton("??"); uiSetSuspend.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiSetSuspendActionPerformed(e); } }); uiSetSuspend .setIcon(new ImageIcon(InfoEmployee.class.getResource("/resource/image/emp_retire.png"))); uiSetSuspend.setFont(APP_FONT); uiSetSuspend.setFocusable(false); toolBar.add(uiSetSuspend); } } { JPanel panel = new JPanel(); getContentPane().add(panel); panel.setLayout(new MigLayout("", "[]5[grow]25[]5[grow]25[]5[grow]5[102]", "[][][][]")); { JLabel label = new JLabel("?"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); panel.add(label, "cell 0 0"); } { uiId = new LynkTextField(); uiId.setEditable(false); uiId.setForeground(Color.BLUE); panel.add(uiId, "cell 1 0,growx"); } { JLabel label = new JLabel("??"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); panel.add(label, "cell 2 0"); } { uiName = new LynkTextField(); uiName.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) { uiNameFocusLost(e); } }); panel.add(uiName, "cell 3 0,growx"); } { JLabel label = new JLabel("?"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); panel.add(label, "cell 4 0"); } { uiNamePy = new LynkTextField(); panel.add(uiNamePy, "cell 5 0,growx"); } { JLabel label = new JLabel("?"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); panel.add(label, "cell 0 1"); } { uiState = new JComboBox<String>(); uiState.setForeground(Color.BLUE); uiState.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiStateActionPerformed(e); } }); uiState.setModel(new DefaultComboBoxModel<String>(new String[] { "", Employee.STATE_PROBATION, Employee.STATE_CONTRACT, Employee.STATE_SUSPEND, Employee.STATE_LEAVE, Employee.STATE_RETIRE, Employee.STATE_DELETE })); uiState.setFont(APP_FONT); panel.add(uiState, "cell 1 1,growx"); } { uiInfoTab = new JideTabbedPane(JTabbedPane.TOP); uiInfoTab.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { uiInfoTabStateChanged(e); } }); uiInfoTab.setColorTheme(JideTabbedPane.COLOR_THEME_DEFAULT); uiInfoTab.setFont(APP_FONT); panel.add(uiInfoTab, "cell 0 3 7 1"); { JPanel uiInfoBasic = new JPanel(); uiInfoBasic.setLayout(new MigLayout("", "[473px,grow][307px,grow]", "[grow][289px][149px]")); uiInfoTab.addTab("?", uiInfoBasic); { JPanel uiIdCardPane = new JPanel(); uiIdCardPane.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); uiIdCardPane.setLayout(new MigLayout("", "[]5[grow]10[]", "[][][][][40px:40px:40px,grow]")); uiInfoBasic.add(uiIdCardPane, "cell 0 0,grow"); { JLabel label = new JLabel("??"); uiIdCardPane.add(label, "cell 0 0"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiIdCard = new LynkTextField(); uiIdCardPane.add(uiIdCard, "cell 1 0,growx"); } { JPanel pane = new JPanel(); uiIdCardPane.add(pane, "cell 2 0 1 5,grow"); pane.setLayout(new MigLayout("insets 0", "[102px:102px:102px]", "[126px:126px:126px]")); { uiPhoto = new ImagePane(); pane.add(uiPhoto, "cell 0 0,grow"); } } // { // JPanel photoPane = new JPanel(); // photoPane.setLayout(new MigLayout("insets 0", "[grow]", "[grow][]")); // uiIdCardPane.add(photoPane, "cell 2 0 2 4,grow"); // { // uiPhoto = new ImagePane(); // photoPane.add(uiPhoto, "cell 0 0,grow"); // } // { // JButton uiReadIdCardDirect = new JButton("??"); // uiReadIdCardDirect.addActionListener(new ActionListener() { // public void actionPerformed(ActionEvent e) { // uiReadIdCardDirectActionPerformed(e); // } // }); // uiReadIdCardDirect.setFont(APP_FONT); // uiReadIdCardDirect.setFocusable(false); // photoPane.add(uiReadIdCardDirect, "cell 0 1,grow"); // } // } { JLabel label = new JLabel(""); uiIdCardPane.add(label, "cell 0 1"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiBirthday = new LynkTextField(); uiIdCardPane.add(uiBirthday, "cell 1 1,growx"); } { JLabel label = new JLabel(""); uiIdCardPane.add(label, "cell 0 2"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiAge = new LynkTextField(); uiIdCardPane.add(uiAge, "cell 1 2,growx"); } { JLabel label = new JLabel(""); uiIdCardPane.add(label, "cell 0 3,aligny top"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiGender = new LynkTextField(); uiIdCardPane.add(uiGender, "cell 1 3,growx,aligny top"); } { JLabel label = new JLabel("??"); label.setFont(APP_FONT); label.setHorizontalAlignment(SwingConstants.RIGHT); uiIdCardPane.add(label, "cell 0 4"); } { JScrollPane scrollPane = new JScrollPane(); uiIdCardPane.add(scrollPane, "cell 1 4,grow"); { uiCensusAddress = new JTextArea(); uiCensusAddress.setWrapStyleWord(true); uiCensusAddress.setLineWrap(true); scrollPane.setViewportView(uiCensusAddress); uiCensusAddress.setFont(APP_FONT); } } } { JPanel uiIdCardPane = new JPanel(); uiIdCardPane.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); uiIdCardPane .setLayout(new MigLayout("", "[]5[grow]25[]5[grow]", "[][][40px:40px:40px,grow]")); uiInfoBasic.add(uiIdCardPane, "cell 0 1,grow"); { JLabel label = new JLabel(""); uiIdCardPane.add(label, "cell 0 0"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiMarital = new JComboBox<String>(); uiIdCardPane.add(uiMarital, "cell 1 0,growx"); uiMarital.setModel(new DefaultComboBoxModel<String>( new String[] { Employee.MARITAL_YES, Employee.MARITAL_NO })); uiMarital.setFont(APP_FONT); } { JLabel label = new JLabel("?"); uiIdCardPane.add(label, "cell 2 0"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiContact = new LynkTextField(); uiIdCardPane.add(uiContact, "cell 3 0,growx"); } { JLabel label = new JLabel("?"); uiIdCardPane.add(label, "cell 0 1"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiCensus = new JComboBox<String>(); uiIdCardPane.add(uiCensus, "cell 1 1,growx"); uiCensus.setModel(new DefaultComboBoxModel<String>( new String[] { Employee.CENSUS_A, Employee.CENSUS_B, Employee.CENSUS_C, Employee.CENSUS_D, Employee.CENSUS_E, Employee.CENSUS_F })); uiCensus.setFont(APP_FONT); } { JLabel label = new JLabel("??"); uiIdCardPane.add(label, "cell 2 1"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiResidencePermit = new JComboBox<String>(); uiIdCardPane.add(uiResidencePermit, "cell 3 1,growx"); uiResidencePermit .setModel(new DefaultComboBoxModel<String>(new String[] { "", "", "" })); uiResidencePermit.setFont(APP_FONT); } { JLabel label = new JLabel(""); uiIdCardPane.add(label, "cell 0 2"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { JScrollPane scrollPane = new JScrollPane(); uiIdCardPane.add(scrollPane, "cell 1 2 3 1,grow"); { uiAddress = new JTextArea(); uiAddress.setWrapStyleWord(true); uiAddress.setLineWrap(true); scrollPane.setViewportView(uiAddress); uiAddress.setFont(APP_FONT); } } } { JPanel uiCompanyPanel = new JPanel(); uiCompanyPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); uiCompanyPanel.setLayout(new MigLayout("", "[]5[grow][]25[]5[grow][]", "[][][][][][][][]")); uiInfoBasic.add(uiCompanyPanel, "cell 0 2,growx,aligny top"); { JLabel label = new JLabel(Employee.SUSPEND_NOTE); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); uiCompanyPanel.add(label, "cell 0 0"); } { uiFactory = new JComboBox<String>(new DefaultComboBoxModel<String>( new String[] { Employee.FACROTY_TC, Employee.FACTORY_SX })); uiFactory.setFont(APP_FONT); uiCompanyPanel.add(uiFactory, "cell 1 0 2 1,growx"); } { JLabel label = new JLabel(""); uiCompanyPanel.add(label, "cell 3 0"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiDept = new LynkTextField(); uiDept.setEditable(false); uiCompanyPanel.add(uiDept, "cell 4 0,growx"); } { JButton uiChooseDept = new JButton(); uiChooseDept.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiChooseDeptActionPerformed(e); } }); uiChooseDept.setIcon(new ImageIcon( InfoEmployee.class.getResource("/resource/image/choose_more.png"))); uiChooseDept.setMargin(new Insets(1, 1, 1, 1)); uiCompanyPanel.add(uiChooseDept, "cell 5 0,growx"); } { JLabel label = new JLabel("?"); uiCompanyPanel.add(label, "cell 0 1"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiJob = new LynkTextField(); uiJob.setEditable(false); uiCompanyPanel.add(uiJob, "cell 1 1,growx"); } { JButton uiChooseJob = new JButton(); uiChooseJob.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiChooseJobActionPerformed(e); } }); uiChooseJob.setIcon(new ImageIcon( InfoEmployee.class.getResource("/resource/image/choose_more.png"))); uiChooseJob.setMargin(new Insets(1, 1, 1, 1)); uiCompanyPanel.add(uiChooseJob, "cell 2 1,growx"); } { JLabel label = new JLabel(Employee.SUSPEND_START); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); uiCompanyPanel.add(label, "cell 3 1"); } { uiDdg = new JComboBox<String>( new DefaultComboBoxModel<>(new String[] { Employee.DDG_N, Employee.DDG_Y })); uiDdg.setFont(APP_FONT); uiCompanyPanel.add(uiDdg, "cell 4 1 2 1,growx"); } { JLabel label = new JLabel(""); uiCompanyPanel.add(label, "cell 0 2"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiEntryDate = new JDateChooser(); uiCompanyPanel.add(uiEntryDate, "cell 1 2 2 1,growx"); uiEntryDate.setDateFormatString("yyyy-MM-dd"); uiEntryDate.setFont(APP_FONT); uiEntryDate.getJCalendar().setTodayButtonVisible(true); uiEntryDate.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if ("date".equals(evt.getPropertyName())) { setWorkAge(); } } }); } { JLabel label = new JLabel(""); uiCompanyPanel.add(label, "cell 3 2"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiWorkAge = new LynkTextField("0"); uiCompanyPanel.add(uiWorkAge, "cell 4 2 2 1,growx"); uiWorkAge.setEditable(false); } { JLabel label = new JLabel("?"); uiCompanyPanel.add(label, "cell 0 3"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiProbation = new JDateChooser(); uiCompanyPanel.add(uiProbation, "cell 1 3 2 1,growx"); uiProbation.setDateFormatString("yyyy-MM-dd"); uiProbation.setFont(APP_FONT); uiProbation.getJCalendar().setTodayButtonVisible(true); } { JLabel label = new JLabel("??"); uiCompanyPanel.add(label, "cell 3 3"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiExpiration = new JDateChooser(); uiCompanyPanel.add(uiExpiration, "cell 4 3 2 1,growx"); uiExpiration.setDateFormatString("yyyy-MM-dd"); uiExpiration.setFont(APP_FONT); uiExpiration.getJCalendar().setLeftButtonText(Employee.EXPIRATION_NO); uiExpiration.getJCalendar().setLeftButtonVisible(true); uiExpiration.getJCalendar().setRightButtonText(Employee.EXPIRATION_LONG); uiExpiration.getJCalendar().setRightButtonVisible(true); } { JLabel label = new JLabel(""); uiCompanyPanel.add(label, "cell 0 4"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiSchool = new LynkTextField(); uiCompanyPanel.add(uiSchool, "cell 1 4 2 1,growx"); } { JLabel label = new JLabel(""); uiCompanyPanel.add(label, "cell 3 4"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiDegree = new JComboBox<String>(); uiCompanyPanel.add(uiDegree, "cell 4 4 2 1,growx"); uiDegree.setMaximumRowCount(12); uiDegree.setModel(new DefaultComboBoxModel<String>(new String[] { "", Employee.DEGREE_A, Employee.DEGREE_B, Employee.DEGREE_C, Employee.DEGREE_D, Employee.DEGREE_E, Employee.DEGREE_F, Employee.DEGREE_G, Employee.DEGREE_H, Employee.DEGREE_I, Employee.DEGREE_J })); uiDegree.setFont(APP_FONT); } { JLabel label = new JLabel(""); uiCompanyPanel.add(label, "cell 0 5"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiMajor = new LynkTextField(); uiCompanyPanel.add(uiMajor, "cell 1 5 2 1,growx"); } { JLabel label = new JLabel(""); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); uiCompanyPanel.add(label, "cell 3 5"); } { uiGuide = new LynkTextField(); uiCompanyPanel.add(uiGuide, "cell 4 5 2 1,growx"); } { JLabel label = new JLabel("?"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT_BLOD); uiCompanyPanel.add(label, "cell 0 6"); } { uiPhoneShort = new LynkTextField(); uiPhoneShort.setFont(APP_FONT_BLOD); uiCompanyPanel.add(uiPhoneShort, "cell 1 6 2 1,growx"); } { JLabel label = new JLabel("?"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); uiCompanyPanel.add(label, "cell 3 6"); } { uiPerformance = new LynkTextField(); uiCompanyPanel.add(uiPerformance, "cell 4 6 2 1,growx"); } // { // JLabel label = new JLabel("??"); // label.setHorizontalAlignment(SwingConstants.RIGHT); // label.setFont(APP_FONT); // uiCompanyPanel.add(label, "cell 0 7"); // } // { // uiSuspendEnd = new LynkTextField(); // uiCompanyPanel.add(uiSuspendEnd, "cell 1 7 5 1,growx"); // } } { JPanel panel4 = new JPanel(); panel4.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); panel4.setLayout(new MigLayout("", "[]5[grow]", "[][][][grow][grow]")); uiInfoBasic.add(panel4, "cell 1 0 1 3,grow"); { JLabel label = new JLabel("???"); panel4.add(label, "cell 0 0,grow"); label.setFont(APP_FONT); } { uiSocialCard = new LynkTextField(); panel4.add(uiSocialCard, "cell 1 0,grow"); } { JLabel label = new JLabel("?"); panel4.add(label, "cell 0 1,grow"); label.setFont(APP_FONT); } { uiHousingCard = new LynkTextField(); panel4.add(uiHousingCard, "cell 1 1,grow"); } { JLabel label = new JLabel("??"); panel4.add(label, "cell 0 2,grow"); label.setFont(APP_FONT); } { uiBankCard = new LynkTextField(); panel4.add(uiBankCard, "cell 1 2,grow"); } { JLabel label = new JLabel("?"); panel4.add(label, "cell 0 3,growx,aligny top"); label.setFont(APP_FONT); } { JScrollPane scrollPane = new JScrollPane(); panel4.add(scrollPane, "cell 1 3,grow"); uiWorkExperience = new JTextArea(); uiWorkExperience.setFont(APP_FONT); scrollPane.setViewportView(uiWorkExperience); } { JLabel label = new JLabel(""); panel4.add(label, "cell 0 4,growx,aligny top"); label.setFont(APP_FONT); } { JScrollPane scrollPane = new JScrollPane(); panel4.add(scrollPane, "cell 1 4,grow"); { uiNote = new JTextArea(); uiNote.setFont(APP_FONT); scrollPane.setViewportView(uiNote); } } } } { JPanel uiInfoLeave = new JPanel(); uiInfoLeave.setLayout(new MigLayout("", "[]5[150px]25[]5[150px]", "[][][][grow][]")); uiInfoTab.addTab("??", uiInfoLeave); { uiLabelLeaveDate = new JLabel("?"); uiLabelLeaveDate.setFont(APP_FONT); uiInfoLeave.add(uiLabelLeaveDate, "cell 0 0,grow"); } { uiLeaveDate = new JDateChooser(); uiLeaveDate.setDateFormatString("yyyy-MM-dd"); uiLeaveDate.setFont(APP_FONT); uiLeaveDate.getJCalendar().setTodayButtonVisible(true); uiLeaveDate.getJCalendar().setNullDateButtonVisible(true); uiInfoLeave.add(uiLeaveDate, "cell 1 0,growx,aligny top"); } { uiLabelSocialEnd = new JLabel("??"); uiLabelSocialEnd.setFont(APP_FONT); uiInfoLeave.add(uiLabelSocialEnd, "cell 0 1,grow"); } { uiLabelHousingEnd = new JLabel("?"); uiLabelHousingEnd.setFont(APP_FONT); uiInfoLeave.add(uiLabelHousingEnd, "cell 2 1,grow"); } { uiHousingEndDate = new JDateChooser(); uiHousingEndDate.setDateFormatString("yyyy-MM-dd"); uiHousingEndDate.setFont(APP_FONT); uiHousingEndDate.getJCalendar().setLeftButtonText(""); uiHousingEndDate.getJCalendar().setLeftButtonVisible(true); uiHousingEndDate.getJCalendar().setTodayButtonVisible(true); uiHousingEndDate.getJCalendar().setNullDateButtonVisible(true); uiInfoLeave.add(uiHousingEndDate, "cell 3 1,growx,aligny top"); } { uiLabelLeaveType = new JLabel("?"); uiLabelLeaveType.setFont(APP_FONT); uiInfoLeave.add(uiLabelLeaveType, "cell 0 2,grow"); } { uiSocialEndDate = new JDateChooser(); uiSocialEndDate.setDateFormatString("yyyy-MM-dd"); uiSocialEndDate.setFont(APP_FONT); uiSocialEndDate.getJCalendar().setLeftButtonText(""); uiSocialEndDate.getJCalendar().setLeftButtonVisible(true); uiSocialEndDate.getJCalendar().setTodayButtonVisible(true); uiSocialEndDate.getJCalendar().setNullDateButtonVisible(true); uiInfoLeave.add(uiSocialEndDate, "cell 1 1,growx,aligny top"); } { uiLeaveType = new JComboBox<String>(new DefaultComboBoxModel<String>( new String[] { "", Employee.LEAVE_TYPE_A, Employee.LEAVE_TYPE_B, Employee.LEAVE_TYPE_C, Employee.LEAVE_TYPE_D, Employee.LEAVE_TYPE_E, Employee.LEAVE_TYPE_F, Employee.LEAVE_TYPE_G, Employee.LEAVE_TYPE_H })); uiLeaveType.setMaximumRowCount(10); uiLeaveType.setFont(APP_FONT); uiInfoLeave.add(uiLeaveType, "cell 1 2 3 1,grow"); } { uiLabelLeaveReason = new JLabel("?"); uiLabelLeaveReason.setFont(APP_FONT); uiInfoLeave.add(uiLabelLeaveReason, "cell 0 3,growx,aligny top"); } { JScrollPane scrollPane_2 = new JScrollPane(); uiInfoLeave.add(scrollPane_2, "cell 1 3 3 1,grow"); { uiLeaveReason = new JTextArea(); scrollPane_2.setViewportView(uiLeaveReason); uiLeaveReason.setFont(APP_FONT); } } { JLabel label = new JLabel("??"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); uiInfoLeave.add(label, "cell 0 4"); } { uiTimeCardLeaveCertify = new LynkTextField(); uiTimeCardLeaveCertify.setEditable(false); uiInfoLeave.add(uiTimeCardLeaveCertify, "cell 1 4 2 1,growx"); } { JButton uiPrintLeaveCertify = new JButton("???"); uiPrintLeaveCertify.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiPrintLeaveCertifyActionPerformed(e); } }); uiPrintLeaveCertify.setToolTipText("???!"); uiPrintLeaveCertify.setFont(APP_FONT); uiPrintLeaveCertify.setFocusable(false); uiInfoLeave.add(uiPrintLeaveCertify, "cell 3 4,alignx right"); } } { JPanel uiInfoSuspendHistory = new JPanel(); uiInfoSuspendHistory.setLayout(new BorderLayout(0, 0)); uiInfoTab.addTab("???", uiInfoSuspendHistory); { JScrollPane scrollPane = new JScrollPane(); uiInfoSuspendHistory.add(scrollPane, BorderLayout.CENTER); { suspendModel = new EmployeeSuspendModel(); uiEmpSuspend = new LynkTable(suspendModel); uiEmpSuspend.addHighlighter(UtilsClient.createAlignHighlighter()); uiEmpSuspend.setAutoResizeMode(LynkTable.AUTO_RESIZE_ALL_COLUMNS); scrollPane.setRowHeaderView(new TableRowHead(uiEmpSuspend)); scrollPane.setViewportView(uiEmpSuspend); } } } { JPanel uiInfoEmpHistory = new JPanel(); uiInfoEmpHistory.setLayout(new BorderLayout(0, 0)); uiInfoTab.addTab("?", uiInfoEmpHistory); { JPanel pane = new JPanel(); pane.setLayout(new MigLayout("", "[][][][100px:100px:100px][]", "[]")); uiInfoEmpHistory.add(pane, BorderLayout.NORTH); { JLabel label = new JLabel(""); label.setFont(APP_FONT); pane.add(label, "cell 0 0"); } { uiHistoryType = new JComboBox<String>(new DefaultComboBoxModel<>( new String[] { "", PraisePunish.TYPE_A, PraisePunish.TYPE_B, PraisePunish.TYPE_C, PraisePunish.TYPE_D, PraisePunish.TYPE_E, PraisePunish.TYPE_F, PraisePunish.TYPE_G, PraisePunish.TYPE_H })); uiHistoryType.setFont(APP_FONT); pane.add(uiHistoryType, "cell 1 0"); } { JLabel label = new JLabel("?"); label.setFont(APP_FONT); pane.add(label, "cell 2 0"); } { uiHistoryOperator = new LynkTextField(); pane.add(uiHistoryOperator, "cell 3 0,growx"); } { JButton uiRefresh = new JButton(""); uiRefresh.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiRefreshActionPerformed(e); } }); uiRefresh.setIcon( new ImageIcon(InfoEmployee.class.getResource("/resource/image/refresh.png"))); uiRefresh.setFont(APP_FONT); uiRefresh.setFocusable(false); pane.add(uiRefresh, "cell 4 0"); } } { JScrollPane scrollPane = new JScrollPane(); uiInfoEmpHistory.add(scrollPane, BorderLayout.CENTER); { historyModel = new EmployeeHistoryModel(); uiEmployeeHistory = new LynkTable(historyModel); uiEmployeeHistory.setColumnSize(70, 540, 50, 130, 90); scrollPane.setViewportView(uiEmployeeHistory); scrollPane.setRowHeaderView(new TableRowHead(uiEmployeeHistory)); } } } { JPanel uiInfoJobAdjustment = new JPanel(); uiInfoJobAdjustment.setLayout(new BorderLayout(0, 0)); uiInfoTab.addTab("?", uiInfoJobAdjustment); { JToolBar toolBar = new JToolBar(); toolBar.setFloatable(false); uiInfoJobAdjustment.add(toolBar, BorderLayout.NORTH); { { JButton uiAddJobAdjust = new JButton("?"); uiAddJobAdjust.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiAddJobAdjustActionPerformed(e); } }); uiAddJobAdjust.setIcon( new ImageIcon(InfoEmployee.class.getResource("/resource/image/add.png"))); uiAddJobAdjust.setFont(APP_FONT); toolBar.add(uiAddJobAdjust); } } } { JScrollPane scrollPane = new JScrollPane(); uiInfoJobAdjustment.add(scrollPane, BorderLayout.CENTER); { jobAdjustmentModel = new JobAdjustmentModel(); uiJobAdjustment = new LynkTable(jobAdjustmentModel); uiJobAdjustment.setColumnSize(50, 100, 100, 100, 100, 100, 80, 100, 150); scrollPane.setRowHeaderView(new TableRowHead(uiJobAdjustment)); scrollPane.setViewportView(uiJobAdjustment); } } } { JPanel uiInfoPraisePunish = new JPanel(); uiInfoTab.addTab("", uiInfoPraisePunish); uiInfoPraisePunish.setLayout( new MigLayout("", "[]10[grow]30[]10[120]5[]5[120]20[]20[][grow]", "[][grow]")); { uiPraisePunishDateStart = new JDateChooser(); uiPraisePunishDateStart.setFont(APP_FONT); uiPraisePunishDateStart.setDateFormatString("yyyy-MM-dd"); uiInfoPraisePunish.add(uiPraisePunishDateStart, "cell 3 0,growx"); } { uiPraisePunishDateEnd = new JDateChooser(); uiPraisePunishDateEnd.setFont(APP_FONT); uiPraisePunishDateEnd.setDateFormatString("yyyy-MM-dd"); uiInfoPraisePunish.add(uiPraisePunishDateEnd, "cell 5 0,growx"); } JButton uiAddPraisePunish = new JButton(""); uiAddPraisePunish.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiAddPraisePunishActionPerformed(e); } }); { JButton uiFindPraisePunish = new JButton(""); uiFindPraisePunish.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiFindPraisePunishActionPerformed(e); } }); { JLabel label = new JLabel(""); label.setFont(APP_FONT); uiInfoPraisePunish.add(label, "cell 0 0,alignx trailing"); } { uiPraisePunishType = new JComboBox<String>( new DefaultComboBoxModel<String>(new String[] { "", PraisePunish.TYPE_A, PraisePunish.TYPE_B, PraisePunish.TYPE_C, PraisePunish.TYPE_D, PraisePunish.TYPE_E, PraisePunish.TYPE_F, PraisePunish.TYPE_G })); uiPraisePunishType.setEditable(true); uiPraisePunishType.setFont(APP_FONT); uiInfoPraisePunish.add(uiPraisePunishType, "cell 1 0,growx"); } { JLabel label = new JLabel(""); label.setFont(APP_FONT); uiInfoPraisePunish.add(label, "cell 2 0"); } { JLabel label = new JLabel(""); label.setFont(APP_FONT); uiInfoPraisePunish.add(label, "cell 4 0"); } uiFindPraisePunish.setFocusable(false); uiFindPraisePunish.setIcon( new ImageIcon(InfoEmployee.class.getResource("/resource/image/refresh.png"))); uiFindPraisePunish.setFont(APP_FONT); uiInfoPraisePunish.add(uiFindPraisePunish, "cell 6 0"); } uiAddPraisePunish .setIcon(new ImageIcon(InfoEmployee.class.getResource("/resource/image/add.png"))); uiAddPraisePunish.setFont(APP_FONT); uiAddPraisePunish.setFocusable(false); uiInfoPraisePunish.add(uiAddPraisePunish, "cell 7 0"); JScrollPane scrollPane = new JScrollPane(); uiInfoPraisePunish.add(scrollPane, "cell 0 1 9 1,grow"); { praisePunishModel = new PraisePunishModel( new String[] { PraisePunish.COLUMN_TYPE, PraisePunish.COLUMN_ACTION, PraisePunish.COLUMN_ACTION_DATE, PraisePunish.COLUMN_DEAL, PraisePunish.COLUMN_DEAL_DATE, PraisePunish.COLUMN_NOTE }); uiPraisePunish = new LynkTable(praisePunishModel); uiPraisePunish.setColumnVisible( new String[] { PraisePunish.COLUMN_TYPE, PraisePunish.COLUMN_ACTION, PraisePunish.COLUMN_ACTION_DATE, PraisePunish.COLUMN_DEAL, PraisePunish.COLUMN_DEAL_DATE, PraisePunish.COLUMN_NOTE }); uiPraisePunish.setDefaultRenderer(Object.class, new PraisePunishColorRenderer()); uiPraisePunish.setMouseDoubleClick(new MouseDoubleClick() { @Override public void doubleClick(int index) { if (index != -1) { index = uiPraisePunish.convertRowIndexToModel(index); PraisePunish pp = praisePunishModel.getPp(index); pp = InfoPraisePunish.showdialog(InfoEmployee.this, pp, null); if (pp != null) { praisePunishModel.updatePp(pp); } } } }); scrollPane.setViewportView(uiPraisePunish); scrollPane.setRowHeaderView(new TableRowHead(uiPraisePunish)); } } { JPanel uiPanelVacation = new JPanel(); uiPanelVacation.setLayout(new BorderLayout()); uiInfoTab.addTab("?", uiPanelVacation); { JToolBar uiVacationToolBar = new JToolBar(); uiVacationToolBar.setFloatable(false); uiPanelVacation.add(uiVacationToolBar, BorderLayout.NORTH); { JButton uiVacationRefresh = new JButton(""); uiVacationRefresh.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiVacationRefreshActionPerformed(e); } }); uiVacationRefresh.setIcon( new ImageIcon(InfoEmployee.class.getResource("/resource/image/refresh.png"))); uiVacationRefresh.setFocusable(false); uiVacationRefresh.setFont(APP_FONT); uiVacationToolBar.add(uiVacationRefresh); } uiVacationToolBar.addSeparator(); { uiVacationHistoryAdd = new JButton(""); uiVacationHistoryAdd.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiVacationAddActionPerformed(e); } }); uiVacationHistoryAdd.setIcon( new ImageIcon(InfoEmployee.class.getResource("/resource/image/add.png"))); uiVacationHistoryAdd.setFocusable(false); uiVacationHistoryAdd.setFont(APP_FONT); uiVacationToolBar.add(uiVacationHistoryAdd); } uiVacationToolBar.addSeparator(); { JButton uiEndLastLeft = new JButton(""); uiEndLastLeft.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiEndLastLeftActionPerformed(e); } }); uiEndLastLeft.setIcon( new ImageIcon(InfoEmployee.class.getResource("/resource/image/add.png"))); uiEndLastLeft.setFocusable(false); uiEndLastLeft.setFont(APP_FONT); uiVacationToolBar.add(uiEndLastLeft); } } { JPanel uiPanelVacationInfo = new JPanel(); uiPanelVacation.add(uiPanelVacationInfo, BorderLayout.CENTER); uiPanelVacationInfo.setLayout(new MigLayout("", "[grow]", "[][grow]")); JPanel paneAv = new JPanel(); uiPanelVacationInfo.add(paneAv, "cell 0 0,grow"); paneAv.setLayout(new MigLayout("", "[][grow]50[][grow]", "[][][]")); { uiVacationStartEnd = new JLabel("Time"); uiVacationStartEnd.setHorizontalAlignment(SwingConstants.CENTER); paneAv.add(uiVacationStartEnd, "cell 0 0 4 1,growx"); uiVacationStartEnd.setForeground(Color.BLUE); uiVacationStartEnd.setFont(APP_FONT.deriveFont(16f)); } { JLabel labe = new JLabel(":"); paneAv.add(labe, "cell 0 1"); labe.setFont(APP_FONT.deriveFont(16f)); } { uiLastTotal = new JLabel(""); paneAv.add(uiLastTotal, "cell 1 1,alignx left"); uiLastTotal.setForeground(Color.BLUE); uiLastTotal.setFont(APP_FONT.deriveFont(16f)); } { JLabel labe = new JLabel(":"); paneAv.add(labe, "cell 2 1"); labe.setFont(APP_FONT.deriveFont(16f)); } { uiLastLeft = new JLabel(""); paneAv.add(uiLastLeft, "cell 3 1,alignx left"); uiLastLeft.setForeground(Color.BLUE); uiLastLeft.setFont(APP_FONT.deriveFont(16f)); } { JLabel labe = new JLabel(":"); paneAv.add(labe, "cell 0 2"); labe.setFont(APP_FONT.deriveFont(16f)); } { uiCurrentTotal = new JLabel(""); paneAv.add(uiCurrentTotal, "cell 1 2,alignx left"); uiCurrentTotal.setForeground(Color.BLUE); uiCurrentTotal.setFont(APP_FONT.deriveFont(16f)); } { JLabel labe = new JLabel("?:"); paneAv.add(labe, "cell 2 2"); labe.setFont(APP_FONT.deriveFont(16f)); } { uiLeftHours = new JLabel(""); paneAv.add(uiLeftHours, "cell 3 2,alignx left"); uiLeftHours.setForeground(Color.BLUE); uiLeftHours.setFont(APP_FONT.deriveFont(16f)); } JScrollPane scrollPane = new JScrollPane(); uiPanelVacationInfo.add(scrollPane, "cell 0 1,grow"); { attendanceVacationModel = new AttendanceVacationHistoryModel(); uiAttendanceVacationHistory = new LynkTable(attendanceVacationModel); uiAttendanceVacationHistory.setAutoResizeMode(LynkTable.AUTO_RESIZE_ALL_COLUMNS); scrollPane.setViewportView(uiAttendanceVacationHistory); scrollPane.setRowHeaderView(new TableRowHead(uiAttendanceVacationHistory)); } } } } } }
From source file:de.huxhorn.lilith.swing.ViewActions.java
public ViewActions(MainFrame mainFrame) { this.mainFrame = mainFrame; containerChangeListener = new ChangeListener() { /**/* ww w. j a v a 2s.c om*/ * Invoked when the target of the listener has changed its state. * * @param e a ChangeEvent object */ public void stateChanged(ChangeEvent e) { updateActions(); } }; containerPropertyChangeListener = new PropertyChangeListener() { /** * This method gets called when a bound property is changed. * * @param evt A PropertyChangeEvent object describing the event source * and the property that has changed. */ public void propertyChange(PropertyChangeEvent evt) { if (ViewContainer.SELECTED_EVENT_PROPERTY_NAME.equals(evt.getPropertyName())) { setEventWrapper((EventWrapper) evt.getNewValue()); } } }; keyStrokeActionMapping = new HashMap<KeyStroke, CopyToClipboardAction>(); // ##### Menu Actions ##### // File OpenMenuAction openMenuAction = new OpenMenuAction(); clearRecentFilesAction = new ClearRecentFilesAction(); OpenInactiveLogMenuAction openInactiveLogMenuAction = new OpenInactiveLogMenuAction(); ImportMenuAction importMenuAction = new ImportMenuAction(); exportMenuAction = new ExportMenuAction(); CleanAllInactiveLogsMenuAction cleanAllInactiveLogsMenuAction = new CleanAllInactiveLogsMenuAction(); preferencesMenuAction = new PreferencesMenuAction(); ExitMenuAction exitMenuAction = new ExitMenuAction(); // Edit showUnfilteredEventAction = new ShowUnfilteredEventAction(); gotoSourceAction = new GotoSourceAction(); copySelectionAction = new CopySelectionAction(); copyEventAction = new CopyToClipboardAction(new EventFormatter()); copyLoggingActions = new ArrayList<CopyToClipboardAction>(); copyLoggingActions.add(new CopyToClipboardAction(new EventJsonFormatter())); copyLoggingActions.add(new CopyToClipboardAction(new EventXmlFormatter())); copyLoggingActions.add(new CopyToClipboardAction(new LoggingMessageFormatter())); copyLoggingActions.add(new CopyToClipboardAction(new LoggingMessagePatternFormatter())); copyLoggingActions.add(new CopyToClipboardAction(new LoggingLoggerNameFormatter())); copyLoggingActions.add(new CopyToClipboardAction(new LoggingThrowableFormatter())); copyLoggingActions.add(new CopyToClipboardAction(new LoggingCallStackFormatter())); copyLoggingActions.add(new CopyToClipboardAction(new LoggingCallLocationFormatter())); copyLoggingActions.add(new CopyToClipboardAction(new LoggingMarkerFormatter())); copyLoggingActions.add(new CopyToClipboardAction(new LoggingMdcFormatter())); copyLoggingActions.add(new CopyToClipboardAction(new LoggingNdcFormatter())); copyAccessActions = new ArrayList<CopyToClipboardAction>(); copyAccessActions.add(new CopyToClipboardAction(new AccessUriFormatter())); prepareClipboardActions(copyLoggingActions, keyStrokeActionMapping); prepareClipboardActions(copyAccessActions, keyStrokeActionMapping); // Search findMenuAction = new FindMenuAction(); findPreviousAction = new FindPreviousAction(); findNextAction = new FindNextAction(); findPreviousActiveAction = new FindPreviousActiveAction(); findNextActiveAction = new FindNextActiveAction(); resetFindAction = new ResetFindAction(); // View scrollToBottomMenuAction = new ScrollToBottomMenuAction(); pauseMenuAction = new PauseMenuAction(); clearMenuAction = new ClearMenuAction(); attachMenuAction = new AttachMenuAction(); disconnectMenuAction = new DisconnectMenuAction(); focusMessageAction = new FocusMessageAction(); focusEventsAction = new FocusEventsAction(); //statisticsMenuAction = new StatisticsMenuAction(); editSourceNameMenuAction = new EditSourceNameMenuAction(); saveLayoutAction = new SaveLayoutAction(); resetLayoutAction = new ResetLayoutAction(); saveConditionMenuAction = new SaveConditionMenuAction(); zoomInMenuAction = new ZoomInMenuAction(); zoomOutMenuAction = new ZoomOutMenuAction(); resetZoomMenuAction = new ResetZoomMenuAction(); previousTabAction = new PreviousTabAction(); nextTabAction = new NextTabAction(); closeFilterAction = new CloseFilterAction(); closeOtherFiltersAction = new CloseOtherFiltersAction(); closeAllFiltersAction = new CloseAllFiltersAction(); // Window ShowTaskManagerAction showTaskManagerAction = new ShowTaskManagerAction(); closeAllAction = new CloseAllAction(); closeOtherAction = new CloseOtherAction(); minimizeAllAction = new MinimizeAllAction(); minimizeAllOtherAction = new MinimizeAllOtherAction(); removeInactiveAction = new RemoveInactiveAction(); //clearAndRemoveInactiveAction=new ClearAndRemoveInactiveAction(); // Help KeyboardHelpAction keyboardHelpAction = new KeyboardHelpAction(); ShowLoveMenuAction showLoveMenuAction = new ShowLoveMenuAction(); TipOfTheDayAction tipOfTheDayAction = new TipOfTheDayAction(); DebugAction debugAction = new DebugAction(); aboutAction = new AboutAction(); CheckForUpdateAction checkForUpdateAction = new CheckForUpdateAction(); TroubleshootingAction troubleshootingAction = new TroubleshootingAction(); // ##### ToolBar Actions ##### scrollToBottomToolBarAction = new ScrollToBottomToolBarAction(); pauseToolBarAction = new PauseToolBarAction(); clearToolBarAction = new ClearToolBarAction(); findToolBarAction = new FindToolBarAction(); //statisticsToolBarAction = new StatisticsToolBarAction(); attachToolBarAction = new AttachToolBarAction(); disconnectToolBarAction = new DisconnectToolBarAction(); showTaskManagerItem = new JMenuItem(showTaskManagerAction); closeAllItem = new JMenuItem(closeAllAction); closeAllOtherItem = new JMenuItem(closeOtherAction); minimizeAllItem = new JMenuItem(minimizeAllAction); minimizeAllOtherItem = new JMenuItem(minimizeAllOtherAction); removeInactiveItem = new JMenuItem(removeInactiveAction); //clearAndRemoveInactiveItem = new JMenuItem(clearAndRemoveInactiveAction); toolbar = new JToolBar(SwingConstants.HORIZONTAL); toolbar.setFloatable(false); scrollToBottomButton = new JToggleButton(scrollToBottomToolBarAction); toolbar.add(scrollToBottomButton); JButton pauseButton = new JButton(pauseToolBarAction); toolbar.add(pauseButton); JButton clearButton = new JButton(clearToolBarAction); toolbar.add(clearButton); JButton findButton = new JButton(findToolBarAction); toolbar.add(findButton); JButton disconnectButton = new JButton(disconnectToolBarAction); toolbar.add(disconnectButton); toolbar.addSeparator(); //JButton statisticsButton = new JButton(statisticsToolBarAction); //toolbar.add(statisticsButton); //toolbar.addSeparator(); JButton attachButton = new JButton(attachToolBarAction); toolbar.add(attachButton); toolbar.addSeparator(); PreferencesToolBarAction preferencesToolBarAction = new PreferencesToolBarAction(); JButton preferencesButton = new JButton(preferencesToolBarAction); toolbar.add(preferencesButton); toolbar.addSeparator(); ShowLoveToolbarAction showLoveToolbarAction = new ShowLoveToolbarAction(); JButton showLoveButton = new JButton(showLoveToolbarAction); toolbar.add(showLoveButton); recentFilesMenu = new JMenu("Recent Files"); Application app = mainFrame.getApplication(); menubar = new JMenuBar(); // File JMenu fileMenu = new JMenu("File"); fileMenu.setMnemonic('f'); fileMenu.add(openMenuAction); fileMenu.add(recentFilesMenu); fileMenu.add(openInactiveLogMenuAction); fileMenu.add(cleanAllInactiveLogsMenuAction); fileMenu.add(importMenuAction); fileMenu.add(exportMenuAction); if (!app.isMac()) { fileMenu.addSeparator(); fileMenu.add(preferencesMenuAction); fileMenu.addSeparator(); fileMenu.add(exitMenuAction); } // Edit editMenu = new JMenu("Edit"); editMenu.setMnemonic('e'); editMenu.add(copySelectionAction); editMenu.addSeparator(); editMenu.add(copyEventAction); editMenu.addSeparator(); for (CopyToClipboardAction current : copyLoggingActions) { editMenu.add(current); } editMenu.addSeparator(); for (CopyToClipboardAction current : copyAccessActions) { editMenu.add(current); } editMenu.addSeparator(); customCopyMenu = new JMenu("Custom copy"); customCopyPopupMenu = new JMenu("Custom copy"); editMenu.add(customCopyMenu); editMenu.addSeparator(); PasteStackTraceElementAction pasteStackTraceElementAction = new PasteStackTraceElementAction(); editMenu.add(pasteStackTraceElementAction); // Search searchMenu = new JMenu("Search"); searchMenu.setMnemonic('s'); searchMenu.add(findMenuAction); searchMenu.add(resetFindAction); searchMenu.add(findPreviousAction); searchMenu.add(findNextAction); searchMenu.add(findPreviousActiveAction); searchMenu.add(findNextActiveAction); searchMenu.addSeparator(); searchMenu.add(saveConditionMenuAction); searchMenu.addSeparator(); focusMenu = new FocusMenu(mainFrame.getApplicationPreferences()); excludeMenu = new ExcludeMenu(mainFrame.getApplicationPreferences()); searchMenu.add(focusMenu); searchMenu.add(excludeMenu); // View viewMenu = new JMenu("View"); viewMenu.setMnemonic('v'); viewMenu.add(scrollToBottomMenuAction); viewMenu.add(pauseMenuAction); viewMenu.add(clearMenuAction); viewMenu.add(attachMenuAction); viewMenu.add(disconnectMenuAction); viewMenu.add(focusEventsAction); viewMenu.add(focusMessageAction); //viewMenu.add(statisticsMenuAction); viewMenu.add(editSourceNameMenuAction); viewMenu.addSeparator(); viewMenu.add(zoomInMenuAction); viewMenu.add(zoomOutMenuAction); viewMenu.add(resetZoomMenuAction); viewMenu.addSeparator(); JMenu layoutMenu = new JMenu("Layout"); columnsMenu = new JMenu("Columns"); layoutMenu.add(columnsMenu); layoutMenu.addSeparator(); layoutMenu.add(saveLayoutAction); layoutMenu.add(resetLayoutAction); viewMenu.add(layoutMenu); viewMenu.addSeparator(); viewMenu.add(previousTabAction); viewMenu.add(nextTabAction); viewMenu.addSeparator(); viewMenu.add(closeFilterAction); viewMenu.add(closeOtherFiltersAction); viewMenu.add(closeAllFiltersAction); // Window windowMenu = new JMenu("Window"); windowMenu.setMnemonic('w'); // Help JMenu helpMenu = new JMenu("Help"); helpMenu.setMnemonic('h'); helpMenu.add(keyboardHelpAction); helpMenu.add(showLoveMenuAction); helpMenu.add(tipOfTheDayAction); helpMenu.add(checkForUpdateAction); helpMenu.add(troubleshootingAction); helpMenu.addSeparator(); helpMenu.add(debugAction); if (!app.isMac()) { helpMenu.addSeparator(); helpMenu.add(aboutAction); } menubar.add(fileMenu); menubar.add(editMenu); menubar.add(searchMenu); menubar.add(viewMenu); menubar.add(windowMenu); menubar.add(helpMenu); updateWindowMenu(); updateRecentFiles(); updateActions(); }
From source file:ru.goodfil.catalog.ui.forms.FiltersPanel.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - ???? ?????? panel2 = new JPanel(); panel12 = new JPanel(); label5 = new JLabel(); tbFilterCode = new JTextField(); btnSearchFilter = new JButton(); panel13 = new JPanel(); hSpacer1 = new JPanel(null); btnJoinFilters = new JButton(); btnCreateFilter = new JButton(); btnEditFilter = new JButton(); btnRemoveFilter = new JButton(); srcTblFilters = new JScrollPane(); tblFilters = new JTable(); panel15 = new JPanel(); label6 = new JLabel(); cbManufactors = new JComboBox(); label7 = new JLabel(); cbSeria = new JComboBox(); btnClearSearchModel = new JButton(); btnSearchMotors = new JButton(); panel1 = new JPanel(); label1 = new JLabel(); tbSeria = new JTextField(); label2 = new JLabel(); tbModel = new JTextField(); label3 = new JLabel(); tbEngine = new JTextField(); label4 = new JLabel(); tbDateF = new JTextField(); label9 = new JLabel(); tbDateT = new JTextField(); scrollPane11 = new JScrollPane(); tblMotors = new JTable(); panel18 = new JPanel(); btnAttachMotor = new JButton(); btnDetachMotor = new JButton(); vSpacer2 = new JPanel(null); scrollPane12 = new JScrollPane(); tblAllMotors = new JTable(); panel16 = new JPanel(); hSpacer3 = new JPanel(null); panel17 = new JPanel(); label8 = new JLabel(); tbOe = new JTextField(); btnOeSearch = new JButton(); scrollPane7 = new JScrollPane(); tblOes = new JTable(); panel19 = new JPanel(); btnAttachOe = new JButton(); btnDetachOe = new JButton(); vSpacer3 = new JPanel(null); scrollPane8 = new JScrollPane(); tblAllOes = new JTable(); tablesPopupMenu = new JPopupMenu(); miFullCopyToExcel = new JMenuItem(); menu1 = new JMenu(); miCopySelectedToExcel = new JMenuItem(); miCopyToExcel = new JMenuItem(); menu2 = new JMenu(); miCopySelectedToBuffer = new JMenuItem(); miCopyToBuffer = new JMenuItem(); miPasteFromBuffer = new JMenuItem(); miShowOnSiteMenu = new JMenu(); miShowOnSite = new JMenuItem(); miDontShowOnSite = new JMenuItem(); miApplyToAllMenu = new JMenu(); miApplyToVT1 = new JMenuItem(); miApplyToVT2 = new JMenuItem(); miApplyToVT3 = new JMenuItem(); miApplyToVT4 = new JMenuItem(); miDontApplyToAll = new JMenuItem(); CellConstraints cc = new CellConstraints(); //======== this ======== setMinimumSize(new Dimension(300, 207)); // JFormDesigner evaluation mark setBorder(/*from www.j av a2 s. c o m*/ new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), getBorder())); addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); setLayout(new FormLayout("default:grow", "fill:default:grow")); //======== panel2 ======== { panel2.setLayout(new FormLayout("default:grow, $lcgap, 21dlu, $lcgap, default:grow", "default, default:grow, $lgap, default, fill:default:grow, $lgap, default, fill:default:grow")); //======== panel12 ======== { panel12.setLayout(new FormLayout("default, default:grow, 21dlu", "default")); //---- label5 ---- label5.setText("\u0418\u0437\u0434\u0435\u043b\u0438\u0435"); panel12.add(label5, cc.xy(1, 1)); //---- tbFilterCode ---- tbFilterCode.setToolTipText( "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430"); tbFilterCode.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { tbFilterCodeKeyPressed(e); } @Override public void keyTyped(KeyEvent e) { tbFilterCodeKeyPressed(e); } }); tbFilterCode.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { tbFilterCodeFocusGained(e); } @Override public void focusLost(FocusEvent e) { tbFilterCodeFocusGained(e); } }); panel12.add(tbFilterCode, cc.xy(2, 1)); //---- btnSearchFilter ---- btnSearchFilter.setIcon( new ImageIcon(getClass().getResource("/ru/goodfil/catalog/ui/icons/find_next_24.png"))); btnSearchFilter.setToolTipText("\u041f\u043e\u0438\u0441\u043a"); btnSearchFilter.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnSearchFilterActionPerformed(e); } }); panel12.add(btnSearchFilter, cc.xy(3, 1)); } panel2.add(panel12, cc.xy(1, 1)); //======== panel13 ======== { panel13.setLayout(new FormLayout("default:grow, 2*($lcgap, 21dlu), 2*(21dlu)", "default")); panel13.add(hSpacer1, cc.xy(1, 1)); //---- btnJoinFilters ---- btnJoinFilters.setIcon( new ImageIcon(getClass().getResource("/ru/goodfil/catalog/ui/icons/recycle_24.png"))); btnJoinFilters.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnJoinFiltersActionPerformed(e); } }); panel13.add(btnJoinFilters, cc.xy(3, 1)); //---- btnCreateFilter ---- btnCreateFilter .setIcon(new ImageIcon(getClass().getResource("/ru/goodfil/catalog/ui/icons/add_24.png"))); btnCreateFilter.setToolTipText( "\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440"); btnCreateFilter.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnCreateFilterActionPerformed(e); } }); panel13.add(btnCreateFilter, cc.xy(5, 1)); //---- btnEditFilter ---- btnEditFilter .setIcon(new ImageIcon(getClass().getResource("/ru/goodfil/catalog/ui/icons/edit_24.png"))); btnEditFilter.setToolTipText( "\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440"); btnEditFilter.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnEditFilterActionPerformed(e); } }); panel13.add(btnEditFilter, cc.xy(6, 1)); //---- btnRemoveFilter ---- btnRemoveFilter.setIcon( new ImageIcon(getClass().getResource("/ru/goodfil/catalog/ui/icons/delete_24.png"))); btnRemoveFilter.setToolTipText( "\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440"); btnRemoveFilter.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnRemoveFilterActionPerformed(e); } }); panel13.add(btnRemoveFilter, cc.xy(7, 1)); } panel2.add(panel13, cc.xy(5, 1)); //======== srcTblFilters ======== { //---- tblFilters ---- tblFilters.setDoubleBuffered(true); tblFilters.setAutoCreateRowSorter(true); tblFilters.setToolTipText( "\u0424\u0438\u043b\u044c\u0442\u0440\u044b, \u043f\u043e\u0434\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u043f\u043e\u0434 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430"); tblFilters.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { tblFiltersKeyPressed(e); } }); tblFilters.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { tblFiltersMouseClicked(e); } }); srcTblFilters.setViewportView(tblFilters); } panel2.add(srcTblFilters, cc.xywh(1, 2, 5, 1)); //======== panel15 ======== { panel15.setLayout(new FormLayout( "default, default:grow, $lcgap, default, default:grow, $rgap, $lcgap, default, $rgap, default, $lcgap", "2*(default)")); //---- label6 ---- label6.setText("\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c"); panel15.add(label6, cc.xy(1, 1)); //---- cbManufactors ---- cbManufactors.setToolTipText( "\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044f"); cbManufactors.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbManufactorsActionPerformed(e); } }); cbManufactors.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { cbManufactorsKeyPressed(e); } }); panel15.add(cbManufactors, cc.xy(2, 1)); //---- label7 ---- label7.setText("\u0421\u0435\u0440\u0438\u044f"); panel15.add(label7, cc.xy(4, 1)); //---- cbSeria ---- cbSeria.setToolTipText( "\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0435\u0440\u0438\u044e"); cbSeria.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbSeriaActionPerformed(e); } }); cbSeria.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { cbSeriaKeyPressed(e); } }); panel15.add(cbSeria, cc.xywh(5, 1, 2, 1)); //---- btnClearSearchModel ---- btnClearSearchModel.setText("\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c"); btnClearSearchModel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnClearSearchModelActionPerformed(); } }); panel15.add(btnClearSearchModel, cc.xy(8, 1)); //---- btnSearchMotors ---- btnSearchMotors.setIcon( new ImageIcon(getClass().getResource("/ru/goodfil/catalog/ui/icons/find_next_24.png"))); btnSearchMotors.setToolTipText( "\u041f\u043e\u0438\u0441\u043a \u043c\u043e\u0442\u043e\u0440\u043e\u0432 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u0438\u0437 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u0440\u0438\u0438"); btnSearchMotors.setText("\u041f\u043e\u0438\u0441\u043a"); btnSearchMotors.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnSearchMotorsActionPerformed(e); } }); panel15.add(btnSearchMotors, cc.xy(10, 1)); //======== panel1 ======== { panel1.setLayout(new FormLayout( "default, $lcgap, default:grow, $lcgap, default, $lcgap, default:grow, $lcgap, default, $lcgap, default:grow, $lcgap, default, $lcgap, default:grow, $lcgap, default, $lcgap, default:grow", "default")); //---- label1 ---- label1.setText("\u0421\u0435\u0440\u0438\u044f"); panel1.add(label1, cc.xy(1, 1)); //---- tbSeria ---- tbSeria.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { tbSeriaKeyPressed(e); } @Override public void keyTyped(KeyEvent e) { tbSeriaKeyPressed(e); } }); panel1.add(tbSeria, cc.xy(3, 1)); //---- label2 ---- label2.setText("\u041c\u043e\u0434\u0435\u043b\u044c"); panel1.add(label2, cc.xy(5, 1)); //---- tbModel ---- tbModel.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { tbModelKeyPressed(e); } @Override public void keyTyped(KeyEvent e) { tbModelKeyPressed(e); } }); panel1.add(tbModel, cc.xy(7, 1)); //---- label3 ---- label3.setText("\u0414\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c"); panel1.add(label3, cc.xy(9, 1)); //---- tbEngine ---- tbEngine.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { tbEngineKeyPressed(e); } @Override public void keyTyped(KeyEvent e) { tbEngineKeyPressed(e); } }); panel1.add(tbEngine, cc.xy(11, 1)); //---- label4 ---- label4.setText("\u0414\u0430\u0442\u0430 \"\u0421\""); panel1.add(label4, cc.xy(13, 1)); //---- tbDateF ---- tbDateF.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { tbDateFKeyPressed(e); } @Override public void keyTyped(KeyEvent e) { tbDateFKeyPressed(e); } }); panel1.add(tbDateF, cc.xy(15, 1)); //---- label9 ---- label9.setText("\u0414\u0430\u0442\u0430 \"\u041f\u041e\""); panel1.add(label9, cc.xy(17, 1)); //---- tbDateT ---- tbDateT.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { tbDateTKeyPressed(e); } @Override public void keyTyped(KeyEvent e) { tbDateTKeyPressed(e); } }); panel1.add(tbDateT, cc.xy(19, 1)); } panel15.add(panel1, cc.xywh(1, 2, 10, 1)); } panel2.add(panel15, cc.xywh(1, 4, 5, 1)); //======== scrollPane11 ======== { //---- tblMotors ---- tblMotors.setToolTipText( "\u041c\u043e\u0442\u043e\u0440\u044b, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043a \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0443"); tblMotors.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { tblMotorsKeyPressed(e); } }); tblMotors.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { tblMotorsMouseClicked(e); } }); scrollPane11.setViewportView(tblMotors); } panel2.add(scrollPane11, cc.xy(1, 5)); //======== panel18 ======== { panel18.setLayout(new FormLayout("21dlu", "2*(default, $lgap), fill:default:grow")); //---- btnAttachMotor ---- btnAttachMotor.setIcon(new ImageIcon( getClass().getResource("/ru/goodfil/catalog/ui/icons/arrow_left_green_24.png"))); btnAttachMotor.setToolTipText( "\u041f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0442\u043e\u0440 \u043a \u0444\u0438\u043b\u044c\u0442\u0440\u0443"); btnAttachMotor.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnAttachMotorActionPerformed(e); } }); panel18.add(btnAttachMotor, cc.xy(1, 1)); //---- btnDetachMotor ---- btnDetachMotor.setIcon(new ImageIcon( getClass().getResource("/ru/goodfil/catalog/ui/icons/arrow_right_green_24.png"))); btnDetachMotor.setToolTipText( "\u041e\u0442\u0432\u044f\u0437\u0430\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0442\u043e\u0440 \u043e\u0442 \u0444\u0438\u043b\u044c\u0442\u0440\u0430"); btnDetachMotor.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnDetachMotorActionPerformed(e); } }); panel18.add(btnDetachMotor, cc.xy(1, 3)); panel18.add(vSpacer2, cc.xy(1, 5)); } panel2.add(panel18, cc.xy(3, 5)); //======== scrollPane12 ======== { //---- tblAllMotors ---- tblAllMotors.setToolTipText( "\u041c\u043e\u0442\u043e\u0440\u044b \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u0440\u0438\u0438"); tblAllMotors.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { tblAllMotorsKeyPressed(e); } }); tblAllMotors.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { tblAllMotorsMouseClicked(e); } }); scrollPane12.setViewportView(tblAllMotors); } panel2.add(scrollPane12, cc.xy(5, 5)); //======== panel16 ======== { panel16.setLayout(new FormLayout("default:grow", "default")); panel16.add(hSpacer3, cc.xy(1, 1)); } panel2.add(panel16, cc.xy(1, 7)); //======== panel17 ======== { panel17.setLayout(new FormLayout("default, default:grow, 21dlu", "default")); //---- label8 ---- label8.setText("\u041d\u043e\u043c\u0435\u0440 \u041e\u0415"); panel17.add(label8, cc.xy(1, 1)); //---- tbOe ---- tbOe.setToolTipText( "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u041e\u0415 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430"); tbOe.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { tbOeKeyTyped(e); } @Override public void keyTyped(KeyEvent e) { tbOeKeyTyped(e); } }); tbOe.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { tbOeFocusGained(e); } @Override public void focusLost(FocusEvent e) { tbOeFocusGained(e); } }); panel17.add(tbOe, cc.xy(2, 1)); //---- btnOeSearch ---- btnOeSearch.setIcon( new ImageIcon(getClass().getResource("/ru/goodfil/catalog/ui/icons/find_next_24.png"))); btnOeSearch.setToolTipText("\u041f\u043e\u0438\u0441\u043a \u043f\u043e \u041e\u0415"); btnOeSearch.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnOeSearchActionPerformed(e); } }); panel17.add(btnOeSearch, cc.xy(3, 1)); } panel2.add(panel17, cc.xy(5, 7)); //======== scrollPane7 ======== { //---- tblOes ---- tblOes.setSurrendersFocusOnKeystroke(true); tblOes.setToolTipText( "\u041e\u0415, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043a \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0443"); tblOes.setAutoCreateRowSorter(true); tblOes.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { tblOesKeyPressed(e); } }); tblOes.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { tblOesMouseClicked(e); } }); scrollPane7.setViewportView(tblOes); } panel2.add(scrollPane7, cc.xy(1, 8)); //======== panel19 ======== { panel19.setLayout( new FormLayout("21dlu", "fill:default, $lgap, default, $lgap, fill:default:grow")); //---- btnAttachOe ---- btnAttachOe.setIcon(new ImageIcon( getClass().getResource("/ru/goodfil/catalog/ui/icons/arrow_left_green_24.png"))); btnAttachOe.setToolTipText( "\u041f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u041e\u0415 \u043a \u0444\u0438\u043b\u044c\u0442\u0440\u0443"); btnAttachOe.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnAttachOeActionPerformed(e); } }); panel19.add(btnAttachOe, cc.xy(1, 1)); //---- btnDetachOe ---- btnDetachOe.setIcon(new ImageIcon( getClass().getResource("/ru/goodfil/catalog/ui/icons/arrow_right_green_24.png"))); btnDetachOe.setToolTipText( "\u041e\u0442\u0432\u044f\u0437\u0430\u0442\u044c \u041e\u0415 \u043e\u0442 \u0444\u0438\u043b\u044c\u0442\u0440\u0430"); btnDetachOe.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnDetachOeActionPerformed(e); } }); panel19.add(btnDetachOe, cc.xy(1, 3)); panel19.add(vSpacer3, cc.xy(1, 5)); } panel2.add(panel19, cc.xy(3, 8)); //======== scrollPane8 ======== { //---- tblAllOes ---- tblAllOes.setToolTipText( "\u041f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u041e\u0415, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u043e\u0434 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043f\u043e\u0438\u0441\u043a\u0430"); tblAllOes.setAutoCreateRowSorter(true); tblAllOes.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { tblAllOesKeyPressed(e); } }); tblAllOes.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { tblAllOesMouseClicked(e); } }); scrollPane8.setViewportView(tblAllOes); } panel2.add(scrollPane8, cc.xy(5, 8)); } add(panel2, cc.xy(1, 1)); //======== tablesPopupMenu ======== { tablesPopupMenu.addPopupMenuListener(new PopupMenuListener() { @Override public void popupMenuCanceled(PopupMenuEvent e) { } @Override public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { } @Override public void popupMenuWillBecomeVisible(PopupMenuEvent e) { tablesPopupMenuPopupMenuWillBecomeVisible(e); } }); //---- miFullCopyToExcel ---- miFullCopyToExcel.setText( "\u041f\u043e\u043b\u043d\u0430\u044f \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0437\u0434\u0435\u043b\u0438\u044f \u0432 Excel"); miFullCopyToExcel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miFullCopyToExcelActionPerformed(e); } }); tablesPopupMenu.add(miFullCopyToExcel); //======== menu1 ======== { menu1.setText("\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 Excel"); //---- miCopySelectedToExcel ---- miCopySelectedToExcel.setText( "\u0422\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438"); miCopySelectedToExcel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miCopySelectedToExcelActionPerformed(e); } }); menu1.add(miCopySelectedToExcel); //---- miCopyToExcel ---- miCopyToExcel.setText("\u0412\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438"); miCopyToExcel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miCopyToExcelActionPerformed(e); } }); menu1.add(miCopyToExcel); } tablesPopupMenu.add(menu1); tablesPopupMenu.addSeparator(); //======== menu2 ======== { menu2.setText( "\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0431\u0443\u0444\u0435\u0440"); //---- miCopySelectedToBuffer ---- miCopySelectedToBuffer.setText( "\u0422\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438"); miCopySelectedToBuffer.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miCopySelectedToBufferActionPerformed(e); } }); menu2.add(miCopySelectedToBuffer); //---- miCopyToBuffer ---- miCopyToBuffer.setText("\u0412\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438"); miCopyToBuffer.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miCopyToBufferActionPerformed(e); } }); menu2.add(miCopyToBuffer); } tablesPopupMenu.add(menu2); //---- miPasteFromBuffer ---- miPasteFromBuffer.setText( "\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430"); miPasteFromBuffer.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miPasteFromBufferActionPerformed(e); } }); tablesPopupMenu.add(miPasteFromBuffer); tablesPopupMenu.addSeparator(); //======== miShowOnSiteMenu ======== { miShowOnSiteMenu.setText( "\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435?"); //---- miShowOnSite ---- miShowOnSite.setText("\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c"); miShowOnSite.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miShowOnSiteActionPerformed(e); } }); miShowOnSiteMenu.add(miShowOnSite); //---- miDontShowOnSite ---- miDontShowOnSite .setText("\u041d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c"); miDontShowOnSite.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miDontShowOnSiteActionPerformed(e); } }); miShowOnSiteMenu.add(miDontShowOnSite); } tablesPopupMenu.add(miShowOnSiteMenu); //======== miApplyToAllMenu ======== { miApplyToAllMenu.setText( "\u0413\u043b\u043e\u0431\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430?"); //---- miApplyToVT1 ---- miApplyToVT1.setText( "\u041a \u043b\u0435\u0433\u043a\u043e\u0432\u044b\u043c \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f\u043c"); miApplyToVT1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miApplyToVT1ActionPerformed(e); } }); miApplyToAllMenu.add(miApplyToVT1); //---- miApplyToVT2 ---- miApplyToVT2.setText( "\u041a \u0433\u0440\u0443\u0437\u043e\u0432\u044b\u043c \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f\u043c"); miApplyToVT2.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miApplyToVT2ActionPerformed(e); } }); miApplyToAllMenu.add(miApplyToVT2); //---- miApplyToVT3 ---- miApplyToVT3.setText( "\u041a \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u0435"); miApplyToVT3.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miApplyToVT3ActionPerformed(e); } }); miApplyToAllMenu.add(miApplyToVT3); //---- miApplyToVT4 ---- miApplyToVT4.setText( "\u041a \u043a\u0430\u0442\u0435\u0440\u0430\u043c \u0438 \u043c\u043e\u0442\u043e\u0446\u0438\u043a\u043b\u0430\u043c"); miApplyToVT4.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miApplyToVT4ActionPerformed(e); } }); miApplyToAllMenu.add(miApplyToVT4); //---- miDontApplyToAll ---- miDontApplyToAll.setText( "\u0423\u0431\u0440\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443"); miDontApplyToAll.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miDontApplyToAllActionPerformed(e); } }); miApplyToAllMenu.add(miDontApplyToAll); } tablesPopupMenu.add(miApplyToAllMenu); } // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:net.sf.dvstar.transmission.TransmissionView.java
/** * Main class for visual application//from ww w. j ava 2 s . co m * @param app Parent application framework */ public TransmissionView(SingleFrameApplication app) { super(app); this.singleFrameApplication = app; this.transmissionView = this; initGlobals(); initLogger(); initComponents(); initLocale(); initTimers(); ResourceMap resourceMap = getResourceMap(); idleIcon = resourceMap.getIcon("StatusBar.idleIcon"); statusAnimationLabel.setIcon(idleIcon); progressBar.setVisible(false); piecesGraph = new PiecesGraph(); plPieces.add(piecesGraph, BorderLayout.CENTER); modelTorrentsList = new TorrentsTableModel(this); TorrentsTableModel.setPreferredColumnWidths(tblTorrentList); setRefButtonsState(connectedServer); setAllButtonsState(connectedServer); tblTorrentList.setModel(modelTorrentsList); /** * Set sorter to table */ //!!tblTorrentList.setAutoCreateRowSorter(true); TorrentListRowSorter rorrentListRowSorter = new TorrentListRowSorter( (TorrentsTableModel) tblTorrentList.getModel()); tblTorrentList.setRowSorter(rorrentListRowSorter); PopupListener popupListener = new PopupListener(); tblTorrentList.addMouseListener(popupListener); tblTorrentList.getTableHeader().addMouseListener(popupListener); tblTorrentList.setRowSelectionAllowed(true); tblTorrentList.tableChanged(new TableModelEvent(modelTorrentsList)); jTabbedPane1.setIconAt(0, globalResourceMap.getIcon("tpInfo.icon0")); jTabbedPane1.setIconAt(1, globalResourceMap.getIcon("tpInfo.icon1")); jTabbedPane1.setIconAt(2, globalResourceMap.getIcon("tpInfo.icon2")); jTabbedPane1.setIconAt(3, globalResourceMap.getIcon("tpInfo.icon3")); jTabbedPane1.setIconAt(4, globalResourceMap.getIcon("tpInfo.icon4")); // connecting action tasks to status bar via TaskMonitor TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext()); taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() { @Override public void propertyChange(java.beans.PropertyChangeEvent evt) { String propertyName = evt.getPropertyName(); if ("started".equals(propertyName)) { if (!busyIconTimer.isRunning()) { statusAnimationLabel.setIcon(busyIcons[0]); busyIconIndex = 0; busyIconTimer.start(); } progressBar.setVisible(true); progressBar.setIndeterminate(true); } else if ("done".equals(propertyName)) { busyIconTimer.stop(); statusAnimationLabel.setIcon(idleIcon); progressBar.setVisible(false); progressBar.setValue(0); } else if ("message".equals(propertyName)) { String text = (String) (evt.getNewValue()); statusMessageLabel.setText((text == null) ? "" : text); messageTimer.restart(); } else if ("progress".equals(propertyName)) { int value = (Integer) (evt.getNewValue()); progressBar.setVisible(true); progressBar.setIndeterminate(false); progressBar.setValue(value); } } }); //setAdditionalButtons(); //Whenever filterText changes, invoke newFilter. tfFindItem.getDocument().addDocumentListener(new DocumentListener() { @Override public void changedUpdate(DocumentEvent e) { setTorrentListFilter(); } @Override public void insertUpdate(DocumentEvent e) { setTorrentListFilter(); } @Override public void removeUpdate(DocumentEvent e) { setTorrentListFilter(); } }); checkNavigator(); updateInfoBox(-1); btConnect.grabFocus(); }
From source file:edu.ku.brc.specify.dbsupport.SpecifySchemaUpdateService.java
/** * Changes all the contents of the Geography 'Name' field from the geonames 'name' to 'acsiiname' to * get rid of the unprintable ascii characters. *//*from ww w . ja va 2 s . co m*/ public void updateGeographyNames() { final String FIXED_GEO = "FIXED.GEOGRAPHY"; if (AppPreferences.getGlobalPrefs().getBoolean(FIXED_GEO, false)) { //return; } String sql = String.format( "SELECT COUNT(*) FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE TABLE_SCHEMA = '%s' AND TABLE_NAME = 'geoname'", DBConnection.getInstance().getDatabaseName()); if (BasicSQLUtils.getCount(sql) == 0) { AppPreferences.getGlobalPrefs().putBoolean(FIXED_GEO, true); return; } final int numRecs = BasicSQLUtils.getCountAsInt( "SELECT COUNT(*) FROM geoname ge INNER JOIN geography g ON ge.name = g.Name WHERE ge.Name <> ge.asciiname"); if (BasicSQLUtils.getCount(sql) == 0) { AppPreferences.getGlobalPrefs().putBoolean(FIXED_GEO, true); return; } final ProgressFrame prefProgFrame = new ProgressFrame(getResourceString("UPDATE_SCHEMA_TITLE")); prefProgFrame.adjustProgressFrame(); prefProgFrame.getCloseBtn().setVisible(false); prefProgFrame.getProcessProgress().setIndeterminate(true); prefProgFrame.setDesc(UIRegistry.getLocalizedMessage("UPDATE_GEO")); UIHelper.centerAndShow(prefProgFrame); prefProgFrame.setProcess(0, 100); SwingWorker<Boolean, Boolean> worker = new SwingWorker<Boolean, Boolean>() { @Override protected Boolean doInBackground() throws Exception { Statement stmt = null; PreparedStatement pStmt = null; try { Connection currDBConn = DBConnection.getInstance().getConnection(); pStmt = currDBConn.prepareStatement("UPDATE geography SET Name=? WHERE GeographyID=?"); stmt = currDBConn.createStatement(); int cnt = 0; String sqlStr = "SELECT ge.asciiname, g.GeographyID FROM geoname ge INNER JOIN geography g ON ge.name = g.Name WHERE ge.Name <> ge.asciiname"; ResultSet rs = stmt.executeQuery(sqlStr); while (rs.next()) { pStmt.setString(1, rs.getString(1)); pStmt.setInt(2, rs.getInt(2)); if (pStmt.executeUpdate() != 1) { } cnt++; if (prefProgFrame != null && cnt % 100 == 0) { setProgress((int) (cnt / numRecs * 100.0)); } } rs.close(); if (prefProgFrame != null) { prefProgFrame.setProcess(numRecs); } AppPreferences.getGlobalPrefs().putBoolean(FIXED_GEO, true); } catch (Exception ex) { ex.printStackTrace(); edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(BuildFromGeonames.class, ex); } finally { try { if (stmt != null) { stmt.close(); } if (pStmt != null) { pStmt.close(); } } catch (Exception ex) { ex.printStackTrace(); } } return true; } /* (non-Javadoc) * @see javax.swing.SwingWorker#done() */ @Override protected void done() { super.done(); prefProgFrame.setVisible(false); prefProgFrame.dispose(); } }; worker.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(final PropertyChangeEvent evt) { if ("progress".equals(evt.getPropertyName())) { prefProgFrame.setProcess((Integer) evt.getNewValue()); } } }); worker.execute(); }
From source file:org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewerComponent.java
/** * Implemented as specified by the {@link TreeViewer} interface. * @see TreeViewer#handleSplitImage(Map, Object, int) *//*from w ww . j a va2 s .c o m*/ public void handleSplitImage(ImageCheckerResult result, final Object action, ImageCheckerType index) { if (!CollectionUtils.isEmpty(result.getMifResults())) { //Indicate what do depending on the index. MIFNotificationDialog dialog = new MIFNotificationDialog(view, result.getMifResults(), action, index, TreeViewerAgent.getAvailableUserGroups()); dialog.addPropertyChangeListener(new PropertyChangeListener() { /** * Moves the data. */ public void propertyChange(PropertyChangeEvent evt) { String name = evt.getPropertyName(); if (MIFNotificationDialog.MOVE_ALL_PROPERTY.equals(name)) { moveObject((ChgrpObject) evt.getNewValue()); } } }); UIUtilities.centerAndShow(dialog); return; } // show a warning if the images to be deleted are linked to multiple datasets: if (ImageCheckerType.DELETE.equals(index) && !result.getMultiLinkedImages().isEmpty()) { LinkNotificationDialog dialog = new LinkNotificationDialog(view, result); dialog.addPropertyChangeListener(new PropertyChangeListener() { /** * Removes the data */ public void propertyChange(PropertyChangeEvent evt) { String name = evt.getPropertyName(); if (LinkNotificationDialog.DELETE_PROPERTY.equals(name)) { delete((List) action); } } }); UIUtilities.centerAndShow(dialog); return; } if (ImageCheckerType.DELETE.equals(index)) { delete((List) action); } else if (ImageCheckerType.CHGRP.equals(index)) { moveObject((ChgrpObject) action); } }