亚洲欧美第一页_禁久久精品乱码_粉嫩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);
			}
		}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品欧美二区三区中文字幕| 在线不卡免费欧美| 欧美激情一区二区在线| 国产激情91久久精品导航 | 亚洲毛片av在线| 色妞www精品视频| 午夜电影网一区| 欧美精品乱码久久久久久| 日本v片在线高清不卡在线观看| 欧美成人在线直播| 粗大黑人巨茎大战欧美成人| 欧美日韩国产精选| 精品制服美女久久| 亚洲欧洲一区二区在线播放| 欧美性淫爽ww久久久久无| 日韩av中文在线观看| 久久精品水蜜桃av综合天堂| eeuss鲁片一区二区三区| 亚洲综合丁香婷婷六月香| 日韩午夜中文字幕| 不卡欧美aaaaa| 亚洲成a人v欧美综合天堂下载| 精品国产一二三区| 色猫猫国产区一区二在线视频| 日韩va欧美va亚洲va久久| 欧美国产精品久久| 欧美一区二区观看视频| 成人激情动漫在线观看| 日韩精品每日更新| 中文一区一区三区高中清不卡| 欧美乱熟臀69xxxxxx| 成人丝袜高跟foot| 日韩国产高清影视| 日韩一区欧美小说| 日韩欧美一级二级三级| 91久久奴性调教| 国产乱码精品一区二区三区av| 洋洋av久久久久久久一区| 久久精品亚洲国产奇米99| 欧美美女一区二区在线观看| 成人免费福利片| 久久精品国产免费| 一区二区三区日本| 中文字幕第一页久久| 91精品久久久久久久99蜜桃| 99久久伊人网影院| 国内精品国产三级国产a久久 | 日韩一区中文字幕| 欧美成人性战久久| 欧美日韩精品一区二区三区蜜桃 | 日韩成人免费在线| 综合欧美一区二区三区| 久久精子c满五个校花| 91精品国产欧美一区二区| 欧美吞精做爰啪啪高潮| 99久久久国产精品免费蜜臀| 国产精品一区免费视频| 日韩精品一区第一页| 亚洲一二三四在线| 亚洲欧美日韩电影| 中文字幕在线观看一区二区| 久久久久88色偷偷免费| 精品国产免费人成在线观看| 欧美一区二区视频在线观看2020 | 亚洲午夜免费电影| 亚洲欧美日韩一区二区| 亚洲欧美自拍偷拍| 国产精品伦理一区二区| 国产色一区二区| 国产欧美日韩在线看| 26uuuu精品一区二区| 精品国产乱码久久久久久久| 日韩欧美国产精品| 日韩精品一区二区三区四区视频| 欧美日韩在线三区| 欧美美女一区二区在线观看| 欧美精品乱码久久久久久按摩 | 亚洲一级片在线观看| 亚洲最大成人综合| 亚洲国产精品欧美一二99| 亚洲一区二区三区四区在线观看| 一区二区在线观看免费视频播放| 亚洲男女一区二区三区| 亚洲你懂的在线视频| 亚洲国产人成综合网站| 亚洲成人自拍网| 日韩福利电影在线观看| 看片的网站亚洲| 国产精品12区| 色综合久久88色综合天天免费| 日本高清不卡在线观看| 欧美日韩精品三区| 精品久久久久久久久久久久久久久久久| 久久综合色8888| 国产精品白丝在线| 亚洲精品国产a| 日韩av一区二区在线影视| 蜜桃久久精品一区二区| 成人午夜又粗又硬又大| 在线中文字幕一区| 日韩一级片在线播放| 久久精品欧美日韩精品| 亚洲日本在线看| 日一区二区三区| 国产呦萝稀缺另类资源| 色婷婷久久久亚洲一区二区三区| 91精品欧美综合在线观看最新| 久久青草国产手机看片福利盒子| 亚洲色图丝袜美腿| 亚洲高清免费在线| 国产乱码字幕精品高清av| 色菇凉天天综合网| 日韩亚洲欧美高清| 亚洲欧洲成人自拍| 青椒成人免费视频| 99视频在线精品| 欧美一级欧美三级在线观看| 欧美国产一区二区在线观看| 午夜久久久影院| 成人在线视频一区| 欧美一激情一区二区三区| 综合亚洲深深色噜噜狠狠网站| 日本视频免费一区| 91影院在线免费观看| 日韩欧美中文一区二区| 亚洲三级小视频| 国产精品自拍三区| 在线播放91灌醉迷j高跟美女| 亚洲国产精品成人久久综合一区| 亚洲高清免费一级二级三级| 不卡的电视剧免费网站有什么| 制服丝袜中文字幕一区| 亚洲天堂2014| 国产一区二区三区在线看麻豆| 欧美日韩性生活| 中文字幕亚洲精品在线观看| 国产在线视视频有精品| 欧美日韩国产美| 亚洲精品国产精华液| 成人高清视频免费观看| 26uuu色噜噜精品一区二区| 日韩电影在线一区二区三区| 91网址在线看| 国产精品国产三级国产专播品爱网| 欧美aaa在线| 337p亚洲精品色噜噜噜| 亚洲福利一区二区| 波多野结衣在线一区| 久久久久久久久久久久久夜| 久久av老司机精品网站导航| 欧美人与性动xxxx| 亚洲第一精品在线| 欧美亚洲综合久久| 一级做a爱片久久| 91黄色免费观看| 亚洲蜜臀av乱码久久精品| 97久久超碰精品国产| 国产精品免费aⅴ片在线观看| 国产精品原创巨作av| 久久久亚洲精品一区二区三区| 久久99久久99小草精品免视看| 日韩欧美精品三级| 蜜臀精品一区二区三区在线观看| 欧美日韩电影一区| 丝瓜av网站精品一区二区| 欧美日韩国产一区二区三区地区| 亚洲午夜激情av| 7777精品伊人久久久大香线蕉完整版 | 精品一区二区三区蜜桃| 欧美一区二区视频在线观看2022 | 国产日韩欧美a| 成人短视频下载| 中文字幕亚洲电影| 色婷婷亚洲婷婷| 午夜精品福利久久久| 欧美日韩精品电影| 蜜臀av一区二区在线观看| 日韩欧美中文一区二区| 国产一区美女在线| 欧美国产日本韩| 色婷婷精品久久二区二区蜜臂av| 一区二区在线观看免费| 91精品一区二区三区在线观看| 免费观看91视频大全| 久久综合九色综合97_久久久| 国产成人精品一区二| 中文字幕制服丝袜成人av | 欧美色图12p| 美洲天堂一区二卡三卡四卡视频| 亚洲精品一区二区三区香蕉| 国v精品久久久网| 一区二区三区在线播| 91精品国产综合久久香蕉的特点 | 日韩不卡一区二区| 久久久精品天堂| 91久久精品日日躁夜夜躁欧美| 日韩影院精彩在线| 国产精品嫩草影院av蜜臀| 欧美日韩在线精品一区二区三区激情| 蜜桃视频第一区免费观看|