mirror of
https://github.com/johndoe6345789/tustu.git
synced 2026-04-26 14:45:01 +00:00
stuff
This commit is contained in:
49
app/bg/JComponentExtensionUsingImage.java
Normal file
49
app/bg/JComponentExtensionUsingImage.java
Normal file
@@ -0,0 +1,49 @@
|
||||
package bg;
|
||||
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Image;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.UIManager;
|
||||
|
||||
class JComponentExtensionUsingImage extends JComponent {
|
||||
private Image b = null;
|
||||
|
||||
k(a parama) {}
|
||||
|
||||
public void paint(Graphics paramGraphics) {
|
||||
super.paint(paramGraphics);
|
||||
if (this.b != null) {
|
||||
paramGraphics.drawImage(this.b, 0, 0, getWidth(), getHeight(), null);
|
||||
} else {
|
||||
paramGraphics.setColor(UIManager.getColor("Label.foreground"));
|
||||
paramGraphics.drawString("Tune View Preview", 10, 20);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(File paramFile) {
|
||||
try {
|
||||
BufferedImage bufferedImage = ImageIO.read(paramFile);
|
||||
this.b = bufferedImage;
|
||||
} catch (IOException iOException) {
|
||||
Logger.getLogger(a.class.getName()).log(Level.SEVERE, "Failed to load preview image", iOException);
|
||||
}
|
||||
repaint();
|
||||
}
|
||||
|
||||
private void a() {
|
||||
this.b = null;
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Location: /home/rewrich/Downloads/TunerStudioMS/TunerStudioMS/!/bg/k.class
|
||||
* Java compiler version: 8 (52.0)
|
||||
* JD-Core Version: 1.1.3
|
||||
*/
|
||||
Reference in New Issue
Block a user