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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? graphedx.java

?? 工作流應(yīng)用源碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package com.softwarematch.workflow;

import java.awt.Color;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.beans.BeanInfo;
import java.beans.DefaultPersistenceDelegate;
import java.beans.Encoder;
import java.beans.ExceptionListener;
import java.beans.Expression;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PersistenceDelegate;
import java.beans.PropertyDescriptor;
import java.beans.XMLDecoder;
import java.beans.XMLEncoder;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JToolBar;
import javax.swing.JViewport;
import javax.swing.filechooser.FileFilter;

import org.jgraph.JGraph;
import org.jgraph.event.GraphSelectionEvent;
import com.softwarematch.tools.GraphEd;
import org.jgraph.graph.AbstractCellView;
import org.jgraph.graph.AttributeMap;
import org.jgraph.graph.BasicMarqueeHandler;
import org.jgraph.graph.DefaultCellViewFactory;
import org.jgraph.graph.DefaultEdge;
import org.jgraph.graph.DefaultGraphCell;
import org.jgraph.graph.DefaultGraphModel;
import org.jgraph.graph.DefaultPort;
import org.jgraph.graph.EdgeView;
import org.jgraph.graph.GraphConstants;
import org.jgraph.graph.GraphLayoutCache;
import org.jgraph.graph.GraphModel;
import org.jgraph.graph.ParentMap;
import org.jgraph.graph.PortView;
import org.jgraph.graph.VertexView;
import org.jgraph.event.GraphModelListener;
import org.jgraph.event.GraphModelEvent;
import java.util.Set;
import java.util.Vector;
import java.util.Iterator;

import java.net.URLConnection;
import java.net.MalformedURLException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.io.OutputStream;
import com.softwarematch.tools.Constants;
import com.caucho.hessian.client.HessianProxyFactory;
import com.yanni.wkf.services.rmi.xml.*;
import com.yanni.wkf.services.rmi.Services;

/**
 * An extension to GraphEd demonstrating more advanced JGraph features
 */
public class GraphEdX extends GraphEd {

	/**
	 * JGraph Factory instance for random new graphs
	 */
	protected JGraphGraphFactory graphFactory = new JGraphGraphFactory();
	/**
	 * References the folding manager.
	 */
	protected JGraphFoldingManager foldingManager;

	// Actions which Change State
	protected Action hide, collapse, expand, expandAll, configure;

	/**
	 * File chooser for loading and saving graphs. Note that it is lazily
	 * instaniated, always call initFileChooser before use.
	 */
	protected JFileChooser fileChooser = null;
        URL url;
        URLConnection urlc;
        InputStream is;
        OutputStream os;
	static {
		makeCellViewFieldsTransient(PortView.class);
		makeCellViewFieldsTransient(VertexView.class);
		makeCellViewFieldsTransient(EdgeView.class);

		// For XML Encoding of the graph instance, we need to exclude
		// the marquee handler explicitely. Being an inner class of
		// GraphEd, it should not be part of the written file.
		try {
			BeanInfo info = Introspector.getBeanInfo(MyGraph.class);
			PropertyDescriptor[] propertyDescriptors = info
					.getPropertyDescriptors();
			for (int i = 0; i < propertyDescriptors.length; ++i) {
				PropertyDescriptor pd = propertyDescriptors[i];
				if (pd.getName().equals("marqueeHandler")) {
					pd.setValue("transient", Boolean.TRUE);
				}
			}
		} catch (IntrospectionException e) {
			e.printStackTrace();
		}
	}

	/**
	 * Constructs a new application
	 */
	public GraphEdX() {
		// Overrides the global vertex renderer
                System.out.println("my doing");

		VertexView.renderer = new JGraphGroupRenderer();

		// Prepares layout actions
		setJMenuBar(new GraphEdXMenuBar(this, graphFactory));
		// Initializes actions states
		valueChanged(null);
                System.out.println("dd");
	}

	/**
	 * Show something interesting on start.
         * 在這里需要添加初始化圖形例子
	 */
	public void init() {
//		graphFactory.insertTreeSampleData(getGraph(),
//				createCellAttributes(new Point2D.Double(0, 0)),
//				createEdgeAttributes());
	}

	// Override parent method
	protected JGraph createGraph() {
		// Creates a model that does not allow disconnections
		GraphModel model = new MyGraphModel();
		GraphLayoutCache layoutCache = new GraphLayoutCache(model,
				new DefaultCellViewFactory(), true);
		return new MyGraph(model, layoutCache);
	}

	// Override parent method
	protected void installListeners(JGraph graph) {
		super.installListeners(graph);
		// Adds redirector for group collapse/expand
		foldingManager = new JGraphFoldingManager();
		graph.addMouseListener(foldingManager);
	}

	protected void uninstallListeners(JGraph graph) {
		super.uninstallListeners(graph);
		graph.removeMouseListener(foldingManager);
	}

	/**
	 * Updates buttons based on application state
	 */
	public void valueChanged(GraphSelectionEvent e) {
		super.valueChanged(e);
		// Group Button only Enabled if a cell is selected
		boolean enabled = !graph.isSelectionEmpty();
		// hide.setEnabled(enabled);
		expand.setEnabled(enabled);
		expandAll.setEnabled(enabled);
		collapse.setEnabled(enabled);
	}

	/**
	 * Overrides the parent example group method to move all edges that cross
	 * the group (eg. from outside to inside and vice versa) to the group's
	 * port.
	 */
	public void group(Object[] children) {
		// Order Cells by Model Layering
		children = graph.order(children);
		// If Any Cells in View
		if (children != null && children.length > 0) {
			double gs2 = 2 * graph.getGridSize();
			Rectangle2D collapsedBounds = graph.getCellBounds(children);
			collapsedBounds.setFrame(collapsedBounds.getX(), collapsedBounds
					.getY(), Math.max(collapsedBounds.getWidth() / 4, gs2),
					Math.max(collapsedBounds.getHeight() / 2, gs2));
			graph.snap(collapsedBounds);
			DefaultGraphCell group = createGroupCell(collapsedBounds);
			if (group != null && children != null && children.length > 0) {
				// Create the group structure
				ParentMap pm = new ParentMap();
				for (int i = 0; i < children.length; i++) {
					pm.addEntry(children[i], group);
				}
				graph.getGraphLayoutCache().insert(new Object[] { group },
						null, null, pm);
			}
		}
	}

	/**
	 * Hook from GraphEd to create a new group cell
	 */
	protected DefaultGraphCell createGroupCell(Rectangle2D collapsedBounds) {
		DefaultGraphCell group = super.createGroupCell();
		group.addPort();
		GraphConstants.setInset(group.getAttributes(), 10);
		GraphConstants.setBackground(group.getAttributes(), new Color(240, 240,
				255));
		GraphConstants.setBorderColor(group.getAttributes(), Color.black);
		GraphConstants.setOpaque(group.getAttributes(), true);
		GraphConstants.setBorder(group.getAttributes(), JGraphShadowBorder
				.getSharedInstance());
		GraphConstants.setBounds(group.getAttributes(), collapsedBounds);
		return group;
	}

	/**
	 * Hook from GraphEd to set attributes of a new cell
	 */
//	public Map createCellAttributes(Point2D point) {
//		Map map = super.createCellAttributes(point);
//		GraphConstants.setInset(map, 5);
//		GraphConstants.setGradientColor(map, new Color(200, 200, 255));
//		return map;
//	}

	/**
	 * Hook from GraphEd to set attributes of a new edge
	 */
	public Map createEdgeAttributes() {
		Map map = super.createEdgeAttributes();
		// Adds a parallel edge router
		GraphConstants.setLineStyle(map, GraphConstants.STYLE_SPLINE);
		if (GraphConstants.DEFAULTFONT != null) {
			GraphConstants.setFont(map, GraphConstants.DEFAULTFONT
					.deriveFont(10f));
		}
		return map;
	}

	/**
	 * Hook from GraphEd to add action button to the tool bar
	 */
	public JToolBar createToolBar() {
		JToolBar toolbar = super.createToolBar();

		// Collapse
		collapse = new AbstractAction() {
			public void actionPerformed(ActionEvent e) {
				graph.getGraphLayoutCache().collapse(graph.getSelectionCells());
			}
		};
		URL url = getClass().getClassLoader().getResource(
				"com/softwarematch/tools/resources/collapse.gif");
		collapse.putValue(Action.SMALL_ICON, new ImageIcon(url));
		collapse.setEnabled(false);

		toolbar.add(collapse);

		// Expand
		expand = new AbstractAction() {
			public void actionPerformed(ActionEvent e) {
				graph.getGraphLayoutCache().expand(graph.getSelectionCells());
			}
		};
		url = getClass().getClassLoader().getResource(
				"com/softwarematch/tools/resources/expand.gif");
		expand.putValue(Action.SMALL_ICON, new ImageIcon(url));
		expand.setEnabled(false);
		toolbar.add(expand);

		// ExpandAll
		expandAll = new AbstractAction() {
			public void actionPerformed(ActionEvent e) {
				graph.getGraphLayoutCache().expand(
						graph.getDescendants(graph.getSelectionCells()));
			}
		};
		url = getClass().getClassLoader().getResource(
				"com/softwarematch/tools/resources/expandAll.gif");
		expandAll.putValue(Action.SMALL_ICON, new ImageIcon(url));
		expandAll.setEnabled(false);
		toolbar.add(expandAll);
		return toolbar;
	}

	public void serializeGraph() {
		int returnValue = JFileChooser.CANCEL_OPTION;
		initFileChooser();
		returnValue = fileChooser.showSaveDialog(graph);
		if (returnValue == JFileChooser.APPROVE_OPTION) {
			Container parent = graph.getParent();
			BasicMarqueeHandler marquee = graph.getMarqueeHandler();
			graph.setMarqueeHandler(null);
			try {
				// Serializes the graph by removing it from the component
				// hierarchy and removing all listeners from it. The marquee
				// handler, begin an inner class of GraphEd, is not marked
				// serializable and will therefore not be stored. This must
				// be taken into account when deserializing a graph.
				uninstallListeners(graph);
				parent.remove(graph);
				ObjectOutputStream out = new ObjectOutputStream(
						new BufferedOutputStream(new FileOutputStream(
								fileChooser.getSelectedFile())));
				out.writeObject(graph);

				out.flush();
				out.close();
			} catch (Exception e) {
				e.printStackTrace();
				JOptionPane.showMessageDialog(graph, e.getMessage(), "Error",
						JOptionPane.ERROR_MESSAGE);
			} finally {
				// Adds the component back into the component hierarchy
				graph.setMarqueeHandler(marquee);
				if (parent instanceof JViewport) {
					JViewport viewPort = (JViewport) parent;
					viewPort.setView(graph);
				} else {
					// Best effort...
					parent.add(graph);
				}
				// And reinstalls the listener
				installListeners(graph);
			}
		}
	}

	public void deserializeGraph() {
		int returnValue = JFileChooser.CANCEL_OPTION;
		initFileChooser();
		returnValue = fileChooser.showOpenDialog(graph);
		if (returnValue == JFileChooser.APPROVE_OPTION) {
			Container parent = graph.getParent();
			BasicMarqueeHandler marqueeHandler = graph.getMarqueeHandler();
			try {
				uninstallListeners(graph);
				parent.remove(graph);
				ObjectInputStream in = new ObjectInputStream(
						new BufferedInputStream(new FileInputStream(fileChooser
								.getSelectedFile())));
				graph = (JGraph) in.readObject();
				// Take the marquee handler from the original graph and
				// use it in the new graph as well.
				graph.setMarqueeHandler(marqueeHandler);
				// Adds the component back into the component hierarchy
				if (parent instanceof JViewport) {
					JViewport viewPort = (JViewport) parent;
					viewPort.setView(graph);
				} else {
					// Best effort...
					parent.add(graph);
				}
				// graph.setMarqueeHandler(previousHandler);
				// And reinstalls the listener
				installListeners(graph);
			} catch (Exception e) {
				e.printStackTrace();
				JOptionPane.showMessageDialog(graph, e.getMessage(), "Error",
						JOptionPane.ERROR_MESSAGE);
			}
		}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久精品国产导航| 亚洲欧美另类图片小说| 蜜桃一区二区三区四区| 7777精品伊人久久久大香线蕉完整版 | 有码一区二区三区| 97国产精品videossex| 1区2区3区精品视频| 色综合天天综合网国产成人综合天| 国产精品免费久久久久| 成人国产在线观看| 亚洲柠檬福利资源导航| 色婷婷综合久久久久中文| 亚洲精品国产a久久久久久| 在线视频亚洲一区| 青青国产91久久久久久| 久久综合资源网| 92精品国产成人观看免费| 亚洲综合视频在线观看| 制服丝袜在线91| 国产成人免费av在线| 一区二区三区不卡视频在线观看| 欧美剧在线免费观看网站| 国内外精品视频| 亚洲一区二区三区中文字幕| 欧美一区二区三区喷汁尤物| 成人深夜福利app| 日本中文在线一区| 亚洲特黄一级片| 欧美成人综合网站| 99国产精品一区| 国产成人亚洲精品狼色在线| 亚洲影院久久精品| 亚洲国产精品ⅴa在线观看| 欧美日韩一卡二卡| 91在线精品一区二区| 激情综合色播五月| 亚洲综合网站在线观看| 久久综合狠狠综合久久激情| 欧美一区永久视频免费观看| 一本到一区二区三区| 国产精品一线二线三线精华| 三级欧美在线一区| 一区二区三区日本| 亚洲欧美另类久久久精品2019| 久久久www免费人成精品| 在线成人高清不卡| 91精品国产乱码| 日韩一区二区电影网| 91精品国产91久久综合桃花| 欧洲生活片亚洲生活在线观看| 91亚洲精品一区二区乱码| 91女人视频在线观看| 色拍拍在线精品视频8848| 色偷偷88欧美精品久久久| 色乱码一区二区三区88| 在线观看国产精品网站| 欧美丰满嫩嫩电影| 26uuu亚洲综合色| 国产亚洲欧美在线| 中文字幕亚洲欧美在线不卡| 亚洲女同女同女同女同女同69| 国产精品久久午夜夜伦鲁鲁| 国产精品乱人伦| 亚洲激情中文1区| 日韩av中文在线观看| 久草这里只有精品视频| 97久久超碰国产精品电影| 欧美日韩电影一区| 久久久久久久国产精品影院| 中文字幕高清一区| 午夜激情久久久| 国产aⅴ综合色| 欧美日韩成人综合天天影院| 欧美videossexotv100| 自拍偷拍欧美激情| 久久99在线观看| 欧美性色欧美a在线播放| 精品粉嫩超白一线天av| 一区二区三区影院| 国产盗摄女厕一区二区三区| 在线视频一区二区三区| 久久综合九色综合久久久精品综合| 国产日韩av一区| 免费欧美高清视频| 一本色道**综合亚洲精品蜜桃冫| 欧美sm极限捆绑bd| 亚洲高清在线视频| 色哟哟国产精品| 亚洲欧洲性图库| 成人黄色片在线观看| 精品久久久三级丝袜| 欧美aaaaaa午夜精品| 7777精品伊人久久久大香线蕉完整版 | 午夜免费欧美电影| 欧美性大战久久久久久久蜜臀| 久久精品免费在线观看| 久久99精品久久久久久久久久久久 | 91成人国产精品| 中文字幕视频一区二区三区久| 国产精选一区二区三区| 欧美成人猛片aaaaaaa| 国产资源在线一区| 久久久亚洲精华液精华液精华液| 石原莉奈在线亚洲二区| 91精品国产全国免费观看| 日韩电影在线一区二区| 精品欧美乱码久久久久久 | 欧洲激情一区二区| 亚洲成人精品在线观看| 欧美精品在线一区二区三区| 亚洲影视在线观看| 欧美一级欧美一级在线播放| 精品一区二区三区香蕉蜜桃| 久久久久久免费毛片精品| 粉嫩av亚洲一区二区图片| 欧美激情自拍偷拍| 成人国产精品免费网站| 亚洲自拍偷拍麻豆| 精品少妇一区二区三区在线播放| 极品少妇一区二区| 国产精品伦一区| 欧美顶级少妇做爰| 成人看片黄a免费看在线| 亚洲欧美日韩国产一区二区三区| 欧美精品成人一区二区三区四区| 国产美女精品一区二区三区| 一区二区三国产精华液| 久久久久97国产精华液好用吗| 99精品1区2区| 成人在线一区二区三区| 香蕉加勒比综合久久| 国产精品久久久久桃色tv| 69p69国产精品| 色婷婷综合久久久中文字幕| 国产一区二区三区| 日韩综合小视频| 尤物av一区二区| 亚洲免费av高清| 国产精品久久久久婷婷| 久久综合精品国产一区二区三区| 在线看不卡av| 在线一区二区三区四区五区| 国产电影精品久久禁18| 蜜桃一区二区三区在线观看| 午夜精品123| 毛片不卡一区二区| 国内精品第一页| 国产精品一卡二卡| 不卡免费追剧大全电视剧网站| 成人综合在线视频| 色一情一伦一子一伦一区| 99精品视频在线观看| 成人av电影在线观看| 欧美色中文字幕| 日韩午夜在线观看| 精品久久久三级丝袜| 中文乱码免费一区二区| 亚洲综合色婷婷| 六月丁香婷婷色狠狠久久| 国产成人在线看| 5月丁香婷婷综合| 中文字幕免费在线观看视频一区| 亚洲精品视频在线观看网站| 婷婷综合五月天| a亚洲天堂av| 欧美成人精品福利| 亚洲精品大片www| 国产福利一区二区三区在线视频| 色播五月激情综合网| 2017欧美狠狠色| 亚洲一区中文日韩| 国产精品一区二区久久精品爱涩| 色婷婷综合激情| 国产精品久99| 国产在线视频一区二区三区| 欧洲av在线精品| 中文字幕色av一区二区三区| 免费看精品久久片| 色呦呦日韩精品| 最好看的中文字幕久久| 韩国成人在线视频| 91精品国产91综合久久蜜臀| 亚洲欧洲精品天堂一级| 国产在线国偷精品免费看| 91精品国产一区二区三区香蕉| 亚洲综合视频在线观看| 色偷偷久久人人79超碰人人澡| 久久九九99视频| 国产成人精品综合在线观看| 欧美精品一区二区高清在线观看| 日日欢夜夜爽一区| 欧美日韩国产a| 亚洲成人激情av| 欧美伦理影视网| 美女性感视频久久| 久久综合网色—综合色88| 麻豆精品新av中文字幕| 日韩视频免费观看高清在线视频| 麻豆精品蜜桃视频网站| 国产无人区一区二区三区|