List of usage examples for javax.swing JTabbedPane addTab
public void addTab(String title, Component component)
component
represented by a title
and no icon. From source file:org.pentaho.reporting.ui.datasources.jdbc.ui.JdbcDataSourceDialog.java
private JPanel createQueryDetailsPanel() { final JPanel queryNamePanel = new JPanel(new BorderLayout()); queryNamePanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8)); queryNamePanel.add(new JLabel(Messages.getString("JdbcDataSourceDialog.QueryStringLabel")), BorderLayout.NORTH);//from w w w . j a v a2s . com queryNamePanel.add(queryNameTextField, BorderLayout.SOUTH); final InvokeQueryDesignerAction queryDesignerAction = new InvokeQueryDesignerAction(); dialogModel.addPropertyChangeListener(queryDesignerAction); final JPanel queryButtonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 5)); queryButtonsPanel.add(new BorderlessButton(queryDesignerAction)); final JPanel queryControlsPanel = new JPanel(new BorderLayout()); queryControlsPanel.add(new JLabel(Messages.getString("JdbcDataSourceDialog.QueryDetailsLabel")), BorderLayout.WEST); queryControlsPanel.add(queryButtonsPanel, BorderLayout.EAST); final JPanel queryPanel = new JPanel(new BorderLayout()); queryPanel.add(queryControlsPanel, BorderLayout.NORTH); queryPanel.add(new RTextScrollPane(500, 300, queryTextArea, true), BorderLayout.CENTER); queryPanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8)); final JTabbedPane queryScriptTabPane = new JTabbedPane(); queryScriptTabPane.addTab(Messages.getString("JdbcDataSourceDialog.StaticQuery"), queryPanel); queryScriptTabPane.addTab(Messages.getString("JdbcDataSourceDialog.QueryScripting"), createQueryScriptTab()); // Create the query details panel final JPanel queryDetailsPanel = new JPanel(new BorderLayout()); queryDetailsPanel.add(BorderLayout.NORTH, queryNamePanel); queryDetailsPanel.add(BorderLayout.CENTER, queryScriptTabPane); return queryDetailsPanel; }
From source file:org.pentaho.reporting.ui.datasources.mondrian.MondrianDataSourceEditor.java
protected Component createContentPane() { // Create the connection panel final JPanel queryContentPanel = new JPanel(new BorderLayout()); queryContentPanel.add(BorderLayout.NORTH, createQueryListPanel()); queryContentPanel.add(BorderLayout.CENTER, createQueryDetailsPanel()); final JdbcConnectionPanel connectionPanel = new JdbcConnectionPanel(dialogModel, context); connectionPanel.setSecurityConfigurationAvailable(false); // Create the content panel final JPanel dialogContent = new JPanel(new BorderLayout()); dialogContent.add(BorderLayout.NORTH, createConnectionTopPanel()); dialogContent.add(BorderLayout.WEST, connectionPanel); dialogContent.add(BorderLayout.CENTER, queryContentPanel); final JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.addTab(Messages.getString("MondrianDataSourceEditor.DataSource"), dialogContent); tabbedPane.addTab(Messages.getString("MondrianDataSourceEditor.GlobalScripting"), createGlobalScriptTab()); final JPanel contentPane = new JPanel(new BorderLayout()); contentPane.add(BorderLayout.SOUTH, createPreviewButtonsPanel()); contentPane.add(BorderLayout.CENTER, tabbedPane); contentPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); return contentPane; }
From source file:org.pentaho.reporting.ui.datasources.mondrian.MondrianDataSourceEditor.java
private JPanel createQueryDetailsPanel() { final JPanel queryNamePanel = new JPanel(new BorderLayout()); queryNamePanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8)); queryNamePanel.add(new JLabel(Messages.getString("MondrianDataSourceEditor.QueryNameLabel")), BorderLayout.NORTH);/*from ww w .ja v a 2 s . c om*/ queryNamePanel.add(queryNameTextField, BorderLayout.SOUTH); final JPanel queryControlPanel = new JPanel(new BorderLayout()); queryControlPanel.add(new JLabel(Messages.getString("MondrianDataSourceEditor.QueryLabel")), BorderLayout.WEST); final JPanel queryPanel = new JPanel(new BorderLayout()); queryPanel.add(queryControlPanel, BorderLayout.NORTH); queryPanel.add(new JScrollPane(queryTextArea), BorderLayout.CENTER); queryPanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8)); final JTabbedPane queryScriptTabPane = new JTabbedPane(); queryScriptTabPane.addTab(Messages.getString("MondrianDataSourceEditor.StaticQuery"), queryPanel); queryScriptTabPane.addTab(Messages.getString("MondrianDataSourceEditor.QueryScripting"), createQueryScriptTab()); // Create the query details panel final JPanel queryDetailsPanel = new JPanel(new BorderLayout()); queryDetailsPanel.add(BorderLayout.NORTH, queryNamePanel); queryDetailsPanel.add(BorderLayout.CENTER, queryScriptTabPane); return queryDetailsPanel; }
From source file:org.pentaho.reporting.ui.datasources.olap4j.Olap4JDataSourceEditor.java
protected Component createContentPane() { // Create the connection panel final JPanel queryContentPanel = new JPanel(new BorderLayout()); queryContentPanel.add(BorderLayout.NORTH, createQueryListPanel()); queryContentPanel.add(BorderLayout.CENTER, createQueryDetailsPanel()); // Create the content panel final JPanel dialogContent = new JPanel(new BorderLayout()); dialogContent.add(BorderLayout.WEST, connectionComponent); dialogContent.add(BorderLayout.CENTER, queryContentPanel); final JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.addTab(Messages.getString("Olap4JDataSourceEditor.DataSource"), dialogContent); tabbedPane.addTab(Messages.getString("Olap4JDataSourceEditor.GlobalScripting"), createGlobalScriptTab()); final JPanel contentPane = new JPanel(new BorderLayout()); contentPane.add(BorderLayout.SOUTH, createPreviewButtonsPanel()); contentPane.add(BorderLayout.CENTER, tabbedPane); contentPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); return contentPane; }
From source file:org.pentaho.reporting.ui.datasources.olap4j.Olap4JDataSourceEditor.java
private JPanel createQueryDetailsPanel() { final JPanel queryNamePanel = new JPanel(new BorderLayout()); queryNamePanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8)); queryNamePanel.add(new JLabel(Messages.getString("Olap4JDataSourceEditor.QueryNameLabel")), BorderLayout.NORTH);//from w w w.jav a 2 s . c o m queryNamePanel.add(queryNameTextField, BorderLayout.SOUTH); final JPanel queryControlsPanel = new JPanel(new BorderLayout()); queryControlsPanel.add(new JLabel(Messages.getString("Olap4JDataSourceEditor.QueryLabel")), BorderLayout.WEST); final JPanel queryPanel = new JPanel(new BorderLayout()); queryPanel.add(queryControlsPanel, BorderLayout.NORTH); queryPanel.add(new JScrollPane(queryTextArea), BorderLayout.CENTER); queryPanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8)); final JTabbedPane queryScriptTabPane = new JTabbedPane(); queryScriptTabPane.addTab(Messages.getString("Olap4JDataSourceEditor.StaticQuery"), queryPanel); queryScriptTabPane.addTab(Messages.getString("Olap4JDataSourceEditor.QueryScripting"), createQueryScriptTab()); // Create the query details panel final JPanel queryDetailsPanel = new JPanel(new BorderLayout()); queryDetailsPanel.add(BorderLayout.NORTH, queryNamePanel); queryDetailsPanel.add(BorderLayout.CENTER, queryScriptTabPane); return queryDetailsPanel; }
From source file:org.pentaho.reporting.ui.datasources.pmd.PmdDataSourceEditor.java
protected Component createContentPane() { final JPanel queryTextAreaHeaderPanel = new JPanel(new BorderLayout()); queryTextAreaHeaderPanel.add(new JLabel(Messages.getString("PmdDataSourceEditor.QueryLabel")), BorderLayout.WEST);//from w ww . j ava 2 s . co m queryTextAreaHeaderPanel.add(queryDesignerButton, BorderLayout.EAST); final JPanel queryConfigurationPanel = new JPanel(); queryConfigurationPanel.setLayout(new BorderLayout()); queryConfigurationPanel.add(queryTextAreaHeaderPanel, BorderLayout.NORTH); queryConfigurationPanel.add(new RTextScrollPane(700, 500, queryTextArea, true), BorderLayout.CENTER); final JTabbedPane queryScriptTabPane = new JTabbedPane(); queryScriptTabPane.addTab(Messages.getString("PmdDataSourceEditor.StaticQuery"), queryConfigurationPanel); queryScriptTabPane.addTab(Messages.getString("PmdDataSourceEditor.QueryScripting"), createQueryScriptTab()); final JPanel queryAreaPanel = new JPanel(); queryAreaPanel.setLayout(new BorderLayout()); queryAreaPanel.add(createGlobalPropertiesPanel(), BorderLayout.NORTH); queryAreaPanel.add(queryScriptTabPane, BorderLayout.CENTER); final JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.addTab(Messages.getString("PmdDataSourceEditor.DataSource"), queryAreaPanel); tabbedPane.addTab(Messages.getString("PmdDataSourceEditor.GlobalScripting"), createGlobalScriptTab()); final JPanel contentPanel = new JPanel(new BorderLayout()); contentPanel.add(tabbedPane, BorderLayout.CENTER); contentPanel.add(createPreviewButtonsPanel(), BorderLayout.SOUTH); contentPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); return contentPanel; }
From source file:org.springframework.richclient.factory.DefaultComponentFactory.java
public void addConfiguredTab(JTabbedPane tabbedPane, String labelKey, JComponent tabComponent) { org.springframework.richclient.core.LabelInfo info = getLabelInfo(getRequiredMessage(labelKey)); tabbedPane.addTab(info.getText(), tabComponent); int tabIndex = tabbedPane.getTabCount() - 1; tabbedPane.setMnemonicAt(tabIndex, info.getMnemonic()); tabbedPane.setDisplayedMnemonicIndexAt(tabIndex, info.getMnemonicIndex()); tabbedPane.setIconAt(tabIndex, getIcon(labelKey)); tabbedPane.setToolTipTextAt(tabIndex, getCaption(labelKey)); }
From source file:org.stanwood.swing.AboutDialog.java
public void init() { Box box = Box.createVerticalBox(); if (icon == null) { createTitleArea(box, title, version); } else {//from w w w. j a v a 2 s. c o m Box hbox = Box.createHorizontalBox(); hbox.add(Box.createHorizontalStrut(40)); hbox.add(new JLabel(icon)); hbox.add(Box.createHorizontalStrut(10)); box.add(hbox); Box vbox = Box.createVerticalBox(); createTitleArea(vbox, title, version); hbox.add(vbox); hbox.add(Box.createHorizontalGlue()); } JTabbedPane infoTabbedPane = new JTabbedPane(); infoTabbedPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); JComponent tabAbout = createAboutTab(); infoTabbedPane.addTab("About", tabAbout); JComponent tabAuthors = createAuthorsTab(); infoTabbedPane.addTab("Authors", tabAuthors); box.add(infoTabbedPane); createButtonPane(box); setContentPane(box); setSize(450, 280); setLocationRelativeTo(getParent()); }
From source file:org.tinymediamanager.ui.movies.dialogs.MovieEditorDialog.java
/** * Create the dialog.//www .j a v a 2 s. co m * * @param movie * the movie * @param inQueue * the in queue */ public MovieEditorDialog(Movie movie, boolean inQueue) { super(BUNDLE.getString("movie.edit"), "movieEditor"); //$NON-NLS-1$ setBounds(5, 5, 950, 650); movieToEdit = movie; ids = MediaIdTable.convertIdMapToEventList(movieToEdit.getIds()); for (MediaFile mf : movie.getMediaFiles()) { mediaFiles.add(new MediaFile(mf)); } getContentPane().setLayout(new BorderLayout()); { JPanel panelPath = new JPanel(); getContentPane().add(panelPath, BorderLayout.NORTH); panelPath.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("15px"), FormFactory.RELATED_GAP_ROWSPEC, })); JLabel lblMoviePathT = new JLabel(BUNDLE.getString("metatag.path")); //$NON-NLS-1$ panelPath.add(lblMoviePathT, "2, 2, left, top"); lblMoviePath = new JLabel(""); TmmFontHelper.changeFont(lblMoviePath, 1.166, Font.BOLD); panelPath.add(lblMoviePath, "5, 2, left, top"); } JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.NORTH); getContentPane().add(tabbedPane, BorderLayout.CENTER); /** * DetailsPanel 1 */ { details1Panel.setBorder(new EmptyBorder(5, 5, 5, 5)); details1Panel.setLayout(new FormLayout(new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("max(40dlu;default)"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("7dlu:grow"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("25dlu:grow"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("24dlu"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("7dlu:grow"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.UNRELATED_GAP_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("100dlu:grow(2)"), FormSpecs.RELATED_GAP_COLSPEC, }, new 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.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("50px:grow"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("15dlu"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("fill:50dlu:grow"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("50px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("fill:default:grow"), })); { JLabel lblTitle = new JLabel(BUNDLE.getString("metatag.title")); //$NON-NLS-1$ details1Panel.add(lblTitle, "2, 4, right, default"); } { tfTitle = new JTextField(); details1Panel.add(tfTitle, "4, 4, 15, 1, fill, default"); tfTitle.setColumns(10); } { // JLabel lblPoster = new JLabel(""); lblPoster = new ImageLabel(); lblPoster.setAlternativeText(BUNDLE.getString("image.notfound.poster")); //$NON-NLS-1$ lblPoster.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ImageChooserDialog dialog = new ImageChooserDialog(movieToEdit.getIds(), ImageType.POSTER, movieList.getDefaultArtworkScrapers(), lblPoster, null, null, MediaType.MOVIE); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); } }); lblPoster.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); details1Panel.add(lblPoster, "22, 4, 3, 23, fill, fill"); } { JLabel lblOriginalTitle = new JLabel(BUNDLE.getString("metatag.originaltitle")); //$NON-NLS-1$ details1Panel.add(lblOriginalTitle, "2, 6, right, default"); } { tfOriginalTitle = new JTextField(); details1Panel.add(tfOriginalTitle, "4, 6, 15, 1, fill, top"); tfOriginalTitle.setColumns(10); } { JLabel lblSorttitle = new JLabel(BUNDLE.getString("metatag.sorttitle")); //$NON-NLS-1$ details1Panel.add(lblSorttitle, "2, 8, right, default"); } { tfSorttitle = new JTextField(); details1Panel.add(tfSorttitle, "4, 8, 15, 1, fill, default"); tfSorttitle.setColumns(10); } { JLabel lblTagline = new JLabel(BUNDLE.getString("metatag.tagline")); //$NON-NLS-1$ details1Panel.add(lblTagline, "2, 10, right, top"); } { JScrollPane scrollPaneTagline = new JScrollPane(); tpTagline = new JTextPane(); scrollPaneTagline.setViewportView(tpTagline); details1Panel.add(scrollPaneTagline, "4, 10, 15, 1, fill, fill"); } { JLabel lblYear = new JLabel(BUNDLE.getString("metatag.year")); //$NON-NLS-1$ details1Panel.add(lblYear, "2, 12, right, default"); } { spYear = new YearSpinner(); details1Panel.add(spYear, "4, 12, fill, top"); } { JLabel lblRuntime = new JLabel(BUNDLE.getString("metatag.runtime")); //$NON-NLS-1$ details1Panel.add(lblRuntime, "8, 12, right, default"); } { spRuntime = new JSpinner(); details1Panel.add(spRuntime, "10, 12, fill, default"); } { JLabel lblMin = new JLabel(BUNDLE.getString("metatag.minutes")); //$NON-NLS-1$ details1Panel.add(lblMin, "12, 12"); } { JLabel lblRating = new JLabel(BUNDLE.getString("metatag.rating")); //$NON-NLS-1$ details1Panel.add(lblRating, "16, 12, right, default"); } { spRating = new JSpinner(); details1Panel.add(spRating, "18, 12"); } spRating.setModel(new SpinnerNumberModel(movie.getRating(), 0.0, 10.0, 0.1)); { JLabel lblReleaseDate = new JLabel(BUNDLE.getString("metatag.releasedate")); //$NON-NLS-1$ details1Panel.add(lblReleaseDate, "2, 14, right, default"); } { dpReleaseDate = new DatePicker(movie.getReleaseDate()); details1Panel.add(dpReleaseDate, "4, 14"); } { JLabel lblCertification = new JLabel(BUNDLE.getString("metatag.certification")); //$NON-NLS-1$ details1Panel.add(lblCertification, "8, 14, right, default"); } cbCertification = new JComboBox(); details1Panel.add(cbCertification, "10, 14, 3, 1, fill, default"); { JLabel lblTop = new JLabel(BUNDLE.getString("metatag.top250")); //$NON-NLS-1$ details1Panel.add(lblTop, "16, 14, right, default"); } { spTop250 = new JSpinner(); details1Panel.add(spTop250, "18, 14"); } spTop250.setValue(movie.getTop250()); { JLabel lblIds = new JLabel("Ids"); details1Panel.add(lblIds, "2, 16, right, bottom"); } { JScrollPane scrollPaneIds = new JScrollPane(); details1Panel.add(scrollPaneIds, "4, 16, 9, 5, fill, fill"); { tableIds = new MediaIdTable(ids, ScraperType.MOVIE); scrollPaneIds.setViewportView(tableIds); } } { JButton btnAddId = new JButton(""); btnAddId.setAction(new AddIdAction()); btnAddId.setIcon(IconManager.LIST_ADD); btnAddId.setMargin(new Insets(2, 2, 2, 2)); details1Panel.add(btnAddId, "2, 18, right, top"); } { JButton btnRemoveId = new JButton(""); btnRemoveId.setAction(new RemoveIdAction()); btnRemoveId.setIcon(IconManager.LIST_REMOVE); btnRemoveId.setMargin(new Insets(2, 2, 2, 2)); details1Panel.add(btnRemoveId, "2, 20, right, top"); } { JLabel lblSpokenLanguages = new JLabel(BUNDLE.getString("metatag.spokenlanguages")); //$NON-NLS-1$ details1Panel.add(lblSpokenLanguages, "2, 22, right, default"); } { tfSpokenLanguages = new JTextField(); details1Panel.add(tfSpokenLanguages, "4, 22, fill, default"); tfSpokenLanguages.setColumns(10); } { JLabel lblCountry = new JLabel(BUNDLE.getString("metatag.country")); //$NON-NLS-1$ details1Panel.add(lblCountry, "8, 22, right, default"); } { tfCountry = new JTextField(); details1Panel.add(tfCountry, "10, 22, 3, 1, fill, default"); tfCountry.setColumns(10); } { JLabel lblMovieSet = new JLabel(BUNDLE.getString("metatag.movieset")); //$NON-NLS-1$ details1Panel.add(lblMovieSet, "2, 24, right, default"); } { cbMovieSet = new JComboBox(); cbMovieSet.addItem(""); details1Panel.add(cbMovieSet, "4, 24, 9, 1, fill, default"); } { JLabel lblDateAdded = new JLabel(BUNDLE.getString("metatag.dateadded")); //$NON-NLS-1$ details1Panel.add(lblDateAdded, "2, 26, right, default"); } { spDateAdded = new JSpinner(new SpinnerDateModel()); // JSpinner.DateEditor timeEditor = new JSpinner.DateEditor(spDateAdded, // "dd.MM.yyyy HH:mm:ss"); // spDateAdded.setEditor(timeEditor); details1Panel.add(spDateAdded, "4, 26"); } spDateAdded.setValue(movie.getDateAdded()); JLabel lblWatched = new JLabel(BUNDLE.getString("metatag.watched")); //$NON-NLS-1$ details1Panel.add(lblWatched, "8, 26, right, default"); { cbWatched = new JCheckBox(""); details1Panel.add(cbWatched, "10, 26"); } cbWatched.setSelected(movie.isWatched()); lblWatched.setLabelFor(cbWatched); { JLabel lblSourceT = new JLabel(BUNDLE.getString("metatag.source")); //$NON-NLS-1$ details1Panel.add(lblSourceT, "2, 28, right, default"); } { cbSource = new JComboBox(MediaSource.values()); details1Panel.add(cbSource, "4, 28, fill, default"); } cbSource.setSelectedItem(movie.getMediaSource()); { final JLabel lblEditionT = new JLabel(BUNDLE.getString("metatag.edition")); //$NON-NLS-1$ details1Panel.add(lblEditionT, "8, 28, right, default"); } { cbEdition = new JComboBox(MovieEdition.values()); details1Panel.add(cbEdition, "10, 28, 3, 1, fill, default"); } { JLabel lblVideod = new JLabel(BUNDLE.getString("metatag.3d")); //$NON-NLS-1$ details1Panel.add(lblVideod, "16, 28, right, default"); } { chckbxVideo3D = new JCheckBox(""); details1Panel.add(chckbxVideo3D, "18, 28"); } chckbxVideo3D.setSelected(movie.isVideoIn3D()); { JLabel lblPlot = new JLabel(BUNDLE.getString("metatag.plot")); //$NON-NLS-1$ details1Panel.add(lblPlot, "2, 30, right, top"); } { JScrollPane scrollPanePlot = new JScrollPane(); details1Panel.add(scrollPanePlot, "4, 30, 15, 1, fill, fill"); { tpPlot = new JTextPane(); scrollPanePlot.setViewportView(tpPlot); } } { lblFanart = new ImageLabel(); lblFanart.setAlternativeText(BUNDLE.getString("image.notfound.fanart")); //$NON-NLS-1$ lblFanart.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); lblFanart.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ImageChooserDialog dialog = new ImageChooserDialog(movieToEdit.getIds(), ImageType.FANART, movieList.getDefaultArtworkScrapers(), lblFanart, extrathumbs, extrafanarts, MediaType.MOVIE); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); } }); details1Panel.add(lblFanart, "22, 30, 3, 5, fill, fill"); } lblFanart.setImagePath(movie.getArtworkFilename(MediaFileType.FANART)); { JLabel lblDirector = new JLabel(BUNDLE.getString("metatag.director")); //$NON-NLS-1$ details1Panel.add(lblDirector, "2, 32, right, default"); } { tfDirector = new JTextField(); details1Panel.add(tfDirector, "4, 32, 15, 1, fill, top"); tfDirector.setColumns(10); } { JLabel lblWriter = new JLabel(BUNDLE.getString("metatag.writer")); //$NON-NLS-1$ details1Panel.add(lblWriter, "2, 34, right, default"); } { tfWriter = new JTextField(); details1Panel.add(tfWriter, "4, 34, 15, 1, fill, top"); tfWriter.setColumns(10); } { JLabel lblCompany = new JLabel(BUNDLE.getString("metatag.production")); //$NON-NLS-1$ details1Panel.add(lblCompany, "2, 36, right, top"); } { JScrollPane scrollPaneProduction = new JScrollPane(); details1Panel.add(scrollPaneProduction, "4, 36, 15, 1, fill, fill"); tfProductionCompanies = new JTextPane(); scrollPaneProduction.setViewportView(tfProductionCompanies); } tabbedPane.addTab(BUNDLE.getString("metatag.details"), details1Panel); //$NON-NLS-1$ } /** * DetailsPanel 2 */ { tabbedPane.addTab(BUNDLE.getString("metatag.details2"), details2Panel); //$NON-NLS-1$ details2Panel.setBorder(new EmptyBorder(5, 5, 5, 5)); details2Panel.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("max(40dlu;default)"), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("50px:grow"), FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("100px:grow"), FormFactory.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("fill:default"), FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"), FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"), FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"), FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow(2)"), })); { JLabel lblActors = new JLabel(BUNDLE.getString("metatag.actors")); //$NON-NLS-1$ details2Panel.add(lblActors, "2, 2, right, default"); } { JScrollPane scrollPane = new JScrollPane(); details2Panel.add(scrollPane, "4, 2, 1, 11"); tableActors = new JTable(); tableActors.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); scrollPane.setViewportView(tableActors); } { JLabel lblProducers = new JLabel(BUNDLE.getString("metatag.producers")); //$NON-NLS-1$ details2Panel.add(lblProducers, "6, 2, right, default"); } { JScrollPane scrollPane = new JScrollPane(); details2Panel.add(scrollPane, "8, 2, 1, 11"); tableProducers = new JTable(); tableProducers.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); scrollPane.setViewportView(tableProducers); } { JButton btnAddActor = new JButton(BUNDLE.getString("cast.actor.add")); //$NON-NLS-1$ btnAddActor.setMargin(new Insets(2, 2, 2, 2)); btnAddActor.setAction(new AddActorAction()); btnAddActor.setIcon(IconManager.LIST_ADD); details2Panel.add(btnAddActor, "2, 4, right, top"); } { JButton btnAddProducer = new JButton((String) null); btnAddProducer.setMargin(new Insets(2, 2, 2, 2)); btnAddProducer.setAction(new AddProducerAction()); btnAddProducer.setIcon(IconManager.LIST_ADD); details2Panel.add(btnAddProducer, "6, 4, right, top"); } { JButton btnRemoveActor = new JButton(BUNDLE.getString("cast.actor.remove")); //$NON-NLS-1$ btnRemoveActor.setMargin(new Insets(2, 2, 2, 2)); btnRemoveActor.setAction(new RemoveActorAction()); btnRemoveActor.setIcon(IconManager.LIST_REMOVE); details2Panel.add(btnRemoveActor, "2,6, right, top"); } { JButton btnRemoveProducer = new JButton((String) null); btnRemoveProducer.setMargin(new Insets(2, 2, 2, 2)); btnRemoveProducer.setAction(new RemoveProducerAction()); btnRemoveProducer.setIcon(IconManager.LIST_REMOVE); details2Panel.add(btnRemoveProducer, "6, 6, right, top"); } { JButton btnMoveActorUp = new JButton((String) null); btnMoveActorUp.setMargin(new Insets(2, 2, 2, 2)); btnMoveActorUp.setAction(new MoveActorUpAction()); btnMoveActorUp.setIcon(IconManager.ARROW_UP); details2Panel.add(btnMoveActorUp, "2, 8, right, top"); } { JButton btnMoveProducerUp = new JButton((String) null); btnMoveProducerUp.setMargin(new Insets(2, 2, 2, 2)); btnMoveProducerUp.setAction(new MoveProducerUpAction()); btnMoveProducerUp.setIcon(IconManager.ARROW_UP); details2Panel.add(btnMoveProducerUp, "6, 8, right, top"); } { JButton btnMoveActorDown = new JButton((String) null); btnMoveActorDown.setMargin(new Insets(2, 2, 2, 2)); btnMoveActorDown.setAction(new MoveActorDownAction()); btnMoveActorDown.setIcon(IconManager.ARROW_DOWN); details2Panel.add(btnMoveActorDown, "2, 10, right, top"); } { JButton btnMoveProducerDown = new JButton((String) null); btnMoveProducerDown.setMargin(new Insets(2, 2, 2, 2)); btnMoveProducerDown.setAction(new MoveProducerDownAction()); btnMoveProducerDown.setIcon(IconManager.ARROW_DOWN); details2Panel.add(btnMoveProducerDown, "6, 10, right, top"); } { JLabel lblGenres = new JLabel(BUNDLE.getString("metatag.genre")); //$NON-NLS-1$ details2Panel.add(lblGenres, "2, 14, right, default"); } { JScrollPane scrollPaneGenres = new JScrollPane(); details2Panel.add(scrollPaneGenres, "4, 14, 1, 5"); { listGenres = new JList(); scrollPaneGenres.setViewportView(listGenres); } } { JLabel lblTags = new JLabel(BUNDLE.getString("metatag.tags")); //$NON-NLS-1$ details2Panel.add(lblTags, "6, 14, right, default"); } { JScrollPane scrollPaneTags = new JScrollPane(); details2Panel.add(scrollPaneTags, "8, 14, 1, 5"); listTags = new JList(); scrollPaneTags.setViewportView(listTags); } { JButton btnAddGenre = new JButton(""); btnAddGenre.setAction(new AddGenreAction()); btnAddGenre.setIcon(IconManager.LIST_ADD); btnAddGenre.setMargin(new Insets(2, 2, 2, 2)); details2Panel.add(btnAddGenre, "2, 16, right, top"); } { JButton btnAddTag = new JButton(""); btnAddTag.setAction(new AddTagAction()); btnAddTag.setIcon(IconManager.LIST_ADD); btnAddTag.setMargin(new Insets(2, 2, 2, 2)); details2Panel.add(btnAddTag, "6, 16, right, top"); } { JButton btnRemoveGenre = new JButton(""); btnRemoveGenre.setAction(new RemoveGenreAction()); btnRemoveGenre.setMargin(new Insets(2, 2, 2, 2)); btnRemoveGenre.setIcon(IconManager.LIST_REMOVE); details2Panel.add(btnRemoveGenre, "2, 18, right, top"); } { JButton btnRemoveTag = new JButton(""); btnRemoveTag.setAction(new RemoveTagAction()); btnRemoveTag.setIcon(IconManager.LIST_REMOVE); btnRemoveTag.setMargin(new Insets(2, 2, 2, 2)); details2Panel.add(btnRemoveTag, "6, 18, right, top"); } { cbGenres = new AutocompleteComboBox(MediaGenres.values()); details2Panel.add(cbGenres, "4, 20"); } { cbTags = new AutocompleteComboBox(movieList.getTagsInMovies()); details2Panel.add(cbTags, "8, 20"); } { JLabel lblTrailer = new JLabel(BUNDLE.getString("metatag.trailer")); //$NON-NLS-1$ details2Panel.add(lblTrailer, "2, 22, right, default"); } { JScrollPane scrollPaneTrailer = new JScrollPane(); details2Panel.add(scrollPaneTrailer, "4, 22, 5, 5"); tableTrailer = new JTable(); tableTrailer.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); scrollPaneTrailer.setViewportView(tableTrailer); } { JButton btnAddTrailer = new JButton(""); btnAddTrailer.setAction(new AddTrailerAction()); btnAddTrailer.setIcon(IconManager.LIST_ADD); btnAddTrailer.setMargin(new Insets(2, 2, 2, 2)); details2Panel.add(btnAddTrailer, "2, 24, right, top"); } { JButton btnRemoveTrailer = new JButton(""); btnRemoveTrailer.setAction(new RemoveTrailerAction()); btnRemoveTrailer.setIcon(IconManager.LIST_REMOVE); btnRemoveTrailer.setMargin(new Insets(2, 2, 2, 2)); details2Panel.add(btnRemoveTrailer, "2, 26, right, top"); } } /** * extra artwork pane */ { JPanel artworkPanel = new JPanel(); tabbedPane.addTab(BUNDLE.getString("metatag.extraartwork"), null, artworkPanel, null); //$NON-NLS-1$ artworkPanel.setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("250px:grow"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("250px:grow"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("150px:grow"), FormSpecs.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("50px:grow(2)"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("50px:grow(2)"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("200px:grow(2)"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"), })); { JLabel lblLogoT = new JLabel(BUNDLE.getString("mediafiletype.logo")); //$NON-NLS-1$ artworkPanel.add(lblLogoT, "2, 2"); } { lblLogo = new ImageLabel(); lblLogo.setAlternativeText(BUNDLE.getString("image.notfound.logo")); //$NON-NLS-1$ lblLogo.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ImageChooserDialog dialog = new ImageChooserDialog(movieToEdit.getIds(), ImageType.LOGO, movieList.getDefaultArtworkScrapers(), lblLogo, null, null, MediaType.MOVIE); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); } }); lblLogo.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); artworkPanel.add(lblLogo, "2, 4, fill, fill"); } { final JLabel lblClearlogoT = new JLabel(BUNDLE.getString("mediafiletype.clearlogo")); //$NON-NLS-1$ artworkPanel.add(lblClearlogoT, "4, 2"); } { lblClearlogo = new ImageLabel(); lblClearlogo.setAlternativeText(BUNDLE.getString("image.notfound.clearlogo")); //$NON-NLS-1$ lblClearlogo.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ImageChooserDialog dialog = new ImageChooserDialog(movieToEdit.getIds(), ImageType.CLEARLOGO, movieList.getDefaultArtworkScrapers(), lblClearlogo, null, null, MediaType.MOVIE); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); } }); lblClearlogo.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); artworkPanel.add(lblClearlogo, "4, 4, fill, fill"); } { JLabel lblBannerT = new JLabel(BUNDLE.getString("mediafiletype.banner")); //$NON-NLS-1$ artworkPanel.add(lblBannerT, "2, 6"); } { lblBanner = new ImageLabel(); lblBanner.setAlternativeText(BUNDLE.getString("image.notfound.banner")); //$NON-NLS-1$ lblBanner.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ImageChooserDialog dialog = new ImageChooserDialog(movieToEdit.getIds(), ImageType.BANNER, movieList.getDefaultArtworkScrapers(), lblBanner, null, null, MediaType.MOVIE); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); } }); lblBanner.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); artworkPanel.add(lblBanner, "2, 8, 3, 1, fill, fill"); } { JLabel lblClearartT = new JLabel("ClearArt"); artworkPanel.add(lblClearartT, "2, 10"); } { lblClearart = new ImageLabel(); lblClearart.setAlternativeText(BUNDLE.getString("image.notfound.clearart")); //$NON-NLS-1$ lblClearart.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ImageChooserDialog dialog = new ImageChooserDialog(movieToEdit.getIds(), ImageType.CLEARART, movieList.getDefaultArtworkScrapers(), lblClearart, null, null, MediaType.MOVIE); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); } }); lblClearart.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); artworkPanel.add(lblClearart, "2, 12, fill, fill"); } { JLabel lblThumbT = new JLabel("Thumb"); artworkPanel.add(lblThumbT, "4, 10"); } { lblThumb = new ImageLabel(); lblThumb.setAlternativeText(BUNDLE.getString("image.notfound.thumb")); //$NON-NLS-1$ lblThumb.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ImageChooserDialog dialog = new ImageChooserDialog(movieToEdit.getIds(), ImageType.THUMB, movieList.getDefaultArtworkScrapers(), lblThumb, null, null, MediaType.MOVIE); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); } }); lblThumb.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); artworkPanel.add(lblThumb, "4, 12, fill, fill"); } { JLabel lblDiscT = new JLabel("Disc"); artworkPanel.add(lblDiscT, "6, 10"); } { lblDisc = new ImageLabel(); lblDisc.setAlternativeText(BUNDLE.getString("image.notfound.disc")); //$NON-NLS-1$ lblDisc.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ImageChooserDialog dialog = new ImageChooserDialog(movieToEdit.getIds(), ImageType.DISC, movieList.getDefaultArtworkScrapers(), lblDisc, null, null, MediaType.MOVIE); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); } }); lblDisc.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); artworkPanel.add(lblDisc, "6, 12, fill, fill"); } } /** * Media Files */ { mediaFilesPanel = new MediaFileEditorPanel(mediaFiles); tabbedPane.addTab(BUNDLE.getString("metatag.mediafiles"), null, mediaFilesPanel, null); //$NON-NLS-1$ } /** * Button pane */ { JPanel bottomPane = new JPanel(); getContentPane().add(bottomPane, BorderLayout.SOUTH); bottomPane.setLayout(new FormLayout( new ColumnSpec[] { ColumnSpec.decode("371px:grow"), FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, })); JPanel buttonPane = new JPanel(); bottomPane.add(buttonPane, "2, 2, left, top"); EqualsLayout layout = new EqualsLayout(5); layout.setMinWidth(100); buttonPane.setLayout(layout); { JButton okButton = new JButton(BUNDLE.getString("Button.ok")); //$NON-NLS-1$ buttonPane.add(okButton, "2, 1, fill, top"); okButton.setAction(new ChangeMovieAction()); okButton.setActionCommand("OK"); getRootPane().setDefaultButton(okButton); } { JButton cancelButton = new JButton(BUNDLE.getString("Button.cancel")); //$NON-NLS-1$ buttonPane.add(cancelButton, "4, 1, fill, top"); cancelButton.setAction(new DiscardAction()); cancelButton.setActionCommand("Cancel"); } if (inQueue) { JButton btnAbort = new JButton(BUNDLE.getString("Button.abortqueue")); //$NON-NLS-1$ btnAbort.setAction(new AbortQueueAction()); buttonPane.add(btnAbort, "6, 1, fill, top"); } } initDataBindings(); { int year = 0; try { year = Integer.parseInt(movieToEdit.getYear()); } catch (Exception ignored) { } SimpleDateFormat dateFormat = (SimpleDateFormat) DateFormat.getDateInstance(DateFormat.MEDIUM); for (Certification cert : Certification .getCertificationsforCountry(MovieModuleManager.MOVIE_SETTINGS.getCertificationCountry())) { cbCertification.addItem(cert); } tfTitle.setText(movieToEdit.getTitle()); tfOriginalTitle.setText(movieToEdit.getOriginalTitle()); tfSorttitle.setText(movieToEdit.getSortTitle()); tpTagline.setText(movieToEdit.getTagline()); tpPlot.setText(movieToEdit.getPlot()); tpPlot.setCaretPosition(0); tfDirector.setText(movieToEdit.getDirector()); tfWriter.setText(movieToEdit.getWriter()); lblPoster.setImagePath(movieToEdit.getArtworkFilename(MediaFileType.POSTER)); tfProductionCompanies.setText(movieToEdit.getProductionCompany()); spRuntime.setValue(movieToEdit.getRuntime()); cbEdition.setSelectedItem(movieToEdit.getEdition()); tfSpokenLanguages.setText(movieToEdit.getSpokenLanguages()); tfCountry.setText(movieToEdit.getCountry()); spYear.setValue(year); cbCertification.setSelectedItem(movieToEdit.getCertification()); lblMoviePath.setText(movieToEdit.getPath()); lblLogo.setImagePath(movieToEdit.getArtworkFilename(MediaFileType.LOGO)); lblClearlogo.setImagePath(movieToEdit.getArtworkFilename(MediaFileType.CLEARLOGO)); lblClearart.setImagePath(movieToEdit.getArtworkFilename(MediaFileType.CLEARART)); lblThumb.setImagePath(movieToEdit.getArtworkFilename(MediaFileType.THUMB)); lblDisc.setImagePath(movieToEdit.getArtworkFilename(MediaFileType.DISCART)); lblBanner.setImagePath(movieToEdit.getArtworkFilename(MediaFileType.BANNER)); for (MovieActor origCast : movieToEdit.getActors()) { MovieActor actor = new MovieActor(); actor.setName(origCast.getName()); actor.setCharacter(origCast.getCharacter()); actor.setThumbUrl(origCast.getThumbUrl()); cast.add(actor); } for (MovieProducer origProducer : movieToEdit.getProducers()) { MovieProducer producer = new MovieProducer(); producer.setName(origProducer.getName()); producer.setRole(origProducer.getRole()); producer.setThumbUrl(origProducer.getThumbUrl()); producers.add(producer); } for (MediaGenres genre : movieToEdit.getGenres()) { genres.add(genre); } for (MovieTrailer trailer : movieToEdit.getTrailer()) { trailers.add(trailer); } for (String tag : movieToEdit.getTags()) { if (StringUtils.isNotBlank(tag)) { tags.add(tag); } } extrathumbs.addAll(movieToEdit.getExtraThumbs()); extrafanarts.addAll(movieToEdit.getExtraFanarts()); for (MovieSet movieSet : movieList.getSortedMovieSetList()) { cbMovieSet.addItem(movieSet); if (movieToEdit.getMovieSet() == movieSet) { cbMovieSet.setSelectedItem(movieSet); } } } // adjust columnn titles - we have to do it this way - thx to windowbuilder pro tableActors.getColumnModel().getColumn(0).setHeaderValue(BUNDLE.getString("metatag.name")); //$NON-NLS-1$ tableActors.getColumnModel().getColumn(1).setHeaderValue(BUNDLE.getString("metatag.role")); //$NON-NLS-1$ tableProducers.getColumnModel().getColumn(0).setHeaderValue(BUNDLE.getString("metatag.name")); //$NON-NLS-1$ tableProducers.getColumnModel().getColumn(1).setHeaderValue(BUNDLE.getString("metatag.role")); //$NON-NLS-1$ tableTrailer.getColumnModel().getColumn(0).setHeaderValue(BUNDLE.getString("metatag.nfo")); //$NON-NLS-1$ tableTrailer.getColumnModel().getColumn(1).setHeaderValue(BUNDLE.getString("metatag.name")); //$NON-NLS-1$ tableTrailer.getColumnModel().getColumn(2).setHeaderValue(BUNDLE.getString("metatag.source")); //$NON-NLS-1$ tableTrailer.getColumnModel().getColumn(3).setHeaderValue(BUNDLE.getString("metatag.quality")); //$NON-NLS-1$ tableTrailer.getColumnModel().getColumn(4).setHeaderValue(BUNDLE.getString("metatag.url")); //$NON-NLS-1$ // adjust table columns tableTrailer.getColumnModel().getColumn(0).setMaxWidth(55); // implement listener to simulate button group tableTrailer.getModel().addTableModelListener(new TableModelListener() { @Override public void tableChanged(TableModelEvent arg0) { // click on the checkbox if (arg0.getColumn() == 0) { int row = arg0.getFirstRow(); MovieTrailer changedTrailer = trailers.get(row); // if flag inNFO was changed, change all other trailers flags if (changedTrailer.getInNfo()) { for (MovieTrailer trailer : trailers) { if (trailer != changedTrailer) { trailer.setInNfo(Boolean.FALSE); } } } } } }); }
From source file:org.tinymediamanager.ui.moviesets.dialogs.MovieSetEditorDialog.java
/** * Instantiates a new movie set editor./*from ww w .j a v a 2 s . c o m*/ * * @param movieSet * the movie set * @param inQueue * the in queue */ public MovieSetEditorDialog(MovieSet movieSet, boolean inQueue) { super(BUNDLE.getString("movieset.edit"), "movieSetEditor"); //$NON-NLS-1$ setBounds(5, 5, 800, 500); movieSetToEdit = movieSet; try { List<String> enabledScrapers = new ArrayList<>(); if (MovieModuleManager.MOVIE_SETTINGS.getMovieArtworkScrapers().contains(Constants.TMDB)) { enabledScrapers.add(Constants.TMDB); } if (MovieModuleManager.MOVIE_SETTINGS.getMovieArtworkScrapers().contains(Constants.FANART_TV)) { enabledScrapers.add(Constants.FANART_TV); } artworkScrapers.addAll(movieList.getArtworkScrapers(enabledScrapers)); // artworkScrapers.addAll(movieList.getArtworkScrapers(Arrays.asList(Constants.TMDB, Constants.FANART_TV))); } catch (Exception e2) { LOGGER.warn("error getting IMediaArtworkProvider " + e2.getMessage()); } getContentPane().setLayout(new BorderLayout()); JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.NORTH); getContentPane().add(tabbedPane, BorderLayout.CENTER); JPanel panelContent = new JPanel(); panelContent.setLayout(new FormLayout(new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("100px"), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("300px:grow"), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("250px:grow"), FormFactory.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormFactory.NARROW_LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("75px:grow"), FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"), FormFactory.NARROW_LINE_GAP_ROWSPEC, })); tabbedPane.addTab(BUNDLE.getString("metatag.details"), panelContent); //$NON-NLS-1$ JLabel lblName = new JLabel(BUNDLE.getString("movieset.title")); //$NON-NLS-1$ panelContent.add(lblName, "2, 2, right, default"); tfName = new JTextField(); panelContent.add(tfName, "4, 2, 3, 1, fill, default"); tfName.setColumns(10); lblPoster = new ImageLabel(); lblPoster.setAlternativeText(BUNDLE.getString("image.notfound.poster")); //$NON-NLS-1$ lblPoster.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { int tmdbId = 0; try { tmdbId = Integer.parseInt(tfTmdbId.getText()); } catch (Exception e1) { } HashMap<String, Object> ids = new HashMap<>(movieSetToEdit.getIds()); ids.put(Constants.TMDB, tmdbId); // MovieSetImageChooserDialog dialog = new MovieSetImageChooserDialog(tmdbId, ImageType.POSTER, lblPoster); ImageChooserDialog dialog = new ImageChooserDialog(ids, ImageType.POSTER, artworkScrapers, lblPoster, null, null, MediaType.MOVIE_SET); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); } }); panelContent.add(lblPoster, "8, 2, 1, 9, fill, fill"); JLabel lblTmdbid = new JLabel(BUNDLE.getString("metatag.tmdb")); //$NON-NLS-1$ panelContent.add(lblTmdbid, "2, 4, right, default"); tfTmdbId = new JTextField(); panelContent.add(tfTmdbId, "4, 4, fill, default"); tfTmdbId.setColumns(10); JButton btnSearchTmdbId = new JButton(""); btnSearchTmdbId.setAction(actionSearchTmdbId); panelContent.add(btnSearchTmdbId, "6, 4, left, default"); JLabel lblOverview = new JLabel(BUNDLE.getString("metatag.plot")); //$NON-NLS-1$ panelContent.add(lblOverview, "2, 6, right, top"); JScrollPane scrollPaneOverview = new JScrollPane(); panelContent.add(scrollPaneOverview, "4, 6, 3, 1, fill, fill"); tpOverview = new JTextPane(); scrollPaneOverview.setViewportView(tpOverview); JLabel lblMovies = new JLabel(BUNDLE.getString("tmm.movies")); //$NON-NLS-1$ panelContent.add(lblMovies, "2, 8, right, top"); JScrollPane scrollPaneMovies = new JScrollPane(); panelContent.add(scrollPaneMovies, "4, 8, 3, 9, fill, fill"); tableMovies = new JTable(); scrollPaneMovies.setViewportView(tableMovies); JButton btnRemoveMovie = new JButton(""); btnRemoveMovie.setAction(actionRemoveMovie); panelContent.add(btnRemoveMovie, "2, 10, right, top"); lblFanart = new ImageLabel(); lblFanart.setAlternativeText(BUNDLE.getString("image.notfound.fanart")); //$NON-NLS-1$ lblFanart.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { int tmdbId = 0; try { tmdbId = Integer.parseInt(tfTmdbId.getText()); } catch (Exception e1) { } HashMap<String, Object> ids = new HashMap<>(movieSetToEdit.getIds()); ids.put(Constants.TMDB, tmdbId); ImageChooserDialog dialog = new ImageChooserDialog(ids, ImageType.FANART, artworkScrapers, lblFanart, null, null, MediaType.MOVIE_SET); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); } }); panelContent.add(lblFanart, "8, 12, 1, 5, fill, fill"); /** * Artwork pane */ { JPanel artworkPanel = new JPanel(); tabbedPane.addTab(BUNDLE.getString("metatag.extraartwork"), null, artworkPanel, null); //$NON-NLS-1$ artworkPanel.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("250px:grow"), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("250px:grow"), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("150px:grow"), FormFactory.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("50px:grow(2)"), FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("200px:grow(2)"), FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"), })); { JLabel lblLogoT = new JLabel(BUNDLE.getString("mediafiletype.logo")); //$NON-NLS-1$ artworkPanel.add(lblLogoT, "2, 2"); } { lblLogo = new ImageLabel(); lblLogo.setAlternativeText(BUNDLE.getString("image.notfound.logo")); //$NON-NLS-1$ lblLogo.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ImageChooserDialog dialog = new ImageChooserDialog(movieSetToEdit.getIds(), ImageType.LOGO, movieList.getDefaultArtworkScrapers(), lblLogo, null, null, MediaType.MOVIE); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); } }); { final JLabel lblClearlogoT = new JLabel(BUNDLE.getString("mediafiletype.clearlogo")); //$NON-NLS-1$ artworkPanel.add(lblClearlogoT, "4, 2"); } lblLogo.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); artworkPanel.add(lblLogo, "2, 4, fill, fill"); } { lblClearlogo = new ImageLabel(); lblClearlogo.setAlternativeText(BUNDLE.getString("image.notfound.clearlogo")); //$NON-NLS-1$ lblClearlogo.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ImageChooserDialog dialog = new ImageChooserDialog(movieSetToEdit.getIds(), ImageType.CLEARLOGO, movieList.getDefaultArtworkScrapers(), lblClearlogo, null, null, MediaType.MOVIE); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); } }); lblClearlogo.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); artworkPanel.add(lblClearlogo, "4, 4, fill, fill"); } { JLabel lblClearartT = new JLabel(BUNDLE.getString("mediafiletype.clearart")); //$NON-NLS-1$ artworkPanel.add(lblClearartT, "2, 6"); } { lblClearart = new ImageLabel(); lblClearart.setAlternativeText(BUNDLE.getString("image.notfound.clearart")); //$NON-NLS-1$ lblClearart.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ImageChooserDialog dialog = new ImageChooserDialog(movieSetToEdit.getIds(), ImageType.CLEARART, movieList.getDefaultArtworkScrapers(), lblClearart, null, null, MediaType.MOVIE); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); } }); { JLabel lblBannerT = new JLabel(BUNDLE.getString("mediafiletype.banner")); //$NON-NLS-1$ artworkPanel.add(lblBannerT, "4, 6"); } lblClearart.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); artworkPanel.add(lblClearart, "2, 8, fill, fill"); } { lblBanner = new ImageLabel(); lblBanner.setAlternativeText(BUNDLE.getString("image.notfound.banner")); //$NON-NLS-1$ lblBanner.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ImageChooserDialog dialog = new ImageChooserDialog(movieSetToEdit.getIds(), ImageType.BANNER, movieList.getDefaultArtworkScrapers(), lblBanner, null, null, MediaType.MOVIE); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); } }); lblBanner.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); artworkPanel.add(lblBanner, "4, 8, 3, 1, fill, fill"); } // extra artwork lblBanner.setImagePath(movieSetToEdit.getArtworkFilename(MediaFileType.BANNER)); } /** * Button pane */ { JPanel buttonPane = new JPanel(); getContentPane().add(buttonPane, BorderLayout.SOUTH); EqualsLayout layout = new EqualsLayout(5); buttonPane.setBorder(new EmptyBorder(4, 4, 4, 4)); layout.setMinWidth(100); buttonPane.setLayout(layout); { JButton btnOk = new JButton(BUNDLE.getString("Button.ok")); //$NON-NLS-1$ btnOk.setAction(actionOk); buttonPane.add(btnOk); getRootPane().setDefaultButton(btnOk); JButton btnCancel = new JButton(BUNDLE.getString("Button.cancel")); //$NON-NLS-1$ btnCancel.setAction(actionCancel); buttonPane.add(btnCancel); if (inQueue) { JButton abortButton = new JButton(BUNDLE.getString("Button.abortqueue")); //$NON-NLS-1$ buttonPane.add(abortButton); abortButton.setAction(actionAbort); } } } { tfName.setText(movieSetToEdit.getTitle()); tfTmdbId.setText(String.valueOf(movieSetToEdit.getTmdbId())); tpOverview.setText(movieSetToEdit.getPlot()); moviesInSet.addAll(movieSetToEdit.getMovies()); if (StringUtils.isNotBlank(movieSetToEdit.getArtworkFilename(MediaFileType.POSTER))) { lblPoster.setImagePath(movieSetToEdit.getArtworkFilename(MediaFileType.POSTER)); } else { lblPoster.setImageUrl(movieSetToEdit.getArtworkUrl(MediaFileType.POSTER)); } if (StringUtils.isNotBlank(movieSetToEdit.getArtworkFilename(MediaFileType.FANART))) { lblFanart.setImagePath(movieSetToEdit.getArtworkFilename(MediaFileType.FANART)); } else { lblFanart.setImageUrl(movieSetToEdit.getArtworkUrl(MediaFileType.FANART)); } lblLogo.setImagePath(movieSetToEdit.getArtworkFilename(MediaFileType.LOGO)); lblClearlogo.setImagePath(movieSetToEdit.getArtworkFilename(MediaFileType.CLEARLOGO)); lblClearart.setImagePath(movieSetToEdit.getArtworkFilename(MediaFileType.CLEARART)); } initDataBindings(); // adjust table columns // name column tableMovies.getTableHeader().getColumnModel().getColumn(0).setHeaderValue(BUNDLE.getString("metatag.name")); // year column int width = tableMovies.getFontMetrics(tableMovies.getFont()).stringWidth(" 2000"); int titleWidth = tableMovies.getFontMetrics(tableMovies.getFont()) .stringWidth(BUNDLE.getString("metatag.year")); //$NON-NLS-1$ if (titleWidth > width) { width = titleWidth; } tableMovies.getTableHeader().getColumnModel().getColumn(1).setPreferredWidth(width); tableMovies.getTableHeader().getColumnModel().getColumn(1).setMinWidth(width); tableMovies.getTableHeader().getColumnModel().getColumn(1).setMaxWidth((int) (width * 1.5)); tableMovies.getTableHeader().getColumnModel().getColumn(1).setHeaderValue(BUNDLE.getString("metatag.year")); // watched column tableMovies.getTableHeader().getColumnModel().getColumn(2).setPreferredWidth(70); tableMovies.getTableHeader().getColumnModel().getColumn(2).setMinWidth(70); tableMovies.getTableHeader().getColumnModel().getColumn(2).setMaxWidth(85); tableMovies.getTableHeader().getColumnModel().getColumn(2) .setHeaderValue(BUNDLE.getString("metatag.watched")); }