teacherlayerfigure.java

来自「拥有图形界面的」· Java 代码 · 共 68 行

JAVA
68
字号
/* * TeacherLayerFigure.java * * Created on 31 maggio 2001, 23.07 */package org.joone.edit;import java.util.*;import java.awt.Color;import CH.ifa.draw.standard.*;import org.joone.engine.*;import org.joone.engine.learning.*;import org.joone.io.*;public class TeacherLayerFigure extends OutputLayerFigure {        private static final long serialVersionUID = -7092869490372528874L;        /** Creates new TeacherLayerFigure */    public TeacherLayerFigure() {    }        protected Vector addHandles(Vector handles) {        handles.addElement(new SpecialConnectionHandle(this, RelativeLocator.north(),        new DesiredLayerConnection(), Color.red));        handles.addElement(new ConnectionHandle(this, RelativeLocator.east(),        new LayerConnection()));        //new ErrorLayerConnection()));        return handles;    }        public boolean addPreConn(LayerFigure figure, InputPatternListener synapse) {        boolean ret = super.addPreConn(figure, synapse);        if (figure instanceof InputLayerFigure) {            ComparingElement ts = (ComparingElement)getOutputLayer();            ts.setDesired((StreamInputSynapse)synapse);        }        return ret;    }        public void removePreConn(LayerFigure figure, InputPatternListener conn) {        super.removePreConn(figure);        if (figure instanceof InputLayerFigure) {            ComparingElement ts = (ComparingElement)getOutputLayer();            ts.setDesired(null);        }    }        public void addPostConn(LayerFigure figure, OutputPatternListener synapse) {        super.addPostConn(figure, synapse);        if (!fPostConn.contains(figure)) {        //if (figure instanceof OutputLayerFigure) {            ComparingElement ts = (ComparingElement)getOutputLayer();            ts.addResultSynapse(synapse);        }    }        public void removePostConn(LayerFigure figure, OutputPatternListener conn) {        removePostConn(figure);        //if (figure instanceof OutputLayerFigure) {            ComparingElement ts = (ComparingElement)getOutputLayer();            ts.removeResultSynapse(conn);        //}    }    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?