roletové menu v java appletu

Vývojová prostředí, aplikace, skripty, http://www... síťové programy, internet, sdílení...
Odpovědět
seuss
Začátečník
Začátečník
Uživatelský avatar
Registrován: 13. zář 2004
Bydliště: Praha, London, Amsterdam
Kontaktovat uživatele:

roletové menu v java appletu

Příspěvek od seuss »

mam applet vyjizdejiciho menu, kazda polozka menu ma v sobe samozrejme nejakej odkaz, ale kdyz v tom menu na odkaz kliknu, tak se nasmeruje do celyho okna prohlizece, kde moji stranku mam, ja vsak potrebuju odkaz nasmerovat do urcityho framu, aby puvodni stranka zustala. Nevite nekdo co s tim? jestli neni nejakej parametr, kterej to odkaze do framu. Nebo jestli nekdo nema zdrojak, je to applet, kterej se da najit bezne, treba na tatousek webu

Kód: Vybrat vše

<applet code="CourseMenu.class" width="160" height="200" align="left"> 
<param name="fontNameHeader" value="Arial"> 
<param name="fontStyleHeader" value="Bold"> 
<param name="fontSizeHeader" value="15"> 
<param name="fontLeadingHeader" value="8"> 
<param name="headerStringColor" value="#009999"> 
<param name="alignment" value="Vertical"> 
<param name="direction" value="Down"> 
<param name="speed" value="130"> 
<param name="background" value="No"> 
<param name="rollover" value="True"> 
<param name="bgColor" value="#FFFFFF"> 
<param name="itemColor" value="#555555"> 
<param name="highlightColor" value="206132000"> 
<param name="fontName" value="Helvetica"> 
<param name="fontStyle" value="bold"> 
<param name="fontSize" value="9"> 
<param name="m1" value="Party"> 
<param name="m1i1" value="Internacional send-off party,http://www.seznam.cz"> 
<param name="m1i2" value="Junior Klub - sklipek 2002,http://www.atlas.cz"> 
<param name="m1i3" value="Vánoce 2002,http://www.atlas.cz"> 
<param name="m1i4" value="Silvestr 2002,http://www.atlas.cz"> 
<param name="m2" value="Fotky"> 
<param name="m2i1" value="Internacional send-off party,http://www.atlas.cz"> 
<param name="m2i2" value="Junior Klub - sklipek 2002,http://www.atlas.cz"> 
<param name="m2i3" value="Večírek LOG 2002,http://www.atlas.cz"> 
<param name="m2i4" value="Vánoce 2002,http://www.atlas.cz"> 
<param name="m2i5" value="Silvestr 2002,http://www.atlas.cz"> 
</applet> 

a nebo kdyby se někomu podařilo najít zdroják toho appletu, mně se to stále nedaří
1. PChomemade cpu AMD Athlon 64 X2 Dual Core 3800+ (2009MHz) non OC, mb Epox 9NPA+Ultra-nForce4 Ultra s939, gpu Gainward BLISS 7600GS PCX 512MB DD Silent FX pci-e , ram 2*1024 MB A-Data, hdd 250 GB Maxtor sata + 320 GB Seagette sata II + 20 GB Western Digital (gnu testing), dvd DVD-R/RW: LG GSA-4120B, zdroj ZM-400HP 400W, crt 17´Compaq V710. + LCD os Win XP SP3 Professional 2.Notebook: HP Pavilion tx2000 tablet PC, cpu AMD Turion 64 X2 Dual Core TL-66 2.3GHz, ram 2GB DDR2, gpu nVidia GeForce Go 6150, hdd 250GB, lcd 12.1" WXGA touchscreen display (1280x800 resolution) os Ubuntu Karmic Koala 9.10 Kernelem 2.6.31-19, Gnome 2.28.1 + (virtualizace XP SP2) &dual boot& Windows Vista Home SP1
N@$ty
Začátečník
Začátečník
Uživatelský avatar
Registrován: 04. říj 2004
Bydliště: Havlíčkův Brod
Kontaktovat uživatele:

Příspěvek od N@$ty »

K tomuhle se puzival atribut target="", ale uz nevim co se psalo do tech uvozovek, myslim jen nazev framu. Dnes se to dela prez php, aspon ja jo. U toho framu pak musis mit atribut name="jmeno_toho_framu", tim name si nejsem jisty, uz sem to tak 2 roky nepouzival.

//EDIT: myslim, ze to jde i nejak pomoci CSS.

Motherboard: ASUS Maximus II Formula; CPU: Intel Core 2 Quad E6600; Cooling: Zalman CNPS7500; RAM: 2×Corsair XMS2 2048MB DHX;
VGA:Leadtek Winfast PX8800 GTS TD 512MB; HDD: Hitachi 160GB SATAII + WesternDigital 750GB SATAII; DVD: DVD±RW LG SuperMulti GSA-H22L;
PSU: Enermax Liberty 620W DXX; Case: Thermaltake Armor Jr. VC3000BWS; OS: Microsoft Windows Vista Ultimate x64; LCD: DELL UltraSharp 2408wfp
Notebook: IBM ThinkPad R61; Intel Core2Duo T7100; 4GB DDR2; 320GB HDD 7200rpm; nVidia Quadro NVS 140M; 15,4" WSXGA+; Microsoft Windows Vista Business
seuss
Začátečník
Začátečník
Uživatelský avatar
Registrován: 13. zář 2004
Bydliště: Praha, London, Amsterdam
Kontaktovat uživatele:

Příspěvek od seuss »

N@$ty píše:K tomuhle se puzival atribut target="", ale uz nevim co se psalo do tech uvozovek, myslim jen nazev framu. Dnes se to dela prez php, aspon ja jo. U toho framu pak musis mit atribut name="jmeno_toho_framu", tim name si nejsem jisty, uz sem to tak 2 roky nepouzival.

//EDIT: myslim, ze to jde i nejak pomoci CSS.
target nefunguje, to samozrejme znam...
v php nejsem tak zbehlej...
1. PChomemade cpu AMD Athlon 64 X2 Dual Core 3800+ (2009MHz) non OC, mb Epox 9NPA+Ultra-nForce4 Ultra s939, gpu Gainward BLISS 7600GS PCX 512MB DD Silent FX pci-e , ram 2*1024 MB A-Data, hdd 250 GB Maxtor sata + 320 GB Seagette sata II + 20 GB Western Digital (gnu testing), dvd DVD-R/RW: LG GSA-4120B, zdroj ZM-400HP 400W, crt 17´Compaq V710. + LCD os Win XP SP3 Professional 2.Notebook: HP Pavilion tx2000 tablet PC, cpu AMD Turion 64 X2 Dual Core TL-66 2.3GHz, ram 2GB DDR2, gpu nVidia GeForce Go 6150, hdd 250GB, lcd 12.1" WXGA touchscreen display (1280x800 resolution) os Ubuntu Karmic Koala 9.10 Kernelem 2.6.31-19, Gnome 2.28.1 + (virtualizace XP SP2) &dual boot& Windows Vista Home SP1
Drom
Začátečník
Začátečník
Uživatelský avatar
Registrován: 18. zář 2005
Bydliště: Kdyne
Kontaktovat uživatele:

Příspěvek od Drom »

N@$ty píše:K tomuhle se puzival atribut target="", ale uz nevim co se psalo do tech uvozovek, myslim jen nazev framu. Dnes se to dela prez php, aspon ja jo. U toho framu pak musis mit atribut name="jmeno_toho_framu", tim name si nejsem jisty, uz sem to tak 2 roky nepouzival.

//EDIT: myslim, ze to jde i nejak pomoci CSS.
]

Dneska uz se hlavne nepouzivaji ramy...
seuss
Začátečník
Začátečník
Uživatelský avatar
Registrován: 13. zář 2004
Bydliště: Praha, London, Amsterdam
Kontaktovat uživatele:

Příspěvek od seuss »

Drom píše:
N@$ty píše:K tomuhle se puzival atribut target="", ale uz nevim co se psalo do tech uvozovek, myslim jen nazev framu. Dnes se to dela prez php, aspon ja jo. U toho framu pak musis mit atribut name="jmeno_toho_framu", tim name si nejsem jisty, uz sem to tak 2 roky nepouzival.

//EDIT: myslim, ze to jde i nejak pomoci CSS.
]

Dneska uz se hlavne nepouzivaji ramy...
ale já vím, prostě musím udělat stránku, kde budou rámy.
jinak tady je zdroják toho appletu:
je mi jasný proč to nejde. Je to kvůli tomu, že definovaná třída java.net.URL to jednoduše neumí, jako každá jiná třída v javě, ale přece to nějak musí jít, pokud máte nějaký nápady, tak mi dejte vědět. Jinak jsem zkoušel všemožně target v html, php funkcí, javascriptem i v css a nic prostě nefungovalo.. :sad:

Kód: Vybrat vše

// Source File Name:   C:\JavaApplets\CourseMenu\CourseMenu.java

import java.applet.Applet;
import java.applet.AppletContext;
import java.awt.*;
import java.awt.image.MemoryImageSource;
import java.awt.image.PixelGrabber;
import java.net.URL;

public class CourseMenu extends Applet
    implements Runnable
{

    public void start()
    {
        if(m_threadAnim == null)
        {
            m_threadAnim = new Thread(this);
            m_threadAnim.start();
        }
    }

    public void stop()
    {
        if(m_threadAnim != null)
        {
            m_threadAnim.stop();
            m_threadAnim = null;
        }
    }

    private String[] parseString(String s, String s1)
        throws StringIndexOutOfBoundsException
    {
        int i = 0;
        int j = 0;
        do
        {
            j = s.indexOf(s1, j);
            if(j < 0)
                break;
            i++;
            j++;
        } while(true);
        int k = i + 1;
        String as[] = new String[k];
        int l = 0;
        boolean flag = false;
        for(int j1 = 0; j1 < k; j1++)
        {
            int i1 = s.indexOf(s1, l);
            if(i1 < 0)
            {
                as[j1] = s.substring(l).trim();
                break;
            }
            as[j1] = s.substring(l, i1).trim();
            l = i1 + 1;
            if(i1 >= s.length())
                break;
        }

        return as;
    }

    private void draw()
    {
        m_menuSelected = null;
        Graphics g = m_imageBuffer.getGraphics();
        g.setFont(m_fontMenuItem);
        g.setColor(m_colorBackground);
        g.fillRect(0, 0, m_nWindowWidth, m_nWindowHeight);
        int i = 0;
        for(int j = 0; j < m_nMenus; j++)
            i = m_menu[j].draw(i, g);

        g.dispose();
        Graphics g1 = getGraphics();
        g1.drawImage(m_imageBuffer, 0, 0, null);
        m_menuCurrent = m_menuSelected;
        if(m_menuCurrent != null)
        {
            showStatus(m_menuCurrent.m_sURL);
            return;
        } else
        {
            showStatus(" ");
            return;
        }
    }

    public boolean mouseExit(Event event, int i, int j)
    {
        m_bMouseInWindow = false;
        m_bMouseMoveSwitch = true;
        m_bRedraw = true;
        m_nMouseX = -1;
        m_nMouseY = -1;
        return true;
    }

    public boolean mouseMove(Event event, int i, int j)
    {
        m_bMouseInWindow = true;
        m_bMouseMoveSwitch = true;
        m_bRedraw = true;
        m_nMouseX = i;
        m_nMouseY = j;
        return true;
    }

    private void initialization()
    {
        String s = null;
        boolean flag = false;
        Double double1 = null;
        MediaTracker mediatracker = new MediaTracker(this);
        Dimension dimension = size();
        m_nWindowWidth = dimension.width;
        m_nWindowHeight = dimension.height;
        m_imageBuffer = createImage(m_nWindowWidth, m_nWindowHeight);
        Graphics g = m_imageBuffer.getGraphics();
        m_sDefaultTarget = getParameter("defaultTarget");
        s = getParameter("bgColor");
        if(s != null)
        {
            m_colorBackground = parseColorParam(s);
            if(m_colorBackground == null)
            {
                m_stringError = new String("bgColor parameter error");
                return;
            }
        }
        String s2 = getParameter("fontName");
        if(s2 == null)
            s2 = new String("Helvetica");
        String s3 = getParameter("fontNameBlurb");
        if(s3 == null)
            s3 = s2;
        s = getParameter("fontSize");
        int i = 11;
        if(s != null)
            i = Integer.parseInt(s);
        if(i < 1)
        {
            m_stringError = new String("fontSize parameter error");
            return;
        }
        s = getParameter("fontSizeBlurb");
        int j = i;
        if(s != null)
            j = Integer.parseInt(s);
        if(j < 1)
        {
            m_stringError = new String("fontSizeBlurb parameter error");
            return;
        }
        s = getParameter("fontLeading");
        boolean flag1 = false;
        int k = 0;
        if(s != null)
        {
            flag1 = true;
            k = Integer.parseInt(s);
        }
        s = getParameter("fontStyle");
        byte byte0 = 0;
        if(s != null)
        {
            byte0 = -1;
            if(s.equalsIgnoreCase("PLAIN"))
                byte0 = 0;
            if(s.equalsIgnoreCase("BOLD"))
                byte0 = 1;
            if(s.equalsIgnoreCase("ITALIC"))
                byte0 = 2;
            if(byte0 < 0)
            {
                m_stringError = new String("fontStyle parameter error");
                return;
            }
        }
        s = getParameter("fontStyleBlurb");
        byte byte1 = byte0;
        if(s != null)
        {
            byte1 = -1;
            if(s.equalsIgnoreCase("PLAIN"))
                byte1 = 0;
            if(s.equalsIgnoreCase("BOLD"))
                byte1 = 1;
            if(s.equalsIgnoreCase("ITALIC"))
                byte1 = 2;
            if(byte1 < 0)
            {
                m_stringError = new String("fontStyleBlurb parameter error");
                return;
            }
        }
        m_fontMenuItem = new Font(s2, byte0, i);
        m_fontBlurb = new Font(s3, byte1, j);
        FontMetrics fontmetrics = null;
        FontMetrics fontmetrics1 = null;
        g.setFont(m_fontMenuItem);
        fontmetrics = g.getFontMetrics();
        int l = fontmetrics.getHeight();
        int i1 = fontmetrics.getAscent();
        int j1 = fontmetrics.getDescent();
        g.setFont(m_fontBlurb);
        fontmetrics1 = g.getFontMetrics();
        int k1 = fontmetrics1.getHeight();
        int l1 = fontmetrics1.getAscent();
        int i2 = fontmetrics1.getDescent();
        if(l > k1)
        {
            if(!flag1)
                m_nItemHeight = l;
            else
                m_nItemHeight = i1 + j1 + k;
            m_nItemBaseline = i1;
        } else
        {
            if(!flag1)
                m_nItemHeight = k1;
            else
                m_nItemHeight = l1 + i2 + k;
            m_nItemBaseline = l1;
        }
        boolean flag2 = false;
        String s4 = getParameter("fontNameHeader");
        if(s4 == null)
            s4 = new String("Helvetica");
        else
            flag2 = true;
        s = getParameter("fontSizeHeader");
        int j2 = 14;
        if(s != null)
        {
            j2 = Integer.parseInt(s);
            flag2 = true;
        }
        if(j2 < 1)
        {
            m_stringError = new String("fontSizeHeader parameter error");
            return;
        }
        s = getParameter("fontStyleHeader");
        byte byte2 = 1;
        if(s != null)
        {
            byte2 = -1;
            if(s.equalsIgnoreCase("PLAIN"))
                byte2 = 0;
            if(s.equalsIgnoreCase("BOLD"))
                byte2 = 1;
            if(s.equalsIgnoreCase("ITALIC"))
                byte2 = 2;
            if(byte2 < 0)
            {
                m_stringError = new String("fontStyleHeader parameter error");
                return;
            }
            flag2 = true;
        }
        s = getParameter("fontLeadingHeader");
        int k2 = 0;
        if(s != null)
        {
            k2 = Integer.parseInt(s);
            flag2 = true;
        }
        s = getParameter("fontAdvanceHeader");
        int l2 = 0;
        if(s != null)
        {
            l2 = Integer.parseInt(s);
            flag2 = true;
        }
        s = getParameter("headerStringColor");
        Color color = Color.black;
        if(s != null)
        {
            color = parseColorParam(s);
            if(color == null)
            {
                m_stringError = new String("headerStringColor parameter error");
                return;
            }
            flag2 = true;
        }
        s = getParameter("headerStringHighlight");
        Color color1 = color;
        if(s != null)
        {
            color1 = parseColorParam(s);
            if(color1 == null)
            {
                m_stringError = new String("headerStringHighlight parameter error");
                return;
            }
            flag2 = true;
        }
        Font font = null;
        boolean flag3 = false;
        if(flag2)
        {
            font = new Font(s4, byte2, j2);
            byte byte3 = 40;
            byte byte4 = 40;
            int j3 = byte3 * byte4;
            Image image2 = createImage(byte3, byte4);
            Graphics g1 = image2.getGraphics();
            g1.setColor(Color.white);
            g1.fillRect(0, 0, byte3, byte4);
            g1.setFont(font);
            g1.setColor(Color.black);
            g1.drawString("M", 0, byte4 / 2);
            g1.dispose();
            int ai[] = new int[byte3 * byte4];
            boolean flag4 = false;
            PixelGrabber pixelgrabber = new PixelGrabber(image2, 0, 0, byte3, byte4, ai, 0, byte3);
            try
            {
                pixelgrabber.grabPixels();
            }
            catch(InterruptedException _ex) { }
            catch(ArrayStoreException _ex)
            {
                flag4 = true;
            }
            int k3 = 0;
            int l3 = 0;
            int j4 = 0;
            for(int k4 = 0; k4 < j3; k4++)
            {
                if(k3 > 2)
                    break;
                switch(k3)
                {
                default:
                    break;

                case 0: // '\0'
                    l3 = ai[k4];
                    k3 = 1;
                    break;

                case 1: // '\001'
                    if(ai[k4] != l3)
                    {
                        j4 = ai[k4];
                        k3 = 2;
                    }
                    break;

                case 2: // '\002'
                    if(ai[k4] != l3 && ai[k4] != j4)
                        k3 = 3;
                    break;
                }
            }

            if(k3 <= 2 && !flag4)
                flag3 = true;
        }
        s = getParameter("antialias");
        if(s != null && s.equalsIgnoreCase("false"))
            flag3 = false;
        s = getParameter("indentation");
        m_nMargin = 5;
        if(s != null)
            m_nMargin = Integer.parseInt(s);
        if(m_nMargin < 0)
        {
            m_stringError = new String("Negative indentation not allowed");
            return;
        }
        s = getParameter("rollover");
        if(s != null && s.equalsIgnoreCase("true"))
            m_bTopLevelRollover = true;
        s = getParameter("StopOnSelect");
        if(s != null && s.equalsIgnoreCase("true"))
            m_bStopOnSelect = true;
        s = getParameter("itemColor");
        if(s != null)
        {
            m_colorNormal = parseColorParam(s);
            if(m_colorNormal == null)
            {
                m_stringError = new String("itemColor parameter error");
                return;
            }
        }
        s = getParameter("itemColorBlurb");
        m_colorNormalBlurb = m_colorNormal;
        if(s != null)
        {
            m_colorNormalBlurb = parseColorParam(s);
            if(m_colorNormalBlurb == null)
            {
                m_stringError = new String("itemColorBlurb parameter error");
                return;
            }
        }
        s = getParameter("highlightColor");
        if(s != null)
        {
            m_colorHighlight = parseColorParam(s);
            if(m_colorHighlight == null)
            {
                m_stringError = new String("highlightColor parameter error");
                return;
            }
        }
        s = getParameter("highlightColorBlurb");
        m_colorHighlightBlurb = m_colorHighlight;
        if(s != null)
        {
            m_colorHighlightBlurb = parseColorParam(s);
            if(m_colorHighlightBlurb == null)
            {
                m_stringError = new String("highlightColorBlurb parameter error");
                return;
            }
        }
        flag = false;
        s = getParameter("speed");
        if(s != null)
        {
            flag = true;
            try
            {
                double1 = Double.valueOf(s);
            }
            catch(NumberFormatException _ex)
            {
                flag = false;
            }
        }
        if(flag)
        {
            double d = double1.doubleValue();
            if(d >= 0.0D)
                m_dVelocity = d;
        }
        int i3 = 0;
        Object obj = null;
        Object obj1 = null;
        Object obj2 = null;
        Object obj3 = null;
        String as[] = null;
        Object obj4 = null;
        Object obj5 = null;
        m_menuChain = null;
        m_nMenus = 0;
        do
        {
            Image image1 = null;
            String s7 = new String("m" + (m_nMenus + 1));
            String s1 = getParameter(s7);
            if(s1 == null)
                break;
            try
            {
                as = parseString(s1, ",");
            }
            catch(StringIndexOutOfBoundsException _ex) { }
            if(as.length < 1)
            {
                m_stringError = new String("Menu " + (m_nMenus + 1) + " param missing.");
                break;
            }
            if(as[0] == null)
            {
                m_stringError = new String("Menu " + (m_nMenus + 1) + " param error.");
                break;
            }
            Image image;
            if(flag2)
            {
                image = createHeaderImage(as[0], color, m_colorBackground, g, font, k2, l2);
                if(flag3)
                    image = antialiasImage(image);
                if(!color.equals(color1))
                {
                    image1 = createHeaderImage(as[0], color1, m_colorBackground, g, font, k2, l2);
                    if(flag3)
                        image1 = antialiasImage(image1);
                }
            } else
            {
                i3++;
                image = getImage(getDocumentBase(), as[0]);
                mediatracker.addImage(image, i3);
                while(!mediatracker.checkID(i3, true)) 
                    try
                    {
                        Thread.sleep(100L);
                    }
                    catch(InterruptedException _ex) { }
                if(mediatracker.statusID(i3, true) != 8)
                {
                    m_stringError = new String("Menu " + (m_nMenus + 1) + " image error.");
                    break;
                }
            }
            if(as.length >= 2 && as[1] != null && as[1].length() > 1 && !flag2)
            {
                i3++;
                image1 = getImage(getDocumentBase(), as[1]);
                mediatracker.addImage(image1, i3);
                while(!mediatracker.checkID(i3, true)) 
                    try
                    {
                        Thread.sleep(100L);
                    }
                    catch(InterruptedException _ex) { }
                if(mediatracker.statusID(i3, true) != 8)
                {
                    m_stringError = new String("Menu " + (m_nMenus + 1) + " highlight image error.");
                    break;
                }
            }
            String s5 = null;
            if(as.length >= 3 && as[2] != null && as[2].length() > 0)
                s5 = as[2];
            String s6 = m_sDefaultTarget;
            if(as.length >= 4 && as[3] != null && as[3].length() > 0)
                s6 = as[3];
            cmMenu cmmenu = new cmMenu(image, image1, s5, s6, this);
            cmmenu.m_menuNext = m_menuChain;
            m_menuChain = cmmenu;
            m_nMenus++;
            addSubmenuItems(cmmenu, 1, s7, g);
            cmmenu.complete();
        } while(true);
        m_menu = new cmMenu[m_nMenus];
        cmMenu cmmenu1 = m_menuChain;
        for(int i4 = m_nMenus - 1; i4 >= 0; i4--)
        {
            m_menu[i4] = cmmenu1;
            cmmenu1 = cmmenu1.m_menuNext;
        }

        m_bInitialized = true;
        m_bRedraw = true;
    }

    public boolean mouseDown(Event event, int i, int j)
    {
        if(!m_bInitialized)
            return true;
        cmMenu cmmenu = m_menuSelected;
        String s = null;
        String s1 = null;
        if(cmmenu != null)
        {
            if(cmmenu.m_nItems > 0 && (cmmenu.m_nLevel > 0 || !m_bTopLevelRollover))
            {
                cmmenu.open();
                return true;
            }
            s = cmmenu.m_sURL;
            s1 = cmmenu.m_sTarget;
        }
        if(s != null)
        {
            URL url;
            try
            {
                url = new URL(s);
            }
            catch(Exception _ex)
            {
                showStatus("Bad URL");
                return true;
            }
            if(s1 == null)
                getAppletContext().showDocument(url);
            else
                getAppletContext().showDocument(url, s1);
            if(m_bStopOnSelect)
                stop();
        }
        return true;
    }

    private Image createHeaderImage(String s, Color color, Color color1, Graphics g, Font font, int i, int j)
    {
        String as[] = null;
        try
        {
            as = parseString(s, "|");
        }
        catch(StringIndexOutOfBoundsException _ex) { }
        g.setFont(font);
        FontMetrics fontmetrics = g.getFontMetrics();
        int k = 0;
        int l = fontmetrics.getHeight() * as.length + i;
        for(int i1 = 0; i1 < as.length; i1++)
            if(as[i1] != null && as[i1].length() > 0)
                k = Math.max(fontmetrics.stringWidth(as[i1]) + (as[i1].length() - 1) * j, k);

        Image image = createImage(k, l);
        Graphics g1 = image.getGraphics();
        g1.setColor(color1);
        g1.fillRect(0, 0, k, l);
        int j1 = fontmetrics.getAscent() + i;
        g1.setFont(font);
        g1.setColor(color);
        for(int k1 = 0; k1 < as.length; k1++)
        {
            if(as[k1] != null && as[k1].length() > 0)
                if(j == 0)
                {
                    g1.drawString(as[k1], 0, j1);
                } else
                {
                    int l1 = 0;
                    char ac[] = as[k1].toCharArray();
                    for(int i2 = 0; i2 < ac.length; i2++)
                    {
                        String s1 = new String(ac, i2, 1);
                        g1.drawString(s1, l1, j1);
                        l1 += fontmetrics.stringWidth(s1) + j;
                    }

                }
            j1 += fontmetrics.getHeight();
        }

        g1.dispose();
        return image;
    }

    public boolean mouseEnter(Event event, int i, int j)
    {
        m_bMouseInWindow = true;
        m_bMouseMoveSwitch = true;
        m_bRedraw = true;
        m_nMouseX = i;
        m_nMouseY = j;
        return true;
    }

    private Image antialiasImage(Image image)
    {
        int i = image.getWidth(null);
        int j = image.getHeight(null);
        int ai[] = new int[i * j];
        int ai1[] = new int[i * j];
        PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, i, j, ai, 0, i);
        try
        {
            pixelgrabber.grabPixels();
        }
        catch(InterruptedException _ex)
        {
            return image;
        }
        if((ai[0] & 0xff000000) != 0xff000000)
            return image;
        for(int k = 0; k < j - 1; k++)
        {
            for(int l = 0; l < i - 1; l++)
            {
                int i1 = ai[l + k * i];
                int j1 = ai[l + k * i + 1];
                int k1 = ai[l + (k + 1) * i];
                int l1 = ai[l + (k + 1) * i + 1];
                int i2 = 0;
                int j2 = 0;
                int k2 = 0;
                int l2 = 0;
                if(k == 0 && l == 0)
                    i2 = i1;
                else
                    i2 = ai1[l + k * i];
                if(k == 0)
                    j2 = j1;
                else
                    j2 = ai1[l + k * i + 1];
                if(l == 0)
                    k2 = k1;
                else
                    k2 = ai1[l + (k + 1) * i];
                l2 = l1;
                if(i1 == l1)
                {
                    if(j1 != i1)
                        j2 = modifyColor(j1, i1);
                    if(k1 != i1)
                        k2 = modifyColor(k1, i1);
                }
                if(j1 == k1)
                {
                    if(i1 != j1)
                        i2 = modifyColor(i1, j1);
                    if(l1 != j1)
                        l2 = modifyColor(l1, j1);
                }
                ai1[l + k * i] = i2;
                ai1[l + k * i + 1] = j2;
                ai1[l + (k + 1) * i] = k2;
                ai1[l + (k + 1) * i + 1] = l2;
            }

        }

        image.flush();
        Image image1 = createImage(new MemoryImageSource(i, j, ai1, 0, i));
        return image1;
    }

    private Color parseColorParam(String s)
    {
        String s1;
        try
        {
            s1 = s.substring(0, 1);
        }
        catch(StringIndexOutOfBoundsException _ex)
        {
            return null;
        }
        if(s1.equals("#"))
        {
            try
            {
                s1 = s.substring(1);
            }
            catch(StringIndexOutOfBoundsException _ex)
            {
                return null;
            }
            return new Color(Integer.parseInt(s1, 16));
        }
        try
        {
            s1 = s.substring(0, 3);
        }
        catch(StringIndexOutOfBoundsException _ex)
        {
            return null;
        }
        int i = Integer.parseInt(s1);
        try
        {
            s1 = s.substring(3, 6);
        }
        catch(StringIndexOutOfBoundsException _ex)
        {
            return null;
        }
        int j = Integer.parseInt(s1);
        try
        {
            s1 = s.substring(6);
        }
        catch(StringIndexOutOfBoundsException _ex)
        {
            return null;
        }
        int k = Integer.parseInt(s1);
        return new Color(i, j, k);
    }

    private int modifyColor(int i, int j)
    {
        int k = i >> 16 & 0xff;
        int l = i >> 8 & 0xff;
        int i1 = i & 0xff;
        int j1 = j >> 16 & 0xff;
        int k1 = j >> 8 & 0xff;
        int l1 = j & 0xff;
        int i2 = (k * 2 + j1) / 3;
        int j2 = (l * 2 + k1) / 3;
        int k2 = (i1 * 2 + l1) / 3;
        return i2 | j2 << 8 | k2 << 16 | 0xff000000;
    }

    public void run()
    {
        if(!m_bInitialized)
        {
            initialization();
            if(!m_bInitialized)
            {
                repaint();
                stop();
            }
        }
        do
        {
            do
                try
                {
                    Thread.sleep(50L);
                }
                catch(InterruptedException _ex)
                {
                    stop();
                }
            while(!m_bRedraw);
            m_bRedraw = false;
            m_lLatestTime = System.currentTimeMillis();
            if(m_bMouseMoveSwitch)
            {
                m_bMouseMoved = true;
                m_bMouseMoveSwitch = false;
            }
            draw();
            m_bMouseMoved = false;
            System.gc();
        } while(true);
    }

    public CourseMenu()
    {
        m_colorBackground = Color.white;
        m_colorNormal = Color.black;
        m_colorHighlight = Color.red;
        m_colorNormalBlurb = Color.black;
        m_colorHighlightBlurb = Color.red;
        m_dVelocity = 90D;
    }

    private void addSubmenuItems(cmMenu cmmenu, int i, String s, Graphics g)
    {
        int j = 1;
        Object obj = null;
        String as[] = null;
        do
        {
            String s1;
            if(i == 1)
                s1 = new String(s + "i" + j);
            else
                s1 = new String(s + "." + j);
            String s2 = getParameter(s1);
            if(s2 != null)
            {
                try
                {
                    as = parseString(s2, ",");
                }
                catch(StringIndexOutOfBoundsException _ex) { }
                String s3 = new String("(???)");
                if(as.length >= 1 && as[0] != null && as[0].length() >= 1)
                    s3 = as[0];
                String s4 = null;
                if(as.length >= 2 && as[1] != null && as[1].length() >= 1)
                    s4 = as[1];
                String s5 = m_sDefaultTarget;
                if(as.length >= 3 && as[2] != null && as[2].length() >= 1)
                    s5 = as[2];
                cmMenu cmmenu1 = new cmMenu(i, s3, s4, s5, g, cmmenu, this);
                cmmenu.addItem(cmmenu1);
                addSubmenuItems(cmmenu1, i + 1, s1, g);
                cmmenu1.complete();
                j++;
            } else
            {
                return;
            }
        } while(true);
    }

    public void paint(Graphics g)
    {
        if(!m_bInitialized)
        {
            Object obj = null;
            Object obj1 = null;
            Dimension dimension = size();
            boolean flag = false;
            boolean flag1 = false;
            if(m_stringError != null)
            {
                showStatus(m_stringError);
                String s = new String("ERROR");
                g.setColor(Color.white);
                g.fillRect(0, 0, dimension.width, dimension.height);
                g.setFont(new Font("Helvetica", 1, 24));
                g.setColor(Color.red);
                FontMetrics fontmetrics = g.getFontMetrics();
                int i = (dimension.width - fontmetrics.stringWidth(s)) / 2;
                int k = dimension.height / 2;
                g.drawString(s, i, k);
                return;
            } else
            {
                String s1 = new String("CourseMenu loading...");
                g.setColor(Color.white);
                g.fillRect(0, 0, dimension.width, dimension.height);
                g.setFont(new Font("Helvetica", 0, 10));
                g.setColor(Color.black);
                FontMetrics fontmetrics1 = g.getFontMetrics();
                int j = (dimension.width - fontmetrics1.stringWidth(s1)) / 2;
                int l = dimension.height / 2;
                g.drawString(s1, j, l);
                return;
            }
        } else
        {
            m_bRedraw = true;
            return;
        }
    }

    int m_nWindowWidth;
    int m_nWindowHeight;
    Image m_imageBuffer;
    String m_stringError;
    public Color m_colorBackground;
    public Font m_fontMenuItem;
    public Font m_fontBlurb;
    public int m_nItemHeight;
    public int m_nItemBaseline;
    public int m_nMargin;
    public Color m_colorNormal;
    public Color m_colorHighlight;
    public Color m_colorNormalBlurb;
    public Color m_colorHighlightBlurb;
    public double m_dVelocity;
    Thread m_threadAnim;
    public long m_lLatestTime;
    public boolean m_bRedraw;
    boolean m_bInitialized;
    String m_sDefaultTarget;
    public int m_nMouseX;
    public int m_nMouseY;
    public boolean m_bMouseInWindow;
    public boolean m_bMouseMoved;
    public boolean m_bMouseMoveSwitch;
    public boolean m_bTopLevelRollover;
    public boolean m_bStopOnSelect;
    int m_nMenus;
    cmMenu m_menu[];
    public cmMenu m_menuChain;
    public cmMenu m_menuSelected;
    cmMenu m_menuCurrent;
}
1. PChomemade cpu AMD Athlon 64 X2 Dual Core 3800+ (2009MHz) non OC, mb Epox 9NPA+Ultra-nForce4 Ultra s939, gpu Gainward BLISS 7600GS PCX 512MB DD Silent FX pci-e , ram 2*1024 MB A-Data, hdd 250 GB Maxtor sata + 320 GB Seagette sata II + 20 GB Western Digital (gnu testing), dvd DVD-R/RW: LG GSA-4120B, zdroj ZM-400HP 400W, crt 17´Compaq V710. + LCD os Win XP SP3 Professional 2.Notebook: HP Pavilion tx2000 tablet PC, cpu AMD Turion 64 X2 Dual Core TL-66 2.3GHz, ram 2GB DDR2, gpu nVidia GeForce Go 6150, hdd 250GB, lcd 12.1" WXGA touchscreen display (1280x800 resolution) os Ubuntu Karmic Koala 9.10 Kernelem 2.6.31-19, Gnome 2.28.1 + (virtualizace XP SP2) &dual boot& Windows Vista Home SP1
N@$ty
Začátečník
Začátečník
Uživatelský avatar
Registrován: 04. říj 2004
Bydliště: Havlíčkův Brod
Kontaktovat uživatele:

Příspěvek od N@$ty »

Drom píše:
N@$ty píše:K tomuhle se puzival atribut target="", ale uz nevim co se psalo do tech uvozovek, myslim jen nazev framu. Dnes se to dela prez php, aspon ja jo. U toho framu pak musis mit atribut name="jmeno_toho_framu", tim name si nejsem jisty, uz sem to tak 2 roky nepouzival.

//EDIT: myslim, ze to jde i nejak pomoci CSS.
]

Dneska uz se hlavne nepouzivaji ramy...
Myslel jsem samozrejme includem ne framem 8-)

Motherboard: ASUS Maximus II Formula; CPU: Intel Core 2 Quad E6600; Cooling: Zalman CNPS7500; RAM: 2×Corsair XMS2 2048MB DHX;
VGA:Leadtek Winfast PX8800 GTS TD 512MB; HDD: Hitachi 160GB SATAII + WesternDigital 750GB SATAII; DVD: DVD±RW LG SuperMulti GSA-H22L;
PSU: Enermax Liberty 620W DXX; Case: Thermaltake Armor Jr. VC3000BWS; OS: Microsoft Windows Vista Ultimate x64; LCD: DELL UltraSharp 2408wfp
Notebook: IBM ThinkPad R61; Intel Core2Duo T7100; 4GB DDR2; 320GB HDD 7200rpm; nVidia Quadro NVS 140M; 15,4" WSXGA+; Microsoft Windows Vista Business
N@$ty
Začátečník
Začátečník
Uživatelský avatar
Registrován: 04. říj 2004
Bydliště: Havlíčkův Brod
Kontaktovat uživatele:

Příspěvek od N@$ty »

Dej si misto toho framu toto:

Kód: Vybrat vše

<div><?php if (!$_GET['page']) $_GET['page']='news'; if (eregi('^([[:alnum:]_-]+)$', $_GET['page'])) include $_GET['page'].'.php'?></div>
a pak pouzivej v tom menu odkazy ve tvaru index.php?page=stranka.

Musis mit hosting s podporou php, hlavní stránku index.php a vsechny ostatni stranky s priponou.php, muze v nich byt obyc html, ale musi byt .php. A php ji za tebe klinutim na odkaz vlozi do stranky.
?page=stranka, vlozi soubor stranka.php, v odkazu se za to to .php nepise.

//EDIT:

Kód: Vybrat vše

$_GET['page']='news'
urcuje vychozi stranku

Motherboard: ASUS Maximus II Formula; CPU: Intel Core 2 Quad E6600; Cooling: Zalman CNPS7500; RAM: 2×Corsair XMS2 2048MB DHX;
VGA:Leadtek Winfast PX8800 GTS TD 512MB; HDD: Hitachi 160GB SATAII + WesternDigital 750GB SATAII; DVD: DVD±RW LG SuperMulti GSA-H22L;
PSU: Enermax Liberty 620W DXX; Case: Thermaltake Armor Jr. VC3000BWS; OS: Microsoft Windows Vista Ultimate x64; LCD: DELL UltraSharp 2408wfp
Notebook: IBM ThinkPad R61; Intel Core2Duo T7100; 4GB DDR2; 320GB HDD 7200rpm; nVidia Quadro NVS 140M; 15,4" WSXGA+; Microsoft Windows Vista Business
Odpovědět

Zpět na „Programování a web“