}
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 -