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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? workflow_jgraphgxlcodec.java

?? 用java實(shí)現(xiàn)的工作流
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
package treedoc;

// 修改原JGRPAH的類(lèi),添加寫(xiě)ICON屬性的方法...
// 將流程圖解碼為GXL文件的主類(lèi)和方法
// 實(shí)際上要XPDL格式的文檔也是在這里實(shí)現(xiàn)

/**
 * 名稱(chēng)       : WORKFLOW_JGRAPHGXLCODEC
 * 描述       : WWW.FANGFA.NET 工作流管理系統(tǒng)--生成流程拓?fù)鋱DGXL文件類(lèi)
 * 版權(quán)信息   : Copyright (c) 2004 COMSCI
 * @作者      : COMSCI Sichuan Fangfa Digital
 * @版本      : 0.9 builder 2004091910
 * @日期      : 2004/09/19
 */



import javax.swing.*;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.geom.Rectangle2D;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.jgraph.JGraph;
import org.jgraph.graph.ConnectionSet;
import org.jgraph.graph.DefaultEdge;
import org.jgraph.graph.DefaultGraphCell;
import org.jgraph.graph.DefaultPort;
import org.jgraph.graph.GraphCell;
import org.jgraph.graph.GraphConstants;
import org.jgraph.graph.GraphModel;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.jgraph.util.JGraphUtilities;

/**
 * @author Gaudenz Alder
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class workflow_JGraphGXLCodec {

  static transient Hashtable encodeHash;
  static transient Hashtable decodeHash;

  /**
   * Retrieves the encoding Hashtable with the node's Id.
   *
   * It may be usefull to sirialize the values of the nodes.
   * @return Hastable with elements : ((key : node), (value : GXL id)).
   */
  public static Hashtable getLastEncodingHashtable() {
    return encodeHash;
  }

  /**
   * Retrieves the decoding Hashtable with the node's Id.
   *
   * It may be usefull to sirialize the values of the nodes.
   * @return Hastable with elements : ((key : node), (value : GXL id)).
   */
  public static Hashtable getLastDecodingHashtable() {
    return decodeHash;
  }

  /**
   * Create a GXL-representation for all the cells.
   *
   * @param graph JGraph to encode.
   * @return Encoded string.
   */
  public static String encode(JGraph graph) {
    Object[] cells = graph.getDescendants(graph.getRoots());
    return encode(graph, cells);
  }

  /**
   * Create a GXL-representation for the specified cells.
   *
   * @param graph JGraph to encode.
   * @param cells Selected cells to be encoded.
   * @return Encoded string.
   */
  public static String encode(JGraph graph, Object[] cells) {
    int counter = 0;
    encodeHash = new Hashtable();
    String gxl = "<?xml version=\"1.0\"?>\n" +
        "<!DOCTYPE gxl>\n" +
        "<gxl xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n" +
        "<graph id=\"jGraph\">\n";

    // Create external keys for nodes
    for (int i = 0; i < cells.length; i++) {
      if (JGraphUtilities.isVertex(graph, cells[i])) {
        encodeHash.put(cells[i], "node" + counter);
        counter++;
      }
    }

    // Convert Nodes
    Iterator it = encodeHash.keySet().iterator();
    while (it.hasNext()) {
      Object node = it.next();
      gxl += encodeVertex(graph, (String) encodeHash.get(node), node);
    }

    // Convert Edges
    int edges = 0;
    for (int i = 0; i < cells.length; i++) {
      if (graph.getModel().isEdge(cells[i])) {
        gxl += encodeEdge(graph, new Integer(edges++), cells[i]);

        // Close main tags
      }
    }
    gxl += "\n</graph>\n</gxl>";
    return gxl;
  }

  /**
   * Create a string with tabs.
   *
   * @param level Tab level.
   * @return Tab string.
   */
  private static String createTab(int level) {
    String tab = "";
    for (int i = 0; i < level; i++) {
      tab += "\t";
    }
    return tab;
  }

  /**
   * Basic value encoding.
   *
   * @param type GXL Type of the value (int, bool, ...)
   * @param value Value to be encoded.
   * @param level Tab level.
   * @return Encoded string.
   */
  protected static String encodeValue(String type, String value, int level) {
    return createTab(level) + "<" + type + ">" + value + "</" + type + ">\n";
  }

  /**
   * Basic boolean encoding.
   *
   * @param value Value to be encoded.
   * @param level Tab level.
   * @return Encoded string.
   */
  private static String encodeValue(boolean value, int level) {
    return createTab(level) + "<bool>" + value + "</bool>\n";
  }

  /**
   * Basic integer encoding.
   *
   * @param value Value to be encoded.
   * @param level Tab level.
   * @return Encoded string.
   */
  protected static String encodeValue(int value, int level) {
    return createTab(level) + "<int>" + value + "</int>\n";
  }

  /**
   * Basic String encoding.
   *
   * @param value Value to be encoded.
   * @param level Tab level.
   * @return Encoded string.
   */
  protected static String encodeValue(String value, int level) {
    return createTab(level) + "<string>" + value + "</string>\n";
  }

  /**
   * Attribute encoding.
   *
   * @param values Values of the attribute.
   * @param attributeName name of the attribute.
   * @param level Tab level.
   * @return Encoded string.
   */
  protected static String encodeAttribute(String values, String attributeName,
                                          int level) {
    String tab = createTab(level);
    return tab + "<attr name=\"" + attributeName + "\">\n" + values + tab +
        "</attr>\n";
  }

  /**
   * String encoding.
   *
   * @param value Value of the attribute.
   * @param attributeName name of the attribute.
   * @param level Tab level.
   * @return Encoded string.
   */
  protected static String encodeString(String value, String attributeName,
                                       int level) {
    if (value != null) {
      return encodeAttribute(encodeValue(value, level + 1), attributeName,
                             level);
    }
    else {
      return "";
    }
  }

  /**
   * Integer encoding.
   *
   * @param value Value of the attribute.
   * @param attributeName name of the attribute.
   * @param level Tab level.
   * @return Encoded string.
   */
  protected static String encodeInteger(int value, String attributeName,
                                        int level) {
    return encodeAttribute(encodeValue(value, level + 1), attributeName, level);
  }

  /**
   * Boolean encoding.
   *
   * @param value Value of the attribute.
   * @param attributeName name of the attribute.
   * @param level Tab level.
   * @return Encoded string.
   */
  protected static String encodeBoolean(boolean value, String attributeName,
                                        int level) {
    return encodeAttribute(encodeValue(value, level + 1), attributeName, level);
  }

  /**
   * Color encoding.
   *
   * @param color Color of the attribute.
   * @param attributeName name of the attribute.
   * @param level Tab level.
   * @return Encoded string.
   */
  protected static String encodeColor(Color color, String attributeName,
                                      int level) {
    if (color != null) {
      String tab1 = createTab(level + 1);
      int level2 = level + 2;
      String values = tab1 + "<tup>\n" +
          encodeValue(color.getRed(), level2) +
          encodeValue(color.getGreen(), level2) +
          encodeValue(color.getBlue(), level2) +
          tab1 + "</tup>\n";
      return encodeAttribute(values, attributeName, level);
    }
    else {
      return "";
    }
  }

  /**
   * Font encoding.
   *
   * @param font Font of the attribute.
   * @param attributeName name of the attribute.
   * @param level Tab level.
   * @return Encoded string.
   */
  protected static String encodeFont(Font font, String attributeName, int level) {
    if (font != null) {
      String tab1 = createTab(level + 1);
      int level2 = level + 2;
      String values = tab1 + "<tup>\n" +
          encodeValue(font.getFontName(), level2) +
          encodeValue(font.getStyle(), level2) +
          encodeValue(font.getSize(), level2) +
          tab1 + "</tup>\n";
      return encodeAttribute(values, attributeName, level);
    }
    else {
      return "";
    }
  }

  /**
   * Rectangle encoding.
   *
   * @param rec Rectangle to be encoded.
   * @param attributeName name of the attribute.
   * @param level Tab level.
   * @return Encoded string.
   */
  protected static String encodeRectangle(Rectangle2D rec, String attributeName,
                                          int level) {
    if (rec != null) {
      String tab1 = createTab(level + 1);
      int level2 = level + 2;
      String values = tab1 + "<tup>\n" +
          encodeValue( (int) rec.getCenterX(), level2) +
          encodeValue( (int) rec.getCenterY(), level2) +
          encodeValue( (int) rec.getWidth(), level2) +
          encodeValue( (int) rec.getHeight(), level2) +
          tab1 + "</tup>\n";
      return encodeAttribute(values, attributeName, level);
    }
    else {
      return "";
    }
  }

  /**
   * Bean encoding.
   * This is usefull to encode the userObject in the Vertex.
   * It must be a bean with a beanInfo class in order to inspect it.
   *
   * @param bean Bean to be encoded.
   * @param attributeName name of the attribute.
   * @param level Tab level.
   * @return Encoded string.
   */
  protected static String encodeBean(Object bean, String attributeName,
                                     int level) {
    String encoded = "";
    if (bean != null) {
      try {
        int level1 = level + 1;
        String tab1 = createTab(level1);
        int level2 = level + 2;
        BeanInfo bi = null;
        PropertyDescriptor tmpProperties[] = null;
        PropertyDescriptor prop = null;

        bi = Introspector.getBeanInfo(bean.getClass());
        tmpProperties = bi.getPropertyDescriptors();
        encoded += encodeString(bean.getClass().getName(), "ClassName", level1);
        for (int i = 0; i < tmpProperties.length; i++) {
          prop = tmpProperties[i];
          encoded +=
              encodeString(prop.getReadMethod().invoke(bean, null).toString(),
                           prop.getDisplayName(), level1);
        }
        encoded = encodeAttribute(encoded, attributeName, level);
      }
      catch (Exception e) {
        e.printStackTrace();
      }
    }
    return encoded;
  }

  /**
   * Encode a Vertex of a graph
   * @param graph Graph containing the vertex.
   * @param id Id of the vertex.
   * @param vertex Vertex to be encoded.
   * @return Encoded string.
   */
  protected static String encodeVertex(JGraph graph, String id, Object vertex) {
    int level = 2;
    String label = graph.convertValueToString(vertex);
    Map attributes = ( (GraphCell) vertex).getAttributes();
    String encoded = "\n\t<node id=\"" + id + "\">\n"
        + encodeString(label, "Label", level)
        + encodeRectangle(GraphConstants.getBounds(attributes), "Bounds", level)
        +
        encodeColor(GraphConstants.getBorderColor(attributes), "BorderColor",
                    level)
        +
        encodeColor(GraphConstants.getForeground(attributes), "BorderColor",
                    level)
        +
        encodeColor(GraphConstants.getBackground(attributes), "BorderColor",
                    level)
        + encodeFont(GraphConstants.getFont(attributes), "Font", level)
        +
        encodeColor(GraphConstants.getLineColor(attributes), "BorderColor",
                    level)
        + encodeIcon(GraphConstants.getIcon(attributes), "Icon", level)
        //+ encodeBoolean(GraphConstants.getOpaque(attributes), "Opaque", level)
        //+ encodeBean(GraphConstants.getValue(attributes), "Value", level)
        + "\t</node>";
    return encoded;
  }

  protected static String encodeIcon(Icon icon, String attributeName, int level) {
    if (icon != null) {
      String tab1 = createTab(level + 1);
      int level2 = level + 2;
      String values = tab1 + "<tup>\n" +
          encodeValue(icon.toString(), level2) +
          tab1 + "</tup>\n";
      return encodeAttribute(values, attributeName, level);

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩欧美电影| 国产精品系列在线| 成人免费在线播放视频| 国产精品色眯眯| 日韩免费在线观看| 亚洲精品一区二区精华| 狠狠色伊人亚洲综合成人| 日韩一区二区精品葵司在线| 亚洲人快播电影网| 欧美精品乱码久久久久久按摩| 欧美精品久久一区| 亚洲欧美日韩综合aⅴ视频| 日韩美女在线视频| 成人免费小视频| 青草av.久久免费一区| 日韩电影在线观看电影| 日韩一区二区在线观看视频| 日本成人在线不卡视频| 奇米在线7777在线精品 | 久久99精品久久久久久动态图| 亚洲欧美偷拍卡通变态| 亚洲另类色综合网站| 亚洲一区二区三区三| 午夜影院久久久| 亚州成人在线电影| 国产在线不卡一区| 91在线精品一区二区| 欧美性受极品xxxx喷水| 精品国产乱码久久久久久久久| 久久女同精品一区二区| 亚洲丝袜自拍清纯另类| 午夜欧美一区二区三区在线播放| 极品美女销魂一区二区三区| 成人国产亚洲欧美成人综合网| 欧美三区在线视频| 久久综合色鬼综合色| 一区二区三区日韩欧美| 美女视频黄频大全不卡视频在线播放| 欧美日韩一区三区四区| 老司机免费视频一区二区| 成人污视频在线观看| 日韩三级免费观看| 91香蕉国产在线观看软件| 精品国产青草久久久久福利| 亚洲综合在线免费观看| 日韩手机在线导航| 国产精品自拍网站| 久久精品国产99国产精品| 欧美日韩国产在线播放网站| 日韩欧美一二区| 亚洲第一电影网| 91精品欧美久久久久久动漫| 六月婷婷色综合| 成人免费在线视频| 国产精品一区二区视频| 欧美精品三级在线观看| 亚洲成av人**亚洲成av**| 91精品国产色综合久久ai换脸| 亚洲国产精品麻豆| 国产精品一区二区你懂的| 国产精品无圣光一区二区| 日韩精品一区二区三区视频在线观看 | 午夜久久久久久| 亚洲欧美日韩国产中文在线| av在线不卡观看免费观看| 欧美精品一二三| 国产91丝袜在线播放| 日韩美女啊v在线免费观看| 欧美在线观看视频在线| 久久免费美女视频| 三级影片在线观看欧美日韩一区二区| 日韩激情一区二区| 91精品麻豆日日躁夜夜躁| 亚洲欧美欧美一区二区三区| av不卡在线观看| 国产精品高潮呻吟久久| 国产久卡久卡久卡久卡视频精品| 欧美撒尿777hd撒尿| 国产精品毛片大码女人| 粉嫩一区二区三区性色av| 亚洲成人www| 日韩一区二区三| 日本vs亚洲vs韩国一区三区| 欧美成人一级视频| 久久99精品一区二区三区三区| 日韩一级免费观看| 青青草国产成人99久久| 久久在线免费观看| 国产成人在线观看| 一色桃子久久精品亚洲| 91论坛在线播放| 亚洲高清视频在线| 欧美久久久久中文字幕| 国内精品伊人久久久久影院对白| 在线观看精品一区| 日本美女一区二区三区| 久久久777精品电影网影网| 成人黄色免费短视频| 亚洲精品国产a| 欧美日韩和欧美的一区二区| 久久精品国产免费看久久精品| 日韩一本二本av| 成人黄页毛片网站| 婷婷激情综合网| 久久午夜国产精品| av电影在线观看不卡| 天天综合色天天| 国产精品少妇自拍| 欧美高清激情brazzers| 国产精品影音先锋| 亚洲成人激情社区| 国产人久久人人人人爽| 欧美午夜精品免费| 国产不卡视频在线播放| 一区二区在线看| 日韩精品中文字幕在线不卡尤物| 成人午夜碰碰视频| 日韩不卡一区二区| 国产精品久久久久久久久免费相片 | 国产一区二区伦理| 夜夜亚洲天天久久| 欧美激情艳妇裸体舞| 日韩一区国产二区欧美三区| 成人三级伦理片| 免费人成精品欧美精品| 亚洲免费三区一区二区| 国产三级欧美三级| 日韩一区二区电影在线| 日本韩国视频一区二区| 国产麻豆91精品| 日日骚欧美日韩| 亚洲一区二区在线免费看| 国产亚洲欧美日韩日本| 日韩视频一区二区三区| 欧洲精品一区二区三区在线观看| 国产高清精品网站| 久久99久久99小草精品免视看| 亚洲一区二区av在线| 中文字幕在线观看一区| 国产免费久久精品| 久久精品夜夜夜夜久久| 日韩三级精品电影久久久| 欧美三电影在线| 欧美日韩午夜在线| 欧美少妇bbb| 欧美日本韩国一区二区三区视频| av激情综合网| 99精品视频一区| 97久久精品人人爽人人爽蜜臀| 国产suv精品一区二区6| 国产一区二区三区免费| 久久国产精品一区二区| 久久成人羞羞网站| 视频一区国产视频| 丝袜诱惑亚洲看片| 亚洲h在线观看| 五月激情丁香一区二区三区| 亚洲黄色免费电影| 亚洲激情图片小说视频| 亚洲国产成人av| 美女视频黄免费的久久| 久久99国产乱子伦精品免费| 国产九色精品成人porny| 国产经典欧美精品| 91在线精品一区二区| 一本大道av一区二区在线播放| 色一情一伦一子一伦一区| 欧美三级蜜桃2在线观看| 色诱亚洲精品久久久久久| 色av一区二区| 6080国产精品一区二区| 日韩欧美你懂的| 欧美激情综合五月色丁香| 国产精品视频线看| 中文字幕成人av| 亚洲最大色网站| 水蜜桃久久夜色精品一区的特点 | 亚洲成av人片在www色猫咪| 手机精品视频在线观看| 丝袜美腿亚洲综合| 国产一区二区影院| 91麻豆产精品久久久久久| 91精品蜜臀在线一区尤物| 久久久亚洲高清| 一区二区三区在线影院| 国产在线精品一区二区三区不卡| 成人av电影在线网| 91精品婷婷国产综合久久| 国产日韩欧美亚洲| 爽爽淫人综合网网站| 成人91在线观看| 制服丝袜亚洲播放| 国产精品看片你懂得| 理论片日本一区| 欧洲色大大久久| 国产精品久久久久久久久搜平片 | 国产偷v国产偷v亚洲高清| 国产欧美日产一区| 亚洲午夜在线视频| 国产中文字幕精品|