The following document contains the results of PMD's CPD 4.2.5.
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\dialogs\DiscAddDialog.java | 532 |
| com\melloware\jukes\gui\view\dialogs\TrackAddDialog.java | 534 |
protected void resizeHook(JComponent component) {
// Resizer.ONE2ONE.resizeDialogContent(component);
}
/**
* Builds the search criteria panel.
* <p>
* @return the panel used to specify criteria
*/
private JComponent buildDiscPanel() {
FormLayout layout = new FormLayout("right:max(14dlu;pref), 400px, pref, pref, pref, pref ,pref, fill:pref:grow",
"p, 4px, p, 4px, p, 4px, 4px");
PanelBuilder builder = new PanelBuilder(layout);
CellConstraints cc = new CellConstraints();
builder.addLabel(Resources.getString("label.artist") + ": ", cc.xy(1, 1));
builder.add(artistField, cc.xyw(2, 1, 4));
builder.add(webImagePreview, cc.xywh(7, 1, 1, 7));
builder.add(ComponentFactory.createTitleCaseButton(artistField), cc.xy(6, 1));
builder.addLabel(Resources.getString("label.disc") + ": ", cc.xy(1, 3));
builder.add(discField, cc.xyw(2, 3, 4));
builder.add(ComponentFactory.createTitleCaseButton(discField), cc.xy(6, 3));
builder.addLabel(Resources.getString("label.genre") + ": ", cc.xy(1, 5));
builder.add(genreField, cc.xy(2, 5));
builder.addLabel(Resources.getString("label.year") + ": ", cc.xy(4, 5));
builder.add(yearField, cc.xy(5, 5));
return builder.getPanel();
}
/**
* Builds the <code>Search Criteria</code>, the <code>Results</code> and
* answers them wrapped by a stripped <code>JSplitPane</code>.
*/
private JComponent buildSplitPane() {
splitPane = UIFactory.createStrippedSplitPane(JSplitPane.VERTICAL_SPLIT, buildDiscPanel(), buildTagTablePanel(),
0.25);
splitPane.setBorder(Borders.DIALOG_BORDER);
return splitPane;
}
/**
* Builds the panel with the JTable tags in it.
* <p>
* @return the panel used to display messages
*/
private JComponent buildTagTablePanel() {
// build the table and model
tagTable.setShowGrid(false);
tagTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
tagTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
// Ask to be notified of selection changes.
ListSelectionModel rowSM = tagTable.getSelectionModel();
rowSM.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
// Ignore extra messages.
if (e.getValueIsAdjusting()) {
return;
}
}
});
JComponent resultsPane = UIFactory.createTablePanel(tagTable);
resultsPane.setPreferredSize(new Dimension(300, 275));
// build the form
FormLayout layout = new FormLayout("fill:pref:grow", "p");
PanelBuilder builder = new PanelBuilder(layout);
CellConstraints cc = new CellConstraints();
builder.add(resultsPane, cc.xy(1, 1));
return builder.getPanel();
}
/**
* Fill each tag from the screen.
*/
private void fillTags() {
// loop through and set the disc settings into each tag
for (int i = 0; i < tags.length; i++) {
MusicTag tag = (MusicTag) tags[i];
tag.setArtist(artistField.getText());
tag.setDisc(discField.getText());
tag.setYear(yearField.getText());
tag.setGenre((String) genreField.getSelectedItem());
}
}
/**
* Loads the JTable with data.
*/
private void loadTable() {
if (LOG.isDebugEnabled()) {
LOG.debug("Loading table.");
}
tableModel = new MusicTagTableModel(tags);
RowSorter<TableModel> sorter = new TableRowSorter<TableModel>(tableModel);
tagTable.setModel(tableModel);
tagTable.setRowSorter(sorter);
header.autoSizeColumns();
// one click to edit the text cell
((DefaultCellEditor) tagTable.getDefaultEditor(String.class)).setClickCountToStart(1);
tagTable.updateUI();
}
/**
* Updates the cover thumbnail.
*/
private void updateCoverImage() {
if ((this.coverImage != null) && (this.coverImage.exists())) {
webImagePreview.setImage(ImageFactory.getScaledImage(coverImage.getAbsolutePath(), 90, 90).getImage());
}
}
/**
* Closes any cell editors and fires datachanged event.
*/
private void updateTable() {
GuiUtil.stopTableEditing(tagTable);
tableModel.fireTableDataChanged();
}
}
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\dialogs\DiscAddDialog.java | 223 |
| com\melloware\jukes\gui\view\dialogs\TrackAddDialog.java | 294 |
public void doCancel() {
LOG.debug("Cancel Pressed.");
super.doCancel();
}
/**
* Finds a new disc cover.
*/
public void findCover() {
final File currentDir = new File(this.directory);
JFileChooser chooser = new JFileChooser();
chooser.setApproveButtonText(Resources.getString("label.Select"));
chooser.setDialogTitle(Resources.getString("label.FindCoverImage"));
chooser.setCurrentDirectory(currentDir);
chooser.addChoosableFileFilter(FilterFactory.imageFileFilter());
chooser.setAcceptAllFileFilterUsed(false);
chooser.setFileView(new ImageFileView());
chooser.setAccessory(new ChooserImagePreview(chooser));
chooser.setMultiSelectionEnabled(false);
int returnVal = chooser.showOpenDialog(Application.getDefaultParentFrame());
if (returnVal != JFileChooser.APPROVE_OPTION) {
return;
}
File file = chooser.getSelectedFile();
this.coverImage = file;
updateCoverImage();
}
/**
* Renames all the music files
*/
public void renameFiles() {
LOG.debug("Renaming Files");
updateTable();
MusicTag musicTag = null;
try {
GuiUtil.setBusyCursor(this, true);
// update tags from dialog values
fillTags();
for (int i = 0; i < tags.length; i++) {
musicTag = (MusicTag) tags[i];
if (musicTag.renameFile(this.settings.getFileFormatMusic())) {
LOG.debug("Renamed " + musicTag.getAbsolutePath());
}
}
} catch (Exception ex) {
final String errorMessage = ResourceUtils.getString("messages.ErrorRenamingFile") + ": " + ex.getMessage();
LOG.error(errorMessage, ex);
MessageUtil.showError(this, errorMessage);
} finally {
GuiUtil.setBusyCursor(this, false);
}
updateTable();
}
/**
* If track titles are all messed up and no amazon search found, this will
* attempt to use the filename to construct a valid title.
*/
public void resetFromFilenames() {
LOG.debug("Constructing titles from filenames");
for (int i = 0; i < tags.length; i++) {
MusicTag tag = (MusicTag) tags[i];
tag.setTitle(tag.extractTitleFromFilename());
}
updateTable();
}
/**
* If track numbers are all screwed up, then loop and make them 1 to N.
*/
public void resetTrackNumbers() {
LOG.debug("Resetting track numbers.");
final int padding = ((tags.length >= 100) ? 3 : 2);
for (int i = 0; i < tags.length; i++) {
MusicTag tag = (MusicTag) tags[i];
tag.setTrack(String.valueOf(i + 1), padding);
}
updateTable();
}
/**
* Apply title case to all tracks in the disc.
*/
public void titleCase() {
LOG.debug("Title casing all tracks");
for (int i = 0; i < tags.length; i++) {
MusicTag tag = (MusicTag) tags[i];
tag.setTitle(FileUtil.capitalize(tag.getTitle()));
}
updateTable();
}
/**
* Updates all of the comments at once
*/
public void updateComments() {
LOG.debug("Updating comments");
updateTable();
final String inputValue = StringUtils.defaultIfEmpty(JOptionPane.showInputDialog(Resources
.getString("label.Enteracomment")
+ ": "), "");
for (int i = 0; i < tags.length; i++) {
final MusicTag tag = (MusicTag) tags[i];
tag.setComment(inputValue);
}
updateTable();
}
/**
* Perform the web search.
*/
public void webSearch() {
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\dialogs\DiscAddHeaderPanel.java | 138 |
| com\melloware\jukes\gui\view\dialogs\TrackAddHeaderPanel.java | 131 |
ActionManager.get(Actions.FILE_RENAME_ID).setEnabled(true);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.DISC_WEB_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this.owner);
toolBar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.DISC_COVER_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this.owner);
toolBar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.FILE_RENAME_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this.owner);
toolBar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.DISC_ADD_TITLECASE_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this.owner);
toolBar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.DISC_ADD_RESET_FROM_FILENAME_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this.owner);
toolBar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.DISC_ADD_RESET_NUMBERS_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this.owner);
toolBar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.DISC_ADD_COMMENTS_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this.owner);
toolBar.add(button);
final JToolBar bar = toolBar.getToolBar();
bar.setOpaque(false);
return bar;
}
/**
* Builds and answers the panel's center component.
*/
protected JComponent buildCenterComponent() {
FormLayout fl = new FormLayout("7dlu, 9dlu, left:pref, 14dlu:grow, pref, 4dlu",
"7dlu, pref, 2dlu, pref, 0:grow");
JPanel panel = new JPanel(fl);
Dimension size = new Dimension(300, height);
panel.setMinimumSize(size);
panel.setPreferredSize(size);
panel.setOpaque(false);
CellConstraints cc = new CellConstraints();
panel.add(titleLabel, cc.xywh(2, 2, 2, 1));
panel.add(descriptionArea, cc.xy(3, 4));
panel.add(iconLabel, cc.xywh(5, 1, 1, 5));
return panel;
}
/**
* Builds the panel.
*/
private void build() {
FormLayout fl = new FormLayout("pref:grow", "pref, pref");
setLayout(fl);
CellConstraints cc = new CellConstraints();
add(buildCenterComponent(), cc.xy(1, 1));
add(buildBottomComponent(), cc.xy(1, 2));
}
/**
* Creates and configures the UI components.
*/
private void initComponents() {
titleLabel = UIFactory.createBoldLabel("", 0, Color.black);
descriptionArea = UIFactory.createMultilineLabel("");
descriptionArea.setForeground(Color.black);
iconLabel = new JLabel();
}
}
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\tool\logging\AwtLogHandler.java | 135 |
| com\melloware\jukes\gui\tool\logging\Log4jFeedbackAppender.java | 99 |
} else if (Level.WARN.equals(level)) {
return "warn";
} else {
return "Message";
}
}
private Frame owner() {
Frame frame = Application.getDefaultParentFrame();
return (frame == null) ? new Frame() : frame;
}
private void sendFeedback(Level level, String msg, Throwable thrown) {
StringWriter out = new StringWriter();
out.write(msg);
out.write("\n");
writeSystemProperties(out,
new String[] {
"os.name", "os.version", "java.vm.vendor", "java.vm.version",
"application.fullversion"
});
if (thrown != null) {
out.write("\n\n");
thrown.printStackTrace(new PrintWriter(out));
}
new SendFeedbackDialog(owner(), "info@melloware.com", getSubject(level), out.toString()).open();
}
private void showOptionWithFeedbackDialog(Level level, String msg, Throwable thrown) {
int messageType = getMessageType(level);
String title = getTitle(level);
String fullMessage = msg + "\n" + thrown.getLocalizedMessage();
int choice = JOptionPane.showOptionDialog(owner(), fullMessage, title, -1, messageType, null, OPTIONS,
OK_LABEL);
if (choice == 1) {
sendFeedback(level, msg, thrown);
}
}
private void writeSystemProperties(StringWriter out, String[] keys) {
for (int i = 0; i < keys.length; i++) {
String key = keys[i];
String value = System.getProperty(key);
if (value != null) {
out.write("\n");
out.write(key);
out.write("=");
out.write(value);
}
}
}
}
| |
| File | Line |
|---|---|
| com\melloware\jukes\file\tag\ApeFileTag.java | 421 |
| com\melloware\jukes\file\tag\AudioFileTag.java | 425 |
return audioFile.getAudioHeader().isVariableBitRate();
}
/*
* (non-Javadoc)
* @see com.melloware.jukes.file.tag.MusicTag#removeTags()
*/
public void removeTags() throws MusicTagException {
if (audioFile != null) {
try {
AudioFileIO.delete(audioFile);
} catch (Exception e) {
throw new MusicTagException("Error removing AudioFile tag: " + e.getMessage(), e);
}
initializeTags();
}
}
/**
* Renames this Music file based on a format from prefs. The format is in
* aFormat and can have values %n for track number, %t for title, %a for
* artist, and %d for disc. Replaces any invalid characters (\\, /, :, , *, ?, ", <, >,
* or |) with underscores _ to prevent any errors on file systems. Examples:
* %n -%t = 01 - Track.mp3 %a - %d - %n - %t = Artist - Album - 01 -
* Track.mp3
* <p>
* @param aFormat the string format like %n -%t to rename 01 - Track.mp3
* @return true if renamed, false if failure
*/
public boolean renameFile(String aFormat) {
boolean result = false;
try {
final String newFileName = createFilenameFromFormat(aFormat);
final File newFile = new File(newFileName);
// close the audioFile
audioFile = null;
result = this.file.renameTo(newFile);
if (result) {
this.file = newFile;
this.audioFile = AudioFileIO.read(newFile);
initializeTags();
}
} catch (Exception ex) {
final String errorMessage = ResourceUtils.getString("messages.ErrorRenamingFile");
LOG.error(errorMessage, ex);
final MainFrame mainFrame = (MainFrame) Application.getDefaultParentFrame();
MessageUtil.showError(mainFrame, errorMessage); //AZ
}
return result;
}
/*
* (non-Javadoc)
* @see com.melloware.jukes.file.tag.MusicTag#save()
*/
public void save() throws MusicTagException {
if (audioFile != null) {
try {
audioFile.commit();
} catch (CannotWriteException ex) {
throw new MusicTagException("Error saving AudioFile tag: " + ex.getMessage());
}
}
}
/**
* Initialize the tags for this audio file.
*/
private void initializeTags() {
// initialize private variables from tags
this.getDisc();
this.getArtist();
this.getComment();
this.getGenre();
this.getTitle();
this.getTrack();
this.getYear();
this.getTrackLength();
this.getEncodedBy();
}
}
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\dialogs\DiscAddHeaderPanel.java | 57 |
| com\melloware\jukes\gui\view\dialogs\TrackAddHeaderPanel.java | 55 |
public TrackAddHeaderPanel(TrackAddDialog owner, String title, String description, Icon icon, int height) {
super(true);
this.owner = owner;
this.height = height;
initComponents();
build();
setTitle(title);
setDescription(description);
setIcon(icon);
}
/**
* Returns the description text.
*/
public String getDescription() {
return descriptionArea.getText();
}
/**
* Returns the icon.
*/
public Icon getIcon() {
return iconLabel.getIcon();
}
/**
* Returns the title text.
*/
public String getTitle() {
return titleLabel.getText();
}
/**
* Sets the description text.
*/
public void setDescription(String description) {
descriptionArea.setText(description);
}
/**
* Sets the icon.
*/
public void setIcon(Icon icon) {
if (null == icon) {
iconLabel.setIcon(null);
return;
}
if ((icon.getIconWidth() > 20) || !(icon instanceof ImageIcon)) {
iconLabel.setIcon(icon);
return;
}
Image image = ((ImageIcon)icon).getImage();
int newWidth = 2 * icon.getIconWidth();
int newHeight = 2 * icon.getIconHeight();
image = image.getScaledInstance(newWidth, newHeight, 0);
iconLabel.setIcon(new ImageIcon(image));
}
/**
* Sets the title text.
*/
public void setTitle(String title) {
titleLabel.setText(title);
}
/**
* Builds and answers the panel's bottom component, a separator by default.
*/
protected JComponent buildBottomComponent() {
final ToolBarBuilder toolBar = new ToolBarBuilder("DiscToolBar");
toolBar.addGap(2);
ToolBarButton button = null;
ActionManager.get(Actions.DISC_WEB_ID).setEnabled(true);
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\DisclistPanel.java | 397 |
| com\melloware\jukes\gui\view\PlaylistPanel.java | 509 |
duration = UIFactory.createBoldLabel("");
bitrate = UIFactory.createBoldLabel("");
albumImage = new AlbumImage(new Dimension(170, 170));
ActionListener actionListener = new ActionListener() {
public void actionPerformed(ActionEvent event) {
AlbumImage preview = (AlbumImage) event.getSource();
if (preview.getDisc() != null) {
GuiUtil.setBusyCursor(mainFrame, true);
mainFrame.getMainModule().selectNodeInTree(preview.getDisc());
GuiUtil.setBusyCursor(mainFrame, false);
}
}
};
albumImage.addActionListener(actionListener);
builder.addLabel(ResourceUtils.getString("label.artist") + ": ", cc.xy(1, 2));
builder.add(artist, cc.xyw(2, 2, 3));
builder.add(albumImage, cc.xywh(5, 2, 1, 11));
builder.addLabel(ResourceUtils.getString("label.disc") + ": ", cc.xy(1, 4));
builder.add(disc, cc.xyw(2, 4, 3));
builder.addLabel(ResourceUtils.getString("label.track") + ": ", cc.xy(1, 6));
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\dialogs\DiscAddDialog.java | 347 |
| com\melloware\jukes\gui\view\dialogs\DiscAddDialog.java | 405 |
dialog.setSelectedDisc(discField.getText());
dialog.open();
// if the user did not select anything
if (dialog.hasBeenCanceled()) {
return;
}
if (StringUtils.isNotBlank(dialog.getSelectedArtist())) {
artistField.setText(dialog.getSelectedArtist());
}
if (StringUtils.isNotBlank(dialog.getSelectedDisc())) {
String end = StringUtils.substringAfterLast(discField.getText(), " -");
if (StringUtils.isNotBlank(end)) {
discField.setText(dialog.getSelectedDisc() + " -" + end);
} else {
discField.setText(dialog.getSelectedDisc());
}
}
if (StringUtils.isNotBlank(dialog.getSelectedYear())) { // NOPMD
if ((NumberUtils.isNumber(yearField.getText())) && (NumberUtils.isNumber(dialog.getSelectedYear()))) { // NOPMD
if (Integer.valueOf(dialog.getSelectedYear()).intValue() < Integer.valueOf(yearField.getText()).intValue()) { // NOPMD
yearField.setText(dialog.getSelectedYear());
}
}
}
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\editor\DiscEditor.java | 405 |
| com\melloware\jukes\gui\view\editor\DiscEditor.java | 565 |
dialog.setSelectedDisc(disc.getName());
dialog.open();
// if the user did not select anything
if (dialog.hasBeenCanceled()) {
return;
}
// flag for if this year or name was modified
boolean modified = false;
// if disc is not blank and does not contain a subtitle like - Disc 1
final String[] checkList = { "- Disc", "-Disc", "- disc" };
if (((StringUtils.isNotBlank(dialog.getSelectedDisc()))
&& (StringUtils.indexOfAny(nameField.getText(), checkList) <= 0))) {
if (!(dialog.getSelectedDisc().equals(nameField.getText()))) {
disc.setName(dialog.getSelectedDisc());
nameField.setText(dialog.getSelectedDisc());
modified = true;
}
}
if ((StringUtils.isNotBlank(dialog.getSelectedYear()))
&& (Integer.valueOf(dialog.getSelectedYear()).intValue() != Integer.valueOf(year.getText()).intValue())) {
disc.setYear(dialog.getSelectedYear());
year.setText(dialog.getSelectedYear());
modified = true;
}
if (dialog.getSelectedImage() != null) {
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\dialogs\FreeDBDialog.java | 384 |
| com\melloware\jukes\gui\view\dialogs\WebSearchDialog.java | 429 |
webImagePreview.setImage(selection.getSmallestImage());
listModel.removeAllElements();
int count = 0;
for (Iterator iter = selection.getTracks().iterator(); iter.hasNext();) {
String element = (String)iter.next();
count++;
listModel.addElement(count + ". " + element);
}
} catch (Exception ex) {
final MainFrame mainFrame = (MainFrame) Application.getDefaultParentFrame();
LOG.error("RuntimeException", ex);
MessageUtil.showError(mainFrame, "RuntimeException");
} finally {
GuiUtil.setBusyCursor(dialog, false);
}
}
}
});
// build the tracks JList and model
listModel = new DefaultListModel();
list = new JList(listModel);
list.setFocusable(false);
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
list.setSelectedIndex(0);
list.setVisibleRowCount(7);
JScrollPane listScrollPane = UIFactory.createStrippedScrollPane(list);
listScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
JPanel previewPanel = new JPanel(new BorderLayout());
previewPanel.add(webImagePreview, BorderLayout.NORTH);
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\dialogs\XMLExportDialog.java | 101 |
| com\melloware\jukes\gui\view\dialogs\XMLImportDialog.java | 116 |
protected JComponent buildContent() {
JPanel content = new JPanel(new BorderLayout());
JButton[] buttons = new JButton[3];
// Create Cancel button
buttonCancel = createCancelButton();
buttonCancel.setText(Resources.getString("label.Close"));
// Create an action with an icon
Action search = new AbstractAction(Resources.getString("label.Start"), Resources.THREAD_START_ICON) {
public void actionPerformed(ActionEvent evt) {
doSearch();
}
};
buttonSearch = new JButton(search);
// Create an action with an icon
Action stop = new AbstractAction(Resources.getString("label.Cancel"), Resources.THREAD_STOP_ICON) {
public void actionPerformed(ActionEvent evt) {
doStop();
}
};
buttonStop = new JButton(stop);
buttonStop.setEnabled(false);
buttons[0] = buttonSearch;
buttons[1] = buttonStop;
buttons[2] = buttonCancel;
buttonBar = ButtonBarFactory.buildCenteredBar(buttons);
content.add(buildMainPanel(), BorderLayout.CENTER);
content.add(buttonBar, BorderLayout.SOUTH);
return content;
}
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\dialogs\DiscAddDialog.java | 116 |
| com\melloware\jukes\gui\view\dialogs\TrackAddDialog.java | 119 |
(yearField).setColumns(5);
tagTable = new JTable();
header = new EnhancedTableHeader(tagTable.getColumnModel(), tagTable);
tagTable.setTableHeader(header);
webImagePreview = new AlbumImage();
// try to read tags
try {
this.settings = settings;
final MusicTag musicTag = TagFactory.getTag(aFile);
if (LOG.isDebugEnabled()) {
LOG.debug(musicTag.getHeaderInfo());
}
artistField = new JTextField(musicTag.getArtist());
artistField.setColumns(45);
discField = new JTextField(musicTag.getDisc());
discField.setColumns(45);
genreField = new JComboBox(MusicTag.getGenreTypes().toArray());
genreField.setSelectedItem(musicTag.getGenre());
if (genreField.getSelectedItem() == null) {
genreField.setSelectedItem("Other");
}
yearField = new JTextField(musicTag.getYear());
(yearField).setColumns(5);
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\tool\MainController.java | 870 |
| com\melloware\jukes\gui\tool\MainController.java | 1311 |
for (int i = tree.getSelectionPaths().length - 1; i >= 0; i--) {
final TreePath path = tree.getSelectionPaths()[i];
if (path.getLastPathComponent() instanceof AbstractTreeNode) {
final AbstractTreeNode node = (AbstractTreeNode) path.getLastPathComponent();
// AZ look for filtered discs
if (node instanceof ArtistNode) {
final int nodeCount = node.getChildCount();
if (nodeCount > 0) {
for (int ii = 0; ii < node.getChildCount(); ii++) {
final AbstractTreeNode childNode = (AbstractTreeNode) node.getChildAt(ii);
playlist.addNext(childNode.getModel());
}
}
} else {
playlist.addNext(node.getModel());
}
}
}
}
if (editor instanceof JList) {
final JList list = (JList) editor;
final Object[] selections = list.getSelectedValues();
for (int i = selections.length - 1; i >= 0; i--) {
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\editor\DiscEditor.java | 442 |
| com\melloware\jukes\gui\view\editor\DiscEditor.java | 616 |
artistField.setText(dialog.getSelectedArtist());
modified = true;
}
}
if (dialog.getSelectedTracks()!= null) {
if (dialog.getSelectedTracks().size() == disc.getTracks().size()) {
int ii = 0;
List trackList = new ArrayList(dialog.getSelectedTracks());
for (Iterator iter = getDisc().getTracks().iterator(); iter.hasNext();) {
Track track = (Track)iter.next();
track.setName(trackList.get(ii).toString());
ii = ii + 1;
}
modified = true;
} else {
final String errorMessage = ResourceUtils.getString("messages.WrongNumberOfTracks");
MessageUtil.showwarn(this, errorMessage);
LOG.error(errorMessage);
}
}
// update dataModel and view for changes //AZ
if (modified) {
updateModel();
updateView();
}
}
/**
* Reads view contents from the underlying model.
*/
protected void updateView() {
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\editor\DiscEditor.java | 755 |
| com\melloware\jukes\gui\view\editor\TrackEditor.java | 500 |
final ToolBarBuilder bar = new ToolBarBuilder("Track Toolbar");
ToolBarButton button = null;
button = (ToolBarButton) ComponentFactory.createToolBarButton(Actions.UNLOCK_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this);
bar.add(button);
button = (ToolBarButton) ComponentFactory.createToolBarButton(Actions.COMMIT_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this);
bar.add(button);
button = (ToolBarButton) ComponentFactory.createToolBarButton(Actions.ROLLBACK_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this);
bar.add(button);
button = (ToolBarButton) ComponentFactory.createToolBarButton(Actions.DELETE_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this);
bar.add(button);
button = (ToolBarButton) ComponentFactory.createToolBarButton(Actions.FILE_RENAME_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this);
bar.add(button);
| |