📄 soundmanagementview.java
字号:
package com.fugle.view;
import com.fugle.model.*;
import java.awt.*;
public class SoundManagementView
{
/**
* @param args
*/
public static void showMenu()
{
System.out.println(" **************************************************");
System.out.println(" 歌 曲 管 理 系 统 v 0.1a " );
System.out.println(" **************************************************");
System.out.println(" 1. -- 显示全部歌曲信息" );
System.out.println(" 2. -- 添加一首歌曲信息" );
System.out.println(" 3. -- 删除一首歌的信息" );
System.out.println(" 4. -- 更新歌曲的信息" );
System.out.println(" 5. -- 查询歌曲的信息" );
System.out.println(" 0. -- 退出系统" );
System.out.println(" **************************************************");
}
///////////*********************显示所有歌曲***********************
public static void showAllList()
{
System.out.println("显示所有歌曲!");
/*
for(int i = 0 ; i < 1 ; i++)
{
//System.out.println(SongCollection.song[i].getName());
//System.out.println(SongCollection.song[i].getSinger());
//System.out.println(SongCollection.song[i].getStyle());
//System.out.println(SongCollection.song[i].getPublishdate());
}
*/
System.out.println(SongCollection.lstname.getItemCount());
for(int i = 0 ; i < SongCollection.lstname.getItemCount() ; i++)
{
System.out.print(i + 1);
System.out.println(" 歌曲名称:" + SongCollection.lstname.getItem(i) + " 演唱者:" + SongCollection.lstsinger.getItem(i));
System.out.println(" 歌曲风格:" + SongCollection.lststyle.getItem(i) + " 发行年月:" + SongCollection.lstpublishdate.getItem(i));
System.out.println();
}
}
////////**********************显示查找到的歌曲*********************
public static void showQueryList(List lst)
{
if(lst.getItemCount() == 0)
SoundManagementView.noResults();
else
for(int i = 0 , j = 0 ; i < lst.getItemCount() ; i++)
{
j =Integer.parseInt( lst.getItem(i));
System.out.print(i + 1);
System.out.println(" 歌曲名称:" + SongCollection.lstname.getItem(j) + " 演唱者:" + SongCollection.lstsinger.getItem(j));
System.out.println(" 歌曲风格:" + SongCollection.lststyle.getItem(j) + " 发行年月:" + SongCollection.lstpublishdate.getItem(j));
System.out.println();
}
}
/////////////**************查找无结果************************
public static void noResults()
{
System.out.println("**未能找到匹配的歌曲信息!**");
}
public static void main(String[] args)
{
// TODO Auto-generated method stub
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -