亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? transition.java

?? Petri網繪制圖形、仿真、計算工具。可用于進行結構分析和性能分析。
?? JAVA
字號:
/*    IMPORTS*/import java.applet.*;import java.awt.*;import java.lang.*;import java.util.*;import java.io.*;import java.net.*;/*    Transition class - implements all the logic for the place. It knows how to draw    itself on the screen, how to read and write itself to/from a file. Also    maintains all the arcs and all the transitions initiating from it.*/class Transition{    /*        CLASS CONSTANTS    */    /*        current state of the Transition    */    final static int    NORMAL      = 0;    final static int    MOVING      = 1;    final static int    ACTIVE      = 2;    final static int    HIGHLIGHTED = 3;    /* dimensions on the screen in pixels */    final static int    HSIZE = 50;    final static int    VSIZE = 10;    /* delimiters used to distinguish records in files */    final static int    BOA = 0x70;    final static int    EOT = 0x72;    /*        INSTANCE VARIABLES    */    /* place origin coordinates on the screen (top left corner of the bounding       rectangle). */    private int         originX;    private int         originY;    /* origin positions used to redraw state during dragging and moving */    private int         oldX;    private int         oldY;    private int         dragX;    private int         dragY;    /* colors corresponding to different states */    private Color       colorNormal;    private Color       colorSelected;    private Color       colorActive;    private Color       colorHighlight;    /* a growing array of incoming arcs */    private Vector      arcsIn;    /* a growing array of outcoming arcs */    private Vector      arcsOut;    /* currently active In and Out Arcs */    /* private Vector      currArcIn; */    /* private Vector      currArcOut; */    /* valid flags */    private boolean     valid;    /* current and old states */    private int         state;    private int         oldState;    /* arc being removed */    private Arc  removing;    /* transition id */    private int         id;    /* place id label */    private String      label;    /*        PUBLIC METHODS    */    /*        constructor method for adding state from user click    */    public Transition (int i, int x, int y)    {        /* initialize instance variable */        id    = i;        label = new Integer (id) . toString ();        oldX = originX = x;        oldY = originY = y;        colorNormal    = new Color (0, 100, 0);        colorSelected  = new Color (100, 100, 100);        colorActive    = new Color (100, 0, 0);        colorHighlight = new Color (0, 0, 100);        state = NORMAL;        removing = (Arc) null;        valid = true;	        arcsIn = new Vector (5, 1);        arcsOut = new Vector (5, 1);    } /* end Transition */    /*        constructor method for adding transition from file    */    public Transition (int i, FileInputStream file)    {        /* read data catching I/O error exception */        try        {            /* initialize instance variable */            id    = i;            label = new Integer (id) . toString ();            colorNormal    = new Color (0, 100, 0);            colorSelected  = new Color (100, 100, 100);            colorActive    = new Color (100, 0, 0);            colorHighlight = new Color (0, 0, 100);            state = NORMAL;            removing = (Arc) null;            valid = true;            arcsIn = new Vector (5, 1);	    arcsOut = new Vector (5, 1);            /* read in origin coordinates and initial and accepting states */            oldX = originX = file . read () | (file . read () << 8);            oldY = originY = file . read () | (file . read () << 8);            int val = 0;            /* while delimiter is not End Of State information */            while (val != EOT)            {                /* read next delimiter */                val = file . read ();                /* if delimiter is Beginning Of Arc information */                if (val == BOA)                {                    /* create a new arc, letting its constructor                       initialize itself from the file */                    Arc arc = new Arc (this, file);		    if (arc.toPlace())                    	arcsOut . addElement ((Object) arc);		    else			arcsIn . addElement ((Object) arc);                }                /* any delimiter value other than EOT is error */                else if (val != EOT)                    return;            }        }        catch (IOException e)        {        }    } /* end Transition */    /*        called when user starts dragging the transition. sample the coordinates        and set transition to MOVING.    */    public void dragStart (int x, int y)    {        dragX    = x;        dragY    = y;        oldState = state;        state    = MOVING;    } /* end dragStart */    /*        called when user stops dragging the transition. update the position by the        same amount that user moved the mouse. restore previous state.    */    public void dragStop (int x, int y)    {        move (originX + (x - dragX), originY + (y - dragY));        dragX = x;        dragY = y;        state = oldState;    } /* end dragStop */    /*        called while user stops drags the transition. update the position by the        same amount that user moved the mouse.    */    public void drag (int x, int y)    {        move (originX + (x - dragX), originY + (y - dragY));        dragX = x;        dragY = y;    } /* end drag */    /*        draw itself on the specified graphics context.    */    public void paint (Graphics g)    {        /* remove previous image */        remove (g);        /* do not paint the image if transition is not valid */        if (! valid)            return;        /* set color depending on the current state */        Color   color;        switch (state)        {            case MOVING:                color = colorSelected;                break;            case ACTIVE:                color = colorActive;                break;            case HIGHLIGHTED:                color = colorHighlight;                break;            case NORMAL:            default:                color = colorNormal;                break;        }        /* set color and draw the rectangle */        g . setColor (color);        g . drawRect (originX, originY, HSIZE, VSIZE);        /* draw all the arcs that belong to us */        Arc tmp;        for (int i = 0; i < arcsOut . size (); i ++)        {            tmp = (Arc) (arcsOut . elementAt (i));            /* depending on the state pick the color (could be different                than the state color) */            switch (state)            {                case MOVING:                    color = colorSelected;                    break;                case ACTIVE:                    color = colorActive;		    state = NORMAL; /* next time transition should be normal */                case HIGHLIGHTED:                case NORMAL:                default:                    color = colorNormal;                    break;            }            g . setColor (color);            /* paint arc */            tmp . paint (g);        }        /* draw transition label outside the rectangle on the right */        g . drawString (label, originX + HSIZE, originY);    } /* end paint */    /*        remove out place from the specified graphics context.    */    public void remove (Graphics g)    {        /* fill the area occupied by the state with background color */        g . setColor (Color . lightGray);        g . fillRect (oldX, oldY, HSIZE, VSIZE);        g . drawString (label, originX + HSIZE, originY);        /* remove out arc drawings */        for (int i = 0; i < arcsOut . size (); i ++)        {            Arc tmp = (Arc) (arcsOut . elementAt (i));            /* clear the arc */            tmp . remove (g);            /* if this arc is being removed or the tplace on the other               side of the arc is removed - delete it */            if (tmp == removing || ! tmp . placeValid ())            {                arcsOut . removeElementAt (i);                i --;                removing = (Arc) null;            }        }        /* update previous coordinates */        oldX = originX;        oldY = originY;    } /* end remove */    /*        move transition's origin to specified location.    */    public void move (int x, int y)    {        originX = x;        originY = y;    } /* end move */    /*        return the bounding rectangle of the transition image.    */    public Rectangle bounds ()    {        return new Rectangle (originX, originY, HSIZE, VSIZE);    } /* end bounds */    /*        check if the specified coordinate is withing the transition image.    */    public boolean inside (int x, int y)    {        return (x >= originX && x <= originX + HSIZE &&                y >= originY && y <= originY + VSIZE);    } /* end inside */    /*        mark transition as invalid    */    public void makeInvalid ()    {        valid = false;    } /* end makeInvalid */    /*        return the valid flag.    */    public boolean valid ()    {        return valid;    } /* end valid */    /*        return transition id.    */    public int transitionId ()    {        return id;    } /* end transitionId */    /*        set the state to highlighted.    */    public void highlightOn ()    {        state = HIGHLIGHTED;    } /* end highlighOn */    /*        clear the highlighted state (set the state to normal).    */    public void highlightOff ()    {        state = NORMAL;    } /* end highlighOn */    /*        add new arc from this transition to specified place.    */    public void addArcOut (Place place)    {        /* see if we already have an arc between these this trans and that place */        for (int i = 0; i < arcsOut . size (); i ++)        {           Arc tmp = (Arc) (arcsOut . elementAt (i));           /* if one exists - do nothing */           if (tmp . place () == place)            {                return;            }        }        /* create a new arc */        Arc arc = new Arc (this, place);        arcsOut . addElement ((Object) arc);	    } /* end addArcOut */    /*        add specified arc to this transition.    */    public void addArcIn (Arc arc)    {        arcsIn . addElement ((Object) arc);	    } /* end addArcIn */    /*        remove arc from this trans to specified place.    */    public void removeArcOut (Place place)    {        /* find the arc with the specified destination place and mark           it as being removed. it will be actually removed in the paint()           call after its image had been removed from the screen. */        for (int i = 0; i < arcsOut . size (); i ++)        {            Arc tmp = (Arc) (arcsOut . elementAt (i));            if (tmp . place () == place)            {                removing = tmp;                return;            }        }    } /* removeArcOut */    /*        remove specified arc to this trans.    */    public void removeArcIn (Arc arc)    {        /* find this arc and remove it */        arcsIn.removeElement((Object) arc);    } /* removeArcIn */    /*        is transition active ?    */    public boolean isActive()    {        /* return true if all places connected to this trans by an in arc has tokens */	int i;        for ( i = 0; i < arcsIn . size (); i ++)        {            Arc tmp = (Arc) (arcsIn . elementAt (i));	    /* if at least one place has no tokens then return false */            if (tmp.place().getTokenNumber() == 0)            {                return false;            }        }	return (i != 0); /* return true if there was some arcs connected to this trans */    } /* isActive */    /*        fire transition	requires transition active (not tested here for efficiency)    */    public void fire()    {	state = ACTIVE; /* will be reset to NORMAL by paint */	/* remove one token from all in arc places */        for (int i = 0; i < arcsIn . size (); i ++)        {            Arc tmp = (Arc) (arcsIn . elementAt (i));	    tmp. place() . removeToken();        }	/* add one token to all out arc places */        for (int i = 0; i < arcsOut . size (); i ++)        {            Arc tmp = (Arc) (arcsOut . elementAt (i));	    tmp. place() . addToken();        }    } /* fire */    /*        write transition data into a file.    */    public boolean saveFile (FileOutputStream file)    {        /* write data catching I/O error exception */        try        {            /* write origin coordinates */            file . write (originX & 0xff);            file . write (originX >>> 8);            file . write (originY & 0xff);            file . write (originY >>> 8);             /* make all of out arcs write their own data		NOTE : In Arcs will be recreated in Place.resolveId */            for (int i = 0; i < arcsOut . size (); i ++)            {                /* write Beginning Of Arc delimiter */                file . write (BOA);                /* make arc write its data */                if (! ((Arc) (arcsOut . elementAt (i))) . saveFile (file))                    return false;            }            /* write End Of Transition delimiter */            file . write (EOT);        }        catch (IOException e)        {            return false;        }        return true;    } /* end saveFile */    /*        make all arcs resolve place and transition ids into place and transition objects with the        specified resolver object.    */    public void resolveId (PlaceTransitionIdResolver res)    {        Arc tmp;        for (int i = 0; i < arcsOut . size (); i ++)        {            tmp = (Arc) (arcsOut . elementAt (i));            tmp . resolveId (res);        }    } /* end resolveId */} /* end Transition */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美偷拍三级| 国产麻豆精品在线| 国产真实精品久久二三区| 成人爽a毛片一区二区免费| 欧美日韩精品欧美日韩精品| 国产情人综合久久777777| 亚洲成av人片在线| gogo大胆日本视频一区| 精品99一区二区| 日韩精品三区四区| 91国偷自产一区二区三区成为亚洲经典 | 美腿丝袜亚洲三区| 国产麻豆视频一区二区| 在线免费不卡视频| 中文字幕精品三区| 激情五月婷婷综合网| 欧洲色大大久久| 国产精品久久久久久久久搜平片| 久久精品国产99国产精品| 欧美日韩一区视频| 一区二区三区在线观看动漫| caoporn国产一区二区| 久久精品男人的天堂| 极品美女销魂一区二区三区免费 | 国产精品18久久久久久久久久久久| 欧美色图一区二区三区| 最新欧美精品一区二区三区| 精品中文字幕一区二区小辣椒| 欧美三级电影网| 亚洲一区自拍偷拍| 91国产丝袜在线播放| 亚洲精品日韩一| 色综合天天在线| 亚洲图片欧美激情| 色综合av在线| 亚洲在线免费播放| 欧美日韩一卡二卡三卡| 亚洲一区在线观看网站| 在线免费观看一区| 亚洲二区在线视频| 欧美视频在线一区二区三区 | 日韩欧美一区二区视频| 蜜臀91精品一区二区三区| 日韩亚洲欧美成人一区| 久久精品国产在热久久| 精品久久国产97色综合| 国产尤物一区二区在线| 国产精品网站在线播放| 99久久精品国产一区二区三区| 中文字幕日韩av资源站| 91国产丝袜在线播放| 午夜久久久久久久久久一区二区| 91精品国产综合久久国产大片| 麻豆精品在线视频| 国产日韩欧美综合在线| www.亚洲激情.com| 亚洲一区二区美女| 日韩一区国产二区欧美三区| 国产精品一品二品| 17c精品麻豆一区二区免费| 欧美制服丝袜第一页| 日韩**一区毛片| 中文子幕无线码一区tr| 色域天天综合网| 日韩精品欧美精品| 中文文精品字幕一区二区| 91视频一区二区三区| 热久久久久久久| 国产精品国产成人国产三级 | 91视频在线观看免费| 日日摸夜夜添夜夜添精品视频 | 久久精品噜噜噜成人88aⅴ| 国产精品热久久久久夜色精品三区| 色狠狠桃花综合| 九九视频精品免费| 亚洲美女视频在线| 欧美一级理论片| 91丨porny丨国产| 麻豆成人av在线| 亚洲精品成人在线| 久久夜色精品一区| 亚洲精品一区二区三区福利| 色老头久久综合| 国产精品影视在线观看| 午夜私人影院久久久久| 国产精品久久久久天堂| 日韩免费一区二区| 在线观看免费亚洲| 成人深夜视频在线观看| 免费久久精品视频| 亚洲第四色夜色| 国产精品久久久久久久裸模| 精品美女在线观看| 在线91免费看| 欧美午夜精品一区二区蜜桃| 丁香婷婷综合激情五月色| 青青草成人在线观看| 一区二区三区蜜桃网| 国产精品素人视频| 久久一二三国产| 欧美大片日本大片免费观看| 欧美三级视频在线| 色88888久久久久久影院野外| 国产盗摄视频一区二区三区| 日韩精品一二三| 亚洲国产精品久久人人爱| 亚洲免费资源在线播放| 国产精品久久久一区麻豆最新章节| 精品对白一区国产伦| 欧美一区二区三区免费在线看| 欧美午夜电影网| 91精品91久久久中77777| 91在线小视频| 91原创在线视频| 色综合色狠狠天天综合色| av色综合久久天堂av综合| 成人理论电影网| 成人高清视频在线| fc2成人免费人成在线观看播放| 国产v日产∨综合v精品视频| 国产成人精品三级| 岛国av在线一区| av毛片久久久久**hd| 99久久免费国产| 91福利国产精品| 欧美日韩国产一二三| 欧美日韩高清影院| 91精品国产色综合久久ai换脸| 91精品国产色综合久久| 欧美大肚乱孕交hd孕妇| 久久久久综合网| 国产精品嫩草影院av蜜臀| 亚洲色图19p| 亚洲成人av一区二区三区| 青青草视频一区| 国产一区二区电影| 久久精品免视看| 18成人在线视频| 亚洲国产精品视频| 久久精品国产秦先生| 国产乱码精品一区二区三区av| 成人在线视频首页| 色哟哟欧美精品| 91精品国产综合久久久久| 欧美精品一区二区三区四区| 国产女人18水真多18精品一级做 | 亚洲乱码一区二区三区在线观看| 亚洲综合在线第一页| 美国三级日本三级久久99| 国产成人精品亚洲777人妖| 色综合久久久久综合体| 91精品国产高清一区二区三区| 久久精品人人做人人爽97| 亚洲精品乱码久久久久久日本蜜臀| 天天综合天天做天天综合| 国产盗摄一区二区| 欧美美女bb生活片| 国产欧美一区二区精品忘忧草 | 亚洲国产欧美一区二区三区丁香婷| 蜜臀av亚洲一区中文字幕| 99国内精品久久| 欧美成人一区二区三区在线观看 | 伊人婷婷欧美激情| 久久av资源网| 色噜噜狠狠成人中文综合| 精品伦理精品一区| 亚洲午夜视频在线| 丁香啪啪综合成人亚洲小说 | 亚洲一级片在线观看| 国模大尺度一区二区三区| 欧美色图激情小说| 亚洲欧洲无码一区二区三区| 日本女人一区二区三区| 色哟哟亚洲精品| 欧美—级在线免费片| 久久精品国产色蜜蜜麻豆| 在线观看亚洲精品| 国产精品毛片无遮挡高清| 国内外成人在线视频| 3d动漫精品啪啪1区2区免费| 亚洲美女一区二区三区| 成人精品视频一区二区三区 | 久久久噜噜噜久久中文字幕色伊伊| 亚洲一区二区在线免费观看视频| 国产盗摄精品一区二区三区在线 | 欧美一a一片一级一片| 国产精品天美传媒沈樵| 国产麻豆成人精品| 日韩欧美不卡在线观看视频| 婷婷开心激情综合| 欧美三级午夜理伦三级中视频| 中文字幕视频一区二区三区久| 国产成人高清在线| 久久久亚洲欧洲日产国码αv| 青青国产91久久久久久| 5月丁香婷婷综合| 日日夜夜免费精品| 91精品国产aⅴ一区二区| 欧美bbbbb| 日韩丝袜情趣美女图片|