Blame view

VRGNYMusicLights/Sources/ApplicationJava/TimeLineJList.java 696 Bytes
278cdee0   pfrison   VRGNYMusicLights ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  import java.awt.Color;
  import java.awt.Graphics;
  
  import javax.swing.JList;
  import javax.swing.ListModel;
  
  public class TimeLineJList extends JList<Music> {
  	private static final long serialVersionUID = 1L;
  	private static final int MARK_WIDTH = 2;
  	
  	private Interface interf;
  
  	public TimeLineJList(ListModel<Music> dataModel, Interface interf) {
  		super(dataModel);
  		this.interf = interf;
  	}
  	
  	@Override
  	protected void paintComponent(Graphics g) {
  		super.paintComponent(g);
  		g.setColor(Color.BLACK);
  		
  		int maxHeight = getPreferredSize().height;
278cdee0   pfrison   VRGNYMusicLights ...
24
  		
d175ba55   pfrison   VRGNYMusicLight a...
25
  		int mark = Util.transformZoom(interf.tick, interf.timeLinePanel.getZoomLevel());
278cdee0   pfrison   VRGNYMusicLights ...
26
27
28
  		
  		g.fillRect(mark, 0, MARK_WIDTH, maxHeight);
  	}
278cdee0   pfrison   VRGNYMusicLights ...
29
  }