Java仿千千静听音乐播放器源代码(4)

2019-09-02 13:17

}

this.border = border; this.repaint();

public Color getBorderColor() { }

public void setColor(Color color) { }

public Color getColor() { }

public void paintBorder(Graphics g) { }

public void mouseClicked(MouseEvent e) { }

public void mouseEntered(MouseEvent e) { }

public void mouseExited(MouseEvent e) { }

public void mousePressed(MouseEvent e) {

Graphics2D cs = (Graphics2D) g; int width = this.getSize().width;

int valueWidth = (int) (((float) value / maxLimit) * (float) width); cs.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,

alpha));

cs.setColor(color);

for (int i = 1; i < valueWidth - 1; i++) { }

cs.setColor(border);

cs.drawRect(0, 0, width - 1, 4);

if (i % 2 == 0) { }

cs.drawLine(i, 1, i, 1); cs.drawLine(i, 3, i, 3);

return color; this.color = color; this.repaint(); return border;

- 16 -

}

}

if (e.getButton() == MouseEvent.BUTTON1) { }

int comparison = (int) (((float) e.getX() / (this.getSize().width - this

.setValue((int) (((float) comparison / 100) * (float)

2)) * (float) 100);

maxLimit));

public void mouseReleased(MouseEvent e) { }

public void mouseDragged(MouseEvent e) { }

public void mouseMoved(MouseEvent e) { }

public void mouseWheelMoved(MouseWheelEvent e) { }

if (e.getUnitsToScroll() > 0)

this.setValue(value - 2); this.setValue(value + 2); else

int comparison = (int) (((float) e.getX() / (this.getSize().width - 2)) this.setValue((int) (((float) comparison / 100) * (float) maxLimit));

* (float) 100);

ProgressBarEvent.java

package eb.cstop.swing;

public class ProgressBarEvent {

public int getValue() { }

return value;

protected void setValue(int value) { }

this.value = value; private Object source; private int comparison; private int value;

- 17 -

}

public Object getSource() {

return source; }

protected void setSource(Object source) { }

this.source = source; public int getComparison() { }

return comparison;

protected void setComparison(int comparison) { }

this.comparison = comparison;

ProgressBarListener.java

package eb.cstop.swing;

public interface ProgressBarListener { }

public void valueChanged(ProgressBarEvent e);

RectangleDialog.java

package eb.cstop.swing;

import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener;

import javax.swing.JDialog; import java.awt.Frame;

public class RectangleDialog extends JDialog implements MouseListener,

public RectangleDialog() { }

this(null);

private int beForX = 0; private int beForY = 0;

MouseMotionListener {

- 18 -

}

public void mouseMoved(MouseEvent e) { }

public void mouseDragged(MouseEvent e) { }

this.setLocation(this.getLocation().x + e.getX() - beForX, this

.getLocation().y + e.getY() - beForY);

public void mouseReleased(MouseEvent e) { }

public void mousePressed(MouseEvent e) { }

beForX = e.getX(); beForY = e.getY();

public void mouseExited(MouseEvent e) { }

public void mouseEntered(MouseEvent e) { }

public void mouseClicked(MouseEvent e) { }

public RectangleDialog(Frame frame) { }

super(frame);

this.setUndecorated(true); this.addMouseListener(this); this.addMouseMotionListener(this);

RectangleFrame.java

package eb.cstop.swing;

import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener;

import javax.swing.JFrame;

- 19 -

public class RectangleFrame extends JFrame implements MouseListener, }

public void mouseMoved(MouseEvent e) { }

public void mouseDragged(MouseEvent e) { }

this.setLocation(this.getLocation().x + e.getX() - beForX, this

.getLocation().y + e.getY() - beForY);

public void mouseReleased(MouseEvent e) { }

public void mousePressed(MouseEvent e) { }

beForX = e.getX(); beForY = e.getY();

public void mouseExited(MouseEvent e) { }

public void mouseEntered(MouseEvent e) { }

public void mouseClicked(MouseEvent e) { }

public RectangleFrame() { }

this.setUndecorated(true); this.addMouseListener(this); this.addMouseMotionListener(this); protected int beForX = 0; protected int beForY = 0;

MouseMotionListener {

SoudPlayer.java

package eb.cstop.swing;

import java.io.*;

import javax.sound.sampled.AudioInputStream;

- 20 -


Java仿千千静听音乐播放器源代码(4).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:FLUENT udf中文资料ch8

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: