/** Create common UI for property wizards */ void populate() { getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS)); Util.setShuffleLocation(this, 400, 400); jlItemChoice = new JLabel(Messages.getString("CustomPropertyWizard.0")); jlName = new JLabel(Messages.getString("CustomPropertyWizard.1")); jcbItemChoice = new JComboBox(); jcbItemChoice.addItem(Messages.getString("Item_Track")); jcbItemChoice.addItem(Messages.getString("Item_File")); jcbItemChoice.addItem(Messages.getString("Item_Style")); jcbItemChoice.addItem(Messages.getString("Item_Author")); jcbItemChoice.addItem(Messages.getString("Item_Album")); jcbItemChoice.addItem(Messages.getString("Item_Device")); jcbItemChoice.addItem(Messages.getString("Item_Directory")); jcbItemChoice.addItem(Messages.getString("Item_Playlist")); // playlist // jcbItemChoice.addItem(Messages.getString("Item_Year")); // file // actually // okp = new OKCancelPanel(this); okp.getOKButton().setEnabled(false); // In physical perspective, default item is file, otherwise, it is track if (PerspectiveManager.getCurrentPerspective().getClass().equals(FilesPerspective.class)) { jcbItemChoice.setSelectedIndex(1); } else { jcbItemChoice.setSelectedIndex(0); } jcbItemChoice.addItemListener(this); jpMain = new JPanel(); }
/* * (non-Javadoc) * * @see org.jajuk.ui.Observer#update(java.lang.String) */ public void update(Event event) { EventSubject subject = event.getSubject(); // Make a search after a stop period if (subject.equals(EventSubject.EVENT_FILE_LAUNCHED) || subject.equals(EventSubject.EVENT_PERPECTIVE_CHANGED)) { // Do not perform search if current perspective is not info for // perfs if (!(PerspectiveManager.getCurrentPerspective() instanceof InfoPerspective)) { return; } // If current state is stopped, reset page if (FIFO.getInstance().getCurrentFile() == null) { reset(); return; } // Launch search launchSearch(false); } // Reset the page when stopping else if (subject.equals(EventSubject.EVENT_ZERO)) { reset(); } // User changed current track tags, so we have to reload // new author wikipedia page else if (subject.equals(EventSubject.EVENT_AUTHOR_CHANGED) || subject.equals(EventSubject.EVENT_ALBUM_CHANGED) || subject.equals(EventSubject.EVENT_TRACK_CHANGED)) { update(new Event(EventSubject.EVENT_FILE_LAUNCHED)); } }
/** * [Perf]. * * @return whether LastFM tabs are visible or not */ private boolean isLastFMTabsVisible() { // Refresh artists only if user selected similar artists or albums tab return (tabs.getSelectedIndex() == 3 || tabs.getSelectedIndex() == 4) // Check this view perspective is visible && PerspectiveManager.getCurrentPerspective().equals(this.getPerspective()); }