List of usage examples for java.beans PropertyChangeEvent getPropertyName
public String getPropertyName()
From source file:org.openmicroscopy.shoola.agents.metadata.editor.EditorUI.java
/** * Returns the collection of attachments. * //from w ww . jav a 2s . c o m * @param src The source of the mouse pressed. * @param location The location of the mouse pressed. */ void removeAttachedFiles(Component src, Point location) { if (!generalPane.hasAttachmentsToUnlink()) return; if (model.isAdministrator() || model.isGroupLeader()) { if (docMenu == null) { docMenu = new PermissionMenu(PermissionMenu.REMOVE, "Attachments"); docMenu.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { String n = evt.getPropertyName(); if (PermissionMenu.SELECTED_LEVEL_PROPERTY.equals(n)) { List<FileAnnotationData> toRemove = model .getFileAnnotatationsByLevel((Integer) evt.getNewValue()); model.fireFileAnnotationRemoveCheck(toRemove); } } }); } docMenu.show(src, location.x, location.y); return; } SwingUtilities.convertPointToScreen(location, src); MessageBox box = new MessageBox(model.getRefFrame(), "Remove All Attachments", "Are you sure you want to remove all Attachments?"); Dimension d = box.getPreferredSize(); Point p = new Point(location.x - d.width / 2, location.y); if (box.showMsgBox(p) == MessageBox.YES_OPTION) { List<FileAnnotationData> list = generalPane.removeAttachedFiles(); if (list.size() > 0) model.fireFileAnnotationRemoveCheck(list); } }
From source file:com.diversityarrays.kdxplore.field.FieldViewDialog.java
public FieldViewDialog(Window owner, String title, SampleGroupChoice sgcSamples, Trial trial, SampleGroupChoice sgcNewMedia, KDSmartDatabase db) throws IOException { super(owner, title, ModalityType.MODELESS); advanceRetreatControls = Box.createHorizontalBox(); advanceRetreatControls.add(new JButton(retreatAction)); advanceRetreatControls.add(new JButton(advanceAction)); autoAdvanceControls = Box.createHorizontalBox(); autoAdvanceControls.add(new JButton(autoAdvanceAction)); autoAdvanceOption.addActionListener(new ActionListener() { @Override/*w w w. jav a 2 s . c o m*/ public void actionPerformed(ActionEvent e) { updateMovementControls(); } }); this.database = db; this.sampleGroupChoiceForSamples = sgcSamples; this.sampleGroupChoiceForNewMedia = sgcNewMedia; NumberSpinner fontSpinner = new NumberSpinner(new SpinnerNumberModel(), "0.00"); this.fieldViewPanel = FieldViewPanel.create(database, trial, SeparatorVisibilityOption.VISIBLE, null, Box.createHorizontalGlue(), new JButton(showInfoAction), Box.createHorizontalGlue(), new JLabel("Font Size:"), fontSpinner, Box.createHorizontalGlue(), advanceRetreatControls, autoAdvanceOption, autoAdvanceControls); initialiseAction(advanceAction, "ic_object_advance_black.png", "Auto-Advance"); this.xyProvider = fieldViewPanel.getXYprovider(); this.traitMap = fieldViewPanel.getTraitMap(); fieldLayoutTable = fieldViewPanel.getFieldLayoutTable(); JScrollPane scrollPane = fieldViewPanel.getFieldTableScrollPane(); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); fieldLayoutTable.setTransferHandler(flth); fieldLayoutTable.setDropMode(DropMode.ON); fieldLayoutTable.addMouseListener(new MouseAdapter() { JPopupMenu popupMenu; @Override public void mouseClicked(MouseEvent e) { if (!SwingUtilities.isRightMouseButton(e) || 1 != e.getClickCount()) { return; } Point pt = e.getPoint(); int row = fieldLayoutTable.rowAtPoint(pt); if (row >= 0) { int col = fieldLayoutTable.columnAtPoint(pt); if (col >= 0) { Plot plot = fieldViewPanel.getPlotAt(col, row); if (plot != null) { if (popupMenu == null) { popupMenu = new JPopupMenu("View Attachments"); } popupMenu.removeAll(); Set<File> set = plot.getMediaFiles(); if (Check.isEmpty(set)) { popupMenu.add(new JMenuItem("No Attachments available")); } else { for (File file : set) { Action a = new AbstractAction(file.getName()) { @Override public void actionPerformed(ActionEvent e) { try { Desktop.getDesktop().browse(file.toURI()); } catch (IOException e1) { MsgBox.warn(FieldViewDialog.this, e1, file.getName()); } } }; popupMenu.add(new JMenuItem(a)); } } popupMenu.show(fieldLayoutTable, pt.x, pt.y); } } } } }); Font font = fieldLayoutTable.getFont(); float fontSize = font.getSize2D(); fontSizeModel = new SpinnerNumberModel(fontSize, fontSize, 50.0, 1.0); fontSpinner.setModel(fontSizeModel); fontSizeModel.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { float fsize = fontSizeModel.getNumber().floatValue(); System.out.println("Using fontSize=" + fsize); Font font = fieldLayoutTable.getFont().deriveFont(fsize); fieldLayoutTable.setFont(font); FontMetrics fm = fieldLayoutTable.getFontMetrics(font); int lineHeight = fm.getMaxAscent() + fm.getMaxDescent(); fieldLayoutTable.setRowHeight(4 * lineHeight); // GuiUtil.initialiseTableColumnWidths(fieldLayoutTable, false); fieldLayoutTable.repaint(); } }); fieldLayoutTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); fieldLayoutTable.setResizable(true, true); fieldLayoutTable.getTableColumnResizer().setResizeAllColumns(true); advanceAction.setEnabled(false); fieldLayoutTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { handlePlotSelection(); } } }); TableColumnModel columnModel = fieldLayoutTable.getColumnModel(); columnModel.addColumnModelListener(new TableColumnModelListener() { @Override public void columnSelectionChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { handlePlotSelection(); } } @Override public void columnRemoved(TableColumnModelEvent e) { } @Override public void columnMoved(TableColumnModelEvent e) { } @Override public void columnMarginChanged(ChangeEvent e) { } @Override public void columnAdded(TableColumnModelEvent e) { } }); PropertyChangeListener listener = new PropertyChangeListener() { // Use a timer and redisplay other columns when delay is GT 100 ms Timer timer = new Timer(true); TimerTask timerTask; long lastActive; boolean busy = false; private int eventColumnWidth; private TableColumn eventColumn; @Override public void propertyChange(PropertyChangeEvent evt) { if (busy) { return; } if (evt.getSource() instanceof TableColumn && "width".equals(evt.getPropertyName())) { eventColumn = (TableColumn) evt.getSource(); eventColumnWidth = eventColumn.getWidth(); lastActive = System.currentTimeMillis(); if (timerTask == null) { timerTask = new TimerTask() { @Override public void run() { if (System.currentTimeMillis() - lastActive > 200) { timerTask.cancel(); timerTask = null; busy = true; try { for (Enumeration<TableColumn> en = columnModel.getColumns(); en .hasMoreElements();) { TableColumn tc = en.nextElement(); if (tc != eventColumn) { tc.setWidth(eventColumnWidth); } } } finally { busy = false; } } } }; timer.scheduleAtFixedRate(timerTask, 100, 150); } } } }; for (Enumeration<TableColumn> en = columnModel.getColumns(); en.hasMoreElements();) { TableColumn tc = en.nextElement(); tc.addPropertyChangeListener(listener); } Map<Integer, Plot> plotById = new HashMap<>(); for (Plot plot : fieldViewPanel.getFieldLayout()) { plotById.put(plot.getPlotId(), plot); } TrialItemVisitor<Sample> sampleVisitor = new TrialItemVisitor<Sample>() { @Override public void setExpectedItemCount(int count) { } @Override public boolean consumeItem(Sample sample) throws IOException { Plot plot = plotById.get(sample.getPlotId()); if (plot == null) { throw new IOException("Missing plot for plotId=" + sample.getPlotId() + " sampleIdent=" + Util.createUniqueSampleKey(sample)); } plot.addSample(sample); SampleCounts counts = countsByTraitId.get(sample.getTraitId()); if (counts == null) { counts = new SampleCounts(); countsByTraitId.put(sample.getTraitId(), counts); } if (sample.hasBeenScored()) { ++counts.scored; } else { ++counts.unscored; } return true; } }; database.visitSamplesForTrial(sampleGroupChoiceForSamples, trial.getTrialId(), SampleOrder.ALL_BY_PLOT_ID_THEN_TRAIT_ID_THEN_INSTANCE_NUMBER_ORDER_THEN_SPECIMEN_NUMBER, sampleVisitor); setDefaultCloseOperation(DISPOSE_ON_CLOSE); this.trial = trial; KDClientUtils.initAction(ImageId.SETTINGS_24, showInfoAction, "Trial Summary"); Action clear = new AbstractAction("Clear") { @Override public void actionPerformed(ActionEvent e) { infoTextArea.setText(""); } }; JPanel bottom = new JPanel(new BorderLayout()); bottom.add(GuiUtil.createLabelSeparator("Plot Details", new JButton(clear)), BorderLayout.NORTH); bottom.add(new JScrollPane(infoTextArea), BorderLayout.CENTER); JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, fieldViewPanel, new JScrollPane(infoTextArea)); splitPane.setResizeWeight(0.0); splitPane.setOneTouchExpandable(true); setContentPane(splitPane); updateMovementControls(); pack(); }
From source file:org.openmicroscopy.shoola.agents.treeviewer.view.ToolBar.java
/** * Creates the menu displaying the groups and users. * /* ww w.j a v a 2s. c o m*/ * @param source The invoker. * @param p The location of the mouse clicked. */ private void createGroupsAndUsersMenu(Component source, Point p) { if (!source.isEnabled()) return; Collection groups = model.getGroups(); if (CollectionUtils.isEmpty(groups)) return; popupMenu.removeAll(); GroupData group; List sortedGroups = sorter.sort(groups); //Determine the group already displayed. Browser browser = model.getBrowser(Browser.PROJECTS_EXPLORER); List<TreeImageDisplay> nodes; ExperimenterVisitor visitor; //Find the user already added to the selected group. visitor = new ExperimenterVisitor(browser, -1); browser.accept(visitor); nodes = visitor.getNodes(); Iterator<TreeImageDisplay> k = nodes.iterator(); List<Long> groupIds = new ArrayList<Long>(); long id; while (k.hasNext()) { id = k.next().getUserObjectId(); if (id >= 0) groupIds.add(id); } //Create the group menu. Iterator i = sortedGroups.iterator(); int size = sortedGroups.size(); long userID = model.getExperimenter().getId(); //First add item to toggle between users and group display DataMenuItem data = new DataMenuItem(DataMenuItem.USERS_TEXT, null); data.setSelected(model.getDisplayMode() == LookupNames.EXPERIMENTER_DISPLAY); data.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { String name = evt.getPropertyName(); if (DataMenuItem.ITEM_SELECTED_PROPERTY.equals(name)) { DataMenuItem data = (DataMenuItem) evt.getNewValue(); handleSelectionDisplay(data.isSelected()); } } }); JPanel panel = new JPanel(); panel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); panel.setBorder(null); IconManager icons = IconManager.getInstance(); panel.add(new JLabel(icons.getIcon(IconManager.TRANSPARENT))); panel.add(data); popupMenu.add(panel); popupMenu.add(new JSeparator()); GroupItem item; GroupItem allGroup = null; //First add option to add all the groups. if (size > 1) { item = new GroupItem(false); item.setUserID(userID); createGroupMenu(item, 0); popupMenu.add(item); popupMenu.add(new JSeparator()); allGroup = item; } boolean selected; int count = 0; while (i.hasNext()) { group = (GroupData) i.next(); boolean b = groupIds.contains(group.getId()); item = new GroupItem(group, b, size > 1); item.setUserID(userID); selected = createGroupMenu(item, size); popupMenu.add(item); if (selected) count++; } if (allGroup != null) { allGroup.setMenuSelected(count == sortedGroups.size(), false); } popupMenu.show(source, p.x, p.y); }
From source file:org.noise_planet.noisecapture.CalibrationLinearityActivity.java
@Override public void propertyChange(PropertyChangeEvent event) { if ((calibration_step == CALIBRATION_STEP.CALIBRATION || calibration_step == CALIBRATION_STEP.WARMUP) && AudioProcess.PROP_DELAYED_STANDART_PROCESSING.equals(event.getPropertyName())) { // New leq AudioProcess.AudioMeasureResult measure = (AudioProcess.AudioMeasureResult) event.getNewValue(); final double leq; // Use global dB value or only the selected frequency band leq = measure.getGlobaldBaValue(); if (calibration_step == CALIBRATION_STEP.CALIBRATION) { leqStats.addLeq(leq);/* w ww . j a v a2 s. com*/ if (!freqLeqStats.isEmpty() && splBackroundNoise != 0) { freqLeqStats.get(freqLeqStats.size() - 1).pushMeasure(measure.getResult()); } } runOnUiThread(new Runnable() { @Override public void run() { double leqToShow; if (calibration_step == CALIBRATION_STEP.CALIBRATION) { leqToShow = leqStats.getLeqMean(); } else { leqToShow = leq; } textDeviceLevel.setText(String.format(Locale.getDefault(), "%.1f", leqToShow)); } }); } }
From source file:Provider.GoogleMapsStatic.TestUI.SampleApp.java
private SwingUIHookAdapter _initHook(SwingUIHookAdapter hook) { hook.enableRecieveStatusNotification(checkboxRecvStatus.isSelected()); hook.enableSendStatusNotification(checkboxSendStatus.isSelected()); hook.setProgressMessage(ttfProgressMsg.getText()); PropertyChangeListener listener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { SwingUIHookAdapter.PropertyList type = ProgressMonitorUtils.parseTypeFrom(evt); int progress = ProgressMonitorUtils.parsePercentFrom(evt); String msg = ProgressMonitorUtils.parseMessageFrom(evt); progressBar.setValue(progress); progressBar.setString(type.toString()); sout(msg);/*from www. j av a 2s . c om*/ } }; hook.addRecieveStatusListener(listener); hook.addSendStatusListener(listener); hook.addUnderlyingIOStreamInterruptedOrClosed(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { sout(evt.getPropertyName() + " fired!!!"); } }); return hook; }
From source file:org.tinymediamanager.ui.movies.MovieExtendedSearchPanel.java
/** * Instantiates a new movie extended search * //from w w w. ja v a 2 s.c o m * @param model * the model */ public MovieExtendedSearchPanel(MovieSelectionModel model) { super(); setOpaque(false); shadowAlpha = 100; arcs = new Dimension(10, 10); this.movieSelectionModel = model; Map<MovieSearchOptions, Object> savedSearchOptions = MovieModuleManager.MOVIE_SETTINGS.getUiFilters(); // add a dummy mouse listener to prevent clicking through addMouseListener(new MouseAdapter() { }); listCheckListener = new ListCheckListener() { @Override public void removeCheck(ListEvent event) { actionFilter.actionPerformed(new ActionEvent(event.getSource(), 1, "checked")); } @Override public void addCheck(ListEvent event) { actionFilter.actionPerformed(new ActionEvent(event.getSource(), 1, "checked")); } }; setLayout(new FormLayout(new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormSpecs.UNRELATED_GAP_COLSPEC, }, new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.UNRELATED_GAP_ROWSPEC, })); JLabel lblFilterBy = new JLabel(BUNDLE.getString("movieextendedsearch.filterby")); //$NON-NLS-1$ setComponentFont(lblFilterBy); add(lblFilterBy, "2, 2, 3, 1"); cbFilterNewMovies = new JCheckBox(""); cbFilterNewMovies.setUI(CHECKBOX_UI); // $hide$ cbFilterNewMovies.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.NEW_MOVIES)); cbFilterNewMovies.setAction(actionFilter); add(cbFilterNewMovies, "2, 4"); lblNewMovies = new JLabel(BUNDLE.getString("movieextendedsearch.newmovies")); //$NON-NLS-1$ setComponentFont(lblNewMovies); add(lblNewMovies, "4, 4, right, default"); cbFilterDuplicates = new JCheckBox(""); cbFilterDuplicates.setUI(CHECKBOX_UI); // $hide$ cbFilterDuplicates.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.DUPLICATES)); cbFilterDuplicates.setAction(actionFilter); add(cbFilterDuplicates, "2, 5"); JLabel lblShowDuplicates = new JLabel(BUNDLE.getString("movieextendedsearch.duplicates")); //$NON-NLS-1$ setComponentFont(lblShowDuplicates); add(lblShowDuplicates, "4, 5, right, default"); cbFilterWatched = new JCheckBox(""); cbFilterWatched.setUI(CHECKBOX_UI); // $hide$ cbFilterWatched.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.WATCHED)); cbFilterWatched.setAction(actionFilter); add(cbFilterWatched, "2, 6"); JLabel lblWatchedFlag = new JLabel(BUNDLE.getString("movieextendedsearch.watched")); //$NON-NLS-1$ setComponentFont(lblWatchedFlag); add(lblWatchedFlag, "4, 6, right, default"); cbWatched = new SmallComboBox(WatchedFlag.values()); setComponentFont(cbWatched); cbWatched.setAction(actionFilter); add(cbWatched, "6, 6, fill, default"); cbFilterGenre = new JCheckBox(""); cbFilterGenre.setUI(CHECKBOX_UI); // $hide$ cbFilterGenre.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.GENRE)); cbFilterGenre.setAction(actionFilter); add(cbFilterGenre, "2, 7"); JLabel lblGenre = new JLabel(BUNDLE.getString("movieextendedsearch.genre")); //$NON-NLS-1$ setComponentFont(lblGenre); add(lblGenre, "4, 7, right, default"); cbGenre = new SmallComboBox(MediaGenres.values()); setComponentFont(cbGenre); cbGenre.setAction(actionFilter); add(cbGenre, "6, 7, fill, default"); cbFilterCertification = new JCheckBox(""); cbFilterCertification.setUI(CHECKBOX_UI); // $hide$ cbFilterCertification.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.CERTIFICATION)); cbFilterCertification.setAction(actionFilter); add(cbFilterCertification, "2, 8"); lblCertification = new JLabel(BUNDLE.getString("metatag.certification")); //$NON-NLS-1$ setComponentFont(lblCertification); add(lblCertification, "4, 8, right, default"); cbCertification = new SmallComboBox(); setComponentFont(cbCertification); cbCertification.setAction(actionFilter); add(cbCertification, "6, 8, fill, default"); cbFilterYear = new JCheckBox(""); cbFilterYear.setUI(CHECKBOX_UI); // $hide$ cbFilterYear.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.YEAR)); cbFilterYear.setAction(actionFilter); add(cbFilterYear, "2, 9"); lblYear = new JLabel(BUNDLE.getString("metatag.year")); //$NON-NLS-1$ setComponentFont(lblYear); add(lblYear, "4, 9, right, default"); int year = Calendar.getInstance().get(Calendar.YEAR); spYear = new JSpinner(); setComponentFont(spYear); spYear.setUI(new SmallSpinnerUI());// $hide$ spYear.setModel(new SpinnerNumberModel(year, 0, 3000, 1)); spYear.setEditor(new JSpinner.NumberEditor(spYear, "#")); spYear.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { actionFilter.actionPerformed(null); } }); add(spYear, "6, 9"); cbFilterCast = new JCheckBox(""); cbFilterCast.setUI(CHECKBOX_UI); // $hide$ cbFilterCast.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.CAST)); cbFilterCast.setAction(actionFilter); add(cbFilterCast, "2, 10"); JLabel lblCastMember = new JLabel(BUNDLE.getString("movieextendedsearch.cast")); //$NON-NLS-1$ setComponentFont(lblCastMember); add(lblCastMember, "4, 10, right, default"); tfCastMember = new JTextField(); setComponentFont(tfCastMember); tfCastMember.setBorder(new SmallTextFieldBorder()); add(tfCastMember, "6, 10, fill, default"); tfCastMember.setColumns(10); tfCastMember.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(DocumentEvent e) { actionFilter.actionPerformed(null); } public void insertUpdate(DocumentEvent e) { actionFilter.actionPerformed(null); } public void removeUpdate(DocumentEvent e) { actionFilter.actionPerformed(null); } }); cbFilterTag = new JCheckBox(""); cbFilterTag.setUI(CHECKBOX_UI); // $hide$ cbFilterTag.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.TAG)); cbFilterTag.setAction(actionFilter); add(cbFilterTag, "2, 11"); JLabel lblTag = new JLabel(BUNDLE.getString("movieextendedsearch.tag")); //$NON-NLS-1$ setComponentFont(lblTag); add(lblTag, "4, 11, right, default"); cbTag = new SmallCheckComboBox(); cbTag.setTextFor(CheckComboBox.NONE, BUNDLE.getString("movieextendedsearch.tags.selected.none")); //$NON-NLS-1$ cbTag.setTextFor(CheckComboBox.MULTIPLE, BUNDLE.getString("movieextendedsearch.tags.selected.multiple")); //$NON-NLS-1$ cbTag.setTextFor(CheckComboBox.ALL, BUNDLE.getString("movieextendedsearch.tags.selected.all")); //$NON-NLS-1$ cbTag.getModel().addListCheckListener(listCheckListener); add(cbTag, "6, 11, fill, default"); cbFilterMovieset = new JCheckBox(""); cbFilterMovieset.setUI(CHECKBOX_UI); // $hide$ cbFilterMovieset.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.MOVIESET)); cbFilterMovieset.setAction(actionFilter); add(cbFilterMovieset, "2, 12"); JLabel lblMoviesInMovieset = new JLabel(BUNDLE.getString("movieextendedsearch.movieset")); //$NON-NLS-1$ setComponentFont(lblMoviesInMovieset); add(lblMoviesInMovieset, "4, 12, right, default"); cbMovieset = new SmallComboBox(MovieInMovieSet.values()); setComponentFont(cbMovieset); cbMovieset.setAction(actionFilter); add(cbMovieset, "6, 12, fill, default"); cbFilterVideoFormat = new JCheckBox(""); cbFilterVideoFormat.setUI(CHECKBOX_UI); // $hide$ cbFilterVideoFormat.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.VIDEO_FORMAT)); cbFilterVideoFormat.setAction(actionFilter); add(cbFilterVideoFormat, "2, 13"); JLabel lblVideoFormat = new JLabel(BUNDLE.getString("metatag.resolution")); //$NON-NLS-1$ setComponentFont(lblVideoFormat); add(lblVideoFormat, "4, 13, right, default"); cbVideoFormat = new SmallComboBox(getVideoFormats()); setComponentFont(cbVideoFormat); cbVideoFormat.setAction(actionFilter); add(cbVideoFormat, "6, 13, fill, default"); cbFilterVideoCodec = new JCheckBox(""); cbFilterVideoCodec.setUI(CHECKBOX_UI); // $hide$ cbFilterVideoCodec.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.VIDEO_CODEC)); cbFilterVideoCodec.setAction(actionFilter); add(cbFilterVideoCodec, "2, 14"); JLabel lblVideoCodec = new JLabel(BUNDLE.getString("metatag.videocodec")); //$NON-NLS-1$ setComponentFont(lblVideoCodec); add(lblVideoCodec, "4, 14, right, default"); cbVideoCodec = new SmallComboBox(); setComponentFont(cbVideoCodec); cbVideoCodec.setAction(actionFilter); add(cbVideoCodec, "6, 14, fill, default"); cbFilterVideo3D = new JCheckBox(""); cbFilterVideo3D.setUI(CHECKBOX_UI); // $hide$ cbFilterVideo3D.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.VIDEO_3D)); cbFilterVideo3D.addActionListener(actionFilter); add(cbFilterVideo3D, "2, 15"); JLabel lblVideo3D = new JLabel(BUNDLE.getString("metatag.3d")); //$NON-NLS-1$ setComponentFont(lblVideo3D); add(lblVideo3D, "4, 15, right, default"); cbFilterAudioCodec = new JCheckBox(""); cbFilterAudioCodec.setUI(CHECKBOX_UI); // $hide$ cbFilterAudioCodec.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.AUDIO_CODEC)); cbFilterAudioCodec.setAction(actionFilter); add(cbFilterAudioCodec, "2, 16"); JLabel lblAudioCodec = new JLabel(BUNDLE.getString("metatag.audiocodec")); //$NON-NLS-1$ setComponentFont(lblAudioCodec); add(lblAudioCodec, "4, 16, right, default"); cbAudioCodec = new SmallComboBox(); setComponentFont(cbAudioCodec); cbAudioCodec.setAction(actionFilter); add(cbAudioCodec, "6, 16, fill, default"); cbFilterDatasource = new JCheckBox(""); cbFilterDatasource.setUI(CHECKBOX_UI); // $hide$ cbFilterDatasource.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.DATASOURCE)); cbFilterDatasource.setAction(actionFilter); add(cbFilterDatasource, "2, 17"); JLabel lblDatasource = new JLabel(BUNDLE.getString("metatag.datasource")); //$NON-NLS-1$ setComponentFont(lblDatasource); add(lblDatasource, "4, 17, right, default"); cbDatasource = new SmallCheckComboBox(); cbDatasource.setTextFor(CheckComboBox.NONE, BUNDLE.getString("checkcombobox.selected.none")); //$NON-NLS-1$ cbDatasource.setTextFor(CheckComboBox.MULTIPLE, BUNDLE.getString("checkcombobox.selected.multiple")); //$NON-NLS-1$ cbDatasource.setTextFor(CheckComboBox.ALL, BUNDLE.getString("checkcombobox.selected.all")); //$NON-NLS-1$ cbDatasource.getModel().addListCheckListener(listCheckListener); add(cbDatasource, "6, 17, fill, default"); cbFilterMediaSource = new JCheckBox(""); cbFilterMediaSource.setUI(CHECKBOX_UI); // $hide$ cbFilterMediaSource.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.MEDIA_SOURCE)); cbFilterMediaSource.addActionListener(actionFilter); add(cbFilterMediaSource, "2, 18"); JLabel lblMediaSource = new JLabel(BUNDLE.getString("metatag.source")); //$NON-NLS-1$ setComponentFont(lblMediaSource); add(lblMediaSource, "4, 18, right, default"); cbMediaSource = new SmallComboBox(MediaSource.values()); setComponentFont(cbMediaSource); cbMediaSource.setAction(actionFilter); add(cbMediaSource, "6, 18, fill, default"); cbFilterMissingMetadata = new JCheckBox(""); cbFilterMissingMetadata.setUI(CHECKBOX_UI); // $hide$ cbFilterMissingMetadata.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.MISSING_METADATA)); cbFilterMissingMetadata.setAction(actionFilter); add(cbFilterMissingMetadata, "2, 19"); JLabel lblMissingMetadata = new JLabel(BUNDLE.getString("movieextendedsearch.missingmetadata")); //$NON-NLS-1$ setComponentFont(lblMissingMetadata); add(lblMissingMetadata, "4, 19, right, default"); cbFilterMissingArtwork = new JCheckBox(""); cbFilterMissingArtwork.setUI(CHECKBOX_UI); // $hide$ cbFilterMissingArtwork.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.MISSING_ARTWORK)); cbFilterMissingArtwork.setAction(actionFilter); add(cbFilterMissingArtwork, "2, 20"); JLabel lblMissingArtwork = new JLabel(BUNDLE.getString("movieextendedsearch.missingartwork")); //$NON-NLS-1$ setComponentFont(lblMissingArtwork); add(lblMissingArtwork, "4, 20, right, default"); cbFilterMissingSubtitles = new JCheckBox(""); cbFilterMissingSubtitles.setUI(CHECKBOX_UI); // $hide$ cbFilterMissingSubtitles.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.MISSING_SUBTITLES)); cbFilterMissingSubtitles.setAction(actionFilter); add(cbFilterMissingSubtitles, "2, 21"); JLabel lblMissingSubtitles = new JLabel(BUNDLE.getString("movieextendedsearch.missingsubtitles")); //$NON-NLS-1$ setComponentFont(lblMissingSubtitles); add(lblMissingSubtitles, "4, 21, right, default"); cbFilterOffline = new JCheckBox(""); cbFilterOffline.setUI(CHECKBOX_UI); // $hide$ cbFilterOffline.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.OFFLINE)); cbFilterOffline.setAction(actionFilter); add(cbFilterOffline, "2, 22"); lblOffline = new JLabel(BUNDLE.getString("movieextendedsearch.offline")); //$NON-NLS-1$ setComponentFont(lblOffline); add(lblOffline, "4, 22, right, default"); cbOffline = new SmallComboBox(OfflineMovie.values()); cbOffline.setAction(actionFilter); add(cbOffline, "6, 22, fill, default"); JSeparator separator = new JSeparator(); add(separator, "2, 24, 5, 1"); JLabel lblSortBy = new JLabel(BUNDLE.getString("movieextendedsearch.sortby")); //$NON-NLS-1$ setComponentFont(lblSortBy); add(lblSortBy, "2, 26, 3, 1"); cbSortColumn = new SmallComboBox(SortColumn.values()); setComponentFont(cbSortColumn); cbSortColumn.setAction(actionSort); add(cbSortColumn, "2, 28, 3, 1, fill, default"); cbSortOrder = new SmallComboBox(SortOrder.values()); setComponentFont(cbSortOrder); cbSortOrder.setAction(actionSort); add(cbSortOrder, "6, 28, fill, default"); PropertyChangeListener propertyChangeListener = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getSource() instanceof MovieList && "tag".equals(evt.getPropertyName())) { buildAndInstallTagsArray(); } if (evt.getSource() instanceof MovieList && "videoCodec".equals(evt.getPropertyName())) { buildAndInstallCodecArray(); } if (evt.getSource() instanceof MovieList && "audioCodec".equals(evt.getPropertyName())) { buildAndInstallCodecArray(); } if (evt.getSource() instanceof MovieSettings && "movieDataSource".equals(evt.getPropertyName())) { buildAndInstallDatasourceArray(); } if (evt.getSource() instanceof MovieList && "certification".equals(evt.getPropertyName())) { buildAndInstallCertificationArray(); } } }; movieList.addPropertyChangeListener(propertyChangeListener); MovieModuleManager.MOVIE_SETTINGS.addPropertyChangeListener(propertyChangeListener); buildAndInstallTagsArray(); buildAndInstallCodecArray(); buildAndInstallDatasourceArray(); buildAndInstallCertificationArray(); }
From source file:edu.ku.brc.specify.config.init.DatabasePanel.java
/** * //www .ja v a 2 s . com */ public void createDB() { getValues(properties); final String databaseName = dbNameTxt.getText(); final String dbUserName = usernameTxt.getText(); final String dbPwd = passwordTxt.getText(); final String hostName = hostNameTxt.getText(); if (UIRegistry.isMobile()) { DBConnection.clearMobileMachineDir(); File tmpDir = DBConnection.getMobileMachineDir(databaseName); UIRegistry.setEmbeddedDBPath(tmpDir.getAbsolutePath()); } final DatabaseDriverInfo driverInfo = (DatabaseDriverInfo) drivers.getSelectedItem(); String connStrInitial = driverInfo.getConnectionStr(DatabaseDriverInfo.ConnectionType.Open, hostName, databaseName, dbUserName, dbPwd, driverInfo.getName()); //System.err.println(connStrInitial); DBConnection.checkForEmbeddedDir(connStrInitial); DBConnection.getInstance().setDriverName(driverInfo.getName()); DBConnection.getInstance().setServerName(hostName); VerifyStatus status = verifyDatabase(properties); if ((isOK == null || !isOK) && status == VerifyStatus.OK) { progressBar.setIndeterminate(true); progressBar.setVisible(true); label.setText(getResourceString("CONN_DB")); createDBBtn.setVisible(false); setUIEnabled(false); DatabasePanel.this.label.setForeground(Color.BLACK); SwingWorker<Object, Object> worker = new SwingWorker<Object, Object>() { @Override protected Object doInBackground() throws Exception { isOK = false; DBMSUserMgr mgr = DBMSUserMgr.getInstance(); List<PermissionInfo> perms = null; boolean dbmsOK = false; if (driverInfo.isEmbedded()) { if (checkForProcesses) { ProcessListUtil.checkForMySQLProcesses(null); checkForProcesses = false; } if (UIRegistry.isMobile()) { File mobileTmpDir = DBConnection.getMobileMachineDir(); if (!mobileTmpDir.exists()) { if (!mobileTmpDir.mkdirs()) { System.err.println( "Dir[" + mobileTmpDir.getAbsolutePath() + "] didn't get created!"); // throw exception } DBConnection.setCopiedToMachineDisk(true); } } String newConnStr = driverInfo.getConnectionStr(DatabaseDriverInfo.ConnectionType.Open, hostName, databaseName, dbUserName, dbPwd, driverInfo.getName()); if (driverInfo.isEmbedded()) { //System.err.println(newConnStr); try { Class.forName(driverInfo.getDriverClassName()); // This call will create the database if it doesn't exist DBConnection testDB = DBConnection.createInstance(driverInfo.getDriverClassName(), driverInfo.getDialectClassName(), databaseName, newConnStr, dbUserName, dbPwd); testDB.getConnection(); // Opens the connection if (testDB != null) { testDB.close(); } dbmsOK = true; } catch (Exception ex) { ex.printStackTrace(); } DBConnection.getInstance().setDatabaseName(null); } } else if (mgr.connectToDBMS(dbUserName, dbPwd, hostName)) { perms = mgr.getPermissionsForCurrentUser(); Pair<List<PermissionInfo>, List<PermissionInfo>> missingPerms = PermissionInfo .getMissingPerms(perms, createDBPerms, databaseName); if (missingPerms.getFirst().size() > 0) { final String missingPermStr = PermissionInfo.getMissingPermissionString(mgr, missingPerms.getFirst(), databaseName); SwingUtilities.invokeLater(new Runnable() { /* (non-Javadoc) * @see java.lang.Runnable#run() */ @Override public void run() { UIRegistry.showLocalizedError("SEC_MISSING_PERMS", dbUserName, missingPermStr); } }); dbmsOK = false; } else { dbmsOK = true; } mgr.close(); } if (dbmsOK) { properties.put(DB_SKIP_CREATE, false); if (perms != null) { properties.put(DBUSERPERMS, perms); } firePropertyChange(PROPNAME, 0, 1); try { SpecifySchemaGenerator.generateSchema(driverInfo, hostName, databaseName, dbUserName, dbPwd); // false means create new database, true means update String connStr = driverInfo.getConnectionStr(DatabaseDriverInfo.ConnectionType.Create, hostName, databaseName); if (connStr == null) { connStr = driverInfo.getConnectionStr(DatabaseDriverInfo.ConnectionType.Open, hostName, databaseName); } firePropertyChange(PROPNAME, 0, 2); // tryLogin sets up DBConnection if (UIHelper.tryLogin(driverInfo.getDriverClassName(), driverInfo.getDialectClassName(), dbNameTxt.getText(), connStr, dbUserName, dbPwd)) { if (!checkEngineCharSet(properties)) { return false; } isOK = true; firePropertyChange(PROPNAME, 0, 3); Thumbnailer thumb = Thumbnailer.getInstance(); File thumbFile = XMLHelper.getConfigDir("thumbnail_generators.xml"); thumb.registerThumbnailers(thumbFile); thumb.setQuality(0.5f); thumb.setMaxSize(128, 128); File attLoc = UIRegistry.getAppDataSubDir("AttachmentStorage", true); AttachmentManagerIface attachMgr = new FileStoreAttachmentManager(attLoc); AttachmentUtils.setAttachmentManager(attachMgr); AttachmentUtils.setThumbnailer(thumb); } else { errorKey = "NO_LOGIN_ROOT"; } } catch (Exception ex) { errorKey = "DB_UNRECOVERABLE"; } } else { errorKey = "NO_CONN_ROOT"; mgr.close(); } return null; } /* (non-Javadoc) * @see javax.swing.SwingWorker#done() */ @Override protected void done() { super.done(); setUIEnabled(true); progressBar.setIndeterminate(false); progressBar.setVisible(false); updateBtnUI(); createDBBtn.setVisible(!isOK); if (isOK) { label.setText(UIRegistry.getResourceString("DB_CREATED")); setUIEnabled(false); } else { label.setText(UIRegistry.getResourceString(errorKey != null ? errorKey : "ERR_CRE_DB")); UIRegistry.showLocalizedError(errorKey != null ? errorKey : "ERR_CRE_DB"); } } }; worker.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(final PropertyChangeEvent evt) { if (PROPNAME.equals(evt.getPropertyName())) { String key = null; switch ((Integer) evt.getNewValue()) { case 1: key = "BLD_SCHEMA"; break; case 2: key = "DB_FRST_LOGIN"; break; case 3: key = "BLD_CACHE"; break; default: break; } if (key != null) { DatabasePanel.this.label.setText(UIRegistry.getResourceString(key)); } } } }); worker.execute(); } else if (status == VerifyStatus.ERROR) { errorKey = "NO_LOGIN_ROOT"; DatabasePanel.this.label.setText(UIRegistry.getResourceString(errorKey)); DatabasePanel.this.label.setForeground(Color.RED); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { UIRegistry.getTopWindow().pack(); } }); } }
From source file:org.openmicroscopy.shoola.agents.metadata.editor.EditorComponent.java
public void handleFileAnnotationRemoveCheck(final FileAnnotationCheckResult result) { if (!result.getSingleParentAnnotations().isEmpty()) { JFrame f = MetadataViewerAgent.getRegistry().getTaskBar().getFrame(); FileAttachmentWarningDialog dlg = new FileAttachmentWarningDialog(f, result); dlg.addPropertyChangeListener(new PropertyChangeListener() { @Override/*from w w w . j ava 2 s .c om*/ public void propertyChange(PropertyChangeEvent arg0) { if (arg0.getPropertyName().equals(FileAttachmentWarningDialog.DELETE_PROPERTY)) { for (FileAnnotationData fd : result.getSingleParentAnnotations()) { view.deleteAnnotation(fd); } for (FileAnnotationData fd : result.getAllAnnotations()) { view.unlinkAttachedFile(fd); } } } }); UIUtilities.centerAndShow(dlg); } else { for (FileAnnotationData fd : result.getAllAnnotations()) { view.unlinkAttachedFile(fd); } } }
From source file:canreg.client.gui.dataentry.ImportView.java
/** * * @return/* w w w . j a va2 s . co m*/ */ @Action() public Task importAction() { // TODO: Add a handler for errors in the file structure... localSettings.setProperty("import_path", path); localSettings.writeSettings(); progressBar.setStringPainted(true); importButton.setEnabled(false); // this.dispose(); importTask = new ImportActionTask( org.jdesktop.application.Application.getInstance(canreg.client.CanRegClientApp.class)); importTask.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if ("progress".equals(evt.getPropertyName())) { progressBar.setValue((Integer) evt.getNewValue()); progressBar.setString(evt.getNewValue().toString() + "%"); } else if ("finished".equals(evt.getPropertyName())) { dispose(); } } }); return importTask; }
From source file:customize.swing.startMain.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - unknown panel1 = new JPanel(); JPanel panel2 = new JPanel(); JScrollPane scrollPane1 = new JScrollPane(); JPanel panel3 = new JPanel(); JPanel panel4 = new JPanel(); JPanel panel5 = new JPanel(); textField6 = new JTextField(); JPanel panel6 = new JPanel(); JLabel label1 = new JLabel(); JPanel panel7 = new JPanel(); JLabel label2 = new JLabel(); JPanel panel8 = new JPanel(); JLabel label3 = new JLabel(); JPanel panel9 = new JPanel(); textField2 = new JTextField(); ButtonView = new JButton(); JPanel panel10 = new JPanel(); textField7 = new JTextField(); JPanel panel11 = new JPanel(); textField1 = new JTextField(); JPanel panel12 = new JPanel(); JLabel label4 = new JLabel(); JPanel panel13 = new JPanel(); CheckBox1 = new JCheckBox(); CheckBox2 = new JCheckBox(); JPanel panel14 = new JPanel(); genButton = new JButton(); JScrollPane scrollPane2 = new JScrollPane(); JPanel panel15 = new JPanel(); JPanel panel16 = new JPanel(); TextField = new JTextField(); JPanel panel17 = new JPanel(); textField3 = new JTextField(); JPanel panel18 = new JPanel(); rootTextField = new JTextField(); JPanel panel19 = new JPanel(); PasswordField = new JPasswordField(); JPanel panel20 = new JPanel(); textField8 = new JTextField(); JPanel panel21 = new JPanel(); JLabel label5 = new JLabel(); JPanel panel22 = new JPanel(); JLabel label6 = new JLabel(); JPanel panel23 = new JPanel(); JLabel label7 = new JLabel(); JPanel panel24 = new JPanel(); JLabel label8 = new JLabel(); JPanel panel25 = new JPanel(); JLabel label9 = new JLabel(); JScrollPane scrollPane3 = new JScrollPane(); jscrollPane1 = new JTextPane(); //======== panel1 ======== {/*from w w w . ja v a 2 s . co m*/ // JFormDesigner evaluation mark panel1.setBorder(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), panel1.getBorder())); panel1.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); panel1.setLayout(new GridLayoutManager(5, 1, new Insets(0, 0, 0, 0), -1, -1)); //======== panel2 ======== { panel2.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); //======== scrollPane1 ======== { scrollPane1.setBorder(new TitledBorder("\u6587\u4ef6\u751f\u6210\u5730\u5740")); //======== panel3 ======== { panel3.setLayout(new GridLayoutManager(4, 2, new Insets(0, 0, 0, 0), -1, -1)); //======== panel4 ======== { panel4.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //======== panel5 ======== { panel5.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- textField6 ---- textField6.setEditable(true); textField6.setEnabled(true); textField6.setText(""); textField6.putClientProperty("html.disable", false); panel5.add(textField6, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel4.add(panel5, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); } panel3.add(panel4, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel6 ======== { panel6.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label1 ---- label1.setText("xml\u751f\u6210\u5728\u54ea\u4e2a\u5305\u540d\u4e0b"); panel6.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel3.add(panel6, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel7 ======== { panel7.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label2 ---- label2.setText("model\u751f\u6210\u5728\u54ea\u4e2a\u5305\u540d\u4e0b"); panel7.add(label2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel3.add(panel7, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel8 ======== { panel8.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label3 ---- label3.setText("\u6587\u4ef6\u7edf\u4e00\u751f\u6210\u8def\u5f84"); panel8.add(label3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel3.add(panel8, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel9 ======== { panel9.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); panel9.add(textField2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); //---- ButtonView ---- ButtonView.setText("\u6d4f\u89c8"); panel9.add(ButtonView, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel3.add(panel9, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel10 ======== { panel10.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- textField7 ---- textField7.setEditable(true); textField7.setEnabled(true); textField7.setText(""); textField7.putClientProperty("html.disable", true); panel10.add(textField7, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel3.add(panel10, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel11 ======== { panel11.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- textField1 ---- textField1.setEditable(true); textField1.setEnabled(true); textField1.setText(""); textField1.putClientProperty("html.disable", true); panel11.add(textField1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel3.add(panel11, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel12 ======== { panel12.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label4 ---- label4.setText("dao\u5c42\u751f\u6210\u5728\u54ea\u4e2a\u5305\u540d\u4e0b"); panel12.add(label4, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel3.add(panel12, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); } scrollPane1.setViewportView(panel3); } panel2.add(scrollPane1, new GridConstraints(0, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null)); } panel1.add(panel2, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel13 ======== { panel13.setBorder(new TitledBorder("\u53ef\u914d\u7f6e\u9879")); panel13.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); //---- CheckBox1 ---- CheckBox1.setSelected(true); CheckBox1.setText("\u662f\u5426\u4e3a\u9a7c\u5cf0\u547d\u540d\u89c4\u8303"); panel13.add(CheckBox1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); //---- CheckBox2 ---- CheckBox2.setSelected(true); CheckBox2.setText("\u662f\u5426\u751f\u6210\u6ce8\u91ca"); panel13.add(CheckBox2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel1.add(panel13, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel14 ======== { panel14.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- genButton ---- genButton.setText("\u751f\u6210"); panel14.add(genButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel1.add(panel14, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== scrollPane2 ======== { scrollPane2.setBorder(new TitledBorder("\u5fc5\u586b\u9879")); //======== panel15 ======== { panel15.setLayout(new GridLayoutManager(5, 2, new Insets(0, 0, 0, 0), -1, -1)); //======== panel16 ======== { panel16.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- TextField ---- TextField.setText("com.mysql.jdbc.Driver"); panel16.add(TextField, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel16, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel17 ======== { panel17.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- textField3 ---- textField3.setText("jdbc:mysql://192.168.0.13/mvp?characterEncoding=UTF-8"); panel17.add(textField3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel17, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel18 ======== { panel18.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- rootTextField ---- rootTextField.setText("root"); panel18.add(rootTextField, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel18, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel19 ======== { panel19.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- PasswordField ---- PasswordField.setText("elab@123"); panel19.add(PasswordField, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel19, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel20 ======== { panel20.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- textField8 ---- textField8.setText(""); panel20.add(textField8, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel20, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel21 ======== { panel21.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label5 ---- label5.setText("\u6570\u636e\u5e93\u9a71\u52a8:"); panel21.add(label5, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel21, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel22 ======== { panel22.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label6 ---- label6.setText("\u6570\u636e\u5e93\u8fde\u63a5\u5730\u5740:"); panel22.add(label6, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel22, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel23 ======== { panel23.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label7 ---- label7.setText("\u6570\u636e\u5e93\u7528\u6237\u540d:"); panel23.add(label7, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel23, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel24 ======== { panel24.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label8 ---- label8.setText("\u6570\u636e\u5e93\u5bc6\u7801:"); panel24.add(label8, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel24, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel25 ======== { panel25.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label9 ---- label9.setText("\u8868\u540d(\u53ef\u6a21\u7cca%)"); panel25.add(label9, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel25, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); } scrollPane2.setViewportView(panel15); } panel1.add(scrollPane2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null)); //======== scrollPane3 ======== { scrollPane3.setBorder(new TitledBorder("\u6ce8\u610f\u4e8b\u9879")); //---- jscrollPane1 ---- jscrollPane1.setEditable(true); jscrollPane1.setEnabled(true); jscrollPane1.setText( "\t1.\u8bf7\u4e0d\u8981\u91cd\u590d\u751f\u6210\u540c\u6837\u7684\u6587\u4ef6\u5728\u540c\u4e00\u4e2a\u76ee\u5f55\u5939\u4e0b\u3002"); scrollPane3.setViewportView(jscrollPane1); } panel1.add(scrollPane3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null)); } // JFormDesigner - End of component initialization //GEN-END:initComponents }