📄 playlistpanel.java
字号:
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(selected) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(selectBG) .addGap(10, 10, 10) .addComponent(bg1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(bg2)) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(title) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(hilight) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(index) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(length)))) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton8))) .addContainerGap(62, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(title) .addComponent(hilight) .addComponent(index) .addComponent(length)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(selected) .addComponent(bg1) .addComponent(selectBG) .addComponent(bg2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(jButton8)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jButton9.setText(Config.getResource("save")); // NOI18N jButton9.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton9ActionPerformed(evt); } }); jPanel3.add(jButton9); jButton10.setText(Config.getResource("reset")); // NOI18N jButton10.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton10ActionPerformed(evt); } }); jPanel3.add(jButton10); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, 428, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed // TODO add your handling code here: Font f = FontChooser.showDialog(null, Config.getResource("PlayListPanel.selectFont"), font); if (f != null) { font = f; } }//GEN-LAST:event_jButton8ActionPerformed private void titleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_titleActionPerformed // TODO add your handling code here: Color c = JColorChooser.showDialog(this, Config.getResource("PlayListPanel.selectTitleColor"), titleColor); if (c != null) { titleColor = c; title.setIcon(Util.createColorIcon(c, width, height)); } }//GEN-LAST:event_titleActionPerformed private void hilightActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hilightActionPerformed // TODO add your handling code here: Color c=JColorChooser.showDialog(this, Config.getResource("PlayListPanel.selectHilightColor"), hilightColor); if(c!=null){ hilightColor=c; hilight.setIcon(Util.createColorIcon(c, width, height)); } }//GEN-LAST:event_hilightActionPerformed private void indexActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_indexActionPerformed // TODO add your handling code here: Color c = JColorChooser.showDialog(this, Config.getResource("PlayListPanel.selectIndexColor"), indexColor); if (c != null) { indexColor = c; index.setIcon(Util.createColorIcon(c, width, height)); } }//GEN-LAST:event_indexActionPerformed private void lengthActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_lengthActionPerformed // TODO add your handling code here: Color c = JColorChooser.showDialog(this, Config.getResource("PlayListPanel.selectLengthColor"), lengthColor); if (c != null) { lengthColor = c; length.setIcon(Util.createColorIcon(c, width, height)); } }//GEN-LAST:event_lengthActionPerformed private void selectedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectedActionPerformed // TODO add your handling code here: Color c = JColorChooser.showDialog(this, Config.getResource("PlayListPanel.selectSelectedColor"), selectedColor); if (c != null) { selectedColor = c; selected.setIcon(Util.createColorIcon(c, width, height)); } }//GEN-LAST:event_selectedActionPerformed private void bg1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bg1ActionPerformed // TODO add your handling code here: Color c = JColorChooser.showDialog(this, Config.getResource("PlayListPanel.selectBg1Color"), bg1Color); if (c != null) { bg1Color = c; bg1.setIcon(Util.createColorIcon(c, width, height)); } }//GEN-LAST:event_bg1ActionPerformed private void bg2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bg2ActionPerformed // TODO add your handling code here: Color c = JColorChooser.showDialog(this, Config.getResource("PlayListPanel.selectBg2Color"), bg2Color); if (c != null) { bg2Color = c; bg2.setIcon(Util.createColorIcon(c, width, height)); } }//GEN-LAST:event_bg2ActionPerformed private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed // TODO add your handling code here: doSave(); Config.getConfig().getPlWindow().repaint(); }//GEN-LAST:event_jButton9ActionPerformed private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed // TODO add your handling code here: init(); }//GEN-LAST:event_jButton10ActionPerformed private void selectBGActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectBGActionPerformed // TODO add your handling code here: Color c = JColorChooser.showDialog(this, Config.getResource("PlayListPanel.selectSelectedBGColor"), selectedBGColor); if (c != null) { selectedBGColor = c; selectBG.setIcon(Util.createColorIcon(c, width, height)); }}//GEN-LAST:event_selectBGActionPerformed private void doSave() { Config config = Config.getConfig(); config.setPlaylistBackground1(bg1Color); config.setPlaylistBackground2(bg2Color); config.setPlaylistFont(font); config.setPlaylistHiLightColor(hilightColor); config.setPlaylistIndexColor(indexColor); config.setPlaylistLengthColor(lengthColor); config.setPlaylistSelectedColor(selectedColor); config.setPlaylistTitleColor(titleColor); config.setPlaylistSelectedBG(selectedBGColor); config.setCanDnD(canDnd.isSelected()); config.setDisableDelete(disableDelete.isSelected()); config.setSavePlayListByAbsolutePath(useAbsolutePath.isSelected()); config.setIgnoreBadFile(ignoreBadFile.isSelected()); config.setShowTooltipOnPlayList(showTip.isSelected()); config.setReadTagInfoStrategy(getReadTagInfoStategy(readTagStrategy.getSelectedItem().toString())); if (config.isAutoCloseDialogWhenSave()) { config.getOptionDialog().setVisible(false); } } private String getReadTagInfoStategy(String s) { String[] ss = {Config.READ_WHEN_ADD, Config.READ_WHEN_DISPLAY, Config.READ_WHEN_PLAY}; for (String temp : ss) { if (Config.getResource(temp).equals(s)) { return temp; } } return Config.READ_WHEN_ADD; } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton bg1; private javax.swing.JButton bg2; private javax.swing.JCheckBox canDnd; private javax.swing.JCheckBox disableDelete; private javax.swing.JButton hilight; private javax.swing.JCheckBox ignoreBadFile; private javax.swing.JButton index; private javax.swing.JButton jButton10; private javax.swing.JButton jButton8; private javax.swing.JButton jButton9; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JButton length; private javax.swing.JComboBox readTagStrategy; private javax.swing.JButton selectBG; private javax.swing.JButton selected; private javax.swing.JCheckBox showTip; private javax.swing.JButton title; private javax.swing.JCheckBox useAbsolutePath; // End of variables declaration//GEN-END:variables}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -