|
@@ -4,9 +4,25 @@
|
|
|
*/
|
|
|
package de.nplusc.izc.iZpl.GUI;
|
|
|
|
|
|
+import com.sun.awt.AWTUtilities;
|
|
|
+import de.nplusc.izc.tools.UiToolz.HoloJPanel;
|
|
|
import de.nplusc.izc.tools.UiToolz.IZSkinFile;
|
|
|
-import java.awt.HeadlessException;
|
|
|
+import static de.nplusc.izc.tools.UiToolz.cmdGUI.gac;
|
|
|
+import de.nplusc.izc.tools.baseTools.Messagers;
|
|
|
+import de.nplusc.izc.tools.baseTools.Tools;
|
|
|
+import java.awt.AlphaComposite;
|
|
|
+import java.awt.Color;
|
|
|
+import java.awt.Container;
|
|
|
+import java.awt.Graphics2D;
|
|
|
+import java.awt.Image;
|
|
|
+import java.awt.Polygon;
|
|
|
+import java.io.File;
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import javax.imageio.ImageIO;
|
|
|
import javax.swing.JFrame;
|
|
|
+import javax.swing.JPanel;
|
|
|
|
|
|
/**
|
|
|
*
|
|
@@ -14,11 +30,104 @@ import javax.swing.JFrame;
|
|
|
*/
|
|
|
public class PlayListManagingSkinnable extends JFrame
|
|
|
{
|
|
|
-
|
|
|
- public PlayListManagingSkinnable(IZSkinFile f) throws HeadlessException
|
|
|
+
|
|
|
+ private String bdir;
|
|
|
+ private IZSkinFile sf;
|
|
|
+ private int h,w;
|
|
|
+
|
|
|
+ private Image paintme,background,buttonIxxClicked,buttonIxxHilit,buttonMinClicked,ButtonMinHilit,buttonHideClicked,ButtonHideHilit,
|
|
|
+ buttonReloadHilit,buttonReloadClickedmbuttonForceClicked,buttonForceHilit;
|
|
|
+ HoloJPanel PA;
|
|
|
+ //definieren die heißen zonen....
|
|
|
+ private Polygon buttonIxx,buttonMin,buttonHide,buttonReload,buttonForce;
|
|
|
+ private int tablewidth=500,tableheight=500,lineheight=15;//defaultwerte wenn exception fliegt
|
|
|
+ public PlayListManagingSkinnable(IZSkinFile f,String baseDir)
|
|
|
{
|
|
|
+ bdir=baseDir;
|
|
|
+ HashMap ed=f.getElementData();
|
|
|
+ HashMap ep = f.getElementPositions();
|
|
|
+ sf=f;
|
|
|
+ //separate exceptions sind gewollt um mitzuteilen welcher key fail'd
|
|
|
+ try{
|
|
|
+ tablewidth = Integer.valueOf((String)ed.get("tablewidth"));
|
|
|
+ }
|
|
|
+ catch(NumberFormatException lickme)
|
|
|
+ {
|
|
|
+ Messagers.SingleLineMsg("Error in SkinFile", "ungültiger Wert für tablewidth");
|
|
|
+ }
|
|
|
+ try{
|
|
|
+ tableheight = Integer.valueOf((String)ed.get("tableheight"));
|
|
|
+ }
|
|
|
+ catch(NumberFormatException lickme)
|
|
|
+ {
|
|
|
+ Messagers.SingleLineMsg("Error in SkinFile", "ungültiger Wert für tableheight");
|
|
|
+ }
|
|
|
+ try{
|
|
|
+ tableheight = Integer.valueOf((String)ed.get("lineheight"));
|
|
|
+ }
|
|
|
+ catch(NumberFormatException lickme)
|
|
|
+ {
|
|
|
+ Messagers.SingleLineMsg("Error in SkinFile", "ungültiger Wert für lineheight");
|
|
|
+ }
|
|
|
+ setUndecorated(true);
|
|
|
+ boolean tp = AWTUtilities.isTranslucencySupported(AWTUtilities.Translucency.PERPIXEL_TRANSLUCENT);
|
|
|
+ if(tp)
|
|
|
+ {
|
|
|
+ AWTUtilities.setWindowOpaque(this, false);//freischalten von irregularShapes
|
|
|
+ //AWTUtilities.
|
|
|
+ }
|
|
|
+ background = loadImageAux((String)ed.get("backgroundlayer"));
|
|
|
+ paintme = loadImageAux((String)ed.get("backgroundlayer"));//background ist default deshalb doppeltgemoppelt; auf paintme wird später rumgepinselt
|
|
|
+ buttonIxxHilit = loadImageAux((String)ed.get("button_IXX_hilit"));
|
|
|
+ while(background.getHeight(null)<=0);
|
|
|
+ h = background.getHeight(null);
|
|
|
+ w = background.getWidth(null);
|
|
|
+ setSize(w, h);
|
|
|
+ PA= new HoloJPanel();
|
|
|
+ PA.setSize(w,h);
|
|
|
+ PA.setOpaque(false);
|
|
|
+ //int[] ixb = ep.get("button_IXX");
|
|
|
+ //paintme.getGraphics().drawImage(buttonIxxHilit, ixb[0], ixb[1], null);
|
|
|
+ PA.setdrawIMG(paintme);
|
|
|
+ add(PA);
|
|
|
+ System.out.println("skindim="+w+"|"+h);
|
|
|
+ Container cp = getContentPane();
|
|
|
+ cp.setLayout(null);
|
|
|
+ while(buttonIxxHilit.getHeight(null)<=0);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public void tickGUI()
|
|
|
+ {
|
|
|
+ HashMap ep = sf.getElementPositions();
|
|
|
+ ArrayList<Integer> ixb= (ArrayList<Integer>) ep.get("button_IXX");
|
|
|
+ ((Graphics2D)paintme.getGraphics()).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC));//WIXTIX!!!!
|
|
|
|
|
|
+ paintme.getGraphics().drawImage(buttonIxxHilit, ixb.get(0), ixb.get(1), null);
|
|
|
+ repaint();
|
|
|
+ System.out.println("NOP");
|
|
|
}
|
|
|
+
|
|
|
+ public static final Color TransBgColor = new Color(0, 0, 0, 0);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private Image loadImageAux(String filename)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ return ImageIO.read(new File(bdir+"\\"+filename));
|
|
|
+ }
|
|
|
+ catch (IOException ex)
|
|
|
+ {
|
|
|
+ ex.printStackTrace();
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|