java图片处理源码_mxgraphmodel.java 源代码在线查看 - 经典的java图像处理程序源码 资源下载 虫虫电子下载站...

root = previous;previous = ((mxGraphModel) model).rootChanged(previous);}}public static class mxChildChange extends mxAtomicGraphModelChange{/** * */protected Object parent, previous, child;/** * */protected int index, previousIndex;/** * */protected boolean added;/** * */public mxChildChange(mxGraphModel model, Object parent, Object child){this(model, parent, child, 0);}/** * */public mxChildChange(mxGraphModel model, Object parent, Object child,int index){super(model);this.parent = parent;previous = this.parent;this.child = child;this.index = index;previousIndex = index;added = (parent == null);}/** * @return the parent */public Object getParent(){return parent;}/** * @return the previous */public Object getPrevious(){return previous;}/** * @return the child */public Object getChild(){return child;}/** * @return the index */public int getIndex(){return index;}/** * @return the previousIndex */public int getPreviousIndex(){return previousIndex;}/** * @return the isAdded */public boolean isAdded(){return added;}/** * Gets the source or target terminal field for the given * edge even if the edge is not stored as an incoming or * outgoing edge in the respective terminal. */protected Object getTerminal(Object edge, boolean source){return model.getTerminal(edge, source);}/** * Sets the source or target terminal field for the given edge * without inserting an incoming or outgoing edge in the * respective terminal. */protected void setTerminal(Object edge, Object terminal, boolean source){((mxICell) edge).setTerminal((mxICell) terminal, source);}/** * */protected void connect(Object cell, boolean isConnect){Object source = getTerminal(cell, true);Object target = getTerminal(cell, false);if (source != null){if (isConnect){((mxGraphModel) model).terminalForCellChanged(cell, source,true);}else{((mxGraphModel) model).terminalForCellChanged(cell, null,true);}}if (target != null){if (isConnect){((mxGraphModel) model).terminalForCellChanged(cell, target,false);}else{((mxGraphModel) model).terminalForCellChanged(cell, null,false);}}// Stores the previous terminals in the edgesetTerminal(cell, source, true);setTerminal(cell, target, false);int childCount = model.getChildCount(cell);for (int i = 0; i < childCount; i++){connect((mxICell) model.getChildAt(cell, i), isConnect);}}/** * Returns the index of the given child inside the given parent. */protected int getChildIndex(Object parent, Object child){return (parent instanceof mxICell && child instanceof mxICell) ? ((mxICell) parent).getIndex((mxICell) child): 0;}/** * Changes the root of the model. */public void execute(){Object tmp = model.getParent(child);int tmp2 = getChildIndex(tmp, child);if (previous == null){connect(child, false);}tmp = ((mxGraphModel) model).parentForCellChanged(child, previous,previousIndex);if (previous != null){connect(child, true);}parent = previous;previous = tmp;index = previousIndex;previousIndex = tmp2;added = !added;}}public static class mxTerminalChange extends mxAtomicGraphModelChange{/** * */protected Object cell, terminal, previous;/** * */protected boolean isSource;/** * */public mxTerminalChange(mxGraphModel model, Object cell,Object terminal, boolean isSource){super(model);this.cell = cell;this.terminal = terminal;this.previous = this.terminal;this.isSource = isSource;}/** * @return the cell */public Object getCell(){return cell;}/** * @return the terminal */public Object getTerminal(){return terminal;}/** * @return the previous */public Object getPrevious(){return previous;}/** * @return the isSource */public boolean isSource(){return isSource;}/** * Changes the root of the model. */public void execute(){terminal = previous;previous = ((mxGraphModel) model).terminalForCellChanged(cell,previous, isSource);}}public static class mxValueChange extends mxAtomicGraphModelChange{/** * */protected Object cell, value, previous;/** * */public mxValueChange(mxGraphModel model, Object cell, Object value){super(model);this.cell = cell;this.value = value;this.previous = this.value;}/** * @return the cell */public Object getCell(){return cell;}/** * @return the value */public Object getValue(){return value;}/** * @return the previous */public Object getPrevious(){return previous;}/** * Changes the root of the model. */public void execute(){value = previous;previous = ((mxGraphModel) model).valueForCellChanged(cell,previous);}}public static class mxStyleChange extends mxAtomicGraphModelChange{/** * */protected Object cell;/** * */protected String style, previous;/** * */public mxStyleChange(mxGraphModel model, Object cell, String style){super(model);this.cell = cell;this.style = style;this.previous = this.style;}/** * @return the cell */public Object getCell(){return cell;}/** * @return the style */public String getStyle(){return style;}/** * @return the previous */public String getPrevious(){return previous;}/** * Changes the root of the model. */public void execute(){style = previous;previous = ((mxGraphModel) model).styleForCellChanged(cell,previous);}}public static class mxGeometryChange extends mxAtomicGraphModelChange{/** * */protected Object cell;/** * */protected mxGeometry geometry, previous;/** * */public mxGeometryChange(mxGraphModel model, Object cell,mxGeometry geometry){super(model);this.cell = cell;this.geometry = geometry;this.previous = this.geometry;}/** * @return the cell */public Object getCell(){return cell;}/** * @return the geometry */public mxGeometry getGeometry(){return geometry;}/** * @return the previous */public mxGeometry getPrevious(){return previous;}/** * Changes the root of the model. */public void execute(){geometry = previous;previous = ((mxGraphModel) model).geometryForCellChanged(cell,previous);}}public static class mxCollapseChange extends mxAtomicGraphModelChange{/** * */protected Object cell;/** * */protected boolean collapsed, previous;/** * */public mxCollapseChange(mxGraphModel model, Object cell,boolean collapsed){super(model);this.cell = cell;this.collapsed = collapsed;this.previous = this.collapsed;}/** * @return the cell */public Object getCell(){return cell;}/** * @return the collapsed */public boolean isCollapsed(){return collapsed;}/** * @return the previous */public boolean getPrevious(){return previous;}/** * Changes the root of the model. */public void execute(){collapsed = previous;previous = ((mxGraphModel) model).collapsedStateForCellChanged(cell, previous);}}public static class mxVisibleChange extends mxAtomicGraphModelChange{/** * */protected Object cell;/** * */protected boolean visible, previous;/** * */public mxVisibleChange(mxGraphModel model, Object cell, boolean visible){super(model);this.cell = cell;this.visible = visible;this.previous = this.visible;}/** * @return the cell */public Object getCell(){return cell;}/** * @return the visible */public boolean isVisible(){return visible;}/** * @return the previous */public boolean getPrevious(){return visible;}/** * Changes the root of the model. */public void execute(){visible = previous;previous = ((mxGraphModel) model).visibleStateForCellChanged(cell,previous);}}}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值